32#ifndef STRUMPACK_BUTTERFLY_MATRIX_HPP
33#define STRUMPACK_BUTTERFLY_MATRIX_HPP
69 using VecVec_t = std::vector<std::vector<std::size_t>>;
73 using mult_t =
typename std::function
75 using delem_blocks_t =
typename HODLRMatrix<scalar_t>::delem_blocks_t;
76 using elem_blocks_t =
typename HODLRMatrix<scalar_t>::elem_blocks_t;
104 std::size_t
rows()
const override {
return rows_; }
105 std::size_t
cols()
const override {
return cols_; }
106 std::size_t lrows()
const {
return lrows_; }
108 std::size_t lcols()
const {
return lcols_; }
110 std::size_t
end_row()
const override {
return rdist_[c_->
rank()+1]; }
111 const std::vector<int>&
rdist()
const override {
return rdist_; }
112 std::size_t begin_col()
const {
return cdist_[c_->
rank()]; }
113 std::size_t end_col()
const {
return cdist_[c_->
rank()+1]; }
114 const std::vector<int>&
cdist()
const override {
return cdist_; }
115 const MPIComm& Comm()
const {
return *c_; }
117 std::size_t
memory()
const override {
return get_stat(
"Mem_Fill") * 1e6; }
119 std::size_t
rank()
const override {
return get_stat(
"Rank_max"); }
121 void compress(
const mult_t& Amult);
122 void compress(
const mult_t& Amult,
int rank_guess);
123 void compress(
const delem_blocks_t& Aelem);
124 void compress(
const elem_blocks_t& Aelem);
143 void extract_add_elements(
const VecVec_t& I,
const VecVec_t& J,
144 std::vector<DenseMW_t>& B);
145 void extract_add_elements(
ExtractionMeta& e, std::vector<DistMW_t>& B);
146 void extract_add_elements(
ExtractionMeta& e, std::vector<DenseMW_t>& B);
148 double get_stat(
const std::string& name)
const;
152 void set_sampling_parameter(
double sample_param);
153 void set_BACA_block(
int bsize);
158 const std::vector<int>&
dist)
const;
159 void redistribute_2D_to_1D(scalar_t a,
const DistM_t& R2D,
161 const std::vector<int>&
dist)
const;
163 const std::vector<int>&
dist)
const;
166 F2Cptr lr_bf_ =
nullptr;
167 F2Cptr options_ =
nullptr;
168 F2Cptr stats_ =
nullptr;
169 F2Cptr msh_ =
nullptr;
170 F2Cptr kerquant_ =
nullptr;
171 F2Cptr ptree_ =
nullptr;
174 int rows_ = 0, cols_ = 0, lrows_ = 0, lcols_ = 0;
175 std::vector<int> rdist_, cdist_;
179 void options_init(
const opts_t& opts);
181 void set_extraction_meta_1grid(
const VecVec_t& I,
const VecVec_t& J,
183 int Nalldat_loc,
int* pmaps)
const;
Class wrapping around Yang Liu's HODLR code.
This is a small wrapper class around a BLACS grid and a BLACS context.
Definition: BLACSGrid.hpp:66
Definition: CompressedSparseMatrix.hpp:49
Like DenseMatrix, this class represents a matrix, stored in column major format, to allow direct use ...
Definition: DenseMatrix.hpp:1015
This class represents a matrix, stored in column major format, to allow direct use of BLAS/LAPACK rou...
Definition: DenseMatrix.hpp:138
Definition: DistributedMatrix.hpp:733
2D block cyclicly distributed matrix, as used by ScaLAPACK.
Definition: DistributedMatrix.hpp:84
Butterfly matrix representation, this includes low-rank matrix representation as a special case.
Definition: ButterflyMatrix.hpp:63
std::size_t rows() const override
Definition: ButterflyMatrix.hpp:104
std::size_t end_row() const override
Definition: ButterflyMatrix.hpp:110
std::size_t local_rows() const override
Definition: ButterflyMatrix.hpp:107
void mult(Trans op, const DenseM_t &X, DenseM_t &Y) const override
std::size_t memory() const override
Definition: ButterflyMatrix.hpp:117
std::size_t nonzeros() const override
Definition: ButterflyMatrix.hpp:118
const std::vector< int > & cdist() const override
Definition: ButterflyMatrix.hpp:114
std::size_t cols() const override
Definition: ButterflyMatrix.hpp:105
void mult(Trans op, const DistM_t &X, DistM_t &Y) const override
ButterflyMatrix(const HODLRMatrix< scalar_t > &A, const HODLRMatrix< scalar_t > &B)
std::size_t begin_row() const override
Definition: ButterflyMatrix.hpp:109
std::size_t rank() const override
Definition: ButterflyMatrix.hpp:119
const std::vector< int > & rdist() const override
Definition: ButterflyMatrix.hpp:111
Hierarchically low-rank matrix representation.
Definition: HODLRMatrix.hpp:79
Class containing several options for the HODLR code and data-structures.
Definition: HODLROptions.hpp:117
Wrapper class around an MPI_Comm object.
Definition: MPIWrapper.hpp:194
int rank() const
Definition: MPIWrapper.hpp:271
The cluster tree, or partition tree that represents the partitioning of the rows or columns of a hier...
Definition: ClusterTree.hpp:67
Class to represent a structured matrix. This is the abstract base class for several types of structur...
Definition: StructuredMatrix.hpp:209
virtual const std::vector< int > & dist() const
Definition: StructuredMatrix.hpp:299
Definition: StrumpackOptions.hpp:43
Trans
Definition: DenseMatrix.hpp:51