7#ifndef PXR_EXEC_VDF_INDEXED_WEIGHTS_OPERAND_H
8#define PXR_EXEC_VDF_INDEXED_WEIGHTS_OPERAND_H
14#include "pxr/exec/vdf/api.h"
19PXR_NAMESPACE_OPEN_SCOPE
76 const VdfIndexedWeights *externalWeights = NULL);
85 void Swap(VdfIndexedWeights *v);
115 const std::vector<This> &operands,
117 bool nonZeroSetOperation);
216 VDF_API
This operator<=(
const This &v)
const;
217 VDF_API
This operator>(
const This &v)
const;
218 VDF_API
This operator>=(
const This &v)
const;
219 VDF_API
This operator==(
const This &v)
const;
220 VDF_API
This operator!=(
const This &v)
const;
222 VDF_API
This operator<=(
double x)
const;
223 VDF_API
This operator>(
double x)
const;
224 VDF_API
This operator>=(
double x)
const;
225 VDF_API
This operator==(
double x)
const;
226 VDF_API
This operator!=(
double x)
const;
238 VDF_API
This acosh()
const;
239 VDF_API
This asin()
const;
240 VDF_API
This asinh()
const;
241 VDF_API
This atan()
const;
242 VDF_API
This atanh()
const;
243 VDF_API
This atan2(
const This &v)
const;
244 VDF_API
This ceil()
const;
245 VDF_API
This cos()
const;
246 VDF_API
This cosh()
const;
247 VDF_API
This exp()
const;
248 VDF_API
This fabs()
const;
249 VDF_API
This floor()
const;
250 VDF_API
This fmod(
float denominator)
const;
251 VDF_API
This log()
const;
252 VDF_API
This log10()
const;
253 VDF_API
This pow(
float exponent)
const;
254 VDF_API
This sin()
const;
255 VDF_API
This sinh()
const;
256 VDF_API
This sqrt()
const;
257 VDF_API
This tan()
const;
258 VDF_API
This tanh()
const;
304 float slope0=0,
float slope1=0)
const;
312 float shoulder0,
float shoulder1)
const;
337 return _externalWeights;
350 This &operator+=(
const This &v);
354 This &operator-=(
const This &v);
358 This &operator*=(
const This &v);
362 This &operator/=(
const This &v);
366 This &operator+=(
double s);
370 This &operator-=(
double s);
374 This &operator*=(
double s);
378 This& operator/=(
double s);
392 template <
bool CheckForMathErrors,
typename ModifyFn>
393 This _ApplyFunctionToCopy(ModifyFn modify)
const;
398 void _CopyExternalWeights();
401 std::vector<int> &_GetWriteIndices() {
402 return VdfIndexedWeights::_GetWriteIndices();
406 const std::vector<int> &_GetReadIndices()
const {
407 return _externalWeights
408 ? VdfIndexedWeights::_GetReadIndices(_externalWeights)
409 : VdfIndexedWeights::_GetReadIndices();
413 std::vector<float> &_GetWriteData() {
414 return VdfIndexedWeights::_GetWriteData();
418 const std::vector<float> &_GetReadData()
const {
419 return _externalWeights
420 ? VdfIndexedWeights::_GetReadData(_externalWeights)
421 : VdfIndexedWeights::_GetReadData();
427 friend VDF_API This
operator-(
double,
const This&);
428 friend VDF_API This
operator/(
double,
const This&);
437 const VdfIndexedWeights *_externalWeights;
441 bool _mayHaveMathErrors;
458PXR_NAMESPACE_CLOSE_SCOPE
Used to perform math operations on VdfIndexedWeights.
VDF_API This clamp(float min, float max) const
Returns a new VdfIndexedWeightsOperand where each indexed weight is clamped between the scalars min a...
VDF_API VdfIndexedWeightsOperand(SetOperation setOperation, const VdfIndexedWeights *externalWeights=NULL)
Creates an indexed weights operand with the given setOperation and optional external weights.
VDF_API This min(const This &v) const
Range-of-weights methods.
VDF_API This min(float min) const
Returns a new VdfIndexedWeightsOperand where each indexed weight is the minimum of that weight in thi...
This operator*(double s) const
Returns a new VdfIndexedWeightsOperand having the weights of this object multiplied by scalar s.
VDF_API This smoothramp(float min, float max, float shoulder0, float shoulder1) const
Returns a new VdfIndexedWeightsOperand where each indexed weight is smoothramped between the scalars ...
VDF_API This smoothstep(float min, float max, float slope0=0, float slope1=0) const
Returns a new VdfIndexedWeightsOperand where each indexed weight is smoothsteped between the scalars ...
This operator+(const This &v) const
Returns a new VdfIndexedWeightsOperand having the weights of VdfIndexedWeightsOperand v added to the ...
SetOperation
The set operation used by binary operations.
VDF_API This max(float max) const
Returns a new VdfIndexedWeightsOperand where each indexed weight is the minimum of that weight in thi...
VDF_API size_t GetNumMathErrors() const
Returns the number of math errors (weights which are inf or NaN).
VDF_API void Swap(VdfIndexedWeights *v)
Swaps the indexed weights held by this opernad with the given indexed weights.
This operator*(const This &v) const
Returns a new VdfIndexedWeightsOperand having the weights of this object multiplied by the weights of...
bool HasExternalWeights() const
Returns whether or not this object references external weights.
VDF_API This lerp(const This &v, const This &a) const
Returns a new VdfIndexedWeightsOperand where each indexed weight is lerped from itself and a correspo...
VDF_API This max(const This &v) const
Returns a new VdfIndexedWeightsOperand where each indexed weight is the maximum of that weight in thi...
VDF_API void Fill(const std::vector< This > &operands, double fillWeight, bool nonZeroSetOperation)
Fills this operand with fillWeight according to the set operation and the indices in operands.
VDF_API void PruneZeros(const std::vector< This > &operands)
Prunes zeros according to the set operation and the indices in operands.
This operator+(double s) const
Returns a new VdfIndexedWeightsOperand having the scalar s added to the weights of this object.
This operator/(double s) const
Returns a new VdfIndexedWeightsOperand having the weights of this object divided by scalar s.
VDF_API This acos() const
Standard math library functions.
This operator-(const This &v) const
Returns a new VdfIndexedWeightsOperand having the weights of VdfIndexedWeightsOperand v subtracted fr...
This operator-() const
Returns a new VdfIndexedWeightsOperand having the weights of this object negated.
VDF_API void ClearMathErrors()
Clears any pending math errors.
VDF_API This operator<(const This &v) const
Component-wise comparisons.
VDF_API This lerp(const This &v, float a) const
Returns a new VdfIndexedWeightsOperand where each indexed weight is lerped from itself and a correspo...
This operator-(double s) const
Returns a new VdfIndexedWeightsOperand having the scalar s subtracted from the weights of this object...
This operator/(const This &v) const
Returns a new VdfIndexedWeightsOperand having the weights of this object divided by the weights of Vd...
VDF_API VdfIndexedWeightsOperand operator+(double, const VdfIndexedWeightsOperand &)
Declare the double arithmetic and comparison free function overloads.