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

#include <matvec3n.h>

Collaboration diagram for MatNx3:

Public Member Functions

 MatNx3 (void)
 
 MatNx3 (integer ns)
 
 MatNx3 (integer ns, const doublereal &d)
 
 ~MatNx3 (void)
 
integer iGetNumRows (void) const
 
void Resize (integer ns)
 
void Reset (const doublereal d=0.)
 
void Put (integer i, integer j, const doublereal &d)
 
void Add (integer i, integer j, const doublereal &d)
 
void Sub (integer i, integer j, const doublereal &d)
 
const doublerealdGet (integer i, integer j) const
 
const MatNx3RightMult (const MatNx3 &n, const Mat3x3 &m)
 
const MatNx3Transpose (const Mat3xN &n)
 
const MatNx3Mult (const MatNxN &m, const MatNx3 &n)
 
Vec3 GetVec (integer iRow) const
 
void PutVec (integer iRow, const Vec3 &v)
 
void AddVec (integer iRow, const Vec3 &v)
 
void SubVec (integer iRow, const Vec3 &v)
 
doublerealoperator() (integer i, integer j)
 
const doublerealoperator() (integer i, integer j) const
 

Protected Member Functions

void Create_ (integer ns)
 
void Destroy_ (void)
 

Protected Attributes

integer iMaxRows
 
integer iNumRows
 
doublerealpdCols [3]
 

Private Member Functions

 MatNx3 (const MatNx3 &)
 
const MatNx3operator= (const MatNx3 &)
 

Friends

class VecN
 
class Mat3xN
 
class MatNxN
 

Detailed Description

Definition at line 375 of file matvec3n.h.

Constructor & Destructor Documentation

MatNx3::MatNx3 ( const MatNx3 )
private
MatNx3::MatNx3 ( void  )

Definition at line 757 of file matvec3n.cc.

References pdCols.

758 : iMaxRows(0), iNumRows(0)
759 {
760  pdCols[0] = NULL;
761 }
integer iMaxRows
Definition: matvec3n.h:387
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
MatNx3::MatNx3 ( integer  ns)

Definition at line 764 of file matvec3n.cc.

References Create_(), and pdCols.

765 : iMaxRows(ns), iNumRows(ns)
766 {
767  pdCols[0] = NULL;
768  Create_(ns);
769 #ifdef DEBUG
770  IsValid();
771 #endif /* DEBUG */
772 }
void Create_(integer ns)
Definition: matvec3n.cc:737
integer iMaxRows
Definition: matvec3n.h:387
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388

Here is the call graph for this function:

MatNx3::MatNx3 ( integer  ns,
const doublereal d 
)

Definition at line 775 of file matvec3n.cc.

References Create_(), pdCols, and Reset().

776 : iMaxRows(ns), iNumRows(ns)
777 {
778  pdCols[0] = NULL;
779  Create_(ns);
780  Reset(d);
781 }
void Create_(integer ns)
Definition: matvec3n.cc:737
integer iMaxRows
Definition: matvec3n.h:387
doublereal * pdCols[3]
Definition: matvec3n.h:389
void Reset(const doublereal d=0.)
Definition: matvec3n.cc:802
integer iNumRows
Definition: matvec3n.h:388

Here is the call graph for this function:

MatNx3::~MatNx3 ( void  )

Definition at line 784 of file matvec3n.cc.

References Destroy_().

785 {
786  Destroy_();
787 }
void Destroy_(void)
Definition: matvec3n.cc:749

Here is the call graph for this function:

Member Function Documentation

void MatNx3::Add ( integer  i,
integer  j,
const doublereal d 
)
inline

Definition at line 452 of file matvec3n.h.

References ASSERT, iNumRows, and pdCols.

453 {
454 #ifdef DEBUG
455  IsValid();
456 #endif /* DEBUG */
457  ASSERT(i > 0 && i <= iNumRows);
458  ASSERT(j > 0 && j <= 3);
459  pdCols[--j][--i] += d;
460 }
#define ASSERT(expression)
Definition: colamd.c:977
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
void MatNx3::AddVec ( integer  iRow,
const Vec3 v 
)

