Basic mock operation for a DelayedUnaryIsometricOperation
.
More...
#include <mock_helpers.hpp>
|
template<typename Index_ , typename InputValue_ , typename OutputValue_ > |
void | dense (bool row, Index_ i, Index_ start, Index_ length, const InputValue_ *input, OutputValue_ *output) const |
|
template<typename Index_ , typename InputValue_ , typename OutputValue_ > |
void | dense (bool row, Index_ i, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const |
|
Basic mock operation for a DelayedUnaryIsometricOperation
.
This defines the basic expectations for an operation to be used as Operation_
in DelayedUnaryIsometricOperation
. Actual operations aren't expected to inherit from this class; this is only provided for documentation purposes. Operations only need to implement methods with the same signatures for compile-time polymorphism.
◆ dense() [1/2]
template<typename Index_ , typename InputValue_ , typename OutputValue_ >
void tatami::DelayedUnaryIsometricMockBasic::dense |
( |
bool | row, |
|
|
Index_ | i, |
|
|
Index_ | start, |
|
|
Index_ | length, |
|
|
const InputValue_ * | input, |
|
|
OutputValue_ * | output ) const |
|
inline |
This method accepts a contiguous block of an element of the target dimension from the underlying matrix (input
), applies the operation to each value, and stores the result in another array of a potentially different type (output
).
Implementions of this method do not necessarily need to have the same template arguments as shown here. It will be called without any explicit template arguments so anything can be used as long as type deduction works.
- Template Parameters
-
Index_ | Type of index value. |
InputValue_ | Type of matrix value to use in the operation. |
OutputValue_ | Type of matrix value returned by the operation. |
- Parameters
-
| row | Whether the rows are the target dimension. If true, buffer contains row i , otherwise it contains column i . |
| i | Index of the extracted row (if row = true ) or column (otherwise). Unlike DelayedUnaryIsometricMockAdvanced::dense() , this is always guaranteed to be available. |
| start | Start of the contiguous block of columns (if row = true ) or rows (otherwise) extracted from i . |
| length | Length of the contiguous block. |
[in] | input | Pointer to an array containing a contiguous block of a row/column extracted from the matrix. This has length addressable elements. |
[out] | output | Pointer to an array to store the results of the operation applied to elements of input . This has length addressable elements. If InputValue_ == OutputValue_ , this is guaranteed to be the same as input . |
◆ dense() [2/2]
template<typename Index_ , typename InputValue_ , typename OutputValue_ >
void tatami::DelayedUnaryIsometricMockBasic::dense |
( |
bool | row, |
|
|
Index_ | i, |
|
|
const std::vector< Index_ > & | indices, |
|
|
const InputValue_ * | input, |
|
|
OutputValue_ * | output ) const |
|
inline |
This method accepts an indexed subset of an element of the target dimension from the underlying matrix (input
), applies the operation to each value, and stores the result in another array of different type (output
).
Implementions of this method do not necessarily need to have the same template arguments as shown here. It will be called without any explicit template arguments so anything can be used as long as type deduction works.
- Template Parameters
-
InputValue_ | Type of matrix value to use in the operation. |
Index_ | Type of index value. |
OutputValue_ | Type of matrix value returned by the operation. |
- Parameters
-
| row | Whether the rows are the target dimension. If true, buffer contains row i , otherwise it contains column i . |
| i | Index of the extracted row (if row = true ) or column (otherwise). Unlike DelayedUnaryIsometricMockAdvanced::dense() , this is always guaranteed to be available. |
| indices | Sorted and unique indices of columns (if row = true ) or rows (otherwise) extracted from i . |
[in] | input | Pointer to an array containing an indexed subset of a row/column extracted from the matrix. This has length addressable elements. |
[out] | output | Pointer to an array to store the results of the operation applied to elements of input . This has length addressable elements. If InputValue_ == OutputValue_ , this is guaranteed to be the same as input . |
◆ is_basic
bool tatami::DelayedUnaryIsometricMockBasic::is_basic = true |
|
staticconstexpr |
The documentation for this class was generated from the following file: