31 SymMatrix(
const char* fname):
LinOp(0,0,SYMMETRIC,2),value() { this->load(fname); }
39 size_t size()
const {
return nlin()*(nlin()+1)/2; };
50 double*
data()
const {
return value.get(); }
55 return data()[(
i<=
j) ?
i+
j*(
j+1)/2 :
j+
i*(
i+1)/2];
61 return data()[(
i<=
j) ?
i+
j*(
j+1)/2 :
j+
i*(
i+1)/2];
97 void save(
const std::string&
s)
const {
save(
s.c_str()); }
120 std::cout <<
"solveLin not defined" << std::endl;
143 std::cout <<
"solveLin not defined" << std::endl;
153 for (
size_t i=0;
i<
sz; ++
i)
164 for (
size_t i=0;
i<
sz; ++
i)
179 std::cerr <<
"Positive definite inverse not defined" << std::endl;
194 std::cout <<
"Big problem in det (DSPTRF)" << std::endl;
195 for (
size_t i = 0;
i<
nlin();
i++){
203 std::cout <<
"Big problem in det" << std::endl;
209 throw OpenMEEG::maths::LinearAlgebraError(
"Determinant not defined without LAPACK");
263 double*
work =
new double[
nlin()*64];
271 throw OpenMEEG::maths::LinearAlgebraError(
"Inverse not implemented, requires LAPACK");
283 double*
work =
new double[
nlin()*64];
291 throw OpenMEEG::maths::LinearAlgebraError(
"Inverse not implemented, requires LAPACK");
305 y(
i)+=(*this)(
i,
j)*
v(
j);
Matrix class Matrix class.
void save(const std::string &s) const
Matrix submat(const Index istart, const Index isize, const Index jstart, const Index jsize) const
SymMatrix posdefinverse() const
Matrix operator*(const Matrix &B) const
SymMatrix operator/(const double x) const
SymMatrix(const char *fname)
Vector solveLin(const Vector &B) const
Matrix solveLin(Matrix &B) const
const SymMatrix & operator=(const double d)
Matrix operator*(const SymMatrix &B) const
SymMatrix operator*(const double x) const
void operator+=(const SymMatrix &B)
SymMatrix submat(const Index istart, const Index iend) const
SymMatrix operator+(const SymMatrix &B) const
Matrix operator()(const Index i_start, const Index i_end, const Index j_start, const Index j_end) const
void setlin(const Index i, const Vector &v)
double & operator()(const Index i, const Index j)
Vector getlin(const Index i) const
void save(const char *filename) const
SymMatrix inverse() const
void reference_data(const double *array)
SymMatrix(const SymMatrix &S, const DeepCopy)
double operator()(const Index i, const Index j) const
void load(const char *filename)
SymMatrix(const Matrix &A)
SymMatrix(const Vector &v)
void load(const std::string &s)
void operator-=(const SymMatrix &B)
SymMatrix(Dimension M, Dimension N)
SymMatrix operator-(const SymMatrix &B) const
Vect3 operator*(const double d, const Vect3 &V)
double det(const Vect3 &V1, const Vect3 &V2, const Vect3 &V3)
BLAS_INT sizet_to_int(const unsigned &num)