tatami
C++ API for different matrix representations
|
Basic mock operation for DelayedBinaryIsometricOperation
.
More...
#include <mock_helpers.hpp>
Public Member Functions | |
template<typename Index_ , typename InputValue_ , typename OutputValue_ > | |
void | dense (bool row, Index_ i, Index_ start, Index_ length, const InputValue_ *left_buffer, const InputValue_ *right_buffer, OutputValue_ *output_buffer) const |
template<typename Index_ , typename InputValue_ , typename OutputValue_ > | |
void | dense (bool row, Index_ i, const std::vector< Index_ > &indices, const InputValue_ *left_buffer, const InputValue_ *right_buffer, OutputValue_ *output_buffer) const |
Static Public Attributes | |
static constexpr bool | is_basic = true |
Basic mock operation for DelayedBinaryIsometricOperation
.
This class defines the basic expectations for an operation in DelayedBinaryIsometricOperation
. 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.
|
inline |
This method should apply the operation to corresponding values of left_buffer
and right_buffer
. These buffers represent the same element of the target dimension from the left and right matrices, respectively, in dense form. Each buffer holds values from a contiguous block of the non-target dimension.
Implementations 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.
Index_ | Type of index value. |
InputValue_ | Type of matrix value to be used in the operation. |
OutputValue_ | Type of the result of the operation. |
row | Whether the rows are the target dimension. If true, left_buffer and right_buffer hold the contents of the i -th row from both matrices; otherwise, they hold the contents of the i -th column. | |
i | Index of the extracted row (if row = true ) or column (otherwise). Unlike DelayedBinaryIsometricMockAdvanced::dense() , this is always guaranteed to be the actual index and not a placeholder. | |
start | Start of the contiguous block of columns (if row = true ) or rows (otherwise) extracted from i . | |
length | Length of the contiguous block. | |
[in] | left_buffer | Pointer to an array containing the row/column extracted from the left matrix. This has length addressable elements. |
[in] | right_buffer | Pointer to an array containing the row/column extracted from the right matrix. This has length addressable elements. |
[out] | output_buffer | Pointer to an array in which to store the result of the operation. This has length addressable elements. If InputValue_ == OutputValue_ , this is guaranteed to be the same as left_buffer . |
|
inline |
This method should apply the operation to corresponding values of left_buffer
and right_buffer
. These buffers represent the same element of the target dimension from the left and right matrices, respectively, in dense form. Each buffer holds values from an indexed subset of the non-target dimension.
Implementations 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.
Index_ | Type of index value. |
InputValue_ | Type of matrix value to be used in the operation. |
OutputValue_ | Type of the result of the operation. |
row | Whether the rows are the target dimension. If true, left_buffer and right_buffer hold the contents of the i -th row from both matrices; otherwise, they hold the contents of the i -th column. | |
i | Index of the extracted row (if row = true ) or column (otherwise). Unlike DelayedBinaryIsometricMockAdvanced::dense() , this is always guaranteed to be the actual index and not a placeholder. | |
indices | Sorted and unique indices of columns (if row = true ) or rows (otherwise) extracted from i . | |
[in] | left_buffer | Pointer to an array containing the row/column extracted from the left matrix. This has length addressable elements, and the result of the operation should be stored here. |
[in] | right_buffer | Pointer to an array containing the row/column extracted from the right matrix. This has length addressable elements. |
[out] | output_buffer | Pointer to an array in which to store the result of the operation. This has length addressable elements. If InputValue_ == OutputValue_ , this is guaranteed to be the same as left_buffer . |
Whether this is a basic operation. This should be true, otherwise an advanced operation is expected (see DelayedBinaryIsometricMockAdvanced
).