|
std::optional< Index_ > | nrow () const |
|
std::optional< Index_ > | ncol () const |
|
bool | zero_depends_on_row () const |
|
bool | zero_depends_on_column () const |
|
bool | non_zero_depends_on_row () const |
|
bool | non_zero_depends_on_column () const |
|
void | dense (bool, Index_, Index_, Index_ length, const InputValue_ *input, OutputValue_ *output) const |
|
void | dense (bool, Index_, const std::vector< Index_ > &indices, const InputValue_ *input, OutputValue_ *output) const |
|
bool | is_sparse () const |
|
void | sparse (bool, Index_, Index_ number, const InputValue_ *input_value, const Index_ *, OutputValue_ *output_value) const |
|
OutputValue_ | fill (bool, Index_) const |
|
template<typename OutputValue_, typename InputValue_, typename Index_>
class tatami::DelayedUnaryIsometricBooleanNotHelper< OutputValue_, InputValue_, Index_ >
Helper for a delayed unary isometric boolean NOT operation.
This class applies a boolean NOT operation to each element of a Matrix
. It should be used as the Operation_
in the DelayedUnaryIsometricOperation
class.
- Template Parameters
-
OutputValue_ | Type of the result of the operation. |
InputValue_ | Type of the value of the input matrix. |
Index_ | Integer type for the row/column indices. |
template<typename OutputValue_ , typename InputValue_ , typename Index_ >
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 different type (output
).
- 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). This argument should be ignored if the operation does not depend on the row/column (i.e., when all of zero_depends_on_row() and friends return false), in which case an arbitrary placeholder may be supplied. |
| 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 . |
Implements tatami::DelayedUnaryIsometricOperationHelper< OutputValue_, InputValue_, Index_ >.
template<typename OutputValue_ , typename InputValue_ , typename Index_ >
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
).
- 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). This argument should be ignored if the operation does not depend on the row/column (i.e., when all of zero_depends_on_row() and friends return false), in which case an arbitrary placeholder may be supplied. |
| 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 . |
Implements tatami::DelayedUnaryIsometricOperationHelper< OutputValue_, InputValue_, Index_ >.
template<typename OutputValue_ , typename InputValue_ , typename Index_ >
This method is expected to iterate over input_value
, apply the operation to each value, and store the result in output_value
. We assume that the operation only needs to be applied to the structural non-zeros; structural zeros are either ignored for sparsity-preserving operations, or the result of the operation on zeros will be populated by fill()
.
If non_zero_depends_on_row() && !row
or non_zero_depends_on_column() && row
, index
is guaranteed to be non-NULL. Otherwise, it may be NULL and should be ignored. Even if non-NULL, indices are not guaranteed to be sorted.
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.
- 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). This argument should be ignored if the operation does not depend on the row/column (i.e., when all of zero_depends_on_row() and friends return false), in which case an arbitrary placeholder may be supplied. |
| num | Number of non-zero elements for row/column i . |
[in] | input_value | Pointer to an array of values of the structural non-zero elements from the row/column of the matrix. This is guaranteed to have num addressable elements. |
[in] | index | Pointer to an array of column (if row = true ) or row indices (otherwise) of the non-zero elements. Alternatively NULL. |
[out] | output_value | Pointer to an array in which to store the result of the operation on each element of input_value . This is guaranteed to have num addressable elements. If InputValue_ == OutputValue_ , this is guaranteed to be the same as input . |
Implements tatami::DelayedUnaryIsometricOperationHelper< OutputValue_, InputValue_, Index_ >.
template<typename OutputValue_ , typename InputValue_ , typename Index_ >