tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
tatami Namespace Reference

Flexible representations for matrix data. More...

Classes

class  ArrayView
 View into a pre-allocated array. More...
 
class  BlockSparsifiedWrapper
 Wrap a block dense extractor in the sparse interface. More...
 
class  CompressedSparseColumnMatrix
 Compressed sparse column matrix. More...
 
struct  CompressedSparseContents
 Compressed sparse contents. More...
 
class  CompressedSparseMatrix
 Compressed sparse matrix representation. More...
 
class  CompressedSparseRowMatrix
 Compressed sparse row matrix. More...
 
class  ConsecutiveOracle
 Predict future accesses along a consecutive sequence. More...
 
class  ConstantMatrix
 Matrix containing a constant value. More...
 
class  DelayedBinaryIsometricArithmetic
 Delayed binary isometric arithmetic. More...
 
struct  DelayedBinaryIsometricBoolean
 Delayed binary isometric boolean operations. More...
 
struct  DelayedBinaryIsometricCompare
 Delayed binary isometric comparison. More...
 
class  DelayedBinaryIsometricMockAdvanced
 Advanced mock operation for DelayedBinaryIsometricOperation. More...
 
class  DelayedBinaryIsometricMockBasic
 Basic mock operation for DelayedBinaryIsometricOperation. More...
 
class  DelayedBinaryIsometricOperation
 Delayed isometric operations on two matrices. More...
 
class  DelayedBind
 Delayed combining of a matrix. More...
 
class  DelayedCast
 Recast a Matrix to a different interface type. More...
 
class  DelayedSubset
 Delayed subsetting of a matrix with general indices. More...
 
class  DelayedSubsetBlock
 Delayed subsetting to a contiguous block. More...
 
class  DelayedSubsetSorted
 Delayed subsetting of a matrix with sorted indices. More...
 
class  DelayedSubsetSortedUnique
 Delayed subsetting of a matrix with sorted, unique indices. More...
 
class  DelayedSubsetUnique
 Delayed subsetting of a matrix with unique indices. More...
 
class  DelayedTranspose
 Delayed transposition of a matrix. More...
 
class  DelayedUnaryIsometricAbs
 Take the absolute value of a matrix entry. More...
 
class  DelayedUnaryIsometricAcos
 Take the inverse cosine of a matrix entry. More...
 
class  DelayedUnaryIsometricAcosh
 Take the inverse hyperbolic cosine of a matrix entry. More...
 
class  DelayedUnaryIsometricArithmeticScalar
 Delayed unary isometric scalar arithmetic. More...
 
class  DelayedUnaryIsometricArithmeticVector
 Delayed unary isometric vector arithmetic. More...
 
class  DelayedUnaryIsometricAsin
 Take the inverse sine of a matrix entry. More...
 
class  DelayedUnaryIsometricAsinh
 Take the inverse hyperbolic sine of a matrix entry. More...
 
class  DelayedUnaryIsometricAtan
 Take the inverse tangent of a matrix entry. More...
 
class  DelayedUnaryIsometricAtanh
 Take the inverse hyperbolic tangent of a matrix entry. More...
 
class  DelayedUnaryIsometricBooleanCast
 Delayed unary isometric boolean cast. More...
 
class  DelayedUnaryIsometricBooleanNot
 Delayed unary isometric boolean NOT operation. More...
 
class  DelayedUnaryIsometricBooleanScalar
 Delayed unary isometric scalar boolean operation. More...
 
class  DelayedUnaryIsometricBooleanVector
 Delayed unary isometric vector boolean operations. More...
 
class  DelayedUnaryIsometricCeiling
 Take the ceiling of a matrix entry. More...
 
class  DelayedUnaryIsometricCompareScalar
 Delayed scalar comparison. More...
 
class  DelayedUnaryIsometricCompareVector
 Delayed vector comparisons. More...
 
class  DelayedUnaryIsometricCos
 Take the cosine of a matrix entry. More...
 
class  DelayedUnaryIsometricCosh
 Take the hyperbolic cosine of a matrix entry. More...
 
class  DelayedUnaryIsometricExp
 Use a matrix entry as an exponent. More...
 
class  DelayedUnaryIsometricExpm1
 Use a matrix entry as an exponent minus 1. More...
 
class  DelayedUnaryIsometricFloor
 Take the floor of a matrix entry. More...
 
class  DelayedUnaryIsometricGamma
 Apply the gamma function to a matrix entry. More...
 
class  DelayedUnaryIsometricLgamma
 Apply the log-gamma function to a matrix entry. More...
 
class  DelayedUnaryIsometricLog
 Take the logarithm of a matrix entry. More...
 
class  DelayedUnaryIsometricLog1p
 Take the logarithm of a matrix entry plus 1. More...
 
class  DelayedUnaryIsometricMockAdvanced
 Advanced mock operation for DelayedUnaryIsometricOperation. More...
 
class  DelayedUnaryIsometricMockBasic
 Basic mock operation for a DelayedUnaryIsometricOperation. More...
 
class  DelayedUnaryIsometricOperation
 Delayed isometric operation on a single matrix. More...
 
class  DelayedUnaryIsometricRound
 Round a matrix entry to the nearest integer. More...
 
class  DelayedUnaryIsometricSign
 Take the sign of a matrix entry. More...
 
class  DelayedUnaryIsometricSin
 Take the sine of a matrix entry. More...
 
class  DelayedUnaryIsometricSinh
 Take the hyperbolic sine of a matrix entry. More...
 
class  DelayedUnaryIsometricSpecialCompare
 Delayed special value comparison. More...
 
class  DelayedUnaryIsometricSpecialSubstitute
 Delayed special value substitution. More...
 
class  DelayedUnaryIsometricSqrt
 Take the square root of a matrix entry. More...
 
class  DelayedUnaryIsometricSubstituteScalar
 Delayed scalar substitution. More...
 
class  DelayedUnaryIsometricSubstituteVector
 Delayed vector comparisons. More...
 
class  DelayedUnaryIsometricTan
 Take the tangent of a matrix entry. More...
 
class  DelayedUnaryIsometricTanh
 Take the hyperbolic tangent of a matrix entry. More...
 
class  DelayedUnaryIsometricTrunc
 Integer truncation of a matrix entry. More...
 
class  DenseColumnMatrix
 Dense column-major matrix. More...
 
class  DenseMatrix
 Dense matrix representation. More...
 
class  DenseRowMatrix
 Dense row-major matrix. More...
 
class  FixedVectorOracle
 Predict future accesses from a vector containing a fixed sequence. More...
 
class  FixedViewOracle
 Predict future accesses from a view on a fixed sequence. More...
 
class  FragmentedSparseColumnMatrix
 Fragmented sparse column matrix. More...
 
struct  FragmentedSparseContents
 Fragmented sparse contents. More...
 
class  FragmentedSparseMatrix
 Fragmented sparse matrix representation. More...
 
class  FragmentedSparseRowMatrix
 Fragmented sparse row matrix. More...
 
class  FullSparsifiedWrapper
 Wrap a full dense extractor in the sparse interface. More...
 
struct  has_data
 Compile time check for the data() method. More...
 
struct  has_data< T, V, decltype((void) std::declval< V >().data(), 0)>
 Compile time check for the data() method. More...
 
class  IndexSparsifiedWrapper
 Wrap an indexed dense extractor in the sparse interface. More...
 
class  Matrix
 Virtual class for a matrix. More...
 
class  MyopicDenseExtractor
 Extract an element of the target dimension in dense form without an oracle. More...
 
class  MyopicSparseExtractor
 Extract an element of the target dimension in sparse form without an oracle. More...
 
struct  Options
 Options for accessing data from a Matrix instance. More...
 
class  Oracle
 Predict future access requests on the target dimension. More...
 
class  OracularDenseExtractor
 Extract an element of the target dimension in dense form with an oracle. More...
 
class  OracularSparseExtractor
 Extract an element of the target dimension in sparse form with an oracle. More...
 
struct  PseudoOracularDenseExtractor
 Mimic the OracularDenseExtractor interface. More...
 
struct  PseudoOracularSparseExtractor
 Mimic the OracularSparseExtractor interface. More...
 
class  SomeNumericArray
 Array of some numeric type, determined at runtime. More...
 
struct  SparseRange
 A range of a sparse vector. More...
 

Typedefs

template<bool oracle_, typename Value_ , typename Index_ >
using DenseExtractor = typename std::conditional< oracle_, OracularDenseExtractor< Value_, Index_ >, MyopicDenseExtractor< Value_, Index_ > >::type
 
template<bool oracle_, typename Value_ , typename Index_ >
using SparseExtractor = typename std::conditional< oracle_, OracularSparseExtractor< Value_, Index_ >, MyopicSparseExtractor< Value_, Index_ > >::type
 
template<typename Index_ >
using VectorPtr = std::shared_ptr< const std::vector< Index_ > >
 
using NumericMatrix = Matrix< double, int >
 
template<class Array_ >
using ElementType = typename std::remove_cv< typename std::remove_reference< decltype(std::declval< Array_ >()[0])>::type >::type
 
template<bool oracle_, typename Index_ >
using MaybeOracle = typename std::conditional< oracle_, std::shared_ptr< const Oracle< Index_ > >, bool >::type
 

Enumerations

enum class  DimensionSelectionType : char { FULL , BLOCK , INDEX }
 
enum class  ArithmeticOperation : char {
  ADD , SUBTRACT , MULTIPLY , DIVIDE ,
  POWER , MODULO , INTEGER_DIVIDE
}
 
enum class  BooleanOperation : char { AND , OR , XOR , EQUAL }
 
enum class  CompareOperation : char {
  EQUAL , GREATER_THAN , LESS_THAN , GREATER_THAN_OR_EQUAL ,
  LESS_THAN_OR_EQUAL , NOT_EQUAL
}
 
enum class  SpecialCompareOperation : char { ISNAN , ISINF , ISFINITE }
 
enum  SomeNumericType {
  I8 , U8 , I16 , U16 ,
  I32 , U32 , I64 , U64 ,
  F32 , F64
}
 

Functions

template<typename StoredValue_ , typename InputValue_ , typename InputIndex_ >
void convert_to_dense (const Matrix< InputValue_, InputIndex_ > *matrix, bool row_major, StoredValue_ *store, int threads=1)
 
template<typename Value_ = double, typename Index_ = int, typename StoredValue_ = Value_, typename InputValue_ , typename InputIndex_ >
std::shared_ptr< Matrix< Value_, Index_ > > convert_to_dense (const Matrix< InputValue_, InputIndex_ > *matrix, bool row_major, int threads=1)
 
template<typename Input_ , typename Output_ >
void transpose (const Input_ *input, size_t nrow, size_t ncol, size_t input_stride, Output_ *output, size_t output_stride)
 
template<typename Input_ , typename Output_ >
void transpose (const Input_ *input, size_t nrow, size_t ncol, Output_ *output)
 
DelayedBinaryIsometricArithmetic< ArithmeticOperation::ADD > make_DelayedBinaryIsometricAdd ()
 
DelayedBinaryIsometricArithmetic< ArithmeticOperation::SUBTRACT > make_DelayedBinaryIsometricSubtract ()
 
DelayedBinaryIsometricArithmetic< ArithmeticOperation::MULTIPLY > make_DelayedBinaryIsometricMultiply ()
 
DelayedBinaryIsometricArithmetic< ArithmeticOperation::DIVIDE > make_DelayedBinaryIsometricDivide ()
 
DelayedBinaryIsometricArithmetic< ArithmeticOperation::POWER > make_DelayedBinaryIsometricPower ()
 
DelayedBinaryIsometricArithmetic< ArithmeticOperation::MODULO > make_DelayedBinaryIsometricModulo ()
 
DelayedBinaryIsometricArithmetic< ArithmeticOperation::INTEGER_DIVIDE > make_DelayedBinaryIsometricIntegerDivide ()
 
DelayedBinaryIsometricBoolean< BooleanOperation::EQUAL > make_DelayedBinaryIsometricBooleanEqual ()
 
DelayedBinaryIsometricBoolean< BooleanOperation::AND > make_DelayedBinaryIsometricBooleanAnd ()
 
DelayedBinaryIsometricBoolean< BooleanOperation::OR > make_DelayedBinaryIsometricBooleanOr ()
 
DelayedBinaryIsometricBoolean< BooleanOperation::XOR > make_DelayedBinaryIsometricBooleanXor ()
 
DelayedBinaryIsometricCompare< CompareOperation::EQUAL > make_DelayedBinaryIsometricEqual ()
 
DelayedBinaryIsometricCompare< CompareOperation::GREATER_THAN > make_DelayedBinaryIsometricGreaterThan ()
 
DelayedBinaryIsometricCompare< CompareOperation::LESS_THAN > make_DelayedBinaryIsometricLessThan ()
 
DelayedBinaryIsometricCompare< CompareOperation::GREATER_THAN_OR_EQUAL > make_DelayedBinaryIsometricGreaterThanOrEqual ()
 
DelayedBinaryIsometricCompare< CompareOperation::LESS_THAN_OR_EQUAL > make_DelayedBinaryIsometricLessThanOrEqual ()
 
DelayedBinaryIsometricCompare< CompareOperation::NOT_EQUAL > make_DelayedBinaryIsometricNotEqual ()
 
template<typename OutputValue_ = double, typename InputValue_ , typename Index_ , class Operation_ >
std::shared_ptr< Matrix< OutputValue_, Index_ > > make_DelayedBinaryIsometricOperation (std::shared_ptr< const Matrix< InputValue_, Index_ > > left, std::shared_ptr< const Matrix< InputValue_, Index_ > > right, Operation_ op)
 
template<typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::ADD, true, InputValue_, Scalar_make_DelayedUnaryIsometricAddScalar (Scalar_ scalar)
 
template<bool right_, typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::SUBTRACT, right_, InputValue_, Scalar_make_DelayedUnaryIsometricSubtractScalar (Scalar_ scalar)
 
template<typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::MULTIPLY, true, InputValue_, Scalar_make_DelayedUnaryIsometricMultiplyScalar (Scalar_ scalar)
 
template<bool right_, typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::DIVIDE, right_, InputValue_, Scalar_make_DelayedUnaryIsometricDivideScalar (Scalar_ scalar)
 
template<bool right_, typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::POWER, right_, InputValue_, Scalar_make_DelayedUnaryIsometricPowerScalar (Scalar_ scalar)
 
template<bool right_, typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::MODULO, right_, InputValue_, Scalar_make_DelayedUnaryIsometricModuloScalar (Scalar_ scalar)
 
template<bool right_, typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::INTEGER_DIVIDE, right_, InputValue_, Scalar_make_DelayedUnaryIsometricIntegerDivideScalar (Scalar_ scalar)
 
template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::ADD, true, InputValue_, Vector_make_DelayedUnaryIsometricAddVector (Vector_ vector, bool by_row)
 
template<bool right_, typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::SUBTRACT, right_, InputValue_, Vector_make_DelayedUnaryIsometricSubtractVector (Vector_ vector, bool by_row)
 
template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::MULTIPLY, true, InputValue_, Vector_make_DelayedUnaryIsometricMultiplyVector (Vector_ vector, bool by_row)
 
template<bool right_, typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::DIVIDE, right_, InputValue_, Vector_make_DelayedUnaryIsometricDivideVector (Vector_ vector, bool by_row)
 
template<bool right_, typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::POWER, right_, InputValue_, Vector_make_DelayedUnaryIsometricPowerVector (Vector_ vector, bool by_row)
 
template<bool right_, typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::MODULO, right_, InputValue_, Vector_make_DelayedUnaryIsometricModuloVector (Vector_ vector, bool by_row)
 
template<bool right_, typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::INTEGER_DIVIDE, right_, InputValue_, Vector_make_DelayedUnaryIsometricIntegerDivideVector (Vector_ vector, bool by_row)
 
DelayedUnaryIsometricBooleanNot make_DelayedUnaryIsometricBooleanNot ()
 
DelayedUnaryIsometricBooleanScalar< BooleanOperation::AND > make_DelayedUnaryIsometricBooleanAndScalar (bool scalar)
 
DelayedUnaryIsometricBooleanScalar< BooleanOperation::OR > make_DelayedUnaryIsometricBooleanOrScalar (bool scalar)
 
DelayedUnaryIsometricBooleanScalar< BooleanOperation::XOR > make_DelayedUnaryIsometricBooleanXorScalar (bool scalar)
 
DelayedUnaryIsometricBooleanScalar< BooleanOperation::EQUAL > make_DelayedUnaryIsometricBooleanEqualScalar (bool scalar)
 
template<typename Vector_ >
DelayedUnaryIsometricBooleanVector< BooleanOperation::AND, Vector_make_DelayedUnaryIsometricBooleanAndVector (Vector_ vector, bool by_row)
 
template<typename Vector_ >
DelayedUnaryIsometricBooleanVector< BooleanOperation::OR, Vector_make_DelayedUnaryIsometricBooleanOrVector (Vector_ vector, bool by_row)
 
template<typename Vector_ >
DelayedUnaryIsometricBooleanVector< BooleanOperation::XOR, Vector_make_DelayedUnaryIsometricBooleanXorVector (Vector_ vector, bool by_row)
 
template<typename Vector_ >
DelayedUnaryIsometricBooleanVector< BooleanOperation::EQUAL, Vector_make_DelayedUnaryIsometricBooleanEqualVector (Vector_ vector, bool by_row)
 
template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::EQUAL, InputValue_make_DelayedUnaryIsometricEqualScalar (InputValue_ scalar)
 
template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::GREATER_THAN, InputValue_make_DelayedUnaryIsometricGreaterThanScalar (InputValue_ scalar)
 
template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::LESS_THAN, InputValue_make_DelayedUnaryIsometricLessThanScalar (InputValue_ scalar)
 
template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::GREATER_THAN_OR_EQUAL, InputValue_make_DelayedUnaryIsometricGreaterThanOrEqualScalar (InputValue_ scalar)
 
template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::LESS_THAN_OR_EQUAL, InputValue_make_DelayedUnaryIsometricLessThanOrEqualScalar (InputValue_ scalar)
 
template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::NOT_EQUAL, InputValue_make_DelayedUnaryIsometricNotEqualScalar (InputValue_ scalar)
 
template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::EQUAL, InputValue_, Vector_make_DelayedUnaryIsometricEqualVector (Vector_ vector, bool by_row)
 
template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::GREATER_THAN, InputValue_, Vector_make_DelayedUnaryIsometricGreaterThanVector (Vector_ vector, bool by_row)
 
template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::LESS_THAN, InputValue_, Vector_make_DelayedUnaryIsometricLessThanVector (Vector_ vector, bool by_row)
 
template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::GREATER_THAN_OR_EQUAL, InputValue_, Vector_make_DelayedUnaryIsometricGreaterThanOrEqualVector (Vector_ vector, bool by_row)
 
template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::LESS_THAN_OR_EQUAL, InputValue_, Vector_make_DelayedUnaryIsometricLessThanOrEqualVector (Vector_ vector, bool by_row)
 
