23 #ifndef SG_SYM_MATRIX_H
24 #define SG_SYM_MATRIX_H
60 inline SgSymMatrix(
unsigned int N,
bool IsNeedClear =
true);
83 inline double&
operator()(
unsigned int i,
unsigned int j);
89 inline double getElement(
unsigned int i,
unsigned int j)
const;
96 inline void setElement(
unsigned int i,
unsigned int j,
double d);
98 inline double** &
base() {
return B_;};
100 inline const double*
const*
base_c()
const {
return B_;};
261 std::cerr <<
"WARNING: double& SgSymMatrix::operator()(unsigned int i, unsigned int j):"
262 <<
" row's index [" << i <<
"] out of range [0.." <<
NRow_-1 <<
"]\n";
264 std::cerr <<
"WARNING: double& SgSymMatrix::operator()(unsigned int i, unsigned int j):"
265 <<
" column's index [" << j +
"] out of range [0.." <<
NCol_-1 <<
"]\n";
278 std::cerr <<
"WARNING: double SgSymMatrix::getElement(unsigned int, unsigned int):"
279 <<
" row's index [" << i <<
"] out of range [0.." <<
NRow_-1 <<
"]\n";
281 std::cerr <<
"WARNING: double SgSymMatrix::getElement(unsigned int, unsigned int):"
282 <<
" column's index [" << j <<
"] out of range [0.." <<
NCol_-1 <<
"]\n";
285 return (i<
NRow_ && j<
NCol_)?*(*(
B_+std::max(j,i))+std::min(i,j)):0.0;
295 std::cerr <<
"WARNING: void SgSymMatrix::setElement(unsigned int i, unsigned int j,"
296 <<
" double d): row's index [" << i <<
"] out of range [0.." <<
NRow_-1 <<
"]\n";
298 std::cerr <<
"WARNING: void SgSymMatrix::setElement(unsigned int i, unsigned int j,"
299 <<
" double d): column's index [" << j +
"] out of range [0.." <<
NCol_-1 <<
"]\n";
303 *(*(
B_+std::max(j,i))+std::min(i,j)) = d;
SgSymMatrix operator-(const SgSymMatrix &P)
SgSymMatrix operator/(const SgSymMatrix &P, double d)
SgSymMatrix operator*(const SgSymMatrix &P, double d)
std::ostream & operator<<(std::ostream &s, const SgSymMatrix &P)
SgSymMatrix operator~(const SgSymMatrix &P)
SgSymMatrix operator+(const SgSymMatrix &P1, const SgSymMatrix &P2)
double dTmp_
Local temporary variable.
unsigned int NCol_
An number of columns in a matrix.
double ** B_
A pointer on a pointer of a first element of the matrix.
unsigned int NRow_
An number of rows in a matrix.
double getElement(unsigned int i, unsigned int j) const
friend SgSymMatrix operator-(const SgSymMatrix &P)
double & operator()(unsigned int i, unsigned int j)
const double *const * base_c() const
void setElement(unsigned int i, unsigned int j, double d)
friend SgSymMatrix operator/(const SgSymMatrix &P, double d)
SgSymMatrix & operator+=(const SgSymMatrix &P)
friend SgSymMatrix operator*(const SgSymMatrix &P, double d)
SgSymMatrix & operator-=(const SgSymMatrix &P)
SgSymMatrix & operator/=(double d)
friend SgSymMatrix operator~(const SgSymMatrix &P)
friend SgMatrix calcProduct_mat_x_mat(const SgMatrix &M1, const SgSymMatrix &P2)
SgSymMatrix & operator*=(double d)
friend SgSymMatrix operator+(const SgSymMatrix &P1, const SgSymMatrix &P2)
SgSymMatrix & operator=(const SgSymMatrix &P)
SgUtMatrix & operator*=(double d)
SgUtMatrix & operator-=(const SgUtMatrix &R)
SgUtMatrix & operator=(const SgUtMatrix &R)
SgUtMatrix & operator/=(double d)
SgUtMatrix & operator+=(const SgUtMatrix &R)