|
| | SumOfMatrices () |
| | Default constructor. More...
|
| |
| | SumOfMatrices (DoubleMatrixBase *main_matrix_pt) |
| | Constructor taking a pointer to the main matrix as input. More...
|
| |
| | SumOfMatrices (const SumOfMatrices &matrix)=delete |
| | Broken copy constructor. More...
|
| |
| void | operator= (const SumOfMatrices &)=delete |
| | Broken assignment operator. More...
|
| |
| | ~SumOfMatrices () |
| |
| const DoubleMatrixBase * | main_matrix_pt () const |
| | Access to the main matrix. More...
|
| |
| DoubleMatrixBase *& | main_matrix_pt () |
| |
| void | set_delete_main_matrix () |
| |
| void | output_bottom_right_zero_helper (std::ostream &outfile) const |
| |
| void | sparse_indexed_output_helper (std::ostream &outfile) const |
| |
| void | get_as_indices (Vector< int > &row, Vector< int > &col, Vector< double > &values) |
| |
| void | add_matrix (DoubleMatrixBase *added_matrix_pt_in, const AddedMainNumberingLookup *main_to_added_rows_pt, const AddedMainNumberingLookup *main_to_added_cols_pt, bool should_delete_matrix=false) |
| |
| DoubleMatrixBase * | added_matrix_pt (const unsigned &i) const |
| |
| const AddedMainNumberingLookup * | row_map_pt (const unsigned &i) const |
| | Access to the maps. More...
|
| |
| const AddedMainNumberingLookup * | col_map_pt (const unsigned &i) const |
| |
| unsigned long | nrow () const |
| | Return the number of rows of the main matrix. More...
|
| |
| unsigned long | ncol () const |
| | Return the number of columns of the main matrix. More...
|
| |
| unsigned | n_added_matrix () const |
| | Return the number of added matrices in the sum. More...
|
| |
| void | multiply (const DoubleVector &x, DoubleVector &soln) const |
| |
| double & | entry (const unsigned long &i, const unsigned long &j) const |
| |
| double | operator() (const unsigned long &i, const unsigned long &j) const |
| |
| virtual void | multiply_transpose (const DoubleVector &x, DoubleVector &soln) const |
| |
| | DoubleMatrixBase () |
| | (Empty) constructor. More...
|
| |
| | DoubleMatrixBase (const DoubleMatrixBase &matrix)=delete |
| | Broken copy constructor. More...
|
| |
| void | operator= (const DoubleMatrixBase &)=delete |
| | Broken assignment operator. More...
|
| |
| virtual | ~DoubleMatrixBase () |
| | virtual (empty) destructor More...
|
| |
| LinearSolver *& | linear_solver_pt () |
| | Return a pointer to the linear solver object. More...
|
| |
| LinearSolver *const & | linear_solver_pt () const |
| | Return a pointer to the linear solver object (const version) More...
|
| |
| void | solve (DoubleVector &rhs) |
| |
| void | solve (const DoubleVector &rhs, DoubleVector &soln) |
| |
| void | solve (Vector< double > &rhs) |
| |
| void | solve (const Vector< double > &rhs, Vector< double > &soln) |
| |
| virtual void | residual (const DoubleVector &x, const DoubleVector &b, DoubleVector &residual_) |
| | Find the residual, i.e. r=b-Ax the residual. More...
|
| |
| virtual double | max_residual (const DoubleVector &x, const DoubleVector &rhs) |
| |
| | Matrix () |
| | (Empty) constructor More...
|
| |
| | Matrix (const Matrix &matrix)=delete |
| | Broken copy constructor. More...
|
| |
| void | operator= (const Matrix &)=delete |
| | Broken assignment operator. More...
|
| |
| virtual | ~Matrix () |
| | Virtual (empty) destructor. More...
|
| |
| double | operator() (const unsigned long &i, const unsigned long &j) const |
| |
| double & | operator() (const unsigned long &i, const unsigned long &j) |
| |
| virtual void | output (std::ostream &outfile) const |
| |
| void | sparse_indexed_output (std::ostream &outfile, const unsigned &precision=0, const bool &output_bottom_right_zero=false) const |
| |
| void | sparse_indexed_output (std::string filename, const unsigned &precision=0, const bool &output_bottom_right_zero=false) const |
| |
Class for a matrix of the form M = S + G + H + ... where S is the main matrix and G,H etc. are matrices of size S or smaller. This may be useful if, for example, G,H etc. are subblocks of M that must be stored in a different format to S. Maps mut be provided which gives a map from the rows/cols of the main matrix to the rows/cols of each of the added matrices.
Multiply: just call multiply on each of the matrices and add up the results (with appropriate bookeeping of the relative positions).
Matrix-vector multiplication for a sumofmatrices class. Just delegate each multiplication to the appropriate class then add up the results.
Implements oomph::DoubleMatrixBase.
49 for (
unsigned i_matrix = 0; i_matrix <
Added_matrix_pt.size(); i_matrix++)
53 LinearAlgebraDistribution col_dist, row_dist;
54 OomphCommunicator serial_comm;
63 std::map<unsigned, unsigned>::const_iterator it;
68 for (it =
Col_map_pt[i_matrix]->main_to_added_mapping_pt()->begin();
69 it !=
Col_map_pt[i_matrix]->main_to_added_mapping_pt()->
end();
72 temp_x[it->second] =
x[it->first];
80 for (it =
Row_map_pt[i_matrix]->main_to_added_mapping_pt()->begin();
81 it !=
Row_map_pt[i_matrix]->main_to_added_mapping_pt()->
end();
84 soln[it->first] += temp_soln[it->second];
virtual void multiply(const DoubleVector &x, DoubleVector &soln) const =0
Multiply the matrix by the vector x: soln=Ax.
DoubleMatrixBase * added_matrix_pt(const unsigned &i) const
Definition: sum_of_matrices.h:485
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79
list x
Definition: plotDoE.py:28
References Added_matrix_pt, added_matrix_pt(), oomph::LinearAlgebraDistribution::build(), Col_map_pt, Eigen::placeholders::end, Main_matrix_pt, oomph::DoubleMatrixBase::multiply(), ncol(), nrow(), Row_map_pt, and plotDoE::x.