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);
225 VDF_API
This operator<=(
const This &v)
const;
226 VDF_API
This operator>(
const This &v)
const;
227 VDF_API
This operator>=(
const This &v)
const;
228 VDF_API
This operator==(
const This &v)
const;
229 VDF_API
This operator!=(
const This &v)
const;
231 VDF_API
This operator<=(
double x)
const;
232 VDF_API
This operator>(
double x)
const;
233 VDF_API
This operator>=(
double x)
const;
234 VDF_API
This operator==(
double x)
const;
235 VDF_API
This operator!=(
double x)
const;
247 VDF_API
This acosh()
const;
248 VDF_API
This asin()
const;
249 VDF_API
This asinh()
const;
250 VDF_API
This atan()
const;
251 VDF_API
This atanh()
const;
252 VDF_API
This atan2(
const This &v)
const;
253 VDF_API
This ceil()
const;
254 VDF_API
This cos()
const;
255 VDF_API
This cosh()
const;
256 VDF_API
This exp()
const;
257 VDF_API
This fabs()
const;
258 VDF_API
This floor()
const;
259 VDF_API
This fmod(
float denominator)
const;
260 VDF_API
This log()
const;
261 VDF_API
This log10()
const;
262 VDF_API
This pow(
float exponent)
const;
263 VDF_API
This sin()
const;
264 VDF_API
This sinh()
const;
265 VDF_API
This sqrt()
const;
266 VDF_API
This tan()
const;
267 VDF_API
This tanh()
const;
313 float slope0=0,
float slope1=0)
const;
321 float shoulder0,
float shoulder1)
const;
346 return _externalWeights;
359 This &operator+=(
const This &v);
363 This &operator-=(
const This &v);
367 This &operator*=(
const This &v);
371 This &operator/=(
const This &v);
375 This &operator+=(
double s);
379 This &operator-=(
double s);
383 This &operator*=(
double s);
387 This& operator/=(
double s);
401 template <
bool CheckForMathErrors,
typename ModifyFn>
402 This _ApplyFunctionToCopy(ModifyFn modify)
const;
407 void _CopyExternalWeights();
410 std::vector<int> &_GetWriteIndices() {
411 return VdfIndexedWeights::_GetWriteIndices();
415 const std::vector<int> &_GetReadIndices()
const {
416 return _externalWeights
417 ? VdfIndexedWeights::_GetReadIndices(_externalWeights)
418 : VdfIndexedWeights::_GetReadIndices();
422 std::vector<float> &_GetWriteData() {
423 return VdfIndexedWeights::_GetWriteData();
427 const std::vector<float> &_GetReadData()
const {
428 return _externalWeights
429 ? VdfIndexedWeights::_GetReadData(_externalWeights)
430 : VdfIndexedWeights::_GetReadData();
436 friend VDF_API This
operator-(
double,
const This&);
437 friend VDF_API This
operator/(
double,
const This&);
446 const VdfIndexedWeights *_externalWeights;
450 bool _mayHaveMathErrors;
467PXR_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.