|
HDK
|
Used to perform math operations on VdfIndexedWeights. More...
#include <indexedWeightsOperand.h>
Inheritance diagram for VdfIndexedWeightsOperand:Public Types | |
| enum | SetOperation { Union, Intersection } |
Public Types inherited from VdfIndexedData< T > | |
| using | DataType = T |
| typedef VdfIndexedDataIterator < int > | IndexIterator |
| typedef VdfIndexedDataIterator< T > | DataIterator |
| typedef std::pair < IndexIterator, IndexIterator > | IndexIteratorRange |
| typedef std::pair < DataIterator, DataIterator > | DataIteratorRange |
Friends | |
| VDF_API This | operator- (double, const This &) |
| VDF_API This | operator/ (double, const This &) |
Additional Inherited Members | |
Static Public Member Functions inherited from VdfIndexedData< T > | |
| static void | Compose (VdfIndexedData *result, const VdfIndexedData &weak, const VdfIndexedData &strong) |
Protected Member Functions inherited from VdfIndexedData< T > | |
| std::vector< int > & | _GetWriteIndices () |
| const std::vector< int > & | _GetReadIndices () const |
| std::vector< T > & | _GetWriteData () |
| const std::vector< T > & | _GetReadData () const |
Static Protected Member Functions inherited from VdfIndexedData< T > | |
| static std::vector< int > & | _GetWriteIndices (VdfIndexedData< T > *o) |
| static const std::vector< int > & | _GetReadIndices (const VdfIndexedData< T > *o) |
| static std::vector< T > & | _GetWriteData (VdfIndexedData< T > *o) |
| static const std::vector< T > & | _GetReadData (const VdfIndexedData< T > *o) |
Used to perform math operations on VdfIndexedWeights.
This class adds functionality for adding, multiplying, dividing, comparing, etc. VdfIndexedWeights with other VdfIndexedWeights or scalars. The weights data can be externally referenced, in which case the lifetime of the operand object must not exceed the lifetime of the referenced weights. The reason for allowing externally referenced weights is to avoid unnecessary copies of VdfIndexedWeights. VdfIndexedWeightsOperand are typically transient objects that only exist during a computation and the result is stored as a VdfIndexedWeights.
XXX:exec BE VERY CAREFUL NOT TO USE THESE AS YOU WOULD A VdfIndexedWeights. The API here can be tightened to make it harder for client code to misuse this class. This class has very unusual read/write semantics.
Definition at line 39 of file indexedWeightsOperand.h.
The set operation used by binary operations.
When applying a binary operator to two indexed weights operands there are really two (independent) operations that get applied to compute the resulting indexed weights. The first is the operation that is applied to the weights (this is typically an arithmetic or comparison operation), and then there is the set operation that gets applied to the operand index sets to determine which indices should be part of the result.
For convenience the set operation is for now not specified when invoking an operator, but instead it is part of the operand. This requires that all operands in an expression have the same set operations. If we ever want to allow more general expressions we would need to come up with new operators, e.g. operator +& could mean addition of weight with index set union, and *| could mean multiplication of weights with index set intersection.
| Enumerator | |
|---|---|
| Union | |
| Intersection | |
Definition at line 62 of file indexedWeightsOperand.h.
|
explicit |
Creates an indexed weights operand with the given setOperation and optional external weights.
Note that the indexed weights operand does not take over ownership of the external weights, see class documentation for details.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Returns a new VdfIndexedWeightsOperand where each indexed weight is clamped between the scalars min and max.
Clears any pending math errors.
Note that this sets all weights with math errors to 0.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
| VDF_API void VdfIndexedWeightsOperand::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.
All operands must have the same set operation as this operand, and note that the previous indices of this operand are discarded. If the set operation is union, indices that have at least one corresponding index in operands are set (and if nonZeroSetOperation is true at least one of the corresponding weights must also be non-zero). If the set operation is intersection, indices that are in all operands are set (and if nonZeroSetOperation is true all their weights must be non-zero).
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
| VDF_API size_t VdfIndexedWeightsOperand::GetNumMathErrors | ( | ) | const |
Returns the number of math errors (weights which are inf or NaN).
|
inline |
Returns whether or not this object references external weights.
Definition at line 345 of file indexedWeightsOperand.h.
Returns a new VdfIndexedWeightsOperand where each indexed weight is lerped from itself and a corresponding weight in VdfIndexedWeightsOperand v using scalar a.
Returns a new VdfIndexedWeightsOperand where each indexed weight is lerped from itself and a corresponding weight in VdfIndexedWeightsOperand v using VdfIndexedWeightsOperand a.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Returns a new VdfIndexedWeightsOperand where each indexed weight is the maximum of that weight in this object and the corresponding weight in VdfIndexedWeightsOperand v.
Returns a new VdfIndexedWeightsOperand where each indexed weight is the minimum of that weight in this object and the scalar min.
Range-of-weights methods.Returns a new VdfIndexedWeightsOperand where each indexed weight is the minimum of that weight in this object and the corresponding weight in VdfIndexedWeightsOperand v.
Returns a new VdfIndexedWeightsOperand where each indexed weight is the minimum of that weight in this object and the scalar min.
| VDF_API This VdfIndexedWeightsOperand::operator!= | ( | const This & | v | ) | const |
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
| VDF_API This VdfIndexedWeightsOperand::operator!= | ( | double | x | ) | const |
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
|
inline |
Returns a new VdfIndexedWeightsOperand having the weights of this object multiplied by scalar s.
Definition at line 161 of file indexedWeightsOperand.h.
Returns a new VdfIndexedWeightsOperand having the weights of this object multiplied by the weights of VdfIndexedWeightsOperand v.
Definition at line 198 of file indexedWeightsOperand.h.
|
inline |
Returns a new VdfIndexedWeightsOperand having the scalar s added to the weights of this object.
Definition at line 143 of file indexedWeightsOperand.h.
Returns a new VdfIndexedWeightsOperand having the weights of VdfIndexedWeightsOperand v added to the weights of this object.
Definition at line 179 of file indexedWeightsOperand.h.
|
inline |
Returns a new VdfIndexedWeightsOperand having the weights of this object negated.
Definition at line 134 of file indexedWeightsOperand.h.
|
inline |
Returns a new VdfIndexedWeightsOperand having the scalar s subtracted from the weights of this object.
Definition at line 152 of file indexedWeightsOperand.h.
Returns a new VdfIndexedWeightsOperand having the weights of VdfIndexedWeightsOperand v subtracted from the weights of this object.
Definition at line 189 of file indexedWeightsOperand.h.
|
inline |
Returns a new VdfIndexedWeightsOperand having the weights of this object divided by scalar s.
Definition at line 170 of file indexedWeightsOperand.h.
Returns a new VdfIndexedWeightsOperand having the weights of this object divided by the weights of VdfIndexedWeightsOperand v.
Definition at line 207 of file indexedWeightsOperand.h.
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
Component-wise comparisons.
Each of these functions returns a new VdfIndexedWeightsOperand in which the weight value at at each index is 1.0 if the comparison holds true for the corresponding weights in this and the compared object (or the weight in this object and the provided scalar value) and 0.0 if not. In effect, the returned object consists of the boolean result of the comparison at each indexed weight, cast to floating-point values.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Prunes zeros according to the set operation and the indices in operands.
All operands must have the same set operation as this operand. If the set operation is union, this removes all indices whose corresponding weights from operands are all zero. If the set operation is intersection, this removes all indices that has a single corresponding weight from operands which is zero. Note that this removes indices regardless of actual weight values in the operand itself.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
| VDF_API This VdfIndexedWeightsOperand::smoothramp | ( | float | min, |
| float | max, | ||
| float | shoulder0, | ||
| float | shoulder1 | ||
| ) | const |
Returns a new VdfIndexedWeightsOperand where each indexed weight is smoothramped between the scalars min and max with "shoulder lengths" shoulder0 and shoulder1.
| VDF_API This VdfIndexedWeightsOperand::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 min and max with slopes slope0 and slope1.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
| VDF_API void VdfIndexedWeightsOperand::Swap | ( | VdfIndexedWeights * | v | ) |
Swaps the indexed weights held by this opernad with the given indexed weights
If this indexed weights operand has external weights these will get copied before the swap.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.
Standard math library functions.
Each of these functions returns a new VdfIndexedWeightsOperand in which the specified math function is applied to the weights of this object.