template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::NOT_EQUAL, InputValue_, Vector_make_DelayedUnaryIsometricNotEqualVector (Vector_ vector, bool by_row)
 
template<bool pass_ = true, typename InputValue_ = double>
DelayedUnaryIsometricSpecialCompare< SpecialCompareOperation::ISNAN, pass_, InputValue_make_DelayedUnaryIsometricIsnan ()
 
template<bool pass_ = true, typename InputValue_ = double>
DelayedUnaryIsometricSpecialCompare< SpecialCompareOperation::ISINF, pass_, InputValue_make_DelayedUnaryIsometricIsinf ()
 
template<bool pass_ = true, typename InputValue_ = double>
DelayedUnaryIsometricSpecialCompare< SpecialCompareOperation::ISFINITE, pass_, InputValue_make_DelayedUnaryIsometricIsfinite ()
 
template<typename OutputValue_ = double, typename InputValue_ , typename Index_ , class Operation_ >
std::shared_ptr< Matrix< OutputValue_, Index_ > > make_DelayedUnaryIsometricOperation (std::shared_ptr< const Matrix< InputValue_, Index_ > > matrix, Operation_ operation)
 
template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::EQUAL, Value_make_DelayedUnaryIsometricSubstituteEqualScalar (Value_ compared, Value_ substitute)
 
template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::GREATER_THAN, Value_make_DelayedUnaryIsometricSubstituteGreaterThanScalar (Value_ compared, Value_ substitute)
 
template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::LESS_THAN, Value_make_DelayedUnaryIsometricSubstituteLessThanScalar (Value_ compared, Value_ substitute)
 
template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::GREATER_THAN_OR_EQUAL, Value_make_DelayedUnaryIsometricSubstituteGreaterThanOrEqualScalar (Value_ compared, Value_ substitute)
 
template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::LESS_THAN_OR_EQUAL, Value_make_DelayedUnaryIsometricSubstituteLessThanOrEqualScalar (Value_ compared, Value_ substitute)
 
template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::NOT_EQUAL, Value_make_DelayedUnaryIsometricSubstituteNotEqualScalar (Value_ compared, Value_ substitute)
 
template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::EQUAL, Value_, Vector_make_DelayedUnaryIsometricSubstituteEqualVector (Vector_ compared, Vector_ substitute, bool by_row)
 
template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::GREATER_THAN, Value_, Vector_make_DelayedUnaryIsometricSubstituteGreaterThanVector (Vector_ compared, Vector_ substitute, bool by_row)
 
template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::LESS_THAN, Value_, Vector_make_DelayedUnaryIsometricSubstituteLessThanVector (Vector_ compared, Vector_ substitute, bool by_row)
 
template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::GREATER_THAN_OR_EQUAL, Value_, Vector_make_DelayedUnaryIsometricSubstituteGreaterThanOrEqualVector (Vector_ compared, Vector_ substitute, bool by_row)
 
template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::LESS_THAN_OR_EQUAL, Value_, Vector_make_DelayedUnaryIsometricSubstituteLessThanOrEqualVector (Vector_ compared, Vector_ substitute, bool by_row)
 
template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::NOT_EQUAL, Value_, Vector_make_DelayedUnaryIsometricSubstituteNotEqualVector (Vector_ compared, Vector_ substitute, bool by_row)
 
template<bool pass_ = true, typename Value_ = double>
DelayedUnaryIsometricSpecialSubstitute< SpecialCompareOperation::ISNAN, pass_, Value_make_DelayedUnaryIsometricSubstituteIsnan (Value_ substitute)
 
template<bool pass_ = true, typename Value_ = double>
DelayedUnaryIsometricSpecialSubstitute< SpecialCompareOperation::ISINF, pass_, Value_make_DelayedUnaryIsometricSubstituteIsinf (Value_ substitute)
 
template<bool pass_ = true, typename Value_ = double>
DelayedUnaryIsometricSpecialSubstitute< SpecialCompareOperation::ISFINITE, pass_, Value_make_DelayedUnaryIsometricSubstituteIsfinite (Value_ substitute)
 
template<typename Value_ , typename Index_ >
std::shared_ptr< Matrix< Value_, Index_ > > make_DelayedBind (std::vector< std::shared_ptr< const Matrix< Value_, Index_ > > > matrices, bool row)
 
template<typename ValueOut_ , typename IndexOut_ , typename ValueIn_ , typename IndexIn_ >
std::shared_ptr< Matrix< ValueOut_, IndexOut_ > > make_DelayedCast (std::shared_ptr< const Matrix< ValueIn_, IndexIn_ > > p)
 
template<typename Value_ , typename Index_ >
std::shared_ptr< Matrix< Value_, Index_ > > make_DelayedTranspose (std::shared_ptr< const Matrix< Value_, Index_ > > matrix)
 
template<class Values_ , class RowIndices_ , class ColumnIndices_ >
std::vector< size_tcompress_sparse_triplets (size_t nrow, size_t ncol, Values_ &values, RowIndices_ &row_indices, ColumnIndices_ &column_indices, bool csr)
 
template<typename Value_ , typename Index_ , typename Count_ >
void count_compressed_sparse_non_zeros (const tatami::Matrix< Value_, Index_ > *matrix, bool row, Count_ *output, int threads)
 
template<typename InputValue_ , typename InputIndex_ , typename Pointer_ , typename StoredValue_ , typename StoredIndex_ >
void fill_compressed_sparse_contents (const tatami::Matrix< InputValue_, InputIndex_ > *matrix, bool row, const Pointer_ *pointers, StoredValue_ *output_value, StoredIndex_ *output_index, int threads)
 
template<typename StoredValue_ , typename StoredIndex_ , typename StoredPointer_ = size_t, typename InputValue_ , typename InputIndex_ >
CompressedSparseContents< StoredValue_, StoredIndex_, StoredPointer_retrieve_compressed_sparse_contents (const Matrix< InputValue_, InputIndex_ > *matrix, bool row, bool two_pass, int threads=1)
 
template<typename Value_ = double, typename Index_ = int, typename StoredValue_ = Value_, typename StoredIndex_ = Index_, typename InputValue_ , typename InputIndex_ >
std::shared_ptr< Matrix< Value_, Index_ > > convert_to_compressed_sparse (const Matrix< InputValue_, InputIndex_ > *matrix, bool row, bool two_pass=false, int threads=1)
 
template<typename StoredValue_ , typename StoredIndex_ , typename InputValue_ , typename InputIndex_ >
FragmentedSparseContents< StoredValue_, StoredIndex_retrieve_fragmented_sparse_contents (const Matrix< InputValue_, InputIndex_ > *matrix, bool row, int threads=1)
 
template<typename Value_ , typename Index_ , typename StoredValue_ = Value_, typename StoredIndex_ = Index_, typename InputValue_ , typename InputIndex_ >
std::shared_ptr< Matrix< Value_, Index_ > > convert_to_fragmented_sparse (const Matrix< InputValue_, InputIndex_ > *matrix, bool row, int threads=1)
 
template<typename Value_ , typename Index_ >
std::shared_ptr< Matrix< Value_, Index_ > > make_DelayedSubsetBlock (std::shared_ptr< const Matrix< Value_, Index_ > > matrix, Index_ subset_start, Index_ subset_length, bool by_row)
 
template<typename Value_ , typename Index_ , class SubsetStorage_ >
std::shared_ptr< Matrix< Value_, Index_ > > make_DelayedSubset (std::shared_ptr< const Matrix< Value_, Index_ > > matrix, SubsetStorage_ subset, bool by_row)
 
template<bool sparse_, typename Value_ , typename Index_ , typename ... Args_>
auto consecutive_extractor (const Matrix< Value_, Index_ > *mat, bool row, Index_ iter_start, Index_ iter_length, Args_ &&... args)
 
template<typename Value_ , typename Size_ >
Value_copy_n (const Value_ *input, Size_ n, Value_ *output)
 
template<bool sparse_, bool oracle_, typename Value_ , typename Index_ , typename ... Args_>
auto new_extractor (const Matrix< Value_, Index_ > *ptr, bool row, MaybeOracle< oracle_, Index_ > oracle, Args_ &&... args)
 
template<bool parallel_ = true, class Function_ , typename Index_ >
void parallelize (Function_ fun, Index_ tasks, int threads)
 
template<typename Index_ , class Function_ >
void process_consecutive_indices (const Index_ *indices, Index_ length, Function_ fun)
 
template<typename Value_ , typename Index_ >
std::shared_ptr< const Matrix< Value_, Index_ > > wrap_shared_ptr (const Matrix< Value_, Index_ > *ptr)
 

Detailed Description

Flexible representations for matrix data.

Typedef Documentation

◆ DenseExtractor

Template Parameters
oracle_Whether to use an oracle-aware interface.
Value_Data value type, should be numeric.
Index_Row/column index type, should be integer.

Type alias that switches between OracularDenseExtractor and MyopicDenseExtractor depending on oracle_. Intended for templated class definitions, where setting oracle_ can define subclasses for both interfaces.

◆ SparseExtractor

Template Parameters
oracle_Whether to use an oracle-aware interface.
Value_Data value type, should be numeric.
Index_Row/column index type, should be integer.

Type alias that switches between OracularSparseExtractor and MyopicSparseExtractor depending on oracle_. Intended for templated class definitions, where setting oracle_ can define subclasses for both interfaces.

◆ VectorPtr

template<typename Index_ >
using tatami::VectorPtr = typedef std::shared_ptr<const std::vector<Index_> >
Template Parameters
IndexRow/column index type, should be integer.

