Selection of libraries designed to be used with Emu projects. This was originally a Math library only, but has since been changed to hold all Emu libraries to enable consistency in changes to dependencies (such as EmuCore modifications).
All basic arithmetic operators and functions implemented.
Semi-advanced arithmetic operator for multiplication implemented, allowing adaptive reactions to multiplying by scalars, vectors and matrices.
Note regarding operators:
All operators except operator* use basic arithmetic.
operator* adaptively reacts to valid arguments in the following way:
If Rhs_ is neither an EmuMath Matrix nor an EmuMath Vector, it will perform basic arithmetic, resulting in an EmuMath Matrix of the same size.
If Rhs_ is an EmuMath Matrix, it will perform a standard Matrix multiplication using dot products of columns and rows in the 2 matrices, resulting in an EmuMath Matrix with a number of columns equal to that of the right-hand argument, and a number of rows equal to that of the left-hand argument.
If the two Matrices are invalid when paired for multiplication, the function is disabled by a std::enable_if_t trigger, with no fallback. This is intentional to provide consistent results with use of operator*.
If Rhs_ is an EmuMath Vector, it will perform multiplication as though the Vector is a column matrix and output the resulting column as an EmuMath Vector of the same size.
If the input Vector's size is not equal to a Matrix's number of rows (or the number of rows - 1, where the missing index is interpreted as 1), the function is disabled by a std::enable_if_t trigger, with no fallback. This follows the same reasoning as the above-mentioned trigger.
One should note that, due to the (intentional) design of the enable_if_t triggers, an invalid Matrix argument (for example) will not fall back to basic multiplication. Valid arguments for a specific template type are required for uses of operator*.
Note regarding operators:
operator*
use basic arithmetic.operator*
adaptively reacts to valid arguments in the following way:std::enable_if_t
trigger, with no fallback. This is intentional to provide consistent results with use ofoperator*
.1
), the function is disabled by astd::enable_if_t
trigger, with no fallback. This follows the same reasoning as the above-mentioned trigger.One should note that, due to the (intentional) design of the
enable_if_t
triggers, an invalid Matrix argument (for example) will not fall back to basic multiplication. Valid arguments for a specific template type are required for uses ofoperator*
.