tatami_chunked
Helpers to create custom chunked tatami matrices
Loading...
Searching...
No Matches
Public Member Functions | List of all members
tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ > Class Template Reference

Matrix of custom sparse chunks. More...

#include <CustomSparseChunkedMatrix.hpp>

Inheritance diagram for tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >:
Inheritance graph
[legend]
Collaboration diagram for tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >:
Collaboration graph
[legend]

Public Member Functions

 CustomSparseChunkedMatrix (Index_ mat_nrow, Index_ mat_ncol, Index_ chunk_nrow, Index_ chunk_ncol, std::vector< Chunk_ > chunks, bool row_major, const CustomSparseChunkedMatrixOptions &opt)
 
Index_ nrow () const
 
Index_ ncol () const
 
bool prefer_rows () const
 
bool uses_oracle (bool) const
 
double prefer_rows_proportion () const
 
bool is_sparse () const
 
double is_sparse_proportion () const
 
std::unique_ptr< tatami::MyopicDenseExtractor< Value_, Index_ > > dense (bool row, const tatami::Options &opt) const
 
std::unique_ptr< tatami::MyopicDenseExtractor< Value_, Index_ > > dense (bool row, Index_ block_start, Index_ block_length, const tatami::Options &opt) const
 
std::unique_ptr< tatami::MyopicDenseExtractor< Value_, Index_ > > dense (bool row, tatami::VectorPtr< Index_ > indices_ptr, const tatami::Options &opt) const
 
std::unique_ptr< tatami::OracularDenseExtractor< Value_, Index_ > > dense (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, const tatami::Options &opt) const
 
std::unique_ptr< tatami::OracularDenseExtractor< Value_, Index_ > > dense (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const tatami::Options &opt) const
 
std::unique_ptr< tatami::OracularDenseExtractor< Value_, Index_ > > dense (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, tatami::VectorPtr< Index_ > indices_ptr, const tatami::Options &opt) const
 
std::unique_ptr< tatami::MyopicSparseExtractor< Value_, Index_ > > sparse (bool row, const tatami::Options &opt) const
 
std::unique_ptr< tatami::MyopicSparseExtractor< Value_, Index_ > > sparse (bool row, Index_ block_start, Index_ block_length, const tatami::Options &opt) const
 
std::unique_ptr< tatami::MyopicSparseExtractor< Value_, Index_ > > sparse (bool row, tatami::VectorPtr< Index_ > indices_ptr, const tatami::Options &opt) const
 
std::unique_ptr< tatami::OracularSparseExtractor< Value_, Index_ > > sparse (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, const tatami::Options &opt) const
 
std::unique_ptr< tatami::OracularSparseExtractor< Value_, Index_ > > sparse (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const tatami::Options &opt) const
 
std::unique_ptr< tatami::OracularSparseExtractor< Value_, Index_ > > sparse (bool row, std::shared_ptr< const tatami::Oracle< Index_ > > oracle, tatami::VectorPtr< Index_ > indices_ptr, const tatami::Options &opt) const
 
- Public Member Functions inherited from tatami::Matrix< Value_, Index_ >
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_row (const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_row (Index_ block_start, Index_ block_length, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_row (VectorPtr< Index_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_row (std::vector< Index_ > indices, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_row () const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_row (Index_ block_start, Index_ block_length) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_row (VectorPtr< Index_ > indices_ptr) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_row (std::vector< Index_ > indices) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_row (std::shared_ptr< const Oracle< Index_ > > oracle) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_row (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_column (const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_column (Index_ block_start, Index_ block_length, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_column (VectorPtr< Index_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_column (std::vector< Index_ > indices, const Options &opt) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_column () const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_column (Index_ block_start, Index_ block_length) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_column (VectorPtr< Index_ > indices_ptr) const
 
std::unique_ptr< MyopicDenseExtractor< Value_, Index_ > > dense_column (std::vector< Index_ > indices) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices, const Options &opt) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_column (std::shared_ptr< const Oracle< Index_ > > oracle) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr) const
 
std::unique_ptr< OracularDenseExtractor< Value_, Index_ > > dense_column (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_row (const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_row (Index_ block_start, Index_ block_length, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_row (VectorPtr< Index_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_row (std::vector< Index_ > indices, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_row () const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_row (Index_ block_start, Index_ block_length) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_row (VectorPtr< Index_ > indices_ptr) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_row (std::vector< Index_ > indices) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_row (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_column (const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_column (Index_ block_start, Index_ block_length, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_column (VectorPtr< Index_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_column (std::vector< Index_ > indices, const Options &opt) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_column () const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_column (Index_ block_start, Index_ block_length) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_column (VectorPtr< Index_ > indices_ptr) const
 
std::unique_ptr< MyopicSparseExtractor< Value_, Index_ > > sparse_column (std::vector< Index_ > indices) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices, const Options &opt) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, Index_ block_start, Index_ block_length) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, VectorPtr< Index_ > indices_ptr) const
 
std::unique_ptr< OracularSparseExtractor< Value_, Index_ > > sparse_column (std::shared_ptr< const Oracle< Index_ > > oracle, std::vector< Index_ > indices) const
 

Additional Inherited Members

- Public Types inherited from tatami::Matrix< Value_, Index_ >
typedef Value_ value_type
 
typedef Index_ index_type
 

Detailed Description

template<typename Value_, typename Index_, typename Chunk_>
class tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >

Matrix of custom sparse chunks.

Template Parameters
Value_Numeric type for the matrix value.
Index_Integer type for the row/column indices.
Chunk_Class of the chunk, implementing either the MockSimpleSparseChunk or MockSubsetSparseChunk interfaces.

Implements a Matrix subclass where data is contained in sparse rectangular chunks. These chunks are typically compressed in some manner to reduce memory usage compared to, e.g., a tatami:CompressedSparseMatrix. On access, the relevant chunks are decompressed and the desired values are extracted. Each dimension should be divided into chunk boundaries at regular intervals starting from zero; this partitions the matrix according to a regular grid where each grid entry is a single chunk of the same size. The exception is for chunks at the non-zero boundaries of the matrix dimensions, which may be truncated.

Constructor & Destructor Documentation

◆ CustomSparseChunkedMatrix()

tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::CustomSparseChunkedMatrix ( Index_  mat_nrow,
Index_  mat_ncol,
Index_  chunk_nrow,
Index_  chunk_ncol,
std::vector< Chunk_ chunks,
bool  row_major,
const CustomSparseChunkedMatrixOptions opt 
)
inline
Parameters
mat_nrowNumber of rows in the matrix.
mat_ncolNumber of columns in the matrix.
chunk_nrowNumber of rows in each chunk.
chunk_ncolNumber of columns in each chunk.
chunksVector containing a two-dimensional array of chunks that cover the entire matrix. This should have length equal to the product of the number of chunks along the rows and columns of the matrix, i.e., ceil(mat_nrow / chunk_nrow) * ceil(mat_ncol / chunk_ncol).
row_majorWhether chunks is in row-major format.
optFurther options for chunked extraction.

Member Function Documentation

◆ nrow()

◆ ncol()

◆ prefer_rows()

◆ uses_oracle()

◆ prefer_rows_proportion()

double tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::prefer_rows_proportion ( ) const
inlinevirtual

◆ is_sparse()

◆ is_sparse_proportion()

double tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::is_sparse_proportion ( ) const
inlinevirtual

◆ dense() [1/6]

◆ dense() [2/6]

std::unique_ptr< tatami::MyopicDenseExtractor< Value_, Index_ > > tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::dense ( bool  row,
Index_  block_start,
Index_  block_length,
const tatami::Options opt 
) const
inlinevirtual

◆ dense() [3/6]

std::unique_ptr< tatami::MyopicDenseExtractor< Value_, Index_ > > tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::dense ( bool  row,
tatami::VectorPtr< Index_ indices_ptr,
const tatami::Options opt 
) const
inlinevirtual

◆ dense() [4/6]

std::unique_ptr< tatami::OracularDenseExtractor< Value_, Index_ > > tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::dense ( bool  row,
std::shared_ptr< const tatami::Oracle< Index_ > >  oracle,
const tatami::Options opt 
) const
inlinevirtual

◆ dense() [5/6]

std::unique_ptr< tatami::OracularDenseExtractor< Value_, Index_ > > tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::dense ( bool  row,
std::shared_ptr< const tatami::Oracle< Index_ > >  oracle,
Index_  block_start,
Index_  block_length,
const tatami::Options opt 
) const
inlinevirtual

◆ dense() [6/6]

std::unique_ptr< tatami::OracularDenseExtractor< Value_, Index_ > > tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::dense ( bool  row,
std::shared_ptr< const tatami::Oracle< Index_ > >  oracle,
tatami::VectorPtr< Index_ indices_ptr,
const tatami::Options opt 
) const
inlinevirtual

◆ sparse() [1/6]

◆ sparse() [2/6]

std::unique_ptr< tatami::MyopicSparseExtractor< Value_, Index_ > > tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::sparse ( bool  row,
Index_  block_start,
Index_  block_length,
const tatami::Options opt 
) const
inlinevirtual

◆ sparse() [3/6]

std::unique_ptr< tatami::MyopicSparseExtractor< Value_, Index_ > > tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::sparse ( bool  row,
tatami::VectorPtr< Index_ indices_ptr,
const tatami::Options opt 
) const
inlinevirtual

◆ sparse() [4/6]

std::unique_ptr< tatami::OracularSparseExtractor< Value_, Index_ > > tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::sparse ( bool  row,
std::shared_ptr< const tatami::Oracle< Index_ > >  oracle,
const tatami::Options opt 
) const
inlinevirtual

◆ sparse() [5/6]

std::unique_ptr< tatami::OracularSparseExtractor< Value_, Index_ > > tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::sparse ( bool  row,
std::shared_ptr< const tatami::Oracle< Index_ > >  oracle,
Index_  block_start,
Index_  block_length,
const tatami::Options opt 
) const
inlinevirtual

◆ sparse() [6/6]

std::unique_ptr< tatami::OracularSparseExtractor< Value_, Index_ > > tatami_chunked::CustomSparseChunkedMatrix< Value_, Index_, Chunk_ >::sparse ( bool  row,
std::shared_ptr< const tatami::Oracle< Index_ > >  oracle,
tatami::VectorPtr< Index_ indices_ptr,
const tatami::Options opt 
) const
inlinevirtual

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