Pointer to a vector, typically containing unique and sorted indices. We use a shared pointer so that we can cheaply re-use the same sequence of indices for multiple Matrix objects.

◆ NumericMatrix

A convenient shorthand for the most common use case of double-precision matrices.

◆ ElementType

template<class Array_ >
using tatami::ElementType = typedef typename std::remove_cv<typename std::remove_reference<decltype(std::declval<Array_>()[0])>::type>::type
Template Parameters
Array_Some array of values that are accessed with [.

Extract the type of array elements, after stripping away references and const-ness.

◆ MaybeOracle

template<bool oracle_, typename Index_ >
using tatami::MaybeOracle = typedef typename std::conditional<oracle_, std::shared_ptr<const Oracle<Index_> >, bool>::type
Template Parameters
oracle_Whether an oracle should be supplied.
Index_Row/column index type, should be integer.

Maybe an Oracle, maybe a placeholder boolean, depending on oracle_.

Enumeration Type Documentation

◆ DimensionSelectionType

Selection of dimension elements:

  • FULL: selects the full extent of the dimension, i.e., all elements.
  • BLOCK: selects a contiguous block of elements in the dimension.
  • INDEX: selects a sorted and unique array of indices of dimension elements.

This corresponds to the various overloads of Matrix methods (e.g., Matrix::dense_row()), each of which extracts a different selection of elements from the non-target dimension.

◆ ArithmeticOperation

Type of arithmetic operation.

The INTEGER_DIVIDE refers to a floored division, which differs from truncation for negative quotients. This choice is based on R's %/%, which in turn is based on a recommendation by Donald Knuth.

Similarly, x MODULO y is defined as x - floor(x / y), based on the same floored division. Note that this differs from the built-in % operator, which performs truncation.

◆ BooleanOperation

Type of boolean operation.

◆ CompareOperation

Type of comparison operation.

◆ SpecialCompareOperation

Type of comparison operation for special IEEE values.

◆ SomeNumericType

Types supported in SomeNumericArray. The letters indicate whether it is an integer (I), unsigned integer (U) or a float, while the numbers specify the number of bits for the type. So, for example, U16 is an unsigned 16-bit integer, while F64 is a double.

Function Documentation

◆ convert_to_dense() [1/2]

void tatami::convert_to_dense ( const Matrix< InputValue_, InputIndex_ > *  matrix,
bool  row_major,
StoredValue_ store,
int  threads = 1 
)
Template Parameters
StoredValue_Type of data values to be stored in the output.
InputValue_Type of data values in the input.
InputIndex_Integer type for the indices in the input.
Parameters
matrixPointer to a tatami::Matrix.
row_majorWhether to store the output as a row-major matrix.
[out]storePointer to an array of length equal to the product of the dimensions of matrix. On output, this is filled with values from matrix in row- or column-major format depending on row_major.
threadsNumber of threads to use, for parallelization with parallelize().

◆ convert_to_dense() [2/2]

std::shared_ptr< Matrix< Value_, Index_ > > tatami::convert_to_dense ( const Matrix< InputValue_, InputIndex_ > *  matrix,
bool  row_major,
int  threads = 1 
)
inline
Template Parameters
Value_Type of data values in the output interface.
Index_Integer type for the indices in the output interface.
StoredValue_Type of data values to be stored in the output.
InputValue_Type of data values in the input.
InputIndex_Integer type for the indices in the input.
Parameters
matrixPointer to a tatami::Matrix.
row_majorWhether to return a row-major matrix.
threadsNumber of threads to use, for parallelization with parallelize().
Returns
A pointer to a new tatami::DenseMatrix with the same dimensions and type as the matrix referenced by matrix. If row_major = true, the matrix is row-major, otherwise it is column-major.

◆ transpose() [1/2]

void tatami::transpose ( const Input_ input,
size_t  nrow,
size_t  ncol,
size_t  input_stride,
Output_ output,
size_t  output_stride 
)
Template Parameters
Input_Input type.
Output_Output type.
Parameters
[in]inputPointer to an array containing a row-major matrix with nrow rows and ncol columns.
nrowNumber of rows in the matrix stored at input.
ncolNumber of columns in the matrix stored at input.
input_strideDistance between corresponding entries on consecutive rows of the input matrix.
[out]outputPointer to an array of length nrow * ncol. On output, this will hold the transpose of the matrix represented by input.
output_strideDistance between corresponding entries on consecutive columns of the output matrix.

This function is intended for developers of Matrix subclasses who need to do some transposition, e.g., for dense chunks during caching. The *_stride arguments allow input and output to refer to submatrices of larger arrays.

◆ transpose() [2/2]

void tatami::transpose ( const Input_ input,
size_t  nrow,
size_t  ncol,
Output_ output 
)
Template Parameters
Input_Input type.
Output_Output type.
Parameters
[in]inputPointer to an array containing a row-major matrix with nrow rows and ncol columns.
nrowNumber of rows in the matrix stored at input.
ncolNumber of columns in the matrix stored at input.
[out]outputPointer to an array of length nrow * ncol. On output, this will hold the transpose of the matrix represented by input.

This function is intended for developers of Matrix subclasses who need to do some transposition, e.g., for dense chunks during caching. Users should instead construct a DelayedTranspose object to perform a memory-efficient delayed transposition, or use convert_to_dense() to convert their dense data into the desired storage layout.

◆ make_DelayedBinaryIsometricAdd()

DelayedBinaryIsometricArithmetic< ArithmeticOperation::ADD > tatami::make_DelayedBinaryIsometricAdd ( )
inline
Returns
A helper class for delayed binary addition, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricSubtract()

DelayedBinaryIsometricArithmetic< ArithmeticOperation::SUBTRACT > tatami::make_DelayedBinaryIsometricSubtract ( )
inline
Returns
A helper class for delayed binary subtraction, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricMultiply()

DelayedBinaryIsometricArithmetic< ArithmeticOperation::MULTIPLY > tatami::make_DelayedBinaryIsometricMultiply ( )
inline
Returns
A helper class for delayed binary multiplication, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricDivide()

DelayedBinaryIsometricArithmetic< ArithmeticOperation::DIVIDE > tatami::make_DelayedBinaryIsometricDivide ( )
inline
Returns
A helper class for delayed binary division, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricPower()

DelayedBinaryIsometricArithmetic< ArithmeticOperation::POWER > tatami::make_DelayedBinaryIsometricPower ( )
inline
Returns
A helper class for delayed binary power, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricModulo()

DelayedBinaryIsometricArithmetic< ArithmeticOperation::MODULO > tatami::make_DelayedBinaryIsometricModulo ( )
inline
Returns
A helper class for delayed binary modulo.

◆ make_DelayedBinaryIsometricIntegerDivide()

DelayedBinaryIsometricArithmetic< ArithmeticOperation::INTEGER_DIVIDE > tatami::make_DelayedBinaryIsometricIntegerDivide ( )
inline
Returns
A helper class for delayed binary integer division.

◆ make_DelayedBinaryIsometricBooleanEqual()

DelayedBinaryIsometricBoolean< BooleanOperation::EQUAL > tatami::make_DelayedBinaryIsometricBooleanEqual ( )
inline
Returns
A helper class for a delayed binary boolean equivalence operation, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricBooleanAnd()

DelayedBinaryIsometricBoolean< BooleanOperation::AND > tatami::make_DelayedBinaryIsometricBooleanAnd ( )
inline
Returns
A helper class for a delayed binary AND comparison, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricBooleanOr()

DelayedBinaryIsometricBoolean< BooleanOperation::OR > tatami::make_DelayedBinaryIsometricBooleanOr ( )
inline
Returns
A helper class for a delayed binary OR comparison, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricBooleanXor()

DelayedBinaryIsometricBoolean< BooleanOperation::XOR > tatami::make_DelayedBinaryIsometricBooleanXor ( )
inline
Returns
A helper class for a delayed binary XOR comparison, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricEqual()

DelayedBinaryIsometricCompare< CompareOperation::EQUAL > tatami::make_DelayedBinaryIsometricEqual ( )
inline
Returns
A helper class for a delayed binary equality comparison, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricGreaterThan()

DelayedBinaryIsometricCompare< CompareOperation::GREATER_THAN > tatami::make_DelayedBinaryIsometricGreaterThan ( )
inline
Returns
A helper class for a delayed binary greater-than comparison, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricLessThan()

DelayedBinaryIsometricCompare< CompareOperation::LESS_THAN > tatami::make_DelayedBinaryIsometricLessThan ( )
inline
Returns
A helper class for a delayed binary less-than comparison, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricGreaterThanOrEqual()

DelayedBinaryIsometricCompare< CompareOperation::GREATER_THAN_OR_EQUAL > tatami::make_DelayedBinaryIsometricGreaterThanOrEqual ( )
inline
Returns
A helper class for a delayed binary greater-than-or-equal comparison, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricLessThanOrEqual()

DelayedBinaryIsometricCompare< CompareOperation::LESS_THAN_OR_EQUAL > tatami::make_DelayedBinaryIsometricLessThanOrEqual ( )
inline
Returns
A helper class for a delayed binary less-than-or-equal comparison, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricNotEqual()

DelayedBinaryIsometricCompare< CompareOperation::NOT_EQUAL > tatami::make_DelayedBinaryIsometricNotEqual ( )
inline
Returns
A helper class for a delayed binary non-equality comparison to a scalar, to be used as the operation in a DelayedBinaryIsometricOperation.

◆ make_DelayedBinaryIsometricOperation()

std::shared_ptr< Matrix< OutputValue_, Index_ > > tatami::make_DelayedBinaryIsometricOperation ( std::shared_ptr< const Matrix< InputValue_, Index_ > >  left,
std::shared_ptr< const Matrix< InputValue_, Index_ > >  right,
Operation_  op 
)

A make_* helper function to enable partial template deduction of supplied types.

Template Parameters
OutputValue_Type of the result of the operation.
InputValue_Type of the value of the input matrices.
Index_Type of index value.
Operation_Helper class defining the operation.
Parameters
leftPointer to a (possibly const) Matrix.
rightPointer to a (possibly const) Matrix.
opInstance of the operation helper class.
Returns
Instance of a DelayedBinaryIsometricOperation clas.

◆ make_DelayedUnaryIsometricAddScalar()

template<typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::ADD, true, InputValue_, Scalar_ > tatami::make_DelayedUnaryIsometricAddScalar ( Scalar_  scalar)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Scalar_Type of the scalar.
Parameters
scalarScalar value to be added.
Returns
A helper class for delayed scalar addition, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubtractScalar()

template<bool right_, typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::SUBTRACT, right_, InputValue_, Scalar_ > tatami::make_DelayedUnaryIsometricSubtractScalar ( Scalar_  scalar)
Template Parameters
right_Whether the scalar should be on the right hand side of the subtraction.
InputValue_Type of the matrix value to use in the operation.
Scalar_Type of the scalar.
Parameters
scalarScalar value to be subtracted.
Returns
A helper class for delayed scalar subtraction, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricMultiplyScalar()

template<typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::MULTIPLY, true, InputValue_, Scalar_ > tatami::make_DelayedUnaryIsometricMultiplyScalar ( Scalar_  scalar)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Scalar_Type of the scalar.
Parameters
scalarScalar value to be multiplied.
Returns
A helper class for delayed scalar multiplication, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricDivideScalar()

template<bool right_, typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::DIVIDE, right_, InputValue_, Scalar_ > tatami::make_DelayedUnaryIsometricDivideScalar ( Scalar_  scalar)
Template Parameters
right_Whether the scalar should be on the right hand side of the division.
InputValue_Type of the matrix value to use in the operation.
Scalar_Type of the scalar.
Parameters
scalarScalar value to be divided.
Returns
A helper class for delayed scalar division, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricPowerScalar()

template<bool right_, typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::POWER, right_, InputValue_, Scalar_ > tatami::make_DelayedUnaryIsometricPowerScalar ( Scalar_  scalar)
Template Parameters
right_Whether the scalar should be on the right hand side of the power transformation.
InputValue_Type of the matrix value to use in the operation.
Scalar_Type of the scalar.
Parameters
scalarScalar value to be power transformed.
Returns
A helper class for delayed scalar power transformation, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricModuloScalar()

template<bool right_, typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::MODULO, right_, InputValue_, Scalar_ > tatami::make_DelayedUnaryIsometricModuloScalar ( Scalar_  scalar)
Template Parameters
right_Whether the scalar should be on the right hand side of the modulus.
InputValue_Type of the matrix value to use in the operation.
Scalar_Type of the scalar.
Parameters
scalarScalar value to be modulo transformed.
Returns
A helper class for delayed scalar modulus, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricIntegerDivideScalar()

template<bool right_, typename InputValue_ = double, typename Scalar_ >
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::INTEGER_DIVIDE, right_, InputValue_, Scalar_ > tatami::make_DelayedUnaryIsometricIntegerDivideScalar ( Scalar_  scalar)
Template Parameters
right_Whether the scalar should be on the right hand side of the integer division.
InputValue_Type of the matrix value to use in the operation.
Scalar_Type of the scalar.
Parameters
scalarScalar value to be integer divided.
Returns
A helper class for delayed scalar integer division, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricAddVector()

template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::ADD, true, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricAddVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector to be added to the rows/columns.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricArithmeticVector.
Returns
A helper class for delayed vector addition, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubtractVector()

template<bool right_, typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::SUBTRACT, right_, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricSubtractVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
right_Whether the scalar should be on the right hand side of the subtraction.
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector to subtract from (or be subtracted by) the rows/columns.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricArithmeticVector.
Returns
A helper class for delayed vector subtraction, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricMultiplyVector()

template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::MULTIPLY, true, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricMultiplyVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector to multiply the rows/columns.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricArithmeticVector.
Returns
A helper class for delayed vector multiplication, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricDivideVector()

template<bool right_, typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::DIVIDE, right_, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricDivideVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
right_Whether the scalar should be on the right hand side of the division.
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector to divide (or be divided by) the rows/columns.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricArithmeticVector.
Returns
A helper class for delayed vector division, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricPowerVector()

template<bool right_, typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::POWER, right_, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricPowerVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
right_Whether the scalar should be on the right hand side of the power transformation.
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector to use in the power transformation of the rows/columns.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricArithmeticVector.
Returns
A helper class for delayed vector power transformation, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricModuloVector()

template<bool right_, typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::MODULO, right_, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricModuloVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
right_Whether the scalar should be on the right hand side of the modulus.
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector to use in the modulus of the rows/columns.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricArithmeticVector.
Returns
A helper class for delayed vector modulus, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricIntegerDivideVector()

template<bool right_, typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::INTEGER_DIVIDE, right_, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricIntegerDivideVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
right_Whether the scalar should be on the right hand side of the integer division.
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector to integer divide (or be integer divided by) the rows/columns.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricArithmeticVector.
Returns
A helper class for delayed vector division, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricBooleanNot()

DelayedUnaryIsometricBooleanNot tatami::make_DelayedUnaryIsometricBooleanNot ( )
inline
Returns
A helper class for a delayed NOT operation, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricBooleanAndScalar()

DelayedUnaryIsometricBooleanScalar< BooleanOperation::AND > tatami::make_DelayedUnaryIsometricBooleanAndScalar ( bool  scalar)
inline
Parameters
scalarScalar value to use in the operation.
Returns
A helper class for a delayed AND operation with a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricBooleanOrScalar()

DelayedUnaryIsometricBooleanScalar< BooleanOperation::OR > tatami::make_DelayedUnaryIsometricBooleanOrScalar ( bool  scalar)
inline
Parameters
scalarScalar value to use in the operation.
Returns
A helper class for a delayed OR operation with a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricBooleanXorScalar()

DelayedUnaryIsometricBooleanScalar< BooleanOperation::XOR > tatami::make_DelayedUnaryIsometricBooleanXorScalar ( bool  scalar)
inline
Parameters
scalarScalar value to be used in the operation.
Returns
A helper class for a delayed XOR operation with a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricBooleanEqualScalar()

DelayedUnaryIsometricBooleanScalar< BooleanOperation::EQUAL > tatami::make_DelayedUnaryIsometricBooleanEqualScalar ( bool  scalar)
inline
Parameters
scalarScalar value to be used in the operation.
Returns
A helper class for a delayed boolean equality operation with a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricBooleanAndVector()

template<typename Vector_ >
DelayedUnaryIsometricBooleanVector< BooleanOperation::AND, Vector_ > tatami::make_DelayedUnaryIsometricBooleanAndVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
Vector_Type of the vector.
Parameters
vectorVector of values to be used in the operation.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricBooleanVector.
Returns
A helper class for a delayed AND operation with a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricBooleanOrVector()

template<typename Vector_ >
DelayedUnaryIsometricBooleanVector< BooleanOperation::OR, Vector_ > tatami::make_DelayedUnaryIsometricBooleanOrVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
Vector_Type of the vector.
Parameters
vectorVector of values to be used in the operation.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricBooleanVector.
Returns
A helper class for a delayed OR operation with a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricBooleanXorVector()

template<typename Vector_ >
DelayedUnaryIsometricBooleanVector< BooleanOperation::XOR, Vector_ > tatami::make_DelayedUnaryIsometricBooleanXorVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
Vector_Type of the vector.
Parameters
vectorVector of values to be used in the operation.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricBooleanVector.
Returns
A helper class for a delayed XOR operation with a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricBooleanEqualVector()

template<typename Vector_ >
DelayedUnaryIsometricBooleanVector< BooleanOperation::EQUAL, Vector_ > tatami::make_DelayedUnaryIsometricBooleanEqualVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
Vector_Type of the vector.
Parameters
vectorVector of values to be used in the operation.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricBooleanVector.
Returns
A helper class for a delayed boolean equality operation with a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricEqualScalar()

template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::EQUAL, InputValue_ > tatami::make_DelayedUnaryIsometricEqualScalar ( InputValue_  scalar)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Parameters
scalarValue to be compared.
Returns
A helper class for a delayed equality comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricGreaterThanScalar()

template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::GREATER_THAN, InputValue_ > tatami::make_DelayedUnaryIsometricGreaterThanScalar ( InputValue_  scalar)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Parameters
scalarScalar value to be compared.
Returns
A helper class for a delayed greater-than comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricLessThanScalar()

template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::LESS_THAN, InputValue_ > tatami::make_DelayedUnaryIsometricLessThanScalar ( InputValue_  scalar)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Parameters
scalarScalar value to be compared.
Returns
A helper class for a delayed less-than comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricGreaterThanOrEqualScalar()

template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::GREATER_THAN_OR_EQUAL, InputValue_ > tatami::make_DelayedUnaryIsometricGreaterThanOrEqualScalar ( InputValue_  scalar)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Parameters
scalarScalar value to be compared.
Returns
A helper class for a delayed greater-than-or-equal comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricLessThanOrEqualScalar()

template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::LESS_THAN_OR_EQUAL, InputValue_ > tatami::make_DelayedUnaryIsometricLessThanOrEqualScalar ( InputValue_  scalar)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Parameters
scalarScalar value to be compared.
Returns
A helper class for a delayed less-than-or-equal comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricNotEqualScalar()

template<typename InputValue_ = double>
DelayedUnaryIsometricCompareScalar< CompareOperation::NOT_EQUAL, InputValue_ > tatami::make_DelayedUnaryIsometricNotEqualScalar ( InputValue_  scalar)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Parameters
scalarScalar value to be compared.
Returns
A helper class for a delayed non-equality comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricEqualVector()

template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::EQUAL, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricEqualVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector of values to be compared.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricCompareVector.
Returns
A helper class for a delayed equality comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricGreaterThanVector()

template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::GREATER_THAN, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricGreaterThanVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector of values to be compared.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricCompareVector.
Returns
A helper class for a delayed greater-than comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricLessThanVector()

template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::LESS_THAN, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricLessThanVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector of values to be compared.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricCompareVector.
Returns
A helper class for a delayed less-than comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricGreaterThanOrEqualVector()

template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::GREATER_THAN_OR_EQUAL, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricGreaterThanOrEqualVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector of values to be compared.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricCompareVector.
Returns
A helper class for a delayed greater-than-or-equal comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricLessThanOrEqualVector()

template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::LESS_THAN_OR_EQUAL, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricLessThanOrEqualVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector of values to be compared.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricCompareVector.
Returns
A helper class for a delayed less-than-or-equal comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricNotEqualVector()

template<typename InputValue_ = double, typename Vector_ >
DelayedUnaryIsometricCompareVector< CompareOperation::NOT_EQUAL, InputValue_, Vector_ > tatami::make_DelayedUnaryIsometricNotEqualVector ( Vector_  vector,
bool  by_row 
)
Template Parameters
InputValue_Type of the matrix value to use in the operation.
Vector_Type of the vector.
Parameters
vectorVector of values to be compared.
by_rowWhether each element of vector corresponds to a row, see DelayedUnaryIsometricCompareVector.
Returns
A helper class for a delayed non-equality comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricIsnan()

template<bool pass_ = true, typename InputValue_ = double>
DelayedUnaryIsometricSpecialCompare< SpecialCompareOperation::ISNAN, pass_, InputValue_ > tatami::make_DelayedUnaryIsometricIsnan ( )
Template Parameters
pass_Whether to return truthy if the matrix value is NaN.
InputValue_Type of the matrix value to use in the operation.
Returns
A helper class for a delayed NaN check, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricIsinf()

template<bool pass_ = true, typename InputValue_ = double>
DelayedUnaryIsometricSpecialCompare< SpecialCompareOperation::ISINF, pass_, InputValue_ > tatami::make_DelayedUnaryIsometricIsinf ( )
Template Parameters
pass_Whether to return truthy if the matrix value is infinite.
InputValue_Type of the matrix value to use in the operation.
Returns
A helper class for a delayed check for infinity (positive or negative), to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricIsfinite()

template<bool pass_ = true, typename InputValue_ = double>
DelayedUnaryIsometricSpecialCompare< SpecialCompareOperation::ISFINITE, pass_, InputValue_ > tatami::make_DelayedUnaryIsometricIsfinite ( )
Template Parameters
pass_Whether to return truthy if the matrix value is finite.
InputValue_Type of the matrix value to use in the operation.
Returns
A helper class for a delayed check for finite values, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricOperation()

std::shared_ptr< Matrix< OutputValue_, Index_ > > tatami::make_DelayedUnaryIsometricOperation ( std::shared_ptr< const Matrix< InputValue_, Index_ > >  matrix,
Operation_  operation 
)

A make_* helper function to enable partial template deduction of supplied types.

Template Parameters
OutputValue_Type of matrix value after the operation.
InputValue_Type of matrix value before the operation.
Index_Type of index value.
Operation_Helper class implementing the operation.
Parameters
matrixPointer to a (possibly const) Matrix.
operationInstance of the operation helper class.
Returns
Instance of a DelayedUnaryIsometricOperation class.

◆ make_DelayedUnaryIsometricSubstituteEqualScalar()

template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::EQUAL, Value_ > tatami::make_DelayedUnaryIsometricSubstituteEqualScalar ( Value_  compared,
Value_  substitute 
)
Template Parameters
Value_Type of the matrix value.
Parameters
comparedScalar to be compared to the matrix values.
substituteScalar to substitute into the matrix when the comparison is true.
Returns
A helper class for a delayed equality comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteGreaterThanScalar()

template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::GREATER_THAN, Value_ > tatami::make_DelayedUnaryIsometricSubstituteGreaterThanScalar ( Value_  compared,
Value_  substitute 
)
Template Parameters
Value_Type of the matrix value.
Parameters
comparedScalar to be compared to the matrix values.
substituteScalar value to substitute into the matrix when the comparison is true.
Returns
A helper class for a delayed greater-than comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteLessThanScalar()

template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::LESS_THAN, Value_ > tatami::make_DelayedUnaryIsometricSubstituteLessThanScalar ( Value_  compared,
Value_  substitute 
)
Template Parameters
Value_Type of the matrix value.
Parameters
comparedScalar to be compared to the matrix values.
substituteScalar value to substitute into the matrix when the comparison is true.
Returns
A helper class for a delayed less-than comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteGreaterThanOrEqualScalar()

template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::GREATER_THAN_OR_EQUAL, Value_ > tatami::make_DelayedUnaryIsometricSubstituteGreaterThanOrEqualScalar ( Value_  compared,
Value_  substitute 
)
Template Parameters
Value_Type of the matrix value.
Parameters
comparedScalar to be compared to the matrix values.
substituteScalar value to substitute into the matrix when the comparison is true.
Returns
A helper class for a delayed greater-than-or-equal comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteLessThanOrEqualScalar()

template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::LESS_THAN_OR_EQUAL, Value_ > tatami::make_DelayedUnaryIsometricSubstituteLessThanOrEqualScalar ( Value_  compared,
Value_  substitute 
)
Template Parameters
Value_Type of the matrix value.
Parameters
comparedScalar to be compared to the matrix values.
substituteScalar to substitute into the matrix when the comparison is true.
Returns
A helper class for a delayed less-than-or-equal comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteNotEqualScalar()

template<typename Value_ = double>
DelayedUnaryIsometricSubstituteScalar< CompareOperation::NOT_EQUAL, Value_ > tatami::make_DelayedUnaryIsometricSubstituteNotEqualScalar ( Value_  compared,
Value_  substitute 
)
Template Parameters
Value_Type of the matrix value.
Parameters
comparedScalar to be compared to the matrix values.
substituteScalar value to substitute into the matrix when the comparison is true.
Returns
A helper class for a delayed non-equality comparison to a scalar, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteEqualVector()

template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::EQUAL, Value_, Vector_ > tatami::make_DelayedUnaryIsometricSubstituteEqualVector ( Vector_  compared,
Vector_  substitute,
bool  by_row 
)
Template Parameters
Value_Type of the matrix value.
Vector_Type of the vector.
Parameters
comparedVector to be compared to the matrix values.
substituteVector containing values to substitute into the matrix when the comparison is true.
by_rowWhether each element of compared and substitute corresponds to a row, see DelayedUnaryIsometricSubstituteVector.
Returns
A helper class for a delayed equality comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteGreaterThanVector()

template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::GREATER_THAN, Value_, Vector_ > tatami::make_DelayedUnaryIsometricSubstituteGreaterThanVector ( Vector_  compared,
Vector_  substitute,
bool  by_row 
)
Template Parameters
Value_Type of the matrix value.
Vector_Type of the vector.
Parameters
comparedVector to be compared to the matrix values.
substituteVector containing values to substitute into the matrix when the comparison is true.
by_rowWhether each element of compared and substitute corresponds to a row, see DelayedUnaryIsometricSubstituteVector.
Returns
A helper class for a delayed greater-than comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteLessThanVector()

template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::LESS_THAN, Value_, Vector_ > tatami::make_DelayedUnaryIsometricSubstituteLessThanVector ( Vector_  compared,
Vector_  substitute,
bool  by_row 
)
Template Parameters
Value_Type of the matrix value.
Vector_Type of the vector.
Parameters
comparedVector to be compared to the matrix values.
substituteVector containing values to substitute into the matrix when the comparison is true.
by_rowWhether each element of compared and substitute corresponds to a row, see DelayedUnaryIsometricSubstituteVector.
Returns
A helper class for a delayed less-than comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteGreaterThanOrEqualVector()

template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::GREATER_THAN_OR_EQUAL, Value_, Vector_ > tatami::make_DelayedUnaryIsometricSubstituteGreaterThanOrEqualVector ( Vector_  compared,
Vector_  substitute,
bool  by_row 
)
Template Parameters
Value_Type of the matrix value.
Vector_Type of the vector.
Parameters
comparedVector to be compared to the matrix values.
substituteVector containing values to substitute into the matrix when the comparison is true.
by_rowWhether each element of compared and substitute corresponds to a row, see DelayedUnaryIsometricSubstituteVector.
Returns
A helper class for a delayed greater-than-or-equal comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteLessThanOrEqualVector()

template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::LESS_THAN_OR_EQUAL, Value_, Vector_ > tatami::make_DelayedUnaryIsometricSubstituteLessThanOrEqualVector ( Vector_  compared,
Vector_  substitute,
bool  by_row 
)
Template Parameters
Value_Type of the matrix value.
Vector_Type of the vector.
Parameters
comparedVector to be compared to the matrix values.
substituteVector containing values to substitute into the matrix when the comparison is true.
by_rowWhether each element of compared and substitute corresponds to a row, see DelayedUnaryIsometricSubstituteVector.
Returns
A helper class for a delayed less-than-or-equal comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteNotEqualVector()

template<typename Value_ = double, typename Vector_ = std::vector<Value_>>
DelayedUnaryIsometricSubstituteVector< CompareOperation::NOT_EQUAL, Value_, Vector_ > tatami::make_DelayedUnaryIsometricSubstituteNotEqualVector ( Vector_  compared,
Vector_  substitute,
bool  by_row 
)
Template Parameters
Value_Type of the matrix value.
Vector_Type of the vector.
Parameters
comparedVector to be compared to the matrix values.
substituteVector containing values to substitute into the matrix when the comparison is true.
by_rowWhether each element of compared and substitute corresponds to a row, see DelayedUnaryIsometricSubstituteVector.
Returns
A helper class for a delayed non-equality comparison to a vector, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteIsnan()

template<bool pass_ = true, typename Value_ = double>
DelayedUnaryIsometricSpecialSubstitute< SpecialCompareOperation::ISNAN, pass_, Value_ > tatami::make_DelayedUnaryIsometricSubstituteIsnan ( Value_  substitute)
Template Parameters
pass_Whether to perform the substitution if the matrix value is NaN. If false, the substitution is performed if the matrix value is not NaN.
Value_Type of the matrix value.
Returns
A helper class for a delayed NaN check, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteIsinf()

template<bool pass_ = true, typename Value_ = double>
DelayedUnaryIsometricSpecialSubstitute< SpecialCompareOperation::ISINF, pass_, Value_ > tatami::make_DelayedUnaryIsometricSubstituteIsinf ( Value_  substitute)
Template Parameters
pass_Whether to return truthy if the matrix value is infinite. If false, the substitution is performed if the matrix value is not infinite.
Value_Type of the matrix value.
Returns
A helper class for a delayed check for infinity (positive or negative), to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedUnaryIsometricSubstituteIsfinite()

template<bool pass_ = true, typename Value_ = double>
DelayedUnaryIsometricSpecialSubstitute< SpecialCompareOperation::ISFINITE, pass_, Value_ > tatami::make_DelayedUnaryIsometricSubstituteIsfinite ( Value_  substitute)
Template Parameters
pass_Whether to return truthy if the matrix value is finite. If false, the substitution is performed if the matrix value is not finite.
Value_Type of the matrix value.
Returns
A helper class for a delayed check for finite values, to be used as the operation in a DelayedUnaryIsometricOperation.

◆ make_DelayedBind()

std::shared_ptr< Matrix< Value_, Index_ > > tatami::make_DelayedBind ( std::vector< std::shared_ptr< const Matrix< Value_, Index_ > > >  matrices,
bool  row 
)

A make_* helper function to enable partial template deduction of supplied types.

Template Parameters
Value_Type of matrix value.
Index_Type of index value.
Parameters
matricesPointers to Matrix objects.
rowWhether to combine matrices by the rows (i.e., the output matrix has number of rows equal to the sum of the number of rows in matrices). If false, combining is applied by the columns.
Returns
A pointer to a DelayedBind instance.

◆ make_DelayedCast()

std::shared_ptr< Matrix< ValueOut_, IndexOut_ > > tatami::make_DelayedCast ( std::shared_ptr< const Matrix< ValueIn_, IndexIn_ > >  p)

Recast a Matrix to a different interface type.

Template Parameters
ValueOut_Data type to cast to.
IndexOut_Index type to cast to.
ValueIn_Data type to cast from.
IndexIn_Index type to cast from.
Parameters
pPointer to the (possbly const) Matrix instance to cast from.
Returns
Pointer to a Matrix instance of the desired interface type.

◆ make_DelayedTranspose()

std::shared_ptr< Matrix< Value_, Index_ > > tatami::make_DelayedTranspose ( std::shared_ptr< const Matrix< Value_, Index_ > >  matrix)

A make_* helper function to enable partial template deduction of supplied types during delayed transposition.

Template Parameters
Value_Type of matrix value.
Index_Type of index value.
Parameters
matrixPointer to a (possibly const) Matrix instance.
Returns
A pointer to a DelayedTranspose instance.

◆ compress_sparse_triplets()

std::vector< size_t > tatami::compress_sparse_triplets ( size_t  nrow,
size_t  ncol,
Values_ values,
RowIndices_ row_indices,
ColumnIndices_ column_indices,
bool  csr 
)
Template Parameters
Values_Random-access container for the values.
RowIndices_Random access container for the row indices.
ColumnIndices_Random access container for the column indices.
Parameters
nrowNumber of rows.
ncolNumber of columns.
row_indicesRow indices of the structural non-zeros. Values must be non-negative integers less than nrow.
column_indicesColumn indices of the structural non-zeros. This must be of the same length as row_indices, where corresponding entries contain data for a single structural non-zero. Values must be non-negative integers less than ncol.
valuesValues of the structural non-zeros. This must be of the same length as row_indices and column_indices, where corresponding entries contain data for a single structural non-zero.
csrWhether to create a compressed sparse row format. If false, the compressed sparse column format is used instead.
Returns
row_indices, column_indices and values are sorted in-place by the row and column indices (if csr = true) or by the column and row indices (if csr = false). A vector of index pointers is returned with length nrow + 1 (if csr = true) or ncol + 1 (if csr = false).

◆ count_compressed_sparse_non_zeros()

void tatami::count_compressed_sparse_non_zeros ( const tatami::Matrix< Value_, Index_ > *  matrix,
bool  row,
Count_ output,
int  threads 
)
Template Parameters
Value_Type of value in the matrix.
Index_Integer type of row/column index.
Count_Integer type for the non-zero count.
Parameters
matrixPointer to a tatami::Matrix.
rowWhether to count structural non-zeros by row.
[out]outputPointer to an array of length equal to the number of rows (if row = true) or columns (otherwise) of matrix. On output, this stores the number of structural non-zeros in each row (if row = true) or column (otherwise).
threadsNumber of threads to use, for parallelization with parallelize().

For sparse matrix, all structural non-zero elements are reported, even if they have actual values of zero. In contrast, for dense matrix, only the non-zero values are counted; these are considered to be structural non-zeros upon conversion to a sparse matrix (e.g., in fill_compressed_sparse_contents()).

◆ fill_compressed_sparse_contents()

void tatami::fill_compressed_sparse_contents ( const tatami::Matrix< InputValue_, InputIndex_ > *  matrix,
bool  row,
const Pointer_ pointers,
StoredValue_ output_value,
StoredIndex_ output_index,
int  threads 
)
Template Parameters
StoredValue_Type of data values to be stored in the output.
StoredIndex_Integer type for storing the indices in the output.
Pointer_Integer type for the row/column pointers.
InputValue_Type of data values in the input interface.
InputIndex_Integer type for indices in the input interface.
Parameters
matrixPointer to a tatami::Matrix.
rowWhether to fill output_value and output_index by row, i.e., the output represents a compressed sparse row matrix.
[in]pointersPointer to an array of length greater than or equal to the number of rows (if row = true) or columns (otherwise) of matrix. Each entry contains the position of the start of each row/column in output_value and output_index. This argument is equivalent to the array of pointers for the compressed sparse format (e.g., CompressedSparseContents::pointers), and can be obtained by taking the cumulative sum of the per-row/column counts from count_compressed_sparse_non_zeros().
[out]output_valuePointer to an array of length equal to the total number of structural non-zero elements. On output, this is used to store the values of those elements in a compressed sparse format (e.g., CompressedSparseContents::value).
[out]output_indexPointer to an array of length equal to the total number of structural non-zero elements. On output, this is used to store the row/column indices of those elements in a compressed sparse format (e.g., CompressedSparseContents::index).
threadsNumber of threads to use, for parallelization with parallelize().

◆ retrieve_compressed_sparse_contents()

CompressedSparseContents< StoredValue_, StoredIndex_, StoredPointer_ > tatami::retrieve_compressed_sparse_contents ( const Matrix< InputValue_, InputIndex_ > *  matrix,
bool  row,
bool  two_pass,
int  threads = 1 
)
Template Parameters
StoredValue_Type of data values to be stored in the output.
StoredIndex_Integer type for storing the row/column indices in the output.
Pointer_Integer type for the row/column pointers in the output.
InputValue_Type of data values in the input interface.
InputIndex_Integer type for indices in the input interface.
Parameters
matrixPointer to a tatami::Matrix.
rowWhether to retrieve the contents of matrix by row, i.e., the output is a compressed sparse row matrix.
two_passWhether to perform the retrieval in two passes. This requires another pass through matrix but is more memory-efficient.
threadsNumber of threads to use, for parallelization with parallelize().
Returns
Contents of the sparse matrix in compressed form, see CompressedSparseContents.

The behavior of this function can be replicated by manually calling count_compressed_sparse_non_zeros() followed by fill_compressed_sparse_contents(). This may be desirable for users who want to put the compressed sparse contents into pre-existing memory allocations.

◆ convert_to_compressed_sparse()

std::shared_ptr< Matrix< Value_, Index_ > > tatami::convert_to_compressed_sparse ( const Matrix< InputValue_, InputIndex_ > *  matrix,
bool  row,
bool  two_pass = false,
int  threads = 1 
)
Template Parameters
Value_Type of data values in the output interface.
Index_Integer type for the indices in the output interface.
StoredValue_Type of data values to be stored in the output.
StoredIndex_Integer type for storing the indices in the output.
InputValue_Type of data values in the input interface.
InputIndex_Integer type for indices in the input interface.
Parameters
matrixPointer to a tatami::Matrix, possibly containing delayed operations.
rowWhether to return a compressed sparse row matrix.
two_passWhether to use a two-pass strategy that reduces peak memory usage at the cost of speed.
threadsNumber of threads to use, for parallelization with parallelize().
Returns
A pointer to a new tatami::CompressedSparseMatrix, with the same dimensions and type as the matrix referenced by matrix. If row = true, the matrix is in compressed sparse row format, otherwise it is compressed sparse column.

◆ retrieve_fragmented_sparse_contents()

FragmentedSparseContents< StoredValue_, StoredIndex_ > tatami::retrieve_fragmented_sparse_contents ( const Matrix< InputValue_, InputIndex_ > *  matrix,
bool  row,
int  threads = 1 
)
Template Parameters
StoredValue_Type of data values to be stored in the output.
StoredIndex_Integer type for storing the indices in the output.
InputValue_Type of data values in the input interface.
InputIndex_Integer type for indices in the input interface.
Parameters
matrixPointer to a tatami::Matrix.
rowWhether to retrieve the contents of matrix by row, i.e., the output is a fragmented sparse row matrix.
threadsNumber of threads to use, for parallelization with parallelize().
Returns
Contents of the sparse matrix in fragmented form, see FragmentedSparseContents.

◆ convert_to_fragmented_sparse()

std::shared_ptr< Matrix< Value_, Index_ > > tatami::convert_to_fragmented_sparse ( const Matrix< InputValue_, InputIndex_ > *  matrix,
bool  row,
int  threads = 1 
)
Template Parameters
Value_Type of data values in the output interface.
Index_Integer type for the indices in the output interface.
StoredValue_Type of data values to be stored in the output.
StoredIndex_Integer type for storing the indices in the output.
InputValue_Type of data values in the input interface.
InputIndex_Integer type for indices in the input interface.
Parameters
matrixPointer to a tatami::Matrix, possibly containing delayed operations.
rowWhether to return a fragmented sparse row matrix.
threadsNumber of threads to use, for parallelization with parallelize().
Returns
A pointer to a new tatami::FragmentedSparseMatrix, with the same dimensions and type as the matrix referenced by matrix. If row = true, the matrix is in fragmented sparse row format, otherwise it is fragmented sparse column.

◆ make_DelayedSubsetBlock()

std::shared_ptr< Matrix< Value_, Index_ > > tatami::make_DelayedSubsetBlock ( std::shared_ptr< const Matrix< Value_, Index_ > >  matrix,
Index_  subset_start,
Index_  subset_length,
bool  by_row 
)

A make_* helper function to enable partial template deduction of supplied types.

Template Parameters
Value_Type of matrix value.
Index_Integer type for the row/column indices.
Parameters
matrixPointer to the underlying (pre-subset) Matrix.
subset_startIndex of the start of the block. This should be a row index if by_row = true and a column index otherwise.
subset_lengthIndex of the one-past-the-end of the block.
by_rowWhether to apply the subset to the rows. If false, the subset is applied to the columns.
Returns
A pointer to a DelayedSubsetBlock instance.

◆ make_DelayedSubset()

std::shared_ptr< Matrix< Value_, Index_ > > tatami::make_DelayedSubset ( std::shared_ptr< const Matrix< Value_, Index_ > >  matrix,
SubsetStorage_  subset,
bool  by_row 
)

A make_* helper function to enable partial template deduction of supplied types. This will automatically dispatch to DelayedSubsetSortedUnique, DelayedSubsetUnique, DelayedSubsetSorted or DelayedSubset, depending on the values in subset.

Template Parameters
Value_Type of matrix value.
Index_Integer type of the row/column indices.
SubsetStorage_Vector containing the subset indices, to be automatically deduced. Any class implementing [, size(), begin() and end() can be used here.
Parameters
matrixPointer to a (possibly const) Matrix.
subsetInstance of the subset index vector.
by_rowWhether to apply the subset to the rows. If false, the subset is applied to the columns.
Returns
A pointer to a DelayedSubset instance.

◆ consecutive_extractor()

template<bool sparse_, typename Value_ , typename Index_ , typename ... Args_>
auto tatami::consecutive_extractor ( const Matrix< Value_, Index_ > *  mat,
bool  row,
Index_  iter_start,
Index_  iter_length,
Args_ &&...  args 
)

This function creates an extractor object with a ConsecutiveOracle instance spanning a range of rows or columns. Matrix implementations that are oracle-aware can then perform pre-fetching of future accesses for greater performance.

Template Parameters
sparse_Whether to perform sparse retrieval.
Value_Type of the matrix value.
Index_Type of the row/column index.
Args_Types of further arguments to pass to Matrix::dense_row or Matrix::dense_column.
Parameters
matMatrix to iterate over.
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
iter_startIndex of the first row (if row = true) or column (otherwise) of the iteration range.
iter_lengthNumber of rows (if row = true) or columns (otherwise) in the iteration range.
argsFurther arguments to pass to new_extractor().
Returns
An extractor for iteration over consecutive rows/columns in [iter_start, iter_start + iter_length). This may be either an OracularDenseExtractor or OracularSparseExtractor depending on sparse_.

◆ copy_n()

template<typename Value_ , typename Size_ >
Value_ * tatami::copy_n ( const Value_ input,
Size_  n,
Value_ output 
)
Template Parameters
Value_Type of value being copied.
Size_Type for the array length.
Parameters
[in]inputPointer to a source array of size n.
nLength of the array.
[out]outputPointer to a destination array of size n.
Returns
Values are copied from input to output, and output is returned. This is a no-op if input == output.

◆ new_extractor()

template<bool sparse_, bool oracle_, typename Value_ , typename Index_ , typename ... Args_>
auto tatami::new_extractor ( const Matrix< Value_, Index_ > *  ptr,
bool  row,
MaybeOracle< oracle_, Index_ oracle,
Args_ &&...  args 
)

This utility makes it easier for developers to write a single templated function that works with and without oracles. A boolean placeholder should be provided as the "oracle" in the myopic extractor case.

Template Parameters
sparse_Whether to perform sparse retrieval.
oracle_Whether an oracle should be supplied.
Value_Data value type, should be numeric.
Index_Row/column index type, should be integer.
Args_Further arguments.
Parameters
[in]ptrPointer to a Matrix object to iterate over.
rowWhether to create a row-wise extractor, i.e., the rows are the target dimension.
oraclePointer to an oracle if oracle_ = true, otherwise a placeholder boolean that is ignored.
argsZero or more additional arguments to pass to methods like Matrix::dense_row().
Returns
An extractor to access elements of the requested dimension of ptr. This may be any of MyopicDenseExtractor, MyopicSparseExtractor, OracularDenseExtractor or OracularSparseExtractor, depending on sparse_ and oracle_.

◆ parallelize()

template<bool parallel_ = true, class Function_ , typename Index_ >
void tatami::parallelize ( Function_  fun,
Index_  tasks,
int  threads 
)

Apply a function to a set of tasks in parallel, usually for iterating over a dimension of a Matrix. By default, this uses subpar::parallelize_range() internally, which uses OpenMP if available and <thread> otherwise. Advanced users can override the default parallelization mechanism by defining a TATAMI_CUSTOM_PARALLEL function-like macro. The macro should accept the fun, tasks and threads arguments as described below.

Template Parameters
parallel_Whether the tasks should be run in parallel. If false, no parallelization is performed and all tasks are run on the current thread.
Function_Function to be applied for a contiguous range of tasks. This should accept three arguments:
  • thread, the thread number executing this task range. This will be passed as a size_t.
  • task_start, the start index of the task range. This will be passed as a Index_.
  • task_length, the number of tasks in the task range. This will be passed as a Index_.
Index_Integer type for the number of tasks.
Parameters
funFunction that executes a contiguous range of tasks.
tasksNumber of tasks.
threadsNumber of threads.

◆ process_consecutive_indices()

void tatami::process_consecutive_indices ( const Index_ indices,
Index_  length,
Function_  fun 
)

Process runs of consecutive indices that are used in the index-aware dense_row(), sparse_column(), etc. methods. This provides some opportunities for optimization when the indices contain contiguous stretches. For example, third-party libraries can be asked to process blocks of observations rather than handling them one at a time.

Template Parameters
Index_Integer type for the row/column indices.
Function_Function to apply to each contiguous run.
Parameters
indicesPointer to an array of sorted and unique indices for row/column elements.
lengthLength of the array pointed to by indices.
funFunction to apply to each contiguous run of indices. This should take two arguments - the start index of each run, and the length of the run. Calls to fun are guaranteed to contain increasing start indices with non-overlapping runs. The return value of this function is ignored.

◆ wrap_shared_ptr()

std::shared_ptr< const Matrix< Value_, Index_ > > tatami::wrap_shared_ptr ( const Matrix< Value_, Index_ > *  ptr)

Wrap a raw pointer inside a shared_ptr, typically to enable use of a raw tatami::Matrix pointer with delayed operation wrappers. This enables use of delayed operations inside functions that accept a raw pointer to an externally owned tatami::Matrix.

Template Parameters
Value_Numeric type for the matrix value.
Index_Integer type for the row/column indices.
Parameters
ptrA pointer to a tatami::Matrix instance.
Returns
A shared pointer to the same object addressed by ptr. The assumption is that ptr will always outlive the returned pointer.