55#ifndef __ADS_SellMatrix
56 #define __ADS_SellMatrix
86template< std::
size_t C = 4 >
89 static_assert( ( C >= 1 ) && ( ( C & ( C - 1 ) ) == 0 ) ,
90 "the rows of a chunk are a power of 2" );
120 [[nodiscard]] std::size_t
rows(
void )
const {
return( f_m ); }
122 [[nodiscard]] std::size_t
cols(
void )
const {
return( f_n ); }
125 [[nodiscard]] std::size_t
nonzeros(
void )
const {
return( f_nnz ); }
127 [[nodiscard]] std::size_t
places(
void )
const {
return( f_val.size() ); }
133 void multiply(
const double * x ,
double * y )
const;
159 void multiply(
const double * x ,
double * y , std::size_t first ,
160 std::size_t last )
const;
163 [[nodiscard]] std::size_t
chunks(
void )
const {
164 return( f_start.size() - 1 );
168 [[nodiscard]] std::size_t
chunkStart( std::size_t c )
const {
169 return( f_start[ c ] );
174 [[nodiscard]] std::vector< double >
182 std::vector< std::size_t > f_start;
183 std::vector< std::uint32_t > f_perm;
184 std::vector< std::uint32_t > f_col;
185 std::vector< double > f_val;
196#include "ADS/numeric/impl/SellMatrix.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
A sparse matrix in compressed sparse rows (CSR), beyond the book: the nonzeros of each row,...
std::size_t rows(void) const
the number of rows
Definition SellMatrix.h:120
std::vector< double > multiply(const std::vector< double > &x) const
the product , a new vector
std::size_t chunks(void) const
the number of chunks
Definition SellMatrix.h:163
void multiply(const double *x, double *y, std::size_t first, std::size_t last) const
the entries of of the rows of the chunks of rows (by the permutation), so that the chunks may be s...
SellMatrix(const CsrMatrix &A, std::size_t sigma=256)
the matrix , its rows sorted by length within windows of rows
std::size_t places(void) const
the places kept, and the padding
Definition SellMatrix.h:127
std::size_t chunkStart(std::size_t c) const
the place where the chunk starts, chunks() for the end
Definition SellMatrix.h:168
std::size_t nonzeros(void) const
the number of the nonzeros of
Definition SellMatrix.h:125
std::size_t cols(void) const
the number of columns
Definition SellMatrix.h:122
void multiply(const double *x, double *y) const
the product into , which must have entries, as the chunks from 0 to chunks()
BasicCsrMatrix<> CsrMatrix
the matrix of doubles of 32-bit columns and std::size_t offsets
Definition CsrMatrix.h:277