Definition at line 870 of file matvec3n.cc.

References ASSERT, iNumRows, pdCols, and Vec3::pdVec.

871 {
872 #ifdef DEBUG
873  IsValid();
874 #endif /* DEBUG */
875  ASSERT(iRow > 0 && iRow <= iNumRows);
876 
877  --iRow;
878  pdCols[0][iRow] += v.pdVec[0];
879  pdCols[1][iRow] += v.pdVec[1];
880  pdCols[2][iRow] += v.pdVec[2];
881 }
doublereal pdVec[3]
Definition: matvec3.h:109
#define ASSERT(expression)
Definition: colamd.c:977
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
void MatNx3::Create_ ( integer  ns)
protected

Definition at line 737 of file matvec3n.cc.

References ASSERT, Destroy_(), pdCols, and SAFENEWARR.

Referenced by MatNx3(), and Resize().

738 {
739  ASSERT(ns > 0);
740  if (pdCols[0] != NULL) {
741  Destroy_();
742  }
743  SAFENEWARR(pdCols[0], doublereal, 3*ns);
744  pdCols[1] = pdCols[0] + ns;
745  pdCols[2] = pdCols[1] + ns;
746 }
#define ASSERT(expression)
Definition: colamd.c:977
#define SAFENEWARR(pnt, item, sz)
Definition: mynewmem.h:701
doublereal * pdCols[3]
Definition: matvec3n.h:389
double doublereal
Definition: colamd.c:52
void Destroy_(void)
Definition: matvec3n.cc:749

Here is the call graph for this function:

void MatNx3::Destroy_ ( void  )
protected

Definition at line 749 of file matvec3n.cc.

References pdCols, and SAFEDELETEARR.

Referenced by Create_(), Resize(), and ~MatNx3().

750 {
751  if (pdCols[0] != NULL) {
752  SAFEDELETEARR(pdCols[0]);
753  }
754 }
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
doublereal * pdCols[3]
Definition: matvec3n.h:389
const doublereal & MatNx3::dGet ( integer  i,
integer  j 
) const
inline

Definition at line 474 of file matvec3n.h.

References ASSERT, iNumRows, and pdCols.

475 {
476 #ifdef DEBUG
477  IsValid();
478 #endif /* DEBUG */
479  ASSERT(i > 0 && i <= iNumRows);
480  ASSERT(j > 0 && j <= 3);
481  return pdCols[--j][--i];
482 }
#define ASSERT(expression)
Definition: colamd.c:977
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
Vec3 MatNx3::GetVec ( integer  iRow) const

Definition at line 844 of file matvec3n.cc.

References ASSERT, iNumRows, and pdCols.

Referenced by Modal::InitialAssRes().

845 {
846 #ifdef DEBUG
847  IsValid();
848 #endif /* DEBUG */
849  ASSERT(iRow > 0 && iRow <= iNumRows);
850 
851  --iRow;
852  return Vec3(pdCols[0][iRow], pdCols[1][iRow], pdCols[2][iRow]);
853 }
Definition: matvec3.h:98
#define ASSERT(expression)
Definition: colamd.c:977
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
integer MatNx3::iGetNumRows ( void  ) const
inline

Definition at line 431 of file matvec3n.h.

References iNumRows.

Referenced by FullMatrixHandler::Add(), FullMatrixHandler::Put(), and FullMatrixHandler::Sub().

432 {
433 #ifdef DEBUG
434  IsValid();
435 #endif /* DEBUG */
436  return iNumRows;
437 }
integer iNumRows
Definition: matvec3n.h:388
const MatNx3& MatNx3::Mult ( const MatNxN m,
const MatNx3 n 
)
doublereal & MatNx3::operator() ( integer  i,
integer  j 
)
inline

Definition at line 485 of file matvec3n.h.

References ASSERT, iNumRows, and pdCols.

486 {
487 #ifdef DEBUG
488  IsValid();
489 #endif /* DEBUG */
490  ASSERT(i > 0 && i <= iNumRows);
491  ASSERT(j > 0 && j <= 3);
492  return pdCols[--j][--i];
493 }
#define ASSERT(expression)
Definition: colamd.c:977
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
const doublereal & MatNx3::operator() ( integer  i,
integer  j 
) const
inline

Definition at line 496 of file matvec3n.h.

References ASSERT, iNumRows, and pdCols.

497 {
498 #ifdef DEBUG
499  IsValid();
500 #endif /* DEBUG */
501  ASSERT(i > 0 && i <= iNumRows);
502  ASSERT(j > 0 && j <= 3);
503  return pdCols[--j][--i];
504 }
#define ASSERT(expression)
Definition: colamd.c:977
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
const MatNx3& MatNx3::operator= ( const MatNx3 )
private
void MatNx3::Put ( integer  i,
integer  j,
const doublereal d 
)
inline

Definition at line 441 of file matvec3n.h.

References ASSERT, iNumRows, and pdCols.

442 {
443 #ifdef DEBUG
444  IsValid();
445 #endif /* DEBUG */
446  ASSERT(i > 0 && i <= iNumRows);
447  ASSERT(j > 0 && j <= 3);
448  pdCols[--j][--i] = d;
449 }
#define ASSERT(expression)
Definition: colamd.c:977
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
void MatNx3::PutVec ( integer  iRow,
const Vec3 v 
)

Definition at line 856 of file matvec3n.cc.

References ASSERT, iNumRows, pdCols, and Vec3::pdVec.

857 {
858 #ifdef DEBUG
859  IsValid();
860 #endif /* DEBUG */
861  ASSERT(iRow > 0 && iRow <= iNumRows);
862 
863  --iRow;
864  pdCols[0][iRow] = v.pdVec[0];
865  pdCols[1][iRow] = v.pdVec[1];
866  pdCols[2][iRow] = v.pdVec[2];
867 }
doublereal pdVec[3]
Definition: matvec3.h:109
#define ASSERT(expression)
Definition: colamd.c:977
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
void MatNx3::Reset ( const doublereal  d = 0.)

Definition at line 802 of file matvec3n.cc.

References iNumRows, and pdCols.

Referenced by MatNx3().

803 {
804 #ifdef DEBUG
805  IsValid();
806 #endif /* DEBUG */
807  for (integer i = iNumRows; i-- > 0; ) {
808  pdCols[0][i] = d;
809  pdCols[1][i] = d;
810  pdCols[2][i] = d;
811  }
812 }
doublereal * pdCols[3]
Definition: matvec3n.h:389
long int integer
Definition: colamd.c:51
integer iNumRows
Definition: matvec3n.h:388
void MatNx3::Resize ( integer  ns)

Definition at line 789 of file matvec3n.cc.

References ASSERT, Create_(), Destroy_(), iMaxRows, iNumRows, and pdCols.

Referenced by RightMult().

790 {
791  ASSERT(ns > 0);
792  if (pdCols[0] != NULL) {
793  Destroy_();
794  }
795  Create_(ns);
796  iMaxRows = iNumRows = ns;
797 #ifdef DEBUG
798  IsValid();
799 #endif /* DEBUG */
800 }
void Create_(integer ns)
Definition: matvec3n.cc:737
integer iMaxRows
Definition: matvec3n.h:387
#define ASSERT(expression)
Definition: colamd.c:977
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
void Destroy_(void)
Definition: matvec3n.cc:749

Here is the call graph for this function:

const MatNx3 & MatNx3::RightMult ( const MatNx3 n,
const Mat3x3 m 
)

Definition at line 814 of file matvec3n.cc.

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

Referenced by Modal::AssJac(), Modal::InitialAssJac(), Modal::InitialAssRes(), and ModuleNonsmoothNode::mbs_get_force().

815 {
816 #ifdef DEBUG
817  IsValid();
818  n.IsValid();
819 #endif /* DEBUG */
820 
821  if (iNumRows != n.iNumRows) {
822  Resize(n.iNumRows);
823  }
824 
825  for (integer i = iNumRows; i-- > 0; ) {
826  pdCols[0][i] =
827  n.pdCols[0][i]*m.pdMat[M11]
828  +n.pdCols[1][i]*m.pdMat[M21]
829  +n.pdCols[2][i]*m.pdMat[M31];
830  pdCols[1][i] =
831  n.pdCols[0][i]*m.pdMat[M12]
832  +n.pdCols[1][i]*m.pdMat[M22]
833  +n.pdCols[2][i]*m.pdMat[M32];
834  pdCols[2][i] =
835  n.pdCols[0][i]*m.pdMat[M13]
836  +n.pdCols[1][i]*m.pdMat[M23]
837  +n.pdCols[2][i]*m.pdMat[M33];
838  }
839 
840  return *this;
841 }
Definition: matvec3.h:59
void Resize(integer ns)
Definition: matvec3n.cc:789
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 * pdCols[3]
Definition: matvec3n.h:389
long int integer
Definition: colamd.c:51
integer iNumRows
Definition: matvec3n.h:388

Here is the call graph for this function:

void MatNx3::Sub ( integer  i,
integer  j,
const doublereal d 
)
inline

Definition at line 463 of file matvec3n.h.

References ASSERT, iNumRows, and pdCols.

464 {
465 #ifdef DEBUG
466  IsValid();
467 #endif /* DEBUG */
468  ASSERT(i > 0 && i <= iNumRows);
469  ASSERT(j > 0 && j <= 3);
470  pdCols[--j][--i] -= d;
471 }
#define ASSERT(expression)
Definition: colamd.c:977
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
void MatNx3::SubVec ( integer  iRow,
const Vec3 v 
)

Definition at line 884 of file matvec3n.cc.

References ASSERT, iNumRows, pdCols, and Vec3::pdVec.

885 {
886 #ifdef DEBUG
887  IsValid();
888 #endif /* DEBUG */
889  ASSERT(iRow > 0 && iRow <= iNumRows);
890 
891  --iRow;
892  pdCols[0][iRow] -= v.pdVec[0];
893  pdCols[1][iRow] -= v.pdVec[1];
894  pdCols[2][iRow] -= v.pdVec[2];
895 }
doublereal pdVec[3]
Definition: matvec3.h:109
#define ASSERT(expression)
Definition: colamd.c:977
doublereal * pdCols[3]
Definition: matvec3n.h:389
integer iNumRows
Definition: matvec3n.h:388
const MatNx3 & MatNx3::Transpose ( const Mat3xN n)

Definition at line 898 of file matvec3n.cc.

References iNumRows, pdCols, and Mat3xN::pdRows.

Referenced by Modal::AssJac(), Modal::InitialAssJac(), Modal::InitialAssRes(), and ModuleNonsmoothNode::mbs_get_force().

899 {
900 #ifdef DEBUG
901  IsValid();
902  n.IsValid();
903 #endif /* DEBUG */
904 
905  for (integer i = iNumRows; i-- > 0; ) {
906  pdCols[0][i] = n.pdRows[0][i];
907  pdCols[1][i] = n.pdRows[1][i];
908  pdCols[2][i] = n.pdRows[2][i];
909  }
910  return *this;
911 }
doublereal * pdRows[3]
Definition: matvec3n.h:236
doublereal * pdCols[3]
Definition: matvec3n.h:389
long int integer
Definition: colamd.c:51
integer iNumRows
Definition: matvec3n.h:388

Friends And Related Function Documentation

friend class Mat3xN
friend

Definition at line 378 of file matvec3n.h.

friend class MatNxN
friend

Definition at line 379 of file matvec3n.h.

friend class VecN
friend

Definition at line 377 of file matvec3n.h.

Member Data Documentation

integer MatNx3::iMaxRows
protected

Definition at line 387 of file matvec3n.h.

Referenced by Resize().

integer MatNx3::iNumRows
protected

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