21 #ifndef OB_MATRIX3x3_H 22 #define OB_MATRIX3x3_H 30 #define RAD_TO_DEG (180.0/M_PI) 34 #define DEG_TO_RAD (M_PI/180.0) 54 for (
unsigned int i = 0; i < 3; ++i)
55 for (
unsigned int j = 0; j < 3; ++j)
63 for (
unsigned int i = 0; i < 3; ++i)
64 for (
unsigned int j = 0; j < 3; ++j)
67 for (
unsigned int i = 0; i < 3; ++i)
90 for (
unsigned int i = 0; i < 3; ++i)
91 for (
unsigned int j = 0; j < 3; ++j)
106 for (
unsigned int i = 0; i < 3; ++i)
107 for (
unsigned int j = 0; j < 3; ++j)
108 m[3*i+j] = ele[i][j];
113 const double & operator() (
int row,
int column )
const 115 return ele[row][column];
120 double & operator() (
int row,
int column )
122 return ele[row][column];
127 #ifdef OB_OLD_MATH_CHECKS 136 double determinant()
const;
139 bool isSymmetric(
void)
const;
158 return (*
this * transpose()).isUnitMatrix();
162 bool isDiagonal(
void)
const;
165 bool isUnitMatrix(
void)
const;
171 double Get(
int row,
int column)
const 173 #ifdef OB_OLD_MATH_CHECKS 174 if (row >= 0 && row <= 2 && column >= 0 && column <= 2)
175 return(ele[row][column]);
179 return(ele[row][column]);
187 void Set(
int row,
int column,
double v)
189 #ifdef OB_OLD_MATH_CHECKS 190 if (row >= 0 && row <= 2 && column >= 0 && column <= 2)
200 void SetColumn(
int column,
const vector3 &v)
201 #ifdef OB_OLD_MATH_CHECKS 209 void SetRow(
int row,
const vector3 &v)
210 #ifdef OB_OLD_MATH_CHECKS 218 vector3 GetColumn(
unsigned int col)
const 219 #ifdef OB_OLD_MATH_CHECKS 227 vector3 GetRow(
unsigned int row)
const 228 #ifdef OB_OLD_MATH_CHECKS 236 for(
int i = 0; i < 3; i++ )
237 for(
int j = 0; j < 3; j++ )
245 return( (*
this) *= ( 1.0 / c ) );
250 void SetupRotMat(
double x,
double y,
double z);
253 void PlaneReflection(
const vector3 &norm);
257 void RotAboutAxisByAngle(
const vector3 &axis,
const double angle);
264 void FillOrth(
double alpha,
double beta,
double gamma,
265 double a,
double b,
double c);
269 #ifdef OB_OLD_MATH_CHECKS 284 static void jacobi(
unsigned int n,
double *a,
double *d,
double *v);
292 #endif // OB_MATRIX3x3_H matrix3x3(double d[3][3])
Constructs a matrix from a 3x3-array of doubles.
Definition: matrix3x3.h:87
matrix3x3 & operator/=(const double &c)
Divides all entries of the matrix by a scalar c.
Definition: matrix3x3.h:243
matrix3x3(double s)
Constructs s times the unit matrix.
Definition: matrix3x3.h:60
matrix3x3 & operator*=(const double &c)
Multiplies all entries of the matrix by a scalar c.
Definition: matrix3x3.h:234
double Get(int row, int column) const
Access function.
Definition: matrix3x3.h:171
void GetArray(double *m)
Access function.
Definition: matrix3x3.h:104
Customizable error handling and logging – store a message, including the method yielding the error...
Definition: oberror.h:52
const double & x() const
Access function to get the x-coordinate of the vector.
Definition: vector3.h:237
~matrix3x3()
Destructor.
Definition: matrix3x3.h:98
matrix3x3(void)
Constructs the zero-matrix.
Definition: matrix3x3.h:51
const double & y() const
Access function to get the y-coordinate of the vector.
Definition: vector3.h:242
void Set(int row, int column, double v)
Access function.
Definition: matrix3x3.h:187
Represents a vector in 3-dimensional real space.
Definition: vector3.h:44
Represents a real 3x3 matrix.
Definition: matrix3x3.h:42
bool isOrthogonal(void) const
Checks if a matrix is orthogonal.
Definition: matrix3x3.h:156
std::ostream & operator<<(std::ostream &, const vector3 &)
Prints a representation of the vector as a row vector of the form "<0.1,1,2>".
Definition: vector3.cpp:109
vector3 center_coords(double *, int)
Handle error messages, warnings, notices, etc.
vector3 operator*(const double &c, const vector3 &v)
Multiplication with a scalar.
Definition: vector3.h:330
const double & z() const
Access function to get the z-coordinate of the vector.
Definition: vector3.h:247
matrix3x3(vector3 row1, vector3 row2, vector3 row3)
Constructs a matrix from row vectors.
Definition: matrix3x3.h:72
Global namespace for all Open Babel code.
Definition: alias.h:22