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

Basic mock operation for a DelayedUnaryIsometricOperation. 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_ *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
 

Static Public Attributes

static constexpr bool is_basic = true
 

Detailed Description

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.

Member Function Documentation

◆ dense() [1/2]

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
rowWhether the rows are the target dimension. If true, buffer contains row i, otherwise it contains column i.
iIndex of the extracted row (if row = true) or column (otherwise). Unlike DelayedUnaryIsometricMockAdvanced::dense(), this is always guaranteed to be available.
startStart of the contiguous block of columns (if row = true) or rows (otherwise) extracted from i.
lengthLength of the contiguous block.
[in]inputPointer to an array containing a contiguous block of a row/column extracted from the matrix. This has length addressable elements.
[out]outputPointer 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]

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
rowWhether the rows are the target dimension. If true, buffer contains row i, otherwise it contains column i.
iIndex of the extracted row (if row = true) or column (otherwise). Unlike DelayedUnaryIsometricMockAdvanced::dense(), this is always guaranteed to be available.
indicesSorted and unique indices of columns (if row = true) or rows (otherwise) extracted from i.
[in]inputPointer to an array containing an indexed subset of a row/column extracted from the matrix. This has length addressable elements.
[out]outputPointer 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.

Member Data Documentation

◆ is_basic

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

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


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