Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Matrix3D Class Reference

3*3 Matric class, row-oriented, 0-based [i][j] indexing. More...

#include <Matrix3D.hpp>

Inheritance diagram for Matrix3D:

Public Member Functions

 Matrix3D ()
 Default constructor sets all entries to 0. More...
 
 Matrix3D (const Matrix3D &A)
 
 Matrix3D (const double &value)
 sets all entries of the matrix to value. More...
 
 Matrix3D (const double *v)
 sets matrix entries to values in array. More...
 
 Matrix3D (const char *s)
 for test purposes, matrices can be instantiated as More...
 
 ~Matrix3D ()
 
Matrix3Doperator= (const Matrix3D &A)
 
Matrix3Doperator= (const double &scalar)
 
Matrix3Doperator= (const char *s)
 for test purposes, matrices can be assigned as follows More...
 
void zero ()
 Sets all entries to zero (more efficient than assignement). More...
 
void set_column (int j, const Vector3D &c)
 Sets column j (0, 1 or 2) to Vector3D c. More...
 
double column_length (int i) const
 returns the column length – i is 0-based. More...
 
const Matrix3D operator* (const double &s) const
 multiplies each entry by the scalar s More...
 
void operator+= (const Matrix3D &rhs)
 
void operator-= (const Matrix3D &rhs)
 
void operator*= (const double &s)
 multiplies each entry by the scalar s More...
 
Matrix3D plus_transpose (const Matrix3D &B) const
 $ + B^T $ More...
 
void plus_transpose_equal (const Matrix3D &B)
 $ += B^T $ More...
 
Matrix3Douter_product (const Vector3D &v1, const Vector3D &v2)
 Computes $ A = v_1 v_2^T $. More...
 
void fill_lower_triangle ()
 
size_t num_rows () const
 
size_t num_cols () const
 
double * operator[] (unsigned i)
 returns a pointer to a row. More...
 
const double * operator[] (unsigned i) const
 returns a pointer to a row. More...
 
 Matrix3D ()
 Default constructor sets all entries to 0. More...
 
 Matrix3D (const Matrix3D &A)
 
 Matrix3D (const double &value)
 sets all entries of the matrix to value. More...
 
 Matrix3D (const double *v)
 sets matrix entries to values in array. More...
 
 Matrix3D (const char *s)
 for test purposes, matrices can be instantiated as More...
 
 ~Matrix3D ()
 
Matrix3Doperator= (const Matrix3D &A)
 
Matrix3Doperator= (const double &scalar)
 
Matrix3Doperator= (const char *s)
 for test purposes, matrices can be assigned as follows More...
 
void zero ()
 Sets all entries to zero (more efficient than assignement). More...
 
void set_column (int j, const Vector3D &c)
 Sets column j (0, 1 or 2) to Vector3D c. More...
 
double column_length (int i) const
 returns the column length – i is 0-based. More...
 
const Matrix3D operator* (const double &s) const
 
void operator+= (const Matrix3D &rhs)
 
void operator-= (const Matrix3D &rhs)
 
void operator*= (const double &s)
 
Matrix3D plus_transpose (const Matrix3D &B) const
 
void plus_transpose_equal (const Matrix3D &B)
 
Matrix3Douter_product (const Vector3D &v1, const Vector3D &v2)
 
void fill_lower_triangle ()
 
size_t num_rows () const
 
size_t num_cols () const
 
double * operator[] (unsigned i)
 returns a pointer to a row. More...
 
const double * operator[] (unsigned i) const
 returns a pointer to a row. More...
 

Protected Member Functions

void copy (const double *v)
 
void set (const double &val)
 
void set_values (const char *s)
 
void copy (const double *v)
 
void set (const double &val)
 
void set_values (const char *s)
 

Protected Attributes

double v_ [9]
 

Friends

bool operator== (const Matrix3D &lhs, const Matrix3D &rhs)
 
bool operator!= (const Matrix3D &lhs, const Matrix3D &rhs)
 
double Frobenius_2 (const Matrix3D &A)
 Return the square of the Frobenius norm of A, i.e. sum (diag (A' * A)) More...
 
Matrix3D transpose (const Matrix3D &A)
 
const Matrix3D operator+ (const Matrix3D &A, const Matrix3D &B)
 
const Matrix3D operator- (const Matrix3D &A, const Matrix3D &B)
 
const Matrix3D operator* (const Matrix3D &A, const Matrix3D &B)
 
const Matrix3D mult_element (const Matrix3D &A, const Matrix3D &B)
 Multiplies entry by entry. This is NOT a matrix multiplication. More...
 
int matmult (Matrix3D &C, const Matrix3D &A, const Matrix3D &B)
 $ C = A \times B $ More...
 
const Vector3D operator* (const Matrix3D &A, const Vector3D &x)
 Computes $ A v $ . More...
 
const Vector3D operator* (const Vector3D &x, const Matrix3D &A)
 Computes $ v^T A $ . More...
 
const Matrix3D operator* (const double &s, const Matrix3D &A)
 friend function to allow for commutatative property of scalar mulitplication. More...
 
void eqAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v = A*x $ More...
 
void plusEqAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v += A*x $ More...
 
void plusEqTransAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v += A^T*x $ More...
 
void plusEqaA (Matrix3D &B, const double a, const Matrix3D &A)
 $ B += a*A $ More...
 
double det (const Matrix3D &A)
 determinant of matrix A, det(A). More...
 
void inv (Matrix3D &B, const Matrix3D &A)
 $ B = A^{-1} $ More...
 
void timesInvA (Matrix3D &B, const Matrix3D &A)
 $ B *= A^{-1} $ More...
 
void QR (Matrix3D &Q, Matrix3D &R, const Matrix3D &A)
 $ Q*R = A $ More...
 
bool operator== (const Matrix3D &lhs, const Matrix3D &rhs)
 
bool operator!= (const Matrix3D &lhs, const Matrix3D &rhs)
 
double Frobenius_2 (const Matrix3D &A)
 Return the square of the Frobenius norm of A, i.e. sum (diag (A' * A)) More...
 
Matrix3D transpose (const Matrix3D &A)
 
const Matrix3D operator+ (const Matrix3D &A, const Matrix3D &B)
 
const Matrix3D operator- (const Matrix3D &A, const Matrix3D &B)
 
const Matrix3D operator* (const Matrix3D &A, const Matrix3D &B)
 
const Matrix3D mult_element (const Matrix3D &A, const Matrix3D &B)
 Multiplies entry by entry. This is NOT a matrix multiplication. More...
 
int matmult (Matrix3D &C, const Matrix3D &A, const Matrix3D &B)
 $ C = A \times B $ More...
 
const Vector3D operator* (const Matrix3D &A, const Vector3D &x)
 Computes $ A v $ . More...
 
const Vector3D operator* (const Vector3D &x, const Matrix3D &A)
 Computes $ v^T A $ . More...
 
const Matrix3D operator* (const double &s, const Matrix3D &A)
 friend function to allow for commutatative property of scalar mulitplication. More...
 
void eqAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v = A*x $ More...
 
void plusEqAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v += A*x $ More...
 
void plusEqTransAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v += A^T*x $ More...
 
void plusEqaA (Matrix3D &B, const double a, const Matrix3D &A)
 $ B += a*A $ More...
 
double det (const Matrix3D &A)
 determinant of matrix A, det(A). More...
 
void inv (Matrix3D &B, const Matrix3D &A)
 $ B = A^{-1} $ More...
 
void timesInvA (Matrix3D &B, const Matrix3D &A)
 $ B *= A^{-1} $ More...
 
void QR (Matrix3D &Q, Matrix3D &R, const Matrix3D &A)
 $ Q*R = A $ More...
 

Detailed Description

3*3 Matric class, row-oriented, 0-based [i][j] indexing.

Since the size of the object is fixed at compile time, the Matrix3D object is as fast as a double[9] array.

Definition at line 78 of file includeLinks/Matrix3D.hpp.

Constructor & Destructor Documentation

Matrix3D ( )
inline

Default constructor sets all entries to 0.

Definition at line 110 of file includeLinks/Matrix3D.hpp.

References Matrix3D::zero().

111  {
112  zero();
113  }
void zero()
Sets all entries to zero (more efficient than assignement).

Here is the call graph for this function:

Matrix3D ( const Matrix3D A)
inline

Definition at line 115 of file includeLinks/Matrix3D.hpp.

References Matrix3D::copy(), and Matrix3D::v_.

116  {
117  copy(A.v_);
118  }
void copy(const double *v)
rational * A
Definition: vinci_lass.c:67

Here is the call graph for this function:

Matrix3D ( const double &  value)
inline

sets all entries of the matrix to value.

Definition at line 121 of file includeLinks/Matrix3D.hpp.

References Matrix3D::set().

122  {
123  set(value);
124  }
void set(const double &val)

Here is the call graph for this function:

Matrix3D ( const double *  v)
inline

sets matrix entries to values in array.

Parameters
vis an array of 9 doubles.

Definition at line 128 of file includeLinks/Matrix3D.hpp.

References Matrix3D::copy().

129  {
130  copy(v);
131  }
void copy(const double *v)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20

Here is the call graph for this function:

Matrix3D ( const char *  s)
inline

for test purposes, matrices can be instantiated as

Matrix3D A("3 2 1 4 5 6 9 8 7");

Definition at line 135 of file includeLinks/Matrix3D.hpp.

References Matrix3D::set_values().

136  {
137  set_values(s);
138  }
double s
Definition: blastest.C:80
void set_values(const char *s)

Here is the call graph for this function:

~Matrix3D ( )
inline

Definition at line 141 of file includeLinks/Matrix3D.hpp.

141 { }
Matrix3D ( )
inline

Default constructor sets all entries to 0.

Definition at line 110 of file src/Misc/Matrix3D.hpp.

References Matrix3D::zero().

111  {
112  zero();
113  }
void zero()
Sets all entries to zero (more efficient than assignement).

Here is the call graph for this function:

Matrix3D ( const Matrix3D A)
inline

Definition at line 115 of file src/Misc/Matrix3D.hpp.

References Matrix3D::copy().

116  {
117  copy(A.v_);
118  }
void copy(const double *v)
rational * A
Definition: vinci_lass.c:67

Here is the call graph for this function:

Matrix3D ( const double &  value)
inline

sets all entries of the matrix to value.

Definition at line 121 of file src/Misc/Matrix3D.hpp.

References Matrix3D::set().

122  {
123  set(value);
124  }
void set(const double &val)

Here is the call graph for this function:

Matrix3D ( const double *  v)
inline

sets matrix entries to values in array.

Parameters
vis an array of 9 doubles.

Definition at line 128 of file src/Misc/Matrix3D.hpp.

References Matrix3D::copy().

129  {
130  copy(v);
131  }
void copy(const double *v)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20

Here is the call graph for this function:

Matrix3D ( const char *  s)
inline

for test purposes, matrices can be instantiated as

Matrix3D A("3 2 1 4 5 6 9 8 7");

Definition at line 135 of file src/Misc/Matrix3D.hpp.

References Matrix3D::set_values().

136  {
137  set_values(s);
138  }
double s
Definition: blastest.C:80
void set_values(const char *s)

Here is the call graph for this function:

~Matrix3D ( )
inline

Definition at line 141 of file src/Misc/Matrix3D.hpp.

141 { }

Member Function Documentation

double column_length ( int  i) const
inline

returns the column length – i is 0-based.

Definition at line 183 of file includeLinks/Matrix3D.hpp.

References sqrt(), and Matrix3D::v_.

Referenced by TargetCalculator::compute_Delta_3D(), TargetCalculator::compute_Q_3D(), and TargetCalculator::compute_V_3D().

184  { return sqrt( v_[0+i]*v_[0+i] + v_[3+i]*v_[3+i] + v_[6+i]*v_[6+i] ); }
double sqrt(double d)
Definition: double.h:73
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

Here is the caller graph for this function:

double column_length ( int  i) const
inline

returns the column length – i is 0-based.

Definition at line 183 of file src/Misc/Matrix3D.hpp.

References sqrt(), and Matrix3D::v_.

184  { return sqrt( v_[0+i]*v_[0+i] + v_[3+i]*v_[3+i] + v_[6+i]*v_[6+i] ); }
double sqrt(double d)
Definition: double.h:73
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

void copy ( const double *  v)
inlineprotected

Definition at line 84 of file includeLinks/Matrix3D.hpp.

References Matrix3D::v_.

Referenced by Matrix3D::Matrix3D(), and Matrix3D::operator=().

85  { memcpy(v_, v, 9*sizeof(double)); }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20

Here is the caller graph for this function:

void copy ( const double *  v)
inlineprotected

Definition at line 84 of file src/Misc/Matrix3D.hpp.

References Matrix3D::v_.

85  { memcpy(v_, v, 9*sizeof(double)); }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void fill_lower_triangle ( )
size_t num_cols ( ) const
inline

Definition at line 231 of file includeLinks/Matrix3D.hpp.

231 { return 3; }
size_t num_cols ( ) const
inline

Definition at line 231 of file src/Misc/Matrix3D.hpp.

231 { return 3; }
size_t num_rows ( ) const
inline

Definition at line 230 of file src/Misc/Matrix3D.hpp.

230 { return 3; }
size_t num_rows ( ) const
inline

Definition at line 230 of file includeLinks/Matrix3D.hpp.

230 { return 3; }
const Matrix3D operator* ( const double &  s) const
inline

multiplies each entry by the scalar s

Definition at line 453 of file includeLinks/Matrix3D.hpp.

References s, and Matrix3D::v_.

454  {
455  Matrix3D temp;
456  temp[0][0]=v_[0] * s; temp[0][1]=v_[1] * s; temp[0][2]=v_[2] * s;
457  temp[1][0]=v_[3] * s; temp[1][1]=v_[4] * s; temp[1][2]=v_[5] * s;
458  temp[2][0]=v_[6] * s; temp[2][1]=v_[7] * s; temp[2][2]=v_[8] * s;
459  return temp;
460  }
Matrix3D()
Default constructor sets all entries to 0.
double s
Definition: blastest.C:80
const Matrix3D operator* ( const double &  s) const
void operator*= ( const double &  s)
void operator*= ( const double &  s)
inline

multiplies each entry by the scalar s

Definition at line 362 of file includeLinks/Matrix3D.hpp.

References s, and Matrix3D::v_.

363  {
364  v_[0] *= s; v_[1] *= s; v_[2] *= s;
365  v_[3] *= s; v_[4] *= s; v_[5] *= s;
366  v_[6] *= s; v_[7] *= s; v_[8] *= s;
367  }
double s
Definition: blastest.C:80
void operator+= ( const Matrix3D rhs)
void operator+= ( const Matrix3D rhs)
inline

Definition at line 347 of file includeLinks/Matrix3D.hpp.

References Matrix3D::v_.

348  {
349  v_[0] += rhs.v_[0]; v_[1] += rhs.v_[1]; v_[2] += rhs.v_[2];
350  v_[3] += rhs.v_[3]; v_[4] += rhs.v_[4]; v_[5] += rhs.v_[5];
351  v_[6] += rhs.v_[6]; v_[7] += rhs.v_[7]; v_[8] += rhs.v_[8];
352  }
NT rhs
void operator-= ( const Matrix3D rhs)
void operator-= ( const Matrix3D rhs)
inline

Definition at line 354 of file includeLinks/Matrix3D.hpp.

References Matrix3D::v_.

355  {
356  v_[0] -= rhs.v_[0]; v_[1] -= rhs.v_[1]; v_[2] -= rhs.v_[2];
357  v_[3] -= rhs.v_[3]; v_[4] -= rhs.v_[4]; v_[5] -= rhs.v_[5];
358  v_[6] -= rhs.v_[6]; v_[7] -= rhs.v_[7]; v_[8] -= rhs.v_[8];
359  }
NT rhs
Matrix3D& operator= ( const Matrix3D A)
inline

Definition at line 144 of file includeLinks/Matrix3D.hpp.

References Matrix3D::copy(), and Matrix3D::v_.

Referenced by TargetMatrix::operator=().

145  {
146  if (v_ == A.v_)
147  return *this;
148  copy(A.v_);
149  return *this;
150  }
void copy(const double *v)
rational * A
Definition: vinci_lass.c:67

Here is the call graph for this function:

Here is the caller graph for this function:

Matrix3D& operator= ( const Matrix3D A)
inline

Definition at line 144 of file src/Misc/Matrix3D.hpp.

References Matrix3D::copy(), and Matrix3D::v_.

145  {
146  if (v_ == A.v_)
147  return *this;
148  copy(A.v_);
149  return *this;
150  }
void copy(const double *v)
rational * A
Definition: vinci_lass.c:67

Here is the call graph for this function:

Matrix3D& operator= ( const double &  scalar)
inline

Definition at line 152 of file includeLinks/Matrix3D.hpp.

References Matrix3D::set().

153  {
154  set(scalar);
155  return *this;
156  }
void set(const double &val)

Here is the call graph for this function:

Matrix3D& operator= ( const double &  scalar)
inline

Definition at line 152 of file src/Misc/Matrix3D.hpp.

References Matrix3D::set().

153  {
154  set(scalar);
155  return *this;
156  }
void set(const double &val)

Here is the call graph for this function:

Matrix3D& operator= ( const char *  s)
inline

for test purposes, matrices can be assigned as follows

A = "3 2 1 4 5 6 9 8 7";

Definition at line 160 of file src/Misc/Matrix3D.hpp.

References Matrix3D::set_values().

161  {
162  set_values(s);
163  return *this;
164  }
double s
Definition: blastest.C:80
void set_values(const char *s)

Here is the call graph for this function:

Matrix3D& operator= ( const char *  s)
inline

for test purposes, matrices can be assigned as follows

A = "3 2 1 4 5 6 9 8 7";

Definition at line 160 of file includeLinks/Matrix3D.hpp.

References Matrix3D::set_values().

161  {
162  set_values(s);
163  return *this;
164  }
double s
Definition: blastest.C:80
void set_values(const char *s)

Here is the call graph for this function:

double* operator[] ( unsigned  i)
inline

returns a pointer to a row.

Definition at line 234 of file includeLinks/Matrix3D.hpp.

References i, and Matrix3D::v_.

235  {
236  return v_ + 3*i;
237  }
blockLoc i
Definition: read.cpp:79
double* operator[] ( unsigned  i)
inline

returns a pointer to a row.

Definition at line 234 of file src/Misc/Matrix3D.hpp.

References i, and Matrix3D::v_.

235  {
236  return v_ + 3*i;
237  }
blockLoc i
Definition: read.cpp:79
const double* operator[] ( unsigned  i) const
inline

returns a pointer to a row.

Definition at line 240 of file includeLinks/Matrix3D.hpp.

References i, and Matrix3D::v_.

241  {
242  return v_ + 3*i;
243  }
blockLoc i
Definition: read.cpp:79
const double* operator[] ( unsigned  i) const
inline

returns a pointer to a row.

Definition at line 240 of file src/Misc/Matrix3D.hpp.

References i, and Matrix3D::v_.

241  {
242  return v_ + 3*i;
243  }
blockLoc i
Definition: read.cpp:79
Matrix3D & outer_product ( const Vector3D v1,
const Vector3D v2 
)
inline

Computes $ A = v_1 v_2^T $.

Definition at line 406 of file includeLinks/Matrix3D.hpp.

References Matrix3D::v_.

Referenced by IdealWeightInverseMeanRatio::compute_element_analytical_hessian().

407  {
408  // remember, matrix entries are v_[0] to v_[8].
409 
410  // diagonal
411  v_[0] = v1[0]*v2[0];
412  v_[4] = v1[1]*v2[1];
413  v_[8] = v1[2]*v2[2];
414 
415  // upper triangular part
416  v_[1] = v1[0]*v2[1];
417  v_[2] = v1[0]*v2[2];
418  v_[5] = v1[1]*v2[2];
419 
420  // lower triangular part
421  v_[3] = v2[0]*v1[1];
422  v_[6] = v2[0]*v1[2];
423  v_[7] = v2[1]*v1[2];
424 
425  return *this;
426  }

Here is the caller graph for this function:

Matrix3D& outer_product ( const Vector3D v1,
const Vector3D v2 
)
Matrix3D plus_transpose ( const Matrix3D B) const
Matrix3D plus_transpose ( const Matrix3D B) const
inline

$ + B^T $

Definition at line 370 of file includeLinks/Matrix3D.hpp.

References Matrix3D::v_.

371  {
372  Matrix3D tmp;
373 
374  tmp.v_[0] = v_[0] + B.v_[0];
375  tmp.v_[1] = v_[1] + B.v_[3];
376  tmp.v_[2] = v_[2] + B.v_[6];
377 
378  tmp.v_[3] = v_[3] + B.v_[1];
379  tmp.v_[4] = v_[4] + B.v_[4];
380  tmp.v_[5] = v_[5] + B.v_[7];
381 
382  tmp.v_[6] = v_[6] + B.v_[2];
383  tmp.v_[7] = v_[7] + B.v_[5];
384  tmp.v_[8] = v_[8] + B.v_[8];
385 
386  return tmp;
387  }
Matrix3D()
Default constructor sets all entries to 0.
void plus_transpose_equal ( const Matrix3D B)
inline

$ += B^T $

Definition at line 390 of file includeLinks/Matrix3D.hpp.

References Matrix3D::v_.

Referenced by MsqHessian::accumulate_entries().

391  {
392  v_[0] += B.v_[0];
393  v_[1] += B.v_[3];
394  v_[2] += B.v_[6];
395 
396  v_[3] += B.v_[1];
397  v_[4] += B.v_[4];
398  v_[5] += B.v_[7];
399 
400  v_[6] += B.v_[2];
401  v_[7] += B.v_[5];
402  v_[8] += B.v_[8];
403  }

Here is the caller graph for this function:

void plus_transpose_equal ( const Matrix3D B)
void set ( const double &  val)
inlineprotected

Definition at line 87 of file includeLinks/Matrix3D.hpp.

References Matrix3D::v_.

Referenced by Matrix3D::Matrix3D(), and Matrix3D::operator=().

88  {
89  v_[0]=val; v_[1]=val; v_[2]=val;
90  v_[3]=val; v_[4]=val; v_[5]=val;
91  v_[6]=val; v_[7]=val; v_[8]=val;
92  }

Here is the caller graph for this function:

void set ( const double &  val)
inlineprotected

Definition at line 87 of file src/Misc/Matrix3D.hpp.

References Matrix3D::v_.

88  {
89  v_[0]=val; v_[1]=val; v_[2]=val;
90  v_[3]=val; v_[4]=val; v_[5]=val;
91  v_[6]=val; v_[7]=val; v_[8]=val;
92  }
void set_column ( int  j,
const Vector3D c 
)
inline

Sets column j (0, 1 or 2) to Vector3D c.

Definition at line 175 of file includeLinks/Matrix3D.hpp.

References j, and Matrix3D::v_.

Referenced by MsqMeshEntity::compute_corner_matrices(), and TargetCalculator::compute_V_3D().

176  {
177  v_[0+j]=c[0];
178  v_[3+j]=c[1];
179  v_[6+j]=c[2];
180  }
j indices j
Definition: Indexing.h:6

Here is the caller graph for this function:

void set_column ( int  j,
const Vector3D c 
)
inline

Sets column j (0, 1 or 2) to Vector3D c.

Definition at line 175 of file src/Misc/Matrix3D.hpp.

References j, and Matrix3D::v_.

176  {
177  v_[0+j]=c[0];
178  v_[3+j]=c[1];
179  v_[6+j]=c[2];
180  }
j indices j
Definition: Indexing.h:6
void set_values ( const char *  s)
inlineprotected

Definition at line 94 of file includeLinks/Matrix3D.hpp.

References Matrix3D::v_.

Referenced by Matrix3D::Matrix3D(), and Matrix3D::operator=().

95  {
96 #ifdef MSQ_USE_OLD_IO_HEADERS
97  ::istrstream ins(s);
98 #else
99  std::istringstream ins(s);
100 #endif
101  ins>>v_[0]; ins>>v_[1]; ins>>v_[2];
102  ins>>v_[3]; ins>>v_[4]; ins>>v_[5];
103  ins>>v_[6]; ins>>v_[7]; ins>>v_[8];
104  }
double s
Definition: blastest.C:80

Here is the caller graph for this function:

void set_values ( const char *  s)
inlineprotected

Definition at line 94 of file src/Misc/Matrix3D.hpp.

References Matrix3D::v_.

95  {
96 #ifdef MSQ_USE_OLD_IO_HEADERS
97  ::istrstream ins(s);
98 #else
99  std::istringstream ins(s);
100 #endif
101  ins>>v_[0]; ins>>v_[1]; ins>>v_[2];
102  ins>>v_[3]; ins>>v_[4]; ins>>v_[5];
103  ins>>v_[6]; ins>>v_[7]; ins>>v_[8];
104  }
double s
Definition: blastest.C:80
void zero ( )
inline

Sets all entries to zero (more efficient than assignement).

Definition at line 167 of file src/Misc/Matrix3D.hpp.

References Matrix3D::v_.

168  {
169  v_[0]=0.; v_[1]=0.; v_[2]=0.;
170  v_[3]=0.; v_[4]=0.; v_[5]=0.;
171  v_[6]=0.; v_[7]=0.; v_[8]=0.;
172  }

Friends And Related Function Documentation

double det ( const Matrix3D A)
friend

determinant of matrix A, det(A).

Definition at line 549 of file includeLinks/Matrix3D.hpp.

549  {
550  return ( A.v_[0]*(A.v_[4]*A.v_[8]-A.v_[7]*A.v_[5])
551  -A.v_[1]*(A.v_[3]*A.v_[8]-A.v_[6]*A.v_[5])
552  +A.v_[2]*(A.v_[3]*A.v_[7]-A.v_[6]*A.v_[4]) );
553  }
rational * A
Definition: vinci_lass.c:67
double det ( const Matrix3D A)
friend

determinant of matrix A, det(A).

Definition at line 549 of file includeLinks/Matrix3D.hpp.

549  {
550  return ( A.v_[0]*(A.v_[4]*A.v_[8]-A.v_[7]*A.v_[5])
551  -A.v_[1]*(A.v_[3]*A.v_[8]-A.v_[6]*A.v_[5])
552  +A.v_[2]*(A.v_[3]*A.v_[7]-A.v_[6]*A.v_[4]) );
553  }
rational * A
Definition: vinci_lass.c:67
void eqAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v = A*x $

Definition at line 522 of file includeLinks/Matrix3D.hpp.

523  {
524  v.mCoords[0] = A.v_[0]*x[0] + A.v_[1]*x.mCoords[1] + A.v_[2]*x.mCoords[2];
525  v.mCoords[1] = A.v_[3]*x[0] + A.v_[4]*x.mCoords[1] + A.v_[5]*x.mCoords[2];
526  v.mCoords[2] = A.v_[6]*x[0] + A.v_[7]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
527  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67
void int int REAL * x
Definition: read.cpp:74
void eqAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v = A*x $

Definition at line 522 of file includeLinks/Matrix3D.hpp.

523  {
524  v.mCoords[0] = A.v_[0]*x[0] + A.v_[1]*x.mCoords[1] + A.v_[2]*x.mCoords[2];
525  v.mCoords[1] = A.v_[3]*x[0] + A.v_[4]*x.mCoords[1] + A.v_[5]*x.mCoords[2];
526  v.mCoords[2] = A.v_[6]*x[0] + A.v_[7]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
527  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67
void int int REAL * x
Definition: read.cpp:74
double Frobenius_2 ( const Matrix3D A)
friend

Return the square of the Frobenius norm of A, i.e. sum (diag (A' * A))

Definition at line 326 of file includeLinks/Matrix3D.hpp.

327  {
328  double fro=0.;
329  for (int i=0; i<3; ++i) {
330  fro += A[0][i]*A[0][i] + A[1][i]*A[1][i] + A[2][i]*A[2][i] ;
331  }
332  return fro;
333  }
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
double Frobenius_2 ( const Matrix3D A)
friend

Return the square of the Frobenius norm of A, i.e. sum (diag (A' * A))

Definition at line 326 of file includeLinks/Matrix3D.hpp.

327  {
328  double fro=0.;
329  for (int i=0; i<3; ++i) {
330  fro += A[0][i]*A[0][i] + A[1][i]*A[1][i] + A[2][i]*A[2][i] ;
331  }
332  return fro;
333  }
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
void inv ( Matrix3D B,
const Matrix3D A 
)
friend

$ B = A^{-1} $

Definition at line 555 of file includeLinks/Matrix3D.hpp.

555  {
556  double inv_detA = 1 / (det(A));
557 
558  Ainv[0][0] = inv_detA*( A.v_[4]*A.v_[8]-A.v_[5]*A.v_[7] );
559  Ainv[0][1] = inv_detA*( A.v_[2]*A.v_[7]-A.v_[8]*A.v_[1] );
560  Ainv[0][2] = inv_detA*( A.v_[1]*A.v_[5]-A.v_[4]*A.v_[2] );
561 
562  Ainv[1][0] = inv_detA*( A.v_[5]*A.v_[6]-A.v_[8]*A.v_[3] );
563  Ainv[1][1] = inv_detA*( A.v_[0]*A.v_[8]-A.v_[6]*A.v_[2] );
564  Ainv[1][2] = inv_detA*( A.v_[2]*A.v_[3]-A.v_[5]*A.v_[0] );
565 
566  Ainv[2][0] = inv_detA*( A.v_[3]*A.v_[7]-A.v_[6]*A.v_[4] );
567  Ainv[2][1] = inv_detA*( A.v_[1]*A.v_[6]-A.v_[7]*A.v_[0] );
568  Ainv[2][2] = inv_detA*( A.v_[0]*A.v_[4]-A.v_[3]*A.v_[1] );
569  return;
570  }
friend double det(const Matrix3D &A)
determinant of matrix A, det(A).
rational * A
Definition: vinci_lass.c:67
void inv ( Matrix3D B,
const Matrix3D A 
)
friend

$ B = A^{-1} $

Definition at line 555 of file includeLinks/Matrix3D.hpp.

555  {
556  double inv_detA = 1 / (det(A));
557 
558  Ainv[0][0] = inv_detA*( A.v_[4]*A.v_[8]-A.v_[5]*A.v_[7] );
559  Ainv[0][1] = inv_detA*( A.v_[2]*A.v_[7]-A.v_[8]*A.v_[1] );
560  Ainv[0][2] = inv_detA*( A.v_[1]*A.v_[5]-A.v_[4]*A.v_[2] );
561 
562  Ainv[1][0] = inv_detA*( A.v_[5]*A.v_[6]-A.v_[8]*A.v_[3] );
563  Ainv[1][1] = inv_detA*( A.v_[0]*A.v_[8]-A.v_[6]*A.v_[2] );
564  Ainv[1][2] = inv_detA*( A.v_[2]*A.v_[3]-A.v_[5]*A.v_[0] );
565 
566  Ainv[2][0] = inv_detA*( A.v_[3]*A.v_[7]-A.v_[6]*A.v_[4] );
567  Ainv[2][1] = inv_detA*( A.v_[1]*A.v_[6]-A.v_[7]*A.v_[0] );
568  Ainv[2][2] = inv_detA*( A.v_[0]*A.v_[4]-A.v_[3]*A.v_[1] );
569  return;
570  }
friend double det(const Matrix3D &A)
determinant of matrix A, det(A).
rational * A
Definition: vinci_lass.c:67
int matmult ( Matrix3D C,
const Matrix3D A,
const Matrix3D B 
)
friend

$ C = A \times B $

Definition at line 470 of file includeLinks/Matrix3D.hpp.

472  {
473  double sum;
474  const double* row_i;
475  const double* col_k;
476  for (size_t i=0; i<3; ++i)
477  for (size_t k=0; k<3; ++k)
478  {
479  row_i = &(A[i][0]);
480  col_k = &(B[0][k]);
481  sum = 0;
482  for (size_t j=0; j<3; ++j)
483  {
484  sum += *row_i * *col_k;
485  row_i++;
486  col_k += 3;
487  }
488  C[i][k] = sum;
489  }
490  return 0;
491  }
j indices k indices k
Definition: Indexing.h:6
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
int matmult ( Matrix3D C,
const Matrix3D A,
const Matrix3D B 
)
friend

$ C = A \times B $

Definition at line 470 of file includeLinks/Matrix3D.hpp.

472  {
473  double sum;
474  const double* row_i;
475  const double* col_k;
476  for (size_t i=0; i<3; ++i)
477  for (size_t k=0; k<3; ++k)
478  {
479  row_i = &(A[i][0]);
480  col_k = &(B[0][k]);
481  sum = 0;
482  for (size_t j=0; j<3; ++j)
483  {
484  sum += *row_i * *col_k;
485  row_i++;
486  col_k += 3;
487  }
488  C[i][k] = sum;
489  }
490  return 0;
491  }
j indices k indices k
Definition: Indexing.h:6
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
const Matrix3D mult_element ( const Matrix3D A,
const Matrix3D B 
)
friend

Multiplies entry by entry. This is NOT a matrix multiplication.

Definition at line 312 of file includeLinks/Matrix3D.hpp.

314  {
315  Matrix3D tmp;
316  size_t i;
317  for (i=0; i<3; ++i) {
318  tmp[i][0] = A[i][0] * B[i][0];
319  tmp[i][1] = A[i][1] * B[i][1];
320  tmp[i][2] = A[i][2] * B[i][2];
321  }
322  return tmp;
323  }
Matrix3D()
Default constructor sets all entries to 0.
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
const Matrix3D mult_element ( const Matrix3D A,
const Matrix3D B 
)
friend

Multiplies entry by entry. This is NOT a matrix multiplication.

Definition at line 312 of file includeLinks/Matrix3D.hpp.

314  {
315  Matrix3D tmp;
316  size_t i;
317  for (i=0; i<3; ++i) {
318  tmp[i][0] = A[i][0] * B[i][0];
319  tmp[i][1] = A[i][1] * B[i][1];
320  tmp[i][2] = A[i][2] * B[i][2];
321  }
322  return tmp;
323  }
Matrix3D()
Default constructor sets all entries to 0.
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
bool operator!= ( const Matrix3D lhs,
const Matrix3D rhs 
)
friend

Definition at line 278 of file includeLinks/Matrix3D.hpp.

279  {
280  return (memcmp(lhs.v_, rhs.v_, 9*sizeof(double)) != 0);
281  }
NT rhs
bool operator!= ( const Matrix3D lhs,
const Matrix3D rhs 
)
friend

Definition at line 278 of file includeLinks/Matrix3D.hpp.

279  {
280  return (memcmp(lhs.v_, rhs.v_, 9*sizeof(double)) != 0);
281  }
NT rhs
const Matrix3D operator* ( const Matrix3D A,
const Matrix3D B 
)
friend
Returns
A*B

Definition at line 436 of file includeLinks/Matrix3D.hpp.

438  {
439  Matrix3D tmp;
440  double sum;
441  for (size_t i=0; i<3; ++i)
442  for (size_t k=0; k<3; ++k)
443  {
444  sum = 0;
445  for (size_t j=0; j<3; j++)
446  sum = sum + A[i][j] * B[j][k];
447  tmp[i][k] = sum;
448  }
449  return tmp;
450  }
Matrix3D()
Default constructor sets all entries to 0.
j indices k indices k
Definition: Indexing.h:6
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
const Matrix3D operator* ( const Matrix3D A,
const Matrix3D B 
)
friend
Returns
A*B

Definition at line 436 of file includeLinks/Matrix3D.hpp.

438  {
439  Matrix3D tmp;
440  double sum;
441  for (size_t i=0; i<3; ++i)
442  for (size_t k=0; k<3; ++k)
443  {
444  sum = 0;
445  for (size_t j=0; j<3; j++)
446  sum = sum + A[i][j] * B[j][k];
447  tmp[i][k] = sum;
448  }
449  return tmp;
450  }
Matrix3D()
Default constructor sets all entries to 0.
j indices k indices k
Definition: Indexing.h:6
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
const Vector3D operator* ( const Matrix3D A,
const Vector3D x 
)
friend

Computes $ A v $ .

Definition at line 494 of file includeLinks/Matrix3D.hpp.

495  {
496  Vector3D tmp; // initializes to 0
497  for (size_t i=0; i<3; ++i)
498  {
499  const double* rowi = A[i];
500  tmp[i] = rowi[0]*x[0] + rowi[1]*x[1] + rowi[2]*x[2];
501  }
502  return tmp;
503  }
rational * A
Definition: vinci_lass.c:67
NVec< 3, double > Vector3D
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
const Vector3D operator* ( const Matrix3D A,
const Vector3D x 
)
friend

Computes $ A v $ .

Definition at line 494 of file includeLinks/Matrix3D.hpp.

495  {
496  Vector3D tmp; // initializes to 0
497  for (size_t i=0; i<3; ++i)
498  {
499  const double* rowi = A[i];
500  tmp[i] = rowi[0]*x[0] + rowi[1]*x[1] + rowi[2]*x[2];
501  }
502  return tmp;
503  }
rational * A
Definition: vinci_lass.c:67
NVec< 3, double > Vector3D
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
const Vector3D operator* ( const Vector3D x,
const Matrix3D A 
)
friend

Computes $ v^T A $ .

This function implicitly considers the transpose of vector x times the matrix A and it is implicit that the returned vector must be transposed.

Definition at line 510 of file includeLinks/Matrix3D.hpp.

511  {
512  Vector3D res(0., 0., 0.);
513  for (size_t i=0; i<3; ++i)
514  {
515  const double* rowi = A[i];
516  for (size_t j=0; j<3; ++j)
517  res[j] += rowi[j] * x[i];
518  }
519  return res;
520  }
rational * A
Definition: vinci_lass.c:67
NVec< 3, double > Vector3D
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
j indices j
Definition: Indexing.h:6
const Vector3D operator* ( const Vector3D x,
const Matrix3D A 
)
friend

Computes $ v^T A $ .

This function implicitly considers the transpose of vector x times the matrix A and it is implicit that the returned vector must be transposed.

Definition at line 510 of file includeLinks/Matrix3D.hpp.

511  {
512  Vector3D res(0., 0., 0.);
513  for (size_t i=0; i<3; ++i)
514  {
515  const double* rowi = A[i];
516  for (size_t j=0; j<3; ++j)
517  res[j] += rowi[j] * x[i];
518  }
519  return res;
520  }
rational * A
Definition: vinci_lass.c:67
NVec< 3, double > Vector3D
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
j indices j
Definition: Indexing.h:6
const Matrix3D operator* ( const double &  s,
const Matrix3D A 
)
friend

friend function to allow for commutatative property of scalar mulitplication.

Definition at line 463 of file includeLinks/Matrix3D.hpp.

464  {
465  return (A.operator*(s));
466  }
double s
Definition: blastest.C:80
rational * A
Definition: vinci_lass.c:67
const Matrix3D operator* ( const double &  s,
const Matrix3D A 
)
friend

friend function to allow for commutatative property of scalar mulitplication.

Definition at line 463 of file includeLinks/Matrix3D.hpp.

464  {
465  return (A.operator*(s));
466  }
double s
Definition: blastest.C:80
rational * A
Definition: vinci_lass.c:67
const Matrix3D operator+ ( const Matrix3D A,
const Matrix3D B 
)
friend
Returns
A+B

Definition at line 284 of file includeLinks/Matrix3D.hpp.

286  {
287  Matrix3D tmp;
288  size_t i;
289  for (i=0; i<3; ++i) {
290  tmp[i][0] = A[i][0] + B[i][0];
291  tmp[i][1] = A[i][1] + B[i][1];
292  tmp[i][2] = A[i][2] + B[i][2];
293  }
294  return tmp;
295  }
Matrix3D()
Default constructor sets all entries to 0.
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
const Matrix3D operator+ ( const Matrix3D A,
const Matrix3D B 
)
friend
Returns
A+B

Definition at line 284 of file includeLinks/Matrix3D.hpp.

286  {
287  Matrix3D tmp;
288  size_t i;
289  for (i=0; i<3; ++i) {
290  tmp[i][0] = A[i][0] + B[i][0];
291  tmp[i][1] = A[i][1] + B[i][1];
292  tmp[i][2] = A[i][2] + B[i][2];
293  }
294  return tmp;
295  }
Matrix3D()
Default constructor sets all entries to 0.
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
const Matrix3D operator- ( const Matrix3D A,
const Matrix3D B 
)
friend
Returns
A-B

Definition at line 298 of file includeLinks/Matrix3D.hpp.

300  {
301  Matrix3D tmp;
302  size_t i;
303  for (i=0; i<3; ++i) {
304  tmp[i][0] = A[i][0] - B[i][0];
305  tmp[i][1] = A[i][1] - B[i][1];
306  tmp[i][2] = A[i][2] - B[i][2];
307  }
308  return tmp;
309  }
Matrix3D()
Default constructor sets all entries to 0.
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
const Matrix3D operator- ( const Matrix3D A,
const Matrix3D B 
)
friend
Returns
A-B

Definition at line 298 of file includeLinks/Matrix3D.hpp.

300  {
301  Matrix3D tmp;
302  size_t i;
303  for (i=0; i<3; ++i) {
304  tmp[i][0] = A[i][0] - B[i][0];
305  tmp[i][1] = A[i][1] - B[i][1];
306  tmp[i][2] = A[i][2] - B[i][2];
307  }
308  return tmp;
309  }
Matrix3D()
Default constructor sets all entries to 0.
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
bool operator== ( const Matrix3D lhs,
const Matrix3D rhs 
)
friend

Definition at line 274 of file includeLinks/Matrix3D.hpp.

275  {
276  return (memcmp(lhs.v_, rhs.v_, 9*sizeof(double)) == 0);
277  }
NT rhs
bool operator== ( const Matrix3D lhs,
const Matrix3D rhs 
)
friend

Definition at line 274 of file includeLinks/Matrix3D.hpp.

275  {
276  return (memcmp(lhs.v_, rhs.v_, 9*sizeof(double)) == 0);
277  }
NT rhs
void plusEqaA ( Matrix3D B,
const double  a,
const Matrix3D A 
)
friend

$ B += a*A $

Definition at line 543 of file includeLinks/Matrix3D.hpp.

543  {
544  B.v_[0] += a*A.v_[0]; B.v_[1] += a*A.v_[1]; B.v_[2] += a*A.v_[2];
545  B.v_[3] += a*A.v_[3]; B.v_[4] += a*A.v_[4]; B.v_[5] += a*A.v_[5];
546  B.v_[6] += a*A.v_[6]; B.v_[7] += a*A.v_[7]; B.v_[8] += a*A.v_[8];
547  }
rational * A
Definition: vinci_lass.c:67
void plusEqaA ( Matrix3D B,
const double  a,
const Matrix3D A 
)
friend

$ B += a*A $

Definition at line 543 of file includeLinks/Matrix3D.hpp.

543  {
544  B.v_[0] += a*A.v_[0]; B.v_[1] += a*A.v_[1]; B.v_[2] += a*A.v_[2];
545  B.v_[3] += a*A.v_[3]; B.v_[4] += a*A.v_[4]; B.v_[5] += a*A.v_[5];
546  B.v_[6] += a*A.v_[6]; B.v_[7] += a*A.v_[7]; B.v_[8] += a*A.v_[8];
547  }
rational * A
Definition: vinci_lass.c:67
void plusEqAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v += A*x $

Definition at line 529 of file includeLinks/Matrix3D.hpp.

530  {
531  v.mCoords[0] += A.v_[0]*x[0] + A.v_[1]*x.mCoords[1] + A.v_[2]*x.mCoords[2];
532  v.mCoords[1] += A.v_[3]*x[0] + A.v_[4]*x.mCoords[1] + A.v_[5]*x.mCoords[2];
533  v.mCoords[2] += A.v_[6]*x[0] + A.v_[7]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
534  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67
void int int REAL * x
Definition: read.cpp:74
void plusEqAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v += A*x $

Definition at line 529 of file includeLinks/Matrix3D.hpp.

530  {
531  v.mCoords[0] += A.v_[0]*x[0] + A.v_[1]*x.mCoords[1] + A.v_[2]*x.mCoords[2];
532  v.mCoords[1] += A.v_[3]*x[0] + A.v_[4]*x.mCoords[1] + A.v_[5]*x.mCoords[2];
533  v.mCoords[2] += A.v_[6]*x[0] + A.v_[7]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
534  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67
void int int REAL * x
Definition: read.cpp:74
void plusEqTransAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v += A^T*x $

Definition at line 536 of file includeLinks/Matrix3D.hpp.

537  {
538  v.mCoords[0] += A.v_[0]*x.mCoords[0] + A.v_[3]*x.mCoords[1] + A.v_[6]*x.mCoords[2];
539  v.mCoords[1] += A.v_[1]*x.mCoords[0] + A.v_[4]*x.mCoords[1] + A.v_[7]*x.mCoords[2];
540  v.mCoords[2] += A.v_[2]*x.mCoords[0] + A.v_[5]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
541  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67
void int int REAL * x
Definition: read.cpp:74
void plusEqTransAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v += A^T*x $

Definition at line 536 of file includeLinks/Matrix3D.hpp.

537  {
538  v.mCoords[0] += A.v_[0]*x.mCoords[0] + A.v_[3]*x.mCoords[1] + A.v_[6]*x.mCoords[2];
539  v.mCoords[1] += A.v_[1]*x.mCoords[0] + A.v_[4]*x.mCoords[1] + A.v_[7]*x.mCoords[2];
540  v.mCoords[2] += A.v_[2]*x.mCoords[0] + A.v_[5]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
541  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67
void int int REAL * x
Definition: read.cpp:74
void QR ( Matrix3D Q,
Matrix3D R,
const Matrix3D A 
)
friend

$ Q*R = A $

Definition at line 593 of file includeLinks/Matrix3D.hpp.

593  {
594  // Compute the QR factorization of A. This code uses the
595  // Modified Gram-Schmidt method for computing the factorization.
596  // The Householder version is more stable, but costs twice as many
597  // floating point operations.
598 
599  Q = A;
600 
601  R[0][0] = sqrt(Q[0][0]*Q[0][0] + Q[1][0]*Q[1][0] + Q[2][0]*Q[2][0]);
602  R[1][0] = 0.0L;
603  R[2][0] = 0.0L;
604  Q[0][0] /= R[0][0];
605  Q[1][0] /= R[0][0];
606  Q[2][0] /= R[0][0];
607 
608  R[0][1] = Q[0][0]*Q[0][1] + Q[1][0]*Q[1][1] + Q[2][0]*Q[2][1];
609  Q[0][1] -= Q[0][0]*R[0][1];
610  Q[1][1] -= Q[1][0]*R[0][1];
611  Q[2][1] -= Q[2][0]*R[0][1];
612 
613  R[0][2] = Q[0][0]*Q[0][2] + Q[1][0]*Q[1][2] + Q[2][0]*Q[2][2];
614  Q[0][2] -= Q[0][0]*R[0][2];
615  Q[1][2] -= Q[1][0]*R[0][2];
616  Q[2][2] -= Q[2][0]*R[0][2];
617 
618  R[1][1] = sqrt(Q[0][1]*Q[0][1] + Q[1][1]*Q[1][1] + Q[2][1]*Q[2][1]);
619  R[2][1] = 0.0L;
620  Q[0][1] /= R[1][1];
621  Q[1][1] /= R[1][1];
622  Q[2][1] /= R[1][1];
623 
624  R[1][2] = Q[0][1]*Q[0][2] + Q[1][1]*Q[1][2] + Q[2][1]*Q[2][2];
625  Q[0][2] -= Q[0][1]*R[1][2];
626  Q[1][2] -= Q[1][1]*R[1][2];
627  Q[2][2] -= Q[2][1]*R[1][2];
628 
629  R[2][2] = sqrt(Q[0][2]*Q[0][2] + Q[1][2]*Q[1][2] + Q[2][2]*Q[2][2]);
630  Q[0][2] /= R[2][2];
631  Q[1][2] /= R[2][2];
632  Q[2][2] /= R[2][2];
633  return;
634  }
double sqrt(double d)
Definition: double.h:73
rational * A
Definition: vinci_lass.c:67
void QR ( Matrix3D Q,
Matrix3D R,
const Matrix3D A 
)
friend

$ Q*R = A $

Definition at line 593 of file includeLinks/Matrix3D.hpp.

593  {
594  // Compute the QR factorization of A. This code uses the
595  // Modified Gram-Schmidt method for computing the factorization.
596  // The Householder version is more stable, but costs twice as many
597  // floating point operations.
598 
599  Q = A;
600 
601  R[0][0] = sqrt(Q[0][0]*Q[0][0] + Q[1][0]*Q[1][0] + Q[2][0]*Q[2][0]);
602  R[1][0] = 0.0L;
603  R[2][0] = 0.0L;
604  Q[0][0] /= R[0][0];
605  Q[1][0] /= R[0][0];
606  Q[2][0] /= R[0][0];
607 
608  R[0][1] = Q[0][0]*Q[0][1] + Q[1][0]*Q[1][1] + Q[2][0]*Q[2][1];
609  Q[0][1] -= Q[0][0]*R[0][1];
610  Q[1][1] -= Q[1][0]*R[0][1];
611  Q[2][1] -= Q[2][0]*R[0][1];
612 
613  R[0][2] = Q[0][0]*Q[0][2] + Q[1][0]*Q[1][2] + Q[2][0]*Q[2][2];
614  Q[0][2] -= Q[0][0]*R[0][2];
615  Q[1][2] -= Q[1][0]*R[0][2];
616  Q[2][2] -= Q[2][0]*R[0][2];
617 
618  R[1][1] = sqrt(Q[0][1]*Q[0][1] + Q[1][1]*Q[1][1] + Q[2][1]*Q[2][1]);
619  R[2][1] = 0.0L;
620  Q[0][1] /= R[1][1];
621  Q[1][1] /= R[1][1];
622  Q[2][1] /= R[1][1];
623 
624  R[1][2] = Q[0][1]*Q[0][2] + Q[1][1]*Q[1][2] + Q[2][1]*Q[2][2];
625  Q[0][2] -= Q[0][1]*R[1][2];
626  Q[1][2] -= Q[1][1]*R[1][2];
627  Q[2][2] -= Q[2][1]*R[1][2];
628 
629  R[2][2] = sqrt(Q[0][2]*Q[0][2] + Q[1][2]*Q[1][2] + Q[2][2]*Q[2][2]);
630  Q[0][2] /= R[2][2];
631  Q[1][2] /= R[2][2];
632  Q[2][2] /= R[2][2];
633  return;
634  }
double sqrt(double d)
Definition: double.h:73
rational * A
Definition: vinci_lass.c:67
void timesInvA ( Matrix3D B,
const Matrix3D A 
)
friend

$ B *= A^{-1} $

Definition at line 572 of file includeLinks/Matrix3D.hpp.

572  {
573 
574  Matrix3D Ainv;
575 
576  double inv_detA = 1 / ( det(A) );
577 
578  Ainv[0][0] = inv_detA*( A.v_[4]*A.v_[8]-A.v_[5]*A.v_[7] );
579  Ainv[0][1] = inv_detA*( A.v_[2]*A.v_[7]-A.v_[8]*A.v_[1] );
580  Ainv[0][2] = inv_detA*( A.v_[1]*A.v_[5]-A.v_[4]*A.v_[2] );
581 
582  Ainv[1][0] = inv_detA*( A.v_[5]*A.v_[6]-A.v_[8]*A.v_[3] );
583  Ainv[1][1] = inv_detA*( A.v_[0]*A.v_[8]-A.v_[6]*A.v_[2] );
584  Ainv[1][2] = inv_detA*( A.v_[2]*A.v_[3]-A.v_[5]*A.v_[0] );
585 
586  Ainv[2][0] = inv_detA*( A.v_[3]*A.v_[7]-A.v_[6]*A.v_[4] );
587  Ainv[2][1] = inv_detA*( A.v_[1]*A.v_[6]-A.v_[7]*A.v_[0] );
588  Ainv[2][2] = inv_detA*( A.v_[0]*A.v_[4]-A.v_[3]*A.v_[1] );
589 
590  B = B*Ainv;
591  }
Matrix3D()
Default constructor sets all entries to 0.
friend double det(const Matrix3D &A)
determinant of matrix A, det(A).
rational * A
Definition: vinci_lass.c:67
void timesInvA ( Matrix3D B,
const Matrix3D A 
)
friend

$ B *= A^{-1} $

Definition at line 572 of file includeLinks/Matrix3D.hpp.

572  {
573 
574  Matrix3D Ainv;
575 
576  double inv_detA = 1 / ( det(A) );
577 
578  Ainv[0][0] = inv_detA*( A.v_[4]*A.v_[8]-A.v_[5]*A.v_[7] );
579  Ainv[0][1] = inv_detA*( A.v_[2]*A.v_[7]-A.v_[8]*A.v_[1] );
580  Ainv[0][2] = inv_detA*( A.v_[1]*A.v_[5]-A.v_[4]*A.v_[2] );
581 
582  Ainv[1][0] = inv_detA*( A.v_[5]*A.v_[6]-A.v_[8]*A.v_[3] );
583  Ainv[1][1] = inv_detA*( A.v_[0]*A.v_[8]-A.v_[6]*A.v_[2] );
584  Ainv[1][2] = inv_detA*( A.v_[2]*A.v_[3]-A.v_[5]*A.v_[0] );
585 
586  Ainv[2][0] = inv_detA*( A.v_[3]*A.v_[7]-A.v_[6]*A.v_[4] );
587  Ainv[2][1] = inv_detA*( A.v_[1]*A.v_[6]-A.v_[7]*A.v_[0] );
588  Ainv[2][2] = inv_detA*( A.v_[0]*A.v_[4]-A.v_[3]*A.v_[1] );
589 
590  B = B*Ainv;
591  }
Matrix3D()
Default constructor sets all entries to 0.
friend double det(const Matrix3D &A)
determinant of matrix A, det(A).
rational * A
Definition: vinci_lass.c:67
Matrix3D transpose ( const Matrix3D A)
friend

Definition at line 335 of file includeLinks/Matrix3D.hpp.

336  {
337  Matrix3D S;
338  size_t i;
339  for (i=0; i<3; ++i) {
340  S[size_t(0)][i] = A[i][0];
341  S[size_t(1)][i] = A[i][1];
342  S[size_t(2)][i] = A[i][2];
343  }
344  return S;
345  }
Matrix3D()
Default constructor sets all entries to 0.
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79
Matrix3D transpose ( const Matrix3D A)
friend

Definition at line 335 of file includeLinks/Matrix3D.hpp.

336  {
337  Matrix3D S;
338  size_t i;
339  for (i=0; i<3; ++i) {
340  S[size_t(0)][i] = A[i][0];
341  S[size_t(1)][i] = A[i][1];
342  S[size_t(2)][i] = A[i][2];
343  }
344  return S;
345  }
Matrix3D()
Default constructor sets all entries to 0.
rational * A
Definition: vinci_lass.c:67
blockLoc i
Definition: read.cpp:79

Member Data Documentation


The documentation for this class was generated from the following files: