CXXR (C++ R)
|
Control attribute copying for binary functions. More...
#include <BinaryFunction.hpp>
Static Public Member Functions | |
static void | copyAttributes (VectorBase *vout, const VectorBase *vl, const VectorBase *vr) |
Copy attributes as described above. |
Control attribute copying for binary functions.
VectorOps::BinaryFunction takes as a template parameter an AttributeCopier class which determines which attributes are copied from the input vectors to the output vector. This class can be used as the value of the AttributeCopier parameter, and acts as follows:
If both operands are arrays (in which case they must have the same dimensions), the result will be an array with the same dimensions. Dimension names are taken from the first operand if it has them, otherwise from the second operand, if it has them.
If just one operand is array, the result will be an array with the same dimensions. Dimension names are taken from the array operand, if it has them.
If neither operand is an array, the 'names' attribute is taken from the first operand if it has them, otherwise from the second operand, if it has them.
If both operands are time series (in which case they must have the same parameters, i.e. start time, end time and frequency), the result will be a time series with the same parameters. The result will take its class attribute from the first operand if it has one, otherwise from the second operand, if it has one.
Note that no class attribute is applied to the result unless at least one of the operands is a time series.
|
inlinestatic |
Copy attributes as described above.
vout | Non-null pointer to the vector to which attributes are to be copied. |
vl | Non-null pointer to the first operand. |
vr | Non-null pointer to the second operand. |