tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
tatami::DelayedBinaryIsometricMockBasic Class Reference

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
 

Detailed Description

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.

Member Function Documentation

◆ dense() [1/2]

void tatami::DelayedBinaryIsometricMockBasic::dense ( bool  row,
Index_  i,
Index_  start,
Index_  length,
const InputValue_ left_buffer,
const InputValue_ right_buffer,
OutputValue_ output_buffer 
) const
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.

Template Parameters
Index_Type of index value.
InputValue_Type of matrix value to be used in the operation.
OutputValue_Type of the result of the operation.
Parameters
rowWhether 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.
iIndex 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.
startStart of the contiguous block of columns (if row = true) or rows (otherwise) extracted from i.
lengthLength of the contiguous block.
[in]left_bufferPointer to an array containing the row/column extracted from the left matrix. This has length addressable elements.
[in]right_bufferPointer to an array containing the row/column extracted from the right matrix. This has length addressable elements.
[out]output_bufferPointer 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.

◆ dense() [2/2]

void tatami::DelayedBinaryIsometricMockBasic::dense ( bool  row,
Index_  i,
const std::vector< Index_ > &  indices,
const InputValue_ left_buffer,
const InputValue_ right_buffer,
OutputValue_ output_buffer 
) const
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.

Template Parameters
Index_Type of index value.
InputValue_Type of matrix value to be used in the operation.
OutputValue_Type of the result of the operation.
Parameters
rowWhether 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.
iIndex 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.
indicesSorted and unique indices of columns (if row = true) or rows (otherwise) extracted from i.
[in]left_bufferPointer 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_bufferPointer to an array containing the row/column extracted from the right matrix. This has length addressable elements.
[out]output_bufferPointer 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.

Member Data Documentation

◆ is_basic

constexpr bool tatami::DelayedBinaryIsometricMockBasic::is_basic = true
staticconstexpr

Whether this is a basic operation. This should be true, otherwise an advanced operation is expected (see DelayedBinaryIsometricMockAdvanced).


The documentation for this class was generated from the following file: