MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Mat3x3 Class Reference

#include <matvec3.h>

Collaboration diagram for Mat3x3:

Public Member Functions

 Mat3x3 (void)
 
 Mat3x3 (const doublereal &m11, const doublereal &m21, const doublereal &m31, const doublereal &m12, const doublereal &m22, const doublereal &m32, const doublereal &m13, const doublereal &m23, const doublereal &m33)
 
 Mat3x3 (const Mat3x3 &m)
 
 Mat3x3 (const Vec3 &v1, const Vec3 &v2, const Vec3 &v3)
 
 Mat3x3 (const doublereal *pd, integer iSize)
 
 Mat3x3 (const Mat3x3_Manip &Manip)
 
 Mat3x3 (const Mat3x3_Manip &Manip, const doublereal d)
 
 Mat3x3 (const Mat3x3_Manip &Manip, const Vec3 &v)
 
 Mat3x3 (const Mat3x3_Manip &Manip, const Vec3 &v1, const Vec3 &v2)
 
 Mat3x3 (const doublereal &d, const Vec3 &v)
 
 ~Mat3x3 (void)
 
const doublerealpGetMat (void) const
 
doublerealpGetMat (void)
 
void Put (unsigned short int iRow, unsigned short int iCol, const doublereal &dCoef)
 
const doublerealdGet (unsigned short int iRow, unsigned short int iCol) const
 
doublerealoperator() (unsigned short int iRow, unsigned short int iCol)
 
const doublerealoperator() (unsigned short int iRow, unsigned short int iCol) const
 
const Mat3x3Tens (const Vec3 &a, const Vec3 &b)
 
Mat3x3 Transpose (void) const
 
Vec3 Ax (void) const
 
doublereal Trace (void) const
 
Mat3x3 Symm (void) const
 
Mat3x3 Symm2 (void) const
 
const Mat3x3Symm (const Mat3x3 &m)
 
Mat3x3 Skew (void) const
 
const Mat3x3Skew (const Mat3x3 &m)
 
Vec3 GetVec (unsigned short int i) const
 
Vec3 GetCol (unsigned short int i) const
 
Vec3 GetRow (unsigned short int i) const
 
void PutVec (unsigned short int i, const Vec3 &v)
 
void AddVec (unsigned short int i, const Vec3 &v)
 
void SubVec (unsigned short int i, const Vec3 &v)
 
doublereal dDet (void) const
 
Mat3x3 Inv (const doublereal &ddet) const
 
Mat3x3 Inv (void) const
 
Vec3 Solve (const Vec3 &v) const
 
Vec3 Solve (const doublereal &d, const Vec3 &v) const
 
Vec3 LDLSolve (const Vec3 &v) const
 
bool EigSym (Vec3 &EigenValues) const
 
bool EigSym (Vec3 &EigenValues, Mat3x3 &EigenVectors) const
 
void GetFrom (const doublereal *pd, integer iSize)
 
void AddTo (doublereal *pd, integer iNRows) const
 
void PutTo (doublereal *pd, integer iNRows) const
 
Mat3x3operator= (const Mat3x3 &m)
 
Mat3x3 operator+ (const Mat3x3 &m) const
 
Mat3x3operator+= (const Mat3x3 &m)
 
Mat3x3 operator- (const Mat3x3 &m) const
 
Mat3x3operator-= (const Mat3x3 &m)
 
Mat3x3 operator* (const doublereal &d) const
 
Mat3x3operator*= (const doublereal &d)
 
Mat3x3 operator/ (const doublereal &d) const
 
Mat3x3operator/= (const doublereal &d)
 
Vec3 operator* (const Vec3 &v) const
 
bool IsNull (void) const
 
bool IsExactlySame (const Mat3x3 &m) const
 
bool IsSame (const Mat3x3 &m, const doublereal &dTol) const
 
bool IsSymmetric (void) const
 
bool IsSymmetric (const doublereal &dTol) const
 
bool IsDiag (void) const
 
bool IsDiag (const doublereal &dTol) const
 
Mat3x3 operator* (const Mat3x3 &m) const
 
Mat3x3 MulMT (const Mat3x3 &m) const
 
Vec3 MulTV (const Vec3 &v) const
 
Mat3x3 MulTM (const Mat3x3 &m) const
 
Mat3x3 MulTMT (const Mat3x3 &m) const
 
Mat3x3 MulVCross (const Vec3 &v) const
 
Mat3x3 MulTVCross (const Vec3 &v) const
 
doublereal Tr (void) const
 
void Reset (void)
 
std::ostream & Write (std::ostream &out, const char *sFill=" ", const char *sFill2=NULL) const
 

Protected Attributes

doublereal pdMat [9]
 

Friends

class Vec3
 
class SparseSubMatrixHandler
 
class Mat3x3_Manip
 
class Mat3xN
 
class MatNx3
 

Detailed Description

Definition at line 550 of file matvec3.h.

Constructor & Destructor Documentation

Mat3x3::Mat3x3 ( void  )
inline

Definition at line 568 of file matvec3.h.

References NO_OP.

Referenced by Inv(), MulMT(), MulTM(), MulTMT(), MulTVCross(), MulVCross(), operator*(), operator+(), operator-(), operator/(), Skew(), Symm(), Symm2(), and Transpose().

568  {
569  NO_OP;
570  };
#define NO_OP
Definition: myassert.h:74
Mat3x3::Mat3x3 ( const doublereal m11,
const doublereal m21,
const doublereal m31,
const doublereal m12,
const doublereal m22,
const doublereal m32,
const doublereal m13,
const doublereal m23,
const doublereal m33 
)
inline

Definition at line 581 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

583  {
584  pdMat[M11] = m11;
585  pdMat[M21] = m21;
586  pdMat[M31] = m31;
587  pdMat[M12] = m12;
588  pdMat[M22] = m22;
589  pdMat[M32] = m32;
590  pdMat[M13] = m13;
591  pdMat[M23] = m23;
592  pdMat[M33] = m33;
593  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3::Mat3x3 ( const Mat3x3 m)
inline

Definition at line 598 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

598  {
599  pdMat[M11] = m.pdMat[M11];
600  pdMat[M21] = m.pdMat[M21];
601  pdMat[M31] = m.pdMat[M31];
602  pdMat[M12] = m.pdMat[M12];
603  pdMat[M22] = m.pdMat[M22];
604  pdMat[M32] = m.pdMat[M32];
605  pdMat[M13] = m.pdMat[M13];
606  pdMat[M23] = m.pdMat[M23];
607  pdMat[M33] = m.pdMat[M33];
608  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3::Mat3x3 ( const Vec3 v1,
const Vec3 v2,
const Vec3 v3 
)
inline

Definition at line 653 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, pdMat, Vec3::pdVec, V1, V2, and V3.

653  {
654  pdMat[M11] = v1.pdVec[V1];
655  pdMat[M21] = v1.pdVec[V2];
656  pdMat[M31] = v1.pdVec[V3];
657 
658  pdMat[M12] = v2.pdVec[V1];
659  pdMat[M22] = v2.pdVec[V2];
660  pdMat[M32] = v2.pdVec[V3];
661 
662  pdMat[M13] = v3.pdVec[V1];
663  pdMat[M23] = v3.pdVec[V2];
664  pdMat[M33] = v3.pdVec[V3];
665  };
Definition: matvec3.h:59
Definition: matvec3.h:50
doublereal pdVec[3]
Definition: matvec3.h:109
Definition: matvec3.h:58
Definition: matvec3.h:51
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3::Mat3x3 ( const doublereal pd,
integer  iSize 
)
inline

Definition at line 672 of file matvec3.h.

References ASSERT, and GetFrom().

672  {
673  ASSERT(pd != NULL);
674  GetFrom(pd, iSize);
675  };
#define ASSERT(expression)
Definition: colamd.c:977
void GetFrom(const doublereal *pd, integer iSize)
Definition: matvec3.h:976

Here is the call graph for this function:

Mat3x3::Mat3x3 ( const Mat3x3_Manip Manip)
inline

Definition at line 682 of file matvec3.h.

References Mat3x3_Manip::Manipulate().

682  {
683  Manip.Manipulate(*this);
684  };
virtual void Manipulate(Mat3x3 &m) const
Definition: matvec3.h:517

Here is the call graph for this function:

Mat3x3::Mat3x3 ( const Mat3x3_Manip Manip,
const doublereal  d 
)
inline

Definition at line 691 of file matvec3.h.

References Mat3x3_Manip::Manipulate().

691  {
692  Manip.Manipulate(*this, d);
693  };
virtual void Manipulate(Mat3x3 &m) const
Definition: matvec3.h:517

Here is the call graph for this function:

Mat3x3::Mat3x3 ( const Mat3x3_Manip Manip,
const Vec3 v 
)
inline

Definition at line 700 of file matvec3.h.

References Mat3x3_Manip::Manipulate().

700  {
701  Manip.Manipulate(*this, v);
702  };
virtual void Manipulate(Mat3x3 &m) const
Definition: matvec3.h:517

Here is the call graph for this function:

Mat3x3::Mat3x3 ( const Mat3x3_Manip Manip,
const Vec3 v1,
const Vec3 v2 
)
inline

Definition at line 709 of file matvec3.h.

References Mat3x3_Manip::Manipulate().

709  {
710  Manip.Manipulate(*this, v1, v2);
711  };
virtual void Manipulate(Mat3x3 &m) const
Definition: matvec3.h:517

Here is the call graph for this function:

Mat3x3::Mat3x3 ( const doublereal d,
const Vec3 v 
)
inline

Definition at line 718 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, pdMat, Vec3::pdVec, V1, V2, and V3.

718  {
719  pdMat[M11] = d;
720  pdMat[M21] = v.pdVec[V3];
721  pdMat[M31] = -v.pdVec[V2];
722  pdMat[M12] = -v.pdVec[V3];
723  pdMat[M22] = d;
724  pdMat[M32] = v.pdVec[V1];
725  pdMat[M13] = v.pdVec[V2];
726  pdMat[M23] = -v.pdVec[V1];
727  pdMat[M33] = d;
728  };
Definition: matvec3.h:59
Definition: matvec3.h:50
doublereal pdVec[3]
Definition: matvec3.h:109
Definition: matvec3.h:58
Definition: matvec3.h:51
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3::~Mat3x3 ( void  )
inline

Definition at line 733 of file matvec3.h.

References NO_OP.

733  {
734  NO_OP;
735  };
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void Mat3x3::AddTo ( doublereal pd,
integer  iNRows 
) const
inline

Definition at line 1002 of file matvec3.h.

References ASSERT, M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

1002  {
1003  ASSERT(pd != NULL);
1004  ASSERT(iNRows >= 3);
1005 
1006  doublereal* pdTo = pd;
1007 
1008  pdTo[0] += pdMat[M11];
1009  pdTo[1] += pdMat[M21];
1010  pdTo[2] += pdMat[M31];
1011 
1012  pdTo += iNRows;
1013  pdTo[0] += pdMat[M12];
1014  pdTo[1] += pdMat[M22];
1015  pdTo[2] += pdMat[M32];
1016 
1017  pdTo += iNRows;
1018  pdTo[0] += pdMat[M13];
1019  pdTo[1] += pdMat[M23];
1020  pdTo[2] += pdMat[M33];
1021  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
double doublereal
Definition: colamd.c:52
void Mat3x3::AddVec ( unsigned short int  i,
const Vec3 v 
)
inline

Definition at line 927 of file matvec3.h.

References ASSERT, pdMat, Vec3::pdVec, V1, V2, and V3.

927  {
928  ASSERT(i >= 1 && i <= 3);
929 
930  i--; i = 3*i;
931  pdMat[i++] += v.pdVec[V1];
932  pdMat[i++] += v.pdVec[V2];
933  pdMat[i] += v.pdVec[V3];
934  };
Definition: matvec3.h:50
doublereal pdVec[3]
Definition: matvec3.h:109
Definition: matvec3.h:51
#define ASSERT(expression)
Definition: colamd.c:977
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Vec3 Mat3x3::Ax ( void  ) const
inline

Definition at line 827 of file matvec3.h.

References M12, M13, M21, M23, M31, M32, pdMat, and Vec3.

Referenced by MatExp::Ax(), CGR_Rot::Param_Manip::Manipulate(), MatR2gparam(), MatR2LinParam(), Skew(), and RotManip::VecRot().

827  {
828  /* assumendo che sia una matrice di rotazione ?!? */
829  return Vec3(
830  .5*(pdMat[M32]-pdMat[M23]),
831  .5*(pdMat[M13]-pdMat[M31]),
832  .5*(pdMat[M21]-pdMat[M12])
833  );
834  };
Definition: matvec3.h:58
Definition: matvec3.h:56
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
friend class Vec3
Definition: matvec3.h:551
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
doublereal Mat3x3::dDet ( void  ) const

Definition at line 122 of file matvec3.cc.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

Referenced by EigSym(), Inv(), main(), and Solve().

123 {
124  doublereal* p = (doublereal*)pdMat;
125 
126  return p[M11]*(p[M22]*p[M33]-p[M23]*p[M32])
127  +p[M12]*(p[M23]*p[M31]-p[M21]*p[M33])
128  +p[M13]*(p[M21]*p[M32]-p[M22]*p[M31]);
129 }
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
double doublereal
Definition: colamd.c:52
const doublereal& Mat3x3::dGet ( unsigned short int  iRow,
unsigned short int  iCol 
) const
inline

Definition at line 770 of file matvec3.h.

References ASSERT, and pdMat.

Referenced by Mat6x6::dGet(), MatR2EulerParams(), operator<<(), MatExp::Write(), and Mat6x6::Write().

771  {
772  ASSERT(iRow >= 1 && iRow <= 3);
773  ASSERT(iCol >= 1 && iCol <= 3);
774  return pdMat[--iRow+3*--iCol];
775  };
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
bool Mat3x3::EigSym ( Vec3 EigenValues) const

Definition at line 255 of file matvec3.cc.

Referenced by Inertia::Collect_int().

256 {
257  Mat3x3 EigenVectors;
258 
259  return EigSym(EigenValues, EigenVectors);
260 }
bool EigSym(Vec3 &EigenValues) const
Definition: matvec3.cc:255
bool Mat3x3::EigSym ( Vec3 EigenValues,
Mat3x3 EigenVectors 
) const

Definition at line 279 of file matvec3.cc.

References grad::acos(), copysign(), grad::cos(), Vec3::Cross(), dDet(), Eye3, grad::fabs(), GetVec(), IsDiag(), IsSymmetric(), M11, M22, M33, M_PI, Vec3::Norm(), pdMat, PutVec(), grad::sqrt(), Trace(), and Vec3.

280 {
281  // From:
282  // W.M. Scherzinger, C.R. Dohrmann,
283  // `A robust algorithm for finding the eigenvalues and eigenvectors
284  // of 3x3 symmetric matrices'
285  // Comput. Methods Appl. Mech. Engrg. 2008
286  // doi:10.1016/j.cma.2008.03.031
287 
288  if (!IsSymmetric(std::numeric_limits<doublereal>::epsilon())) {
289  return false;
290  }
291 
292  if (IsDiag(std::numeric_limits<doublereal>::epsilon())) {
293  EigenVectors = Eye3;
294  EigenValues = Vec3(pdMat[M11], pdMat[M22], pdMat[M33]);
295 
296  return true;
297  }
298 
299  Mat3x3 AA = *this;
300 
301  doublereal trA_3 = Trace()/3;
302 
303  AA(1, 1) -= trA_3;
304  AA(2, 2) -= trA_3;
305  AA(3, 3) -= trA_3;
306 
307  doublereal J2 = (AA*AA).Trace()/2;
308 
309  if (fabs(J2) < std::numeric_limits<doublereal>::epsilon()) {
310  EigenVectors = Eye3;
311  EigenValues = Vec3(pdMat[M11], pdMat[M22], pdMat[M33]);
312 
313  return true;
314  }
315 
316  doublereal J2_dmy = sqrt(J2/3.);
317  doublereal J3 = AA.dDet();
318  doublereal dmy = J3/2/(J2_dmy*J2_dmy*J2_dmy);
319  doublereal alpha;
320 
321  // NOTE: we want real eigenvalues; this requires the matrix to be
322  // positive definite or semi-definite
323  if (dmy < -1.) {
324  dmy = -1.;
325  alpha = M_PI;
326 
327  } else if (dmy > 1.) {
328  dmy = 1.;
329  alpha = 0.;
330 
331  } else {
332  alpha = acos(dmy)/3;
333  }
334 
335  int idx1;
336  if (alpha < M_PI/6.) {
337  idx1 = 1;
338 
339  } else {
340  idx1 = 3;
341  }
342 
343  doublereal eta1 = 2*J2_dmy*cos(alpha + 2./3.*M_PI*(idx1 - 1));
344  EigenValues(idx1) = eta1 + trA_3;
345 
346  // NOTE: there's a typo in the original paper;
347  // AA must be used instead of A
348  Vec3 r1 = AA.GetVec(1);
349  r1(1) -= eta1;
350  Vec3 r2 = AA.GetVec(2);
351  r2(2) -= eta1;
352  Vec3 r3 = AA.GetVec(3);
353  r3(3) -= eta1;
354 
355  doublereal
356  nr1 = r1.Norm(),
357  nr2 = r2.Norm(),
358  nr3 = r3.Norm();
359 
360  int irmax = 1;
361  doublereal nrmax = nr1;
362 
363  if (nr2 > nrmax) {
364  irmax = 2;
365  nrmax = nr2;
366  }
367 
368  if (nr3 > nrmax) {
369  irmax = 3;
370  nrmax = nr3;
371  }
372 
373  if (irmax == 2) {
374  Vec3 rtmp = r2;
375  r2 = r1;
376  nr2 = nr1;
377  r1 = rtmp;
378  nr1 = nrmax;
379 
380  } else if (irmax == 3) {
381  Vec3 rtmp = r3;
382  r3 = r1;
383  nr3 = nr1;
384  r1 = rtmp;
385  nr1 = nrmax;
386  }
387 
388  Vec3 s1, s2;
389  s1 = r1/nr1;
390  Vec3 t2 = r2 - s1*(s1*r2);
391  doublereal nt2 = t2.Norm();
392  Vec3 t3 = r3 - s1*(s1*r3);
393  doublereal nt3 = t3.Norm();
394 
395  if (nt2 > nt3) {
396  s2 = t2/nt2;
397 
398  } else {
399  s2 = t3/nt3;
400  }
401 
402  Vec3 v1(s1.Cross(s2));
403  EigenVectors.PutVec(idx1, v1);
404 
405  Mat3x3 AAA(eta1, 0., 0.,
406  0., s1*(AA*s1), s2*(AA*s1),
407  0., s1*(AA*s2), s2*(AA*s2));
408 
409  int idx2 = idx1%3 + 1;
410  int idx3 = (idx1 + 1)%3 + 1;
411 
412  doublereal AAA22p33 = AAA(2, 2) + AAA(3, 3);
413  doublereal AAA22m33 = AAA(2, 2) - AAA(3, 3);
414  doublereal eta2 = (AAA22p33 - copysign(1., AAA22m33)*sqrt(AAA22m33*AAA22m33 + 4*AAA(2, 3)*AAA(3, 2)))/2;
415  doublereal eta3 = AAA22p33 - eta2;
416 
417  EigenValues(idx2) = eta2 + trA_3;
418  EigenValues(idx3) = eta3 + trA_3;
419 
420  Vec3 u1 = AA*s1 - s1*eta2;
421  doublereal nu1 = u1.Norm();
422  Vec3 u2 = AA*s2 - s2*eta2;
423  doublereal nu2 = u2.Norm();
424 
425  Vec3 w1;
426  if (nu1 > nu2) {
427  w1 = u1/nu1;
428 
429  } else {
430  w1 = u2/nu2;
431  }
432 
433  Vec3 v2(w1.Cross(v1));
434  EigenVectors.PutVec(idx2, v2);
435  EigenVectors.PutVec(idx3, v1.Cross(v2));
436 
437  return true;
438 }
#define M_PI
Definition: gradienttest.cc:67
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
doublereal Norm(void) const
Definition: matvec3.h:263
Definition: matvec3.h:59
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
Definition: matvec3.h:55
void PutVec(unsigned short int i, const Vec3 &v)
Definition: matvec3.h:918
doublereal Trace(void) const
Definition: matvec3.h:836
doublereal dDet(void) const
Definition: matvec3.cc:122
Definition: matvec3.h:63
bool IsDiag(void) const
Definition: matvec3.h:1284
doublereal copysign(doublereal x, doublereal y)
Definition: gradient.h:97
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
friend class Vec3
Definition: matvec3.h:551
bool IsSymmetric(void) const
Definition: matvec3.h:1260
doublereal pdMat[9]
Definition: matvec3.h:559
GradientExpression< UnaryExpr< FuncAcos, Expr > > acos(const GradientExpression< Expr > &u)
Definition: gradient.h:2984
GradientExpression< UnaryExpr< FuncCos, Expr > > cos(const GradientExpression< Expr > &u)
Definition: gradient.h:2978
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

void Mat3x3::GetFrom ( const doublereal pd,
integer  iSize 
)
inline

Definition at line 976 of file matvec3.h.

References ASSERT, M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

Referenced by Mat3x3().

976  {
977  ASSERT(pd != NULL);
978  ASSERT(iSize >= 3);
979 
980  doublereal* pdFrom = (doublereal*)pd;
981  pdMat[M11] = pdFrom[0];
982  pdMat[M21] = pdFrom[1];
983  pdMat[M31] = pdFrom[2];
984 
985  pdFrom += iSize;
986  pdMat[M12] = pdFrom[0];
987  pdMat[M22] = pdFrom[1];
988  pdMat[M32] = pdFrom[2];
989 
990  pdFrom += iSize;
991  pdMat[M13] = pdFrom[0];
992  pdMat[M23] = pdFrom[1];
993  pdMat[M33] = pdFrom[2];
994  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
double doublereal
Definition: colamd.c:52
Vec3 Mat3x3::GetRow ( unsigned short int  i) const
inline

Definition at line 912 of file matvec3.h.

References ASSERT, pdMat, and Vec3.

Referenced by HydrodynamicPlainBearing::AssJac().

912  {
913  ASSERT(i >= 1 && i <= 3);
914  --i;
915  return Vec3(pdMat[i], pdMat[3 + i], pdMat[6 + i]);
916  };
#define ASSERT(expression)
Definition: colamd.c:977
friend class Vec3
Definition: matvec3.h:551
doublereal pdMat[9]
Definition: matvec3.h:559
Vec3 Mat3x3::GetVec ( unsigned short int  i) const
inline

Definition at line 893 of file matvec3.h.

References ASSERT, pdMat, and Vec3.

Referenced by ViscousAxialJoint::AfterPredict(), UniversalHingeJoint::AssJac(), Brake::AssJac(), PlaneHingeJoint::AssJac(), BeamSliderJoint::AssJac(), TotalJoint::AssJac(), UniversalRotationJoint::AssJac(), UniversalPinJoint::AssJac(), PlaneRotationJoint::AssJac(), TotalPinJoint::AssJac(), AxialRotationJoint::AssJac(), PlanePinJoint::AssJac(), InLineJoint::AssRes(), UniversalHingeJoint::AssRes(), Brake::AssRes(), PlaneHingeJoint::AssRes(), BeamSliderJoint::AssRes(), InLineWithOffsetJoint::AssRes(), UniversalRotationJoint::AssRes(), AeroDynModule::AssRes(), UniversalPinJoint::AssRes(), PlaneRotationJoint::AssRes(), AxialRotationJoint::AssRes(), CyclocopterUniform1D::AssRes(), PlanePinJoint::AssRes(), ViscousAxialJoint::AssVec(), TotalEquation::dGetPrivData(), TotalJoint::dGetPrivData(), TotalReaction::dGetPrivData(), StructNode::dGetPrivData(), EigSym(), getrotorparams(), ScalarFuncWindProfile::GetVelocity(), PowerLawWindProfile::GetVelocity(), LogarithmicWindProfile::GetVelocity(), Rotor::Init(), UniversalHingeJoint::InitialAssJac(), PrismaticJoint::InitialAssJac(), PlaneHingeJoint::InitialAssJac(), UniversalRotationJoint::InitialAssJac(), UniversalPinJoint::InitialAssJac(), PlaneRotationJoint::InitialAssJac(), Modal::InitialAssJac(), ViscousAxialJoint::InitialAssJac(), TotalPinJoint::InitialAssJac(), ViscoElasticAxialJoint::InitialAssJac(), AxialRotationJoint::InitialAssJac(), PlanePinJoint::InitialAssJac(), InLineJoint::InitialAssRes(), UniversalHingeJoint::InitialAssRes(), PrismaticJoint::InitialAssRes(), PlaneHingeJoint::InitialAssRes(), InLineWithOffsetJoint::InitialAssRes(), UniversalRotationJoint::InitialAssRes(), UniversalPinJoint::InitialAssRes(), PlaneRotationJoint::InitialAssRes(), Modal::InitialAssRes(), ViscousAxialJoint::InitialAssRes(), AxialRotationJoint::InitialAssRes(), PlanePinJoint::InitialAssRes(), Rotor::InitParam(), UniversalPinJoint::Output(), ReadModal(), PrismaticJoint::Restart(), UniversalHingeJoint::Restart(), SphericalHingeJoint::Restart(), GimbalRotationJoint::Restart(), ViscousBody::Restart(), DriveHingeJoint::Restart(), DeformableAxialJoint::Restart(), Brake::Restart(), PlaneHingeJoint::Restart(), DeformableDispJoint::Restart(), TotalEquation::Restart(), TotalJoint::Restart(), DeformableHingeJoint::Restart(), DeformableJoint::Restart(), UniversalRotationJoint::Restart(), PlaneRotationJoint::Restart(), UniversalPinJoint::Restart(), AerodynamicBody::Restart(), TotalReaction::Restart(), TotalPinJoint::Restart(), AerodynamicBeam::Restart(), AxialRotationJoint::Restart(), AerodynamicBeam2::Restart(), PlanePinJoint::Restart(), StructNode::Restart(), HBeam::Restart_(), Beam2::Restart_(), Beam::Restart_(), and AircraftInstruments::Update().

893  {
894  ASSERT(i >= 1 && i <= 3);
895  return Vec3(pdMat+3*--i);
896  };
#define ASSERT(expression)
Definition: colamd.c:977
friend class Vec3
Definition: matvec3.h:551
doublereal pdMat[9]
Definition: matvec3.h:559
Mat3x3 Mat3x3::Inv ( const doublereal ddet) const

Definition at line 133 of file matvec3.cc.

References ASSERT, grad::fabs(), M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

Referenced by main().

134 {
135  ASSERT(fabs(d) > std::numeric_limits<doublereal>::epsilon());
136 
137  doublereal* p = (doublereal*)pdMat;
138 
139  return Mat3x3((p[M22]*p[M33]-p[M23]*p[M32])/d,
140  (p[M23]*p[M31]-p[M21]*p[M33])/d,
141  (p[M21]*p[M32]-p[M22]*p[M31])/d,
142  (p[M13]*p[M32]-p[M12]*p[M33])/d,
143  (p[M11]*p[M33]-p[M13]*p[M31])/d,
144  (p[M12]*p[M31]-p[M11]*p[M32])/d,
145  (p[M12]*p[M23]-p[M13]*p[M22])/d,
146  (p[M13]*p[M21]-p[M11]*p[M23])/d,
147  (p[M11]*p[M22]-p[M12]*p[M21])/d);
148 }
Definition: matvec3.h:59
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
double doublereal
Definition: colamd.c:52
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

Mat3x3 Mat3x3::Inv ( void  ) const

Definition at line 152 of file matvec3.cc.

References dDet(), grad::fabs(), and MBDYN_EXCEPT_ARGS.

153 {
154  doublereal d = dDet();
155  if (fabs(d) < std::numeric_limits<doublereal>::epsilon()) {
156  silent_cerr("matrix is singular" << std::endl);
158  }
159 
160  return Inv(d);
161 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Mat3x3 Inv(void) const
Definition: matvec3.cc:152
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
doublereal dDet(void) const
Definition: matvec3.cc:122
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

bool Mat3x3::IsDiag ( void  ) const
inline

Definition at line 1284 of file matvec3.h.

References M12, M13, M21, M23, M31, M32, and pdMat.

Referenced by EigSym().

1284  {
1285  if (pdMat[M12] != 0.
1286  || pdMat[M21] != 0.
1287  || pdMat[M13] != 0.
1288  || pdMat[M31] != 0.
1289  || pdMat[M23] != 0.
1290  || pdMat[M32] != 0.)
1291  {
1292  return false;
1293  }
1294 
1295  return true;
1296  };
Definition: matvec3.h:58
Definition: matvec3.h:56
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
bool Mat3x3::IsDiag ( const doublereal dTol) const
inline

Definition at line 1298 of file matvec3.h.

References ASSERT, grad::fabs(), M12, M13, M21, M23, M31, M32, and pdMat.

1298  {
1299  ASSERT(dTol > 0.);
1300 
1301  if (fabs(pdMat[M12]) > dTol
1302  || fabs(pdMat[M21]) > dTol
1303  || fabs(pdMat[M13]) > dTol
1304  || fabs(pdMat[M31]) > dTol
1305  || fabs(pdMat[M23]) > dTol
1306  || fabs(pdMat[M32]) > dTol)
1307  {
1308  return false;
1309  }
1310 
1311  return true;
1312  };
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
Definition: matvec3.h:58
Definition: matvec3.h:56
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60

Here is the call graph for this function:

bool Mat3x3::IsExactlySame ( const Mat3x3 m) const
inline

Definition at line 1237 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

Referenced by DataManager::ReadControl().

1237  {
1238  return (pdMat[M11] == m.pdMat[M11]
1239  && pdMat[M12] == m.pdMat[M12]
1240  && pdMat[M13] == m.pdMat[M13]
1241  && pdMat[M21] == m.pdMat[M21]
1242  && pdMat[M22] == m.pdMat[M22]
1243  && pdMat[M23] == m.pdMat[M23]
1244  && pdMat[M31] == m.pdMat[M31]
1245  && pdMat[M32] == m.pdMat[M32]
1246  && pdMat[M33] == m.pdMat[M33]);
1247  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
bool Mat3x3::IsNull ( void  ) const
inline

Definition at line 1231 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

1231  {
1232  return (pdMat[M11] == 0. && pdMat[M12] == 0. && pdMat[M13] == 0.
1233  && pdMat[M21] == 0. && pdMat[M22] == 0. && pdMat[M23] == 0.
1234  && pdMat[M31] == 0. && pdMat[M32] == 0. && pdMat[M33] == 0.);
1235  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
bool Mat3x3::IsSame ( const Mat3x3 m,
const doublereal dTol 
) const
inline

Definition at line 1249 of file matvec3.h.

References pdMat, and grad::sqrt().

Referenced by MBDynParser::GetMatR2vec(), ReadElectric(), and ReferenceFrame::ReferenceFrame().

1249  {
1250  doublereal d2 = 0.;
1251 
1252  for (int i = 0; i < 9; i++) {
1253  doublereal d = pdMat[i] - m.pdMat[i];
1254  d2 += d*d;
1255  }
1256 
1257  return sqrt(d2) <= dTol;
1258  };
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
doublereal pdMat[9]
Definition: matvec3.h:559
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

bool Mat3x3::IsSymmetric ( void  ) const
inline

Definition at line 1260 of file matvec3.h.

References M12, M13, M21, M23, M31, M32, and pdMat.

Referenced by CenterOfMass::Collect_int(), AutomaticStructElem::ComputeAccelerations(), and EigSym().

1260  {
1261  if (pdMat[M12] != pdMat[M21]
1262  || pdMat[M13] != pdMat[M31]
1263  || pdMat[M23] != pdMat[M32])
1264  {
1265  return false;
1266  }
1267 
1268  return true;
1269  };
Definition: matvec3.h:58
Definition: matvec3.h:56
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
bool Mat3x3::IsSymmetric ( const doublereal dTol) const
inline

Definition at line 1271 of file matvec3.h.

References ASSERT, grad::fabs(), M12, M13, M21, M23, M31, M32, and pdMat.

1271  {
1272  ASSERT(dTol > 0.);
1273 
1274  if (fabs(pdMat[M12] - pdMat[M21]) > dTol
1275  || fabs(pdMat[M13] - pdMat[M31]) > dTol
1276  || fabs(pdMat[M23] - pdMat[M32]) > dTol)
1277  {
1278  return false;
1279  }
1280 
1281  return true;
1282  };
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
Definition: matvec3.h:58
Definition: matvec3.h:56
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60

Here is the call graph for this function:

Vec3 Mat3x3::LDLSolve ( const Vec3 v) const

Definition at line 199 of file matvec3.cc.

References ASSERT, M11, M12, M13, M21, M22, M23, M31, M32, M33, pdMat, and Vec3.

Referenced by CenterOfMass::Collect_int(), AutomaticStructElem::ComputeAccelerations(), main(), and testSolve().

200 {
201  doublereal d1, d2, d3, l21 = 0., l31 = 0., l32 = 0.;
202 
203  d1 = pdMat[M11];
204  ASSERT(d1 >= 0.);
205  if (d1 > std::numeric_limits<doublereal>::epsilon()) {
206  l21 = (pdMat[M21] + pdMat[M12])/(2.*d1);
207  l31 = (pdMat[M31] + pdMat[M13])/(2.*d1);
208  }
209 
210  d2 = pdMat[M22] - l21*l21*d1;
211  ASSERT(d2 >= 0.);
212  if (d2 > std::numeric_limits<doublereal>::epsilon()) {
213  l32 = ((pdMat[M32] + pdMat[M23])/2. - l21*l31*d1)/d2;
214  }
215 
216  d3 = pdMat[M33] - l31*l31*d1 - l32*l32*d2;
217 
218  // L * D * L^T * x = v
219  // L^T * x = y
220  // D * y = z
221  // L * z = v
222 
223  // z = L^-1 * v
224  doublereal z1 = v(1);
225  doublereal z2 = v(2) - l21*z1;
226  doublereal z3 = v(3) - l31*z1 - l32*z2;
227 
228  // y = D^-1 * z
229  if (d1 > std::numeric_limits<doublereal>::epsilon()) {
230  z1 /= d1;
231  } else {
232  z1 = 0.;
233  }
234 
235  if (d2 > std::numeric_limits<doublereal>::epsilon()) {
236  z2 /= d2;
237  } else {
238  z2 = 0.;
239  }
240 
241  if (d3 > std::numeric_limits<doublereal>::epsilon()) {
242  z3 /= d3;
243  } else {
244  z3 = 0.;
245  }
246 
247  // x = L^-T * y
248  z2 -= l32*z3;
249  z1 -= l21*z2 + l31*z3;
250 
251  return Vec3(z1, z2, z3);
252 }
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
friend class Vec3
Definition: matvec3.h:551
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
double doublereal
Definition: colamd.c:52
Mat3x3 Mat3x3::MulMT ( const Mat3x3 m) const

multiply by another matrix, transposed: this * m^T

Definition at line 444 of file matvec3.cc.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

Referenced by ElasticHingeJoint::AfterPredict(), StructDispNode::AfterPredict(), ElasticHingeJointInv::AfterPredict(), Body::AfterPredict(), ViscoElasticHingeJoint::AfterPredict(), ViscoElasticHingeJointInv::AfterPredict(), StructNode::AfterPredict(), DataManager::AssConstrRes(), Shell4EAS::AssJac(), AerodynamicBeam::AssJac(), ElasticAxialJoint::AssMat(), ElasticHingeJoint::AssMat(), LoadIncNorm::AssRes(), TotalJoint::AssRes(), ClampJoint::AssRes(), DynamicBody::AssRes(), TotalPinJoint::AssRes(), ModalBody::AssRes(), StaticBody::AssRes(), StructNode::BeforePredict(), Inertia::Collect_int(), Shell4EAS::ComputeIPCurvature(), Shell4EASANS::ComputeIPCurvature(), Modal::GetJ_int(), Body::GetJ_int(), ClampJoint::InitialAssRes(), DynamicBody::InitialAssRes(), TotalPinJoint::InitialAssRes(), DataManager::InitialJointAssembly(), Shell4EAS::InterpolateOrientation(), Shell4EASANS::InterpolateOrientation(), main(), MultMRt(), MultRMRt(), MultRMRtGammam1(), ReadBody(), DynamicBody::SetValue(), InvAngularConstitutiveLaw::Update(), and RelFrameDummyStructNode::Update_int().

445 {
446  return Mat3x3(
447  pdMat[M11]*m.pdMat[M11]
448  + pdMat[M12]*m.pdMat[M12]
449  + pdMat[M13]*m.pdMat[M13],
450  pdMat[M21]*m.pdMat[M11]
451  + pdMat[M22]*m.pdMat[M12]
452  + pdMat[M23]*m.pdMat[M13],
453  pdMat[M31]*m.pdMat[M11]
454  + pdMat[M32]*m.pdMat[M12]
455  + pdMat[M33]*m.pdMat[M13],
456 
457  pdMat[M11]*m.pdMat[M21]
458  + pdMat[M12]*m.pdMat[M22]
459  + pdMat[M13]*m.pdMat[M23],
460  pdMat[M21]*m.pdMat[M21]
461  + pdMat[M22]*m.pdMat[M22]
462  + pdMat[M23]*m.pdMat[M23],
463  pdMat[M31]*m.pdMat[M21]
464  + pdMat[M32]*m.pdMat[M22]
465  + pdMat[M33]*m.pdMat[M23],
466 
467  pdMat[M11]*m.pdMat[M31]
468  + pdMat[M12]*m.pdMat[M32]
469  + pdMat[M13]*m.pdMat[M33],
470  pdMat[M21]*m.pdMat[M31]
471  + pdMat[M22]*m.pdMat[M32]
472  + pdMat[M23]*m.pdMat[M33],
473  pdMat[M31]*m.pdMat[M31]
474  + pdMat[M32]*m.pdMat[M32]
475  + pdMat[M33]*m.pdMat[M33]);
476 }
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

Mat3x3 Mat3x3::MulTM ( const Mat3x3 m) const

multiply self transposed by another matrix: this^T * m

Definition at line 500 of file matvec3.cc.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

Referenced by PlanePinJoint::AfterConvergence(), ElasticJoint::AfterPredict(), ElasticJointInv::AfterPredict(), ViscoElasticJoint::AfterPredict(), StructNode::AfterPredict(), anglerel(), HydrodynamicPlainBearing::AssJac(), Motor::AssJac(), AerodynamicBody::AssJac(), Shell4EAS::AssJac(), AerodynamicBeam::AssJac(), AerodynamicBeam2::AssJac(), TotalEquation::AssRes(), TotalJoint::AssRes(), ElasticJoint::AssVec(), AerodynamicBeam::AssVec(), ViscoElasticJoint::AssVec(), StructDispNode::BeforePredict(), StructNode::BeforePredict(), PlanePinJoint::dGetPrivData(), MBDynParser::GetMatR2vec(), MBDynParser::GetMatRel(), MBDynParser::GetRotRel(), TotalEquation::InitialAssRes(), TotalJoint::InitialAssRes(), ModalMappingExt::ModalMappingExt(), DeformableJoint::Output(), StructExtForce::Output(), TotalEquation::Output(), TotalJoint::Output(), TotalReaction::Output(), PlanePinJoint::Output(), Inertia::Output_int(), ReadBeam(), ReadBeam2(), ReferenceFrame::ReferenceFrame(), ModalMappingExt::Send(), StructExtForce::SendToFileDes(), StructExtForce::SendToStream(), StructMappingExtForce::SendToStream(), StructMembraneMappingExtForce::SendToStream(), PlaneHingeJoint::SetValue(), TotalEquation::SetValue(), TotalJoint::SetValue(), StructDispNode::SetValue(), PlaneRotationJoint::SetValue(), TotalReaction::SetValue(), TotalPinJoint::SetValue(), AxialRotationJoint::SetValue(), PlanePinJoint::SetValue(), StructNode::SetValue(), Shell4EAS::UpdateNodalAndAveragePosAndOrientation(), and Shell4EASANS::UpdateNodalAndAveragePosAndOrientation().

501 {
502  return Mat3x3(
503  pdMat[M11]*m.pdMat[M11]
504  + pdMat[M21]*m.pdMat[M21]
505  + pdMat[M31]*m.pdMat[M31],
506  pdMat[M12]*m.pdMat[M11]
507  + pdMat[M22]*m.pdMat[M21]
508  + pdMat[M32]*m.pdMat[M31],
509  pdMat[M13]*m.pdMat[M11]
510  + pdMat[M23]*m.pdMat[M21]
511  + pdMat[M33]*m.pdMat[M31],
512 
513  pdMat[M11]*m.pdMat[M12]
514  + pdMat[M21]*m.pdMat[M22]
515  + pdMat[M31]*m.pdMat[M32],
516  pdMat[M12]*m.pdMat[M12]
517  + pdMat[M22]*m.pdMat[M22]
518  + pdMat[M32]*m.pdMat[M32],
519  pdMat[M13]*m.pdMat[M12]
520  + pdMat[M23]*m.pdMat[M22]
521  + pdMat[M33]*m.pdMat[M32],
522 
523  pdMat[M11]*m.pdMat[M13]
524  + pdMat[M21]*m.pdMat[M23]
525  + pdMat[M31]*m.pdMat[M33],
526  pdMat[M12]*m.pdMat[M13]
527  + pdMat[M22]*m.pdMat[M23]
528  + pdMat[M32]*m.pdMat[M33],
529  pdMat[M13]*m.pdMat[M13]
530  + pdMat[M23]*m.pdMat[M23]
531  + pdMat[M33]*m.pdMat[M33]);
532 }
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

Mat3x3 Mat3x3::MulTMT ( const Mat3x3 m) const

multiply self transposed by another matrix, transposed: this^T * m^T

Definition at line 538 of file matvec3.cc.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

Referenced by Shell4EAS::AssJac().

539 {
540  return Mat3x3(
541  pdMat[M11]*m.pdMat[M11]
542  + pdMat[M21]*m.pdMat[M12]
543  + pdMat[M31]*m.pdMat[M13],
544  pdMat[M12]*m.pdMat[M11]
545  + pdMat[M22]*m.pdMat[M12]
546  + pdMat[M32]*m.pdMat[M13],
547  pdMat[M13]*m.pdMat[M11]
548  + pdMat[M23]*m.pdMat[M12]
549  + pdMat[M33]*m.pdMat[M13],
550 
551  pdMat[M11]*m.pdMat[M21]
552  + pdMat[M21]*m.pdMat[M22]
553  + pdMat[M31]*m.pdMat[M23],
554  pdMat[M12]*m.pdMat[M21]
555  + pdMat[M22]*m.pdMat[M22]
556  + pdMat[M32]*m.pdMat[M23],
557  pdMat[M13]*m.pdMat[M21]
558  + pdMat[M23]*m.pdMat[M22]
559  + pdMat[M33]*m.pdMat[M23],
560 
561  pdMat[M11]*m.pdMat[M31]
562  + pdMat[M21]*m.pdMat[M32]
563  + pdMat[M31]*m.pdMat[M33],
564  pdMat[M12]*m.pdMat[M31]
565  + pdMat[M22]*m.pdMat[M32]
566  + pdMat[M32]*m.pdMat[M33],
567  pdMat[M13]*m.pdMat[M31]
568  + pdMat[M23]*m.pdMat[M32]
569  + pdMat[M33]*m.pdMat[M33]);
570 }
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

Vec3 Mat3x3::MulTV ( const Vec3 v) const

multiply self transposed by a vector: this^T * v

Definition at line 482 of file matvec3.cc.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, pdMat, Vec3::pdVec, V1, V2, V3, and Vec3.

Referenced by AerodynamicModal::AerodynamicModal(), AeroDynModule::AeroDynModule(), ViscousBody::AfterPredict(), Beam2::AfterPredict(), ElasticJoint::AfterPredict(), ElasticJointInv::AfterPredict(), ViscoElasticBeam2::AfterPredict(), ViscousJoint::AfterPredict(), ViscousHingeJointInv::AfterPredict(), ViscoElasticJoint::AfterPredict(), ViscoElasticHingeJointInv::AfterPredict(), HydrodynamicPlainBearing::AssJac(), LoadIncNorm::AssJac(), AerodynamicBody::AssJac(), Shell4EAS::AssJac(), AerodynamicBeam::AssJac(), AerodynamicBeam2::AssJac(), ModalBody::AssMats(), ModuleIMU::AssRes(), InlineFriction::AssRes(), TotalEquation::AssRes(), TotalJoint::AssRes(), AeroDynModule::AssRes(), Shell4EAS::AssRes(), Shell4EASANS::AssRes(), ModuleIMUConstraint::AssRes(), TotalPinJoint::AssRes(), Beam2::AssStiffnessVec(), ViscoElasticBeam2::AssStiffnessVec(), ViscousBody::AssVec(), GenericAerodynamicForce::AssVec(), ElasticJoint::AssVec(), AerodynamicBody::AssVec(), ElasticDispJointInv::AssVec(), ElasticJointInv::AssVec(), AerodynamicBeam::AssVec(), ViscousJoint::AssVec(), AerodynamicBeam2::AssVec(), ViscousHingeJointInv::AssVec(), ViscoElasticJoint::AssVec(), StructDispNode::BeforePredict(), StructNode::BeforePredict(), HydrodynamicPlainBearing::ComputeResidual(), NodeDistDriveCaller::dGet(), NodeDistDriveCaller::dGetP(), Motor::dGetPhiMechanical(), PlaneHingeJoint::dGetPrivData(), TotalEquation::dGetPrivData(), TotalJoint::dGetPrivData(), PlaneRotationJoint::dGetPrivData(), Body::dGetPrivData(), TotalReaction::dGetPrivData(), Beam2::DsDxi(), Beam::DsDxi(), getelemparams(), DynamicBody::GetG_int(), MBDynParser::GetOmeRel(), MBDynParser::GetPosRel(), MBDynParser::GetVecRel(), AirProperties::GetVelocity(), MBDynParser::GetVelRel(), getvnvt(), InlineFriction::InitialAssRes(), DataManager::InitialJointAssembly(), ModalMappingExt::ModalMappingExt(), ModuleIMU::ModuleIMU(), ModuleIMUConstraint::ModuleIMUConstraint(), Inertia::Output(), StructExtForce::Output(), TotalEquation::Output(), TotalJoint::Output(), ClampJoint::Output(), TotalReaction::Output(), Inertia::Output_int(), ReadStructMappingExtForce(), ExtRigidForceEDGE::Send(), ModalMappingExt::Send(), StructExtForce::SendToFileDes(), StructMappingExtForce::SendToFileDes(), StructMembraneMappingExtForce::SendToFileDes(), StructExtEDGEForce::SendToStream(), StructExtForce::SendToStream(), StructMappingExtForce::SendToStream(), StructMembraneMappingExtForce::SendToStream(), TotalEquation::SetValue(), TotalJoint::SetValue(), StructDispNode::SetValue(), TotalReaction::SetValue(), ModuleIMUConstraint::SetValue(), PlanePinJoint::SetValue(), StructNode::SetValue(), Shell4EAS::Shell4EAS(), Shell4EASANS::Shell4EASANS(), InlineFriction::SlidingVelocity(), AircraftInstruments::Update(), DriveRigidBodyKinematics::Update(), and InvAngularConstitutiveLaw::Update().

483 {
484  return Vec3(
485  pdMat[M11]*v.pdVec[V1]
486  + pdMat[M21]*v.pdVec[V2]
487  + pdMat[M31]*v.pdVec[V3],
488  pdMat[M12]*v.pdVec[V1]
489  + pdMat[M22]*v.pdVec[V2]
490  + pdMat[M32]*v.pdVec[V3],
491  pdMat[M13]*v.pdVec[V1]
492  + pdMat[M23]*v.pdVec[V2]
493  + pdMat[M33]*v.pdVec[V3]);
494 }
Definition: matvec3.h:59
Definition: matvec3.h:50
doublereal pdVec[3]
Definition: matvec3.h:109
Definition: matvec3.h:58
Definition: matvec3.h:51
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
friend class Vec3
Definition: matvec3.h:551
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3 Mat3x3::MulTVCross ( const Vec3 v) const

multiply self transposed times vCross

Definition at line 596 of file matvec3.cc.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), pdMat, Vec3::pdVec, V1, V2, and V3.

Referenced by ModalBody::AssMats().

597 {
598  return Mat3x3(
599  pdMat[M21]*v.pdVec[V3] - pdMat[M31]*v.pdVec[V2],
600  pdMat[M22]*v.pdVec[V3] - pdMat[M32]*v.pdVec[V2],
601  pdMat[M23]*v.pdVec[V3] - pdMat[M33]*v.pdVec[V2],
602 
603  pdMat[M31]*v.pdVec[V1] - pdMat[M11]*v.pdVec[V3],
604  pdMat[M32]*v.pdVec[V1] - pdMat[M12]*v.pdVec[V3],
605  pdMat[M33]*v.pdVec[V1] - pdMat[M13]*v.pdVec[V3],
606 
607  pdMat[M11]*v.pdVec[V2] - pdMat[M21]*v.pdVec[V1],
608  pdMat[M12]*v.pdVec[V2] - pdMat[M22]*v.pdVec[V1],
609  pdMat[M13]*v.pdVec[V2] - pdMat[M23]*v.pdVec[V1]);
610 }
Definition: matvec3.h:59
Definition: matvec3.h:50
doublereal pdVec[3]
Definition: matvec3.h:109
Definition: matvec3.h:58
Definition: matvec3.h:51
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

Mat3x3 Mat3x3::MulVCross ( const Vec3 v) const

multiply self times vCross

Definition at line 576 of file matvec3.cc.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), pdMat, Vec3::pdVec, V1, V2, and V3.

577 {
578  return Mat3x3(
579  pdMat[M12]*v.pdVec[V3] - pdMat[M13]*v.pdVec[V2],
580  pdMat[M22]*v.pdVec[V3] - pdMat[M23]*v.pdVec[V2],
581  pdMat[M32]*v.pdVec[V3] - pdMat[M33]*v.pdVec[V2],
582 
583  pdMat[M13]*v.pdVec[V1] - pdMat[M11]*v.pdVec[V3],
584  pdMat[M23]*v.pdVec[V1] - pdMat[M21]*v.pdVec[V3],
585  pdMat[M33]*v.pdVec[V1] - pdMat[M31]*v.pdVec[V3],
586 
587  pdMat[M11]*v.pdVec[V2] - pdMat[M12]*v.pdVec[V1],
588  pdMat[M21]*v.pdVec[V2] - pdMat[M22]*v.pdVec[V1],
589  pdMat[M31]*v.pdVec[V2] - pdMat[M32]*v.pdVec[V1]);
590 }
Definition: matvec3.h:59
Definition: matvec3.h:50
doublereal pdVec[3]
Definition: matvec3.h:109
Definition: matvec3.h:58
Definition: matvec3.h:51
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

doublereal& Mat3x3::operator() ( unsigned short int  iRow,
unsigned short int  iCol 
)
inline

Definition at line 777 of file matvec3.h.

References ASSERT, and pdMat.

778  {
779  ASSERT(iRow >= 1 && iRow <= 3);
780  ASSERT(iCol >= 1 && iCol <= 3);
781  return pdMat[--iRow+3*--iCol];
782  };
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
const doublereal& Mat3x3::operator() ( unsigned short int  iRow,
unsigned short int  iCol 
) const
inline

Definition at line 784 of file matvec3.h.

References ASSERT, and pdMat.

785  {
786  ASSERT(iRow >= 1 && iRow <= 3);
787  ASSERT(iCol >= 1 && iCol <= 3);
788  return pdMat[--iRow+3*--iCol];
789  };
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
Mat3x3 Mat3x3::operator* ( const doublereal d) const
inline

Definition at line 1142 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

1142  {
1143  if (d != 1.) {
1144  return Mat3x3(pdMat[M11]*d,
1145  pdMat[M21]*d,
1146  pdMat[M31]*d,
1147  pdMat[M12]*d,
1148  pdMat[M22]*d,
1149  pdMat[M32]*d,
1150  pdMat[M13]*d,
1151  pdMat[M23]*d,
1152  pdMat[M33]*d);
1153  }
1154  return *this;
1155  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

Vec3 Mat3x3::operator* ( const Vec3 v) const
inline

Definition at line 1224 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, pdMat, Vec3::pdVec, V1, V2, V3, and Vec3.

1224  {
1225 
1226  return Vec3(pdMat[M11]*v.pdVec[V1]+pdMat[M12]*v.pdVec[V2]+pdMat[M13]*v.pdVec[V3],
1227  pdMat[M21]*v.pdVec[V1]+pdMat[M22]*v.pdVec[V2]+pdMat[M23]*v.pdVec[V3],
1228  pdMat[M31]*v.pdVec[V1]+pdMat[M32]*v.pdVec[V2]+pdMat[M33]*v.pdVec[V3]);
1229  };
Definition: matvec3.h:59
Definition: matvec3.h:50
doublereal pdVec[3]
Definition: matvec3.h:109
Definition: matvec3.h:58
Definition: matvec3.h:51
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
friend class Vec3
Definition: matvec3.h:551
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3 Mat3x3::operator* ( const Mat3x3 m) const
inline

Definition at line 1318 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

1319  {
1320  return Mat3x3(pdMat[M11]*m.pdMat[M11]+pdMat[M12]*m.pdMat[M21]+pdMat[M13]*m.pdMat[M31],
1321  pdMat[M21]*m.pdMat[M11]+pdMat[M22]*m.pdMat[M21]+pdMat[M23]*m.pdMat[M31],
1322  pdMat[M31]*m.pdMat[M11]+pdMat[M32]*m.pdMat[M21]+pdMat[M33]*m.pdMat[M31],
1323  pdMat[M11]*m.pdMat[M12]+pdMat[M12]*m.pdMat[M22]+pdMat[M13]*m.pdMat[M32],
1324  pdMat[M21]*m.pdMat[M12]+pdMat[M22]*m.pdMat[M22]+pdMat[M23]*m.pdMat[M32],
1325  pdMat[M31]*m.pdMat[M12]+pdMat[M32]*m.pdMat[M22]+pdMat[M33]*m.pdMat[M32],
1326  pdMat[M11]*m.pdMat[M13]+pdMat[M12]*m.pdMat[M23]+pdMat[M13]*m.pdMat[M33],
1327  pdMat[M21]*m.pdMat[M13]+pdMat[M22]*m.pdMat[M23]+pdMat[M23]*m.pdMat[M33],
1328  pdMat[M31]*m.pdMat[M13]+pdMat[M32]*m.pdMat[M23]+pdMat[M33]*m.pdMat[M33]);
1329  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

Mat3x3& Mat3x3::operator*= ( const doublereal d)
inline

Definition at line 1161 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

1161  {
1162  if (d != 1.) {
1163  pdMat[M11] *= d;
1164  pdMat[M21] *= d;
1165  pdMat[M31] *= d;
1166  pdMat[M12] *= d;
1167  pdMat[M22] *= d;
1168  pdMat[M32] *= d;
1169  pdMat[M13] *= d;
1170  pdMat[M23] *= d;
1171  pdMat[M33] *= d;
1172  }
1173 
1174  return *this;
1175  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3 Mat3x3::operator+ ( const Mat3x3 m) const
inline

Definition at line 1074 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

1074  {
1075  return Mat3x3(pdMat[M11]+m.pdMat[M11],
1076  pdMat[M21]+m.pdMat[M21],
1077  pdMat[M31]+m.pdMat[M31],
1078  pdMat[M12]+m.pdMat[M12],
1079  pdMat[M22]+m.pdMat[M22],
1080  pdMat[M32]+m.pdMat[M32],
1081  pdMat[M13]+m.pdMat[M13],
1082  pdMat[M23]+m.pdMat[M23],
1083  pdMat[M33]+m.pdMat[M33]);
1084  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

Mat3x3& Mat3x3::operator+= ( const Mat3x3 m)
inline

Definition at line 1090 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

1090  {
1091  pdMat[M11] += m.pdMat[M11];
1092  pdMat[M21] += m.pdMat[M21];
1093  pdMat[M31] += m.pdMat[M31];
1094  pdMat[M12] += m.pdMat[M12];
1095  pdMat[M22] += m.pdMat[M22];
1096  pdMat[M32] += m.pdMat[M32];
1097  pdMat[M13] += m.pdMat[M13];
1098  pdMat[M23] += m.pdMat[M23];
1099  pdMat[M33] += m.pdMat[M33];
1100 
1101  return *this;
1102  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3 Mat3x3::operator- ( const Mat3x3 m) const
inline

Definition at line 1108 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

1108  {
1109  return Mat3x3(pdMat[M11]-m.pdMat[M11],
1110  pdMat[M21]-m.pdMat[M21],
1111  pdMat[M31]-m.pdMat[M31],
1112  pdMat[M12]-m.pdMat[M12],
1113  pdMat[M22]-m.pdMat[M22],
1114  pdMat[M32]-m.pdMat[M32],
1115  pdMat[M13]-m.pdMat[M13],
1116  pdMat[M23]-m.pdMat[M23],
1117  pdMat[M33]-m.pdMat[M33]);
1118  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

Mat3x3& Mat3x3::operator-= ( const Mat3x3 m)
inline

Definition at line 1124 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

1124  {
1125  pdMat[M11] -= m.pdMat[M11];
1126  pdMat[M21] -= m.pdMat[M21];
1127  pdMat[M31] -= m.pdMat[M31];
1128  pdMat[M12] -= m.pdMat[M12];
1129  pdMat[M22] -= m.pdMat[M22];
1130  pdMat[M32] -= m.pdMat[M32];
1131  pdMat[M13] -= m.pdMat[M13];
1132  pdMat[M23] -= m.pdMat[M23];
1133  pdMat[M33] -= m.pdMat[M33];
1134 
1135  return *this;
1136  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3 Mat3x3::operator/ ( const doublereal d) const
inline

Definition at line 1181 of file matvec3.h.

References ASSERT, M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

1181  {
1182  ASSERT(d != 0.);
1183  if (d != 1.) {
1184  return Mat3x3(pdMat[M11]/d,
1185  pdMat[M21]/d,
1186  pdMat[M31]/d,
1187  pdMat[M12]/d,
1188  pdMat[M22]/d,
1189  pdMat[M32]/d,
1190  pdMat[M13]/d,
1191  pdMat[M23]/d,
1192  pdMat[M33]/d);
1193  }
1194 
1195  return *this;
1196  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

Mat3x3& Mat3x3::operator/= ( const doublereal d)
inline

Definition at line 1202 of file matvec3.h.

References ASSERT, M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

1202  {
1203  ASSERT(d != 0.);
1204  if (d != 1.) {
1205  pdMat[M11] /= d;
1206  pdMat[M21] /= d;
1207  pdMat[M31] /= d;
1208  pdMat[M12] /= d;
1209  pdMat[M22] /= d;
1210  pdMat[M32] /= d;
1211  pdMat[M13] /= d;
1212  pdMat[M23] /= d;
1213  pdMat[M33] /= d;
1214  }
1215 
1216  return *this;
1217  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3& Mat3x3::operator= ( const Mat3x3 m)
inline

Definition at line 1055 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

1055  {
1056 
1057  pdMat[M11] = m.pdMat[M11];
1058  pdMat[M21] = m.pdMat[M21];
1059  pdMat[M31] = m.pdMat[M31];
1060  pdMat[M12] = m.pdMat[M12];
1061  pdMat[M22] = m.pdMat[M22];
1062  pdMat[M32] = m.pdMat[M32];
1063  pdMat[M13] = m.pdMat[M13];
1064  pdMat[M23] = m.pdMat[M23];
1065  pdMat[M33] = m.pdMat[M33];
1066 
1067  return *this;
1068  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
doublereal* Mat3x3::pGetMat ( void  )
inline

Definition at line 747 of file matvec3.h.

References pdMat.

747  {
748  return pdMat;
749  };
doublereal pdMat[9]
Definition: matvec3.h:559
void Mat3x3::Put ( unsigned short int  iRow,
unsigned short int  iCol,
const doublereal dCoef 
)
inline

Definition at line 758 of file matvec3.h.

References ASSERT, and pdMat.

Referenced by Mat6x6::Put(), CubicElasticGenericConstitutiveLaw< Vec3, Mat3x3 >::Update(), and CubicViscoElasticGenericConstitutiveLaw< Vec3, Mat3x3 >::Update().

760  {
761  ASSERT(iRow >= 1 && iRow <= 3);
762  ASSERT(iCol >= 1 && iCol <= 3);
763  pdMat[--iRow+3*--iCol] = dCoef;
764  };
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
void Mat3x3::PutTo ( doublereal pd,
integer  iNRows 
) const
inline

Definition at line 1029 of file matvec3.h.

References ASSERT, M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

1029  {
1030  ASSERT(pd != NULL);
1031  ASSERT(iNRows >= 3);
1032 
1033  doublereal* pdTo = pd;
1034 
1035  pdTo[0] = pdMat[M11];
1036  pdTo[1] = pdMat[M21];
1037  pdTo[2] = pdMat[M31];
1038 
1039  pdTo += iNRows;
1040  pdTo[0] = pdMat[M12];
1041  pdTo[1] = pdMat[M22];
1042  pdTo[2] = pdMat[M32];
1043 
1044  pdTo += iNRows;
1045  pdTo[0] = pdMat[M13];
1046  pdTo[1] = pdMat[M23];
1047  pdTo[2] = pdMat[M33];
1048  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
double doublereal
Definition: colamd.c:52
void Mat3x3::PutVec ( unsigned short int  i,
const Vec3 v 
)
inline

Definition at line 918 of file matvec3.h.

References ASSERT, pdMat, Vec3::pdVec, V1, V2, and V3.

Referenced by Modal::AssRes(), and EigSym().

918  {
919  ASSERT(i >= 1 && i <= 3);
920 
921  i--; i = 3*i;
922  pdMat[i++] = v.pdVec[V1];
923  pdMat[i++] = v.pdVec[V2];
924  pdMat[i] = v.pdVec[V3];
925  };
Definition: matvec3.h:50
doublereal pdVec[3]
Definition: matvec3.h:109
Definition: matvec3.h:51
#define ASSERT(expression)
Definition: colamd.c:977
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
void Mat3x3::Reset ( void  )

Definition at line 613 of file matvec3.cc.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

Referenced by AerodynamicBeam::AssJac(), AerodynamicBeam2::AssJac(), Modal::AssRes(), and Mat6x6::Reset().

614 {
615  pdMat[M11] = 0.;
616  pdMat[M12] = 0.;
617  pdMat[M13] = 0.;
618 
619  pdMat[M21] = 0.;
620  pdMat[M22] = 0.;
621  pdMat[M23] = 0.;
622 
623  pdMat[M31] = 0.;
624  pdMat[M32] = 0.;
625  pdMat[M33] = 0.;
626 }
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3 Mat3x3::Skew ( void  ) const

Definition at line 629 of file matvec3.cc.

References Ax(), Mat3x3(), and MatCross.

630 {
631  return Mat3x3(MatCross, this->Ax());
632 }
Vec3 Ax(void) const
Definition: matvec3.h:827
const MatCross_Manip MatCross
Definition: matvec3.cc:639
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

const Mat3x3& Mat3x3::Skew ( const Mat3x3 m)
inline

Definition at line 877 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, and pdMat.

877  {
878  pdMat[M11] = pdMat[M22] = pdMat[M13] = 0.;
879  pdMat[M12] = m.pdMat[M12] - m.pdMat[M21];
880  pdMat[M21] = -pdMat[M12];
881  pdMat[M13] = m.pdMat[M13] - m.pdMat[M31];
882  pdMat[M31] = -pdMat[M13];
883  pdMat[M23] = m.pdMat[M23] - m.pdMat[M32];
884  pdMat[M32] = -pdMat[M23];
885 
886  return *this;
887  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Vec3 Mat3x3::Solve ( const Vec3 v) const

Definition at line 186 of file matvec3.cc.

References dDet(), grad::fabs(), and MBDYN_EXCEPT_ARGS.

Referenced by RotorTrimBase::AssRes(), and testSolve().

187 {
188  doublereal d = dDet();
189 
190  if (fabs(d) < std::numeric_limits<doublereal>::epsilon()) {
191  silent_cerr("matrix is singular" << std::endl);
193  }
194 
195  return Solve(d, v);
196 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
doublereal dDet(void) const
Definition: matvec3.cc:122
Vec3 Solve(const Vec3 &v) const
Definition: matvec3.cc:186
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

Vec3 Mat3x3::Solve ( const doublereal d,
const Vec3 v 
) const

Definition at line 166 of file matvec3.cc.

References ASSERT, grad::fabs(), M11, M12, M13, M21, M22, M23, M31, M32, M33, pdMat, Vec3::pGetVec(), V1, V2, V3, and Vec3.

167 {
168  const doublereal* p = pdMat;
169  const doublereal* pv = v.pGetVec();
170 
171  ASSERT(fabs(d) > std::numeric_limits<doublereal>::epsilon());
172 
173  return Vec3((pv[V1]*(p[M22]*p[M33] - p[M23]*p[M32])
174  +pv[V2]*(p[M13]*p[M32] - p[M12]*p[M33])
175  +pv[V3]*(p[M12]*p[M23] - p[M13]*p[M22]))/d,
176  (pv[V1]*(p[M23]*p[M31] - p[M21]*p[M33])
177  +pv[V2]*(p[M11]*p[M33] - p[M13]*p[M31])
178  +pv[V3]*(p[M13]*p[M21] - p[M11]*p[M23]))/d,
179  (pv[V1]*(p[M21]*p[M32] - p[M22]*p[M31])
180  +pv[V2]*(p[M12]*p[M31] - p[M11]*p[M32])
181  +pv[V3]*(p[M11]*p[M22] - p[M12]*p[M21]))/d);
182 }
Definition: matvec3.h:59
Definition: matvec3.h:50
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
Definition: matvec3.h:58
Definition: matvec3.h:51
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
friend class Vec3
Definition: matvec3.h:551
Definition: matvec3.h:49
const doublereal * pGetVec(void) const
Definition: matvec3.h:192
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

void Mat3x3::SubVec ( unsigned short int  i,
const Vec3 v 
)
inline

Definition at line 936 of file matvec3.h.

References ASSERT, pdMat, Vec3::pdVec, V1, V2, and V3.

936  {
937  ASSERT(i >= 1 && i <= 3);
938 
939  i--; i = 3*i;
940  pdMat[i++] -= v.pdVec[V1];
941  pdMat[i++] -= v.pdVec[V2];
942  pdMat[i] -= v.pdVec[V3];
943  };
Definition: matvec3.h:50
doublereal pdVec[3]
Definition: matvec3.h:109
Definition: matvec3.h:51
#define ASSERT(expression)
Definition: colamd.c:977
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Mat3x3 Mat3x3::Symm ( void  ) const
inline

Definition at line 840 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

Referenced by CenterOfMass::Collect_int(), and RotManip::VecRot().

840  {
841  doublereal m12 = .5*(pdMat[M21]+pdMat[M12]);
842  doublereal m13 = .5*(pdMat[M31]+pdMat[M13]);
843  doublereal m23 = .5*(pdMat[M32]+pdMat[M23]);
844 
845  return Mat3x3(
846  pdMat[M11], m12, m13,
847  m12, pdMat[M22], m23,
848  m13, m23, pdMat[M33]
849  );
850  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
double doublereal
Definition: colamd.c:52
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

const Mat3x3& Mat3x3::Symm ( const Mat3x3 m)
inline

Definition at line 864 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

864  {
865  pdMat[M11] = m.pdMat[M11];
866  pdMat[M22] = m.pdMat[M22];
867  pdMat[M33] = m.pdMat[M33];
868  pdMat[M12] = pdMat[M21] = .5*(m.pdMat[M21]+m.pdMat[M12]);
869  pdMat[M13] = pdMat[M31] = .5*(m.pdMat[M31]+m.pdMat[M13]);
870  pdMat[M23] = pdMat[M32] = .5*(m.pdMat[M32]+m.pdMat[M23]);
871 
872  return *this;
873  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3 Mat3x3::Symm2 ( void  ) const
inline

Definition at line 852 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

Referenced by Modal::AssJac(), Modal::AssRes(), and Modal::GetJ_int().

852  {
853  doublereal m12 = pdMat[M21]+pdMat[M12];
854  doublereal m13 = pdMat[M31]+pdMat[M13];
855  doublereal m23 = pdMat[M32]+pdMat[M23];
856 
857  return Mat3x3(
858  2.*pdMat[M11], m12, m13,
859  m12, 2.*pdMat[M22], m23,
860  m13, m23, 2.*pdMat[M33]
861  );
862  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
double doublereal
Definition: colamd.c:52
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

const Mat3x3& Mat3x3::Tens ( const Vec3 a,
const Vec3 b 
)
inline

Definition at line 799 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, pdMat, Vec3::pdVec, V1, V2, and V3.

Referenced by ElasticAxialJoint::AfterPredict(), ViscousAxialJoint::AfterPredict(), ViscoElasticAxialJoint::AfterPredict(), Motor::AssJac(), ViscousAxialJoint::InitialAssJac(), and ViscoElasticAxialJoint::InitialAssJac().

799  {
800  pdMat[M11] = a.pdVec[V1]*b.pdVec[V1]; /* m(1,1) = a(1)*b(1) */
801  pdMat[M21] = a.pdVec[V2]*b.pdVec[V1]; /* m(2,1) = a(2)*b(1) */
802  pdMat[M31] = a.pdVec[V3]*b.pdVec[V1]; /* m(3,1) = a(3)*b(1) */
803  pdMat[M12] = a.pdVec[V1]*b.pdVec[V2]; /* m(1,2) = a(1)*b(2) */
804  pdMat[M22] = a.pdVec[V2]*b.pdVec[V2]; /* m(2,2) = a(2)*b(2) */
805  pdMat[M32] = a.pdVec[V3]*b.pdVec[V2]; /* m(3,2) = a(3)*b(2) */
806  pdMat[M13] = a.pdVec[V1]*b.pdVec[V3]; /* m(1,3) = a(1)*b(3) */
807  pdMat[M23] = a.pdVec[V2]*b.pdVec[V3]; /* m(2,3) = a(2)*b(3) */
808  pdMat[M33] = a.pdVec[V3]*b.pdVec[V3]; /* m(3,3) = a(3)*b(3) */
809  return *this;
810  };
Definition: matvec3.h:59
Definition: matvec3.h:50
doublereal pdVec[3]
Definition: matvec3.h:109
Definition: matvec3.h:58
Definition: matvec3.h:51
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
doublereal Mat3x3::Tr ( void  ) const
inline

Definition at line 1361 of file matvec3.h.

References M11, M22, M33, and pdMat.

Referenced by MatR2EulerParams().

1361  {
1362  return pdMat[M11]+pdMat[M22]+pdMat[M33];
1363  };
Definition: matvec3.h:59
Definition: matvec3.h:55
Definition: matvec3.h:63
doublereal pdMat[9]
Definition: matvec3.h:559
doublereal Mat3x3::Trace ( void  ) const
inline

Definition at line 836 of file matvec3.h.

References M11, M22, M33, and pdMat.

Referenced by EigSym(), CGR_Rot::Param_Manip::Manipulate(), MatR2gparam(), and RotManip::VecRot().

836  {
837  return pdMat[M11]+pdMat[M22]+pdMat[M33];
838  };
Definition: matvec3.h:59
Definition: matvec3.h:55
Definition: matvec3.h:63
doublereal pdMat[9]
Definition: matvec3.h:559
Mat3x3 Mat3x3::Transpose ( void  ) const
inline

Definition at line 816 of file matvec3.h.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3(), and pdMat.

Referenced by Brake::AfterConvergence(), DriveHingeJoint::AfterPredict(), ElasticHingeJointInv::AfterPredict(), ViscousHingeJointInv::AfterPredict(), ViscoElasticHingeJointInv::AfterPredict(), HydrodynamicPlainBearing::AssJac(), AerodynamicBody::AssJac(), AerodynamicBeam::AssJac(), AerodynamicBeam2::AssJac(), Modal::AssRes(), CyclocopterNoInflow::AssRes(), CyclocopterUniform1D::AssRes(), CyclocopterUniform2D::AssRes(), CyclocopterPolimi::AssRes(), HBeam::AssStiffnessVec(), GimbalRotationJoint::AssVec(), ElasticJointInv::AssVec(), Compute(), ViscousBody::dGetPrivData(), DeformableJoint::dGetPrivData(), HBeam::DsDxi(), LocalNodeResForces::Force(), getelemparams(), MBDynParser::GetMatAbs(), RoTrManip::Helix(), InLineWithOffsetJoint::InitialAssJac(), InPlaneWithOffsetJoint::InitialAssJac(), Modal::InitialAssRes(), Rotor::InitParam(), main(), LocalNodeResForces::Moment(), GimbalRotationJoint::Output(), DriveDisplacementJoint::Output(), UniversalPinJoint::Output(), DataManager::ReadOneElem(), ModalExt::Send(), DriveDisplacementJoint::SetValue(), DriveHingeJoint::SetValue(), PrismaticJoint::SetValue(), DeformableAxialJoint::SetValue(), DeformableDispJoint::SetValue(), DeformableHingeJoint::SetValue(), DeformableJoint::SetValue(), TotalJoint::SetValue(), DriveDisplacementPinJoint::SetValue(), TotalPinJoint::SetValue(), and MatExp::Transpose().

816  {
817  /* La funzione non e' ottimizzata. Genera una nuova matrice che
818  * costruisce in modo opportuno. Se si ritiene di dover usare
819  * ripetutamente la matrice trasposta, conviene memorizzarla in
820  * una variabile di servizio */
821 
822  return Mat3x3(pdMat[M11], pdMat[M12], pdMat[M13],
823  pdMat[M21], pdMat[M22], pdMat[M23],
824  pdMat[M31], pdMat[M32], pdMat[M33]);
825  };
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
Mat3x3(void)
Definition: matvec3.h:568

Here is the call graph for this function:

std::ostream & Mat3x3::Write ( std::ostream &  out,
const char *  sFill = " ",
const char *  sFill2 = NULL 
) const

Definition at line 722 of file matvec3.cc.

References M11, M12, M13, M21, M22, M23, M31, M32, M33, and pdMat.

Referenced by ReadModal(), ReadStructNode(), AircraftInstruments::Restart(), TotalForce::Restart(), and Write().

723 {
724  char* sF2 = (char*)sFill2;
725  if (sFill2 == NULL) {
726  sF2 = (char*)sFill;
727  }
728  out
729  << pdMat[M11] << sFill << pdMat[M12] << sFill << pdMat[M13] << sF2
730  << pdMat[M21] << sFill << pdMat[M22] << sFill << pdMat[M23] << sF2
731  << pdMat[M31] << sFill << pdMat[M32] << sFill << pdMat[M33];
732 
733  return out;
734 }
Definition: matvec3.h:59
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60

Friends And Related Function Documentation

friend class Mat3x3_Manip
friend

Definition at line 553 of file matvec3.h.

friend class Mat3xN
friend

Definition at line 554 of file matvec3.h.

friend class MatNx3
friend

Definition at line 555 of file matvec3.h.

friend class SparseSubMatrixHandler
friend

Definition at line 552 of file matvec3.h.

friend class Vec3
friend

Definition at line 551 of file matvec3.h.

Referenced by Ax(), EigSym(), GetCol(), GetRow(), GetVec(), LDLSolve(), MulTV(), operator*(), and Solve().

Member Data Documentation


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