tatami_mult
Multiply tatami matrices
Loading...
Searching...
No Matches
Classes | Functions
tatami_mult Namespace Reference

Multiplication of tatami matrices. More...

Classes

struct  Options
 Options for multiply(). More...
 

Functions

template<typename Value_ , typename Index_ , typename Right_ , typename Output_ >
void multiply (const tatami::Matrix< Value_, Index_ > &left, const Right_ *right, Output_ *output, const Options &opt)
 
template<typename Left_ , typename Value_ , typename Index_ , typename Output_ >
void multiply (const Left_ *left, const tatami::Matrix< Value_, Index_ > &right, Output_ *output, const Options &opt)
 
template<typename Value_ , typename Index_ , typename Right_ , typename Output_ >
void multiply (const tatami::Matrix< Value_, Index_ > &left, const std::vector< Right_ * > &right, const std::vector< Output_ * > &output, const Options &opt)
 
template<typename Left_ , typename Value_ , typename Index_ , typename Output_ >
void multiply (const std::vector< Left_ * > &left, const tatami::Matrix< Value_, Index_ > &right, const std::vector< Output_ * > &output, const Options &opt)
 
template<typename LeftValue_ , typename LeftIndex_ , typename RightValue_ , typename RightIndex_ , typename Output_ >
void multiply (const tatami::Matrix< LeftValue_, LeftIndex_ > &left, const tatami::Matrix< RightValue_, RightIndex_ > &right, Output_ *output, const Options &opt)
 

Detailed Description

Multiplication of tatami matrices.

Function Documentation

◆ multiply() [1/5]

template<typename Left_ , typename Value_ , typename Index_ , typename Output_ >
void tatami_mult::multiply ( const Left_ *  left,
const tatami::Matrix< Value_, Index_ > &  right,
Output_ *  output,
const Options opt 
)

Compute the product t(left) * right, storing the result in output.

Template Parameters
Left_Numeric type of the vector on the left hand side.
Value_Numeric type of the matrix value.
Index_Integer type of the matrix index.
Output_Numeric type of the output array.
Parameters
[in]leftPointer to an array of length right.nrow(), containing the vector with which to multiply right.
rightA tatami matrix to be multiplied.
[out]outputPointer to an array of length right.ncol(). On output, this stores the product t(left) * right.
optFurther options.

◆ multiply() [2/5]

template<typename Left_ , typename Value_ , typename Index_ , typename Output_ >
void tatami_mult::multiply ( const std::vector< Left_ * > &  left,
const tatami::Matrix< Value_, Index_ > &  right,
const std::vector< Output_ * > &  output,
const Options opt 
)

Compute the product t(left[i]) * right for each array i, storing the result in output[i].

Template Parameters
Left_Numeric type of the vector on the left hand side.
Value_Numeric type of the matrix value.
Index_Integer type of the matrix index.
Output_Numeric type of the output array.
Parameters
[in]leftVector of pointers, each of which points to an array of length right.nrow(). Each entry contains a vector with which to multiply right.
rightA tatami matrix to be multiplied.
[out]outputVector of pointers, each of which points to an array of length right.ncol(). On output, the i-th entry stores the product t(left[i]) * right.
optFurther options.

◆ multiply() [3/5]

template<typename LeftValue_ , typename LeftIndex_ , typename RightValue_ , typename RightIndex_ , typename Output_ >
void tatami_mult::multiply ( const tatami::Matrix< LeftValue_, LeftIndex_ > &  left,
const tatami::Matrix< RightValue_, RightIndex_ > &  right,
Output_ *  output,
const Options opt 
)

Compute the product left * right, storing the result in output.

Template Parameters
RightValue_Numeric type of the right matrix value.
RightIndex_Integer type of the right matrix index.
LeftValue_Numeric type of the left matrix value.
LeftIndex_Integer type of the left matrix index.
Output_Numeric type of the output array.
Parameters
leftA tatami matrix to use in the multiplication.
rightA tatami matrix to use in the multiplication. right.nrow() and left.ncol() should be equal.
[out]outputPointer to an array of length equal to left.nrow() * right.ncol(). On output, this stores the matrix product as a column- or row-major matrix (see Options::column_major_output).
optFurther options.

◆ multiply() [4/5]

template<typename Value_ , typename Index_ , typename Right_ , typename Output_ >
void tatami_mult::multiply ( const tatami::Matrix< Value_, Index_ > &  left,
const Right_ *  right,
Output_ *  output,
const Options opt 
)

Compute the product left * right, storing the result in output.

Template Parameters
Value_Numeric type of the matrix value.
Index_Integer type of the matrix index.
Right_Numeric type of the vector on the right hand side.
Output_Numeric type of the output array.
Parameters
leftA tatami matrix to be multiplied.
[in]rightPointer to an array of length left.ncol(), containing the vector with which to multiply left.
[out]outputPointer to an array of length left.nrow(). On output, this stores the product left * right.
optFurther options.

◆ multiply() [5/5]

template<typename Value_ , typename Index_ , typename Right_ , typename Output_ >
void tatami_mult::multiply ( const tatami::Matrix< Value_, Index_ > &  left,
const std::vector< Right_ * > &  right,
const std::vector< Output_ * > &  output,
const Options opt 
)

Compute the product left * right[i] for each array i, storing the result in output[i].

Template Parameters
Value_Numeric type of the matrix value.
Index_Integer type of the matrix index.
Right_Numeric type of the vectors on the right hand side.
Output_Numeric type of the output array.
Parameters
leftA tatami matrix to be multiplied.
[in]rightVector of pointers, each of which points to an array of length left.ncol(). Each entry contains a vector with which to multiply left.
[out]outputVector of pointers, each of which points to an array of length left.nrow(). On output, the i-th entry stores the product left * right[i].
optFurther options.