19 template class OPENMEEGMATHS_EXPORT std::map<std::pair<size_t,size_t>,
double>;
29 typedef std::map<std::pair<size_t,size_t>,
double>
Tank;
38 inline double operator()(
const size_t i,
const size_t j)
const {
42 return (it!=m_tank.end()) ? it->second : 0.0;
48 return m_tank[std::make_pair(i,j)];
62 void set(
const double d) {
63 for(
auto& tkelmt : m_tank)
70 for (
size_t j=0; j<ncol(); ++j) {
72 v(j) = (it!=m_tank.end()) ? it->second : 0.0;
79 for (
size_t j=0; j<v.
nlin(); ++j)
83 void save(
const char* filename)
const {
84 maths::ofstream ofs(filename);
86 ofs << maths::format(filename,maths::format::FromSuffix) << *
this;
87 }
catch (maths::Exception&) {
92 void load(
const char* filename) {
93 maths::ifstream ifs(filename);
95 ifs >> maths::format(filename,maths::format::FromSuffix) >> *
this;
96 }
catch (maths::Exception&) {
101 void save(
const std::string& s)
const {
save(s.c_str()); }
102 void load(
const std::string& s) {
load(s.c_str()); }
Matrix class Matrix class.
SparseMatrix(const char *fname)
SparseMatrix transpose() const
double operator()(const size_t i, const size_t j) const
const Tank & tank() const
Vector operator*(const Vector &x) const
SparseMatrix(const size_t N, const size_t M)
void save(const char *filename) const
const_iterator end() const
void save(const std::string &s) const
const_iterator begin() const
SparseMatrix operator+(const SparseMatrix &m) const
SparseMatrix operator*(const SparseMatrix &m) const
void load(const std::string &s)
void load(const char *filename)
std::map< std::pair< size_t, size_t >, double > Tank
Vector getlin(const size_t i) const
Tank::const_iterator const_iterator
void setlin(const Vector &v, const size_t i)
double frobenius_norm() const
double & operator()(size_t i, size_t j)
Matrix operator*(const Matrix &m) const
Matrix operator*(const SymMatrix &m) const