21 #ifndef __DOLFIN_COORDINATE_MATRIX_H 22 #define __DOLFIN_COORDINATE_MATRIX_H 26 #include <dolfin/common/types.h> 27 #include <dolfin/common/MPI.h> 50 std::size_t
size(std::size_t dim)
const 51 {
return _size[dim]; }
54 const std::vector<std::size_t>&
rows()
const 58 const std::vector<std::size_t>&
columns()
const 62 const std::vector<double>&
values()
const 66 double norm(std::string norm_type)
const;
70 {
return _mpi_comm.
comm(); }
82 std::vector<std::size_t> _rows;
83 std::vector<std::size_t> _cols;
86 std::vector<double> _vals;
92 const bool _symmetric;
virtual ~CoordinateMatrix()
Destructor.
Definition: CoordinateMatrix.h:45
CoordinateMatrix(const GenericMatrix &A, bool symmetric, bool base_one)
Constructor.
Definition: CoordinateMatrix.cpp:30
MPI_Comm comm() const
Return the underlying MPI_Comm object.
Definition: MPI.cpp:117
std::size_t size(std::size_t dim) const
Definition: CoordinateMatrix.h:50
This class defines a common interface for matrices.
Definition: GenericMatrix.h:46
const std::vector< std::size_t > & rows() const
Get row indices.
Definition: CoordinateMatrix.h:54
double norm(std::string norm_type) const
Return norm of matrix.
Definition: CoordinateMatrix.cpp:89
bool base_one() const
Whether indices start from 0 (C-style) or 1 (FORTRAN-style)
Definition: CoordinateMatrix.h:73
Coordinate sparse matrix.
Definition: CoordinateMatrix.h:37
const std::vector< std::size_t > & columns() const
Get column indices.
Definition: CoordinateMatrix.h:58
MPI_Comm mpi_comm() const
Get MPI_Comm.
Definition: CoordinateMatrix.h:69
const std::vector< double > & values() const
Get values.
Definition: CoordinateMatrix.h:62