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

#include <matvec3n.h>

Collaboration diagram for Mat3xN:

Public Member Functions

 Mat3xN (void)
 
 Mat3xN (integer nc)
 
 Mat3xN (integer nc, const doublereal &d)
 
 ~Mat3xN (void)
 
void Resize (integer ns)
 
void Reset (const doublereal &d=0.)
 
integer iGetNumCols (void) const
 
integer iGetNumRows (void) const
 
void Put (int i, integer j, const doublereal &d)
 
void Add (int i, integer j, const doublereal &d)
 
void Sub (int i, integer j, const doublereal &d)
 
const doublerealdGet (int i, integer j) const
 
const Mat3xNLeftMult (const Mat3x3 &m)
 
const Mat3xNLeftMult (const Mat3x3 &m, const Mat3xN &n)
 
const Mat3xNMult (const Mat3xN &m, const MatNxN &n)
 
const Mat3xNCopy (const Mat3xN &m)
 
const Mat3xNoperator*= (const doublereal &d)
 
const Mat3xNoperator/= (const doublereal &d)
 
const Mat3xNoperator+= (const Mat3xN &m)
 
const Mat3xNoperator-= (const Mat3xN &m)
 
Vec3 operator* (const VecN &v) const
 
Vec3 Mult (const ArrayView &vm, const VecN &v) const
 
Vec3 Mult (const ArrayView &vm, const VecN &v, const ArrayView &vv) const
 
Vec3 GetVec (integer iCol) const
 
void PutVec (integer iCol, const Vec3 &v)
 
void AddVec (integer iCol, const Vec3 &v)
 
void SubVec (integer iCol, const Vec3 &v)
 
Mat3x3 GetMat3x3 (integer iFirstCol) const
 
void PutMat3x3 (integer iCol, const Mat3x3 &m)
 
void AddMat3x3 (integer iCol, const Mat3x3 &m)
 
void SubMat3x3 (integer iCol, const Mat3x3 &m)
 
Mat3x3 GetMat3x3ScalarMult (integer iFirstCol, const doublereal &d) const
 
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 iMaxCols
 
integer iNumCols
 
doublerealpdRows [3]
 

Private Member Functions

 Mat3xN (const Mat3xN &)
 
const Mat3xNoperator= (const Mat3xN &)
 

Friends

class MatNx3
 
class MatNxN
 

Detailed Description

Definition at line 222 of file matvec3n.h.

Constructor & Destructor Documentation

Mat3xN::Mat3xN ( const Mat3xN )
private
Mat3xN::Mat3xN ( void  )

Definition at line 272 of file matvec3n.cc.

References pdRows.

273 : iMaxCols(0), iNumCols(0)
274 {
275  pdRows[0] = NULL;
276  pdRows[1] = NULL;
277  pdRows[2] = NULL;
278 }
integer iNumCols
Definition: matvec3n.h:235
integer iMaxCols
Definition: matvec3n.h:234
doublereal * pdRows[3]
Definition: matvec3n.h:236
Mat3xN::Mat3xN ( integer  nc)

Definition at line 281 of file matvec3n.cc.

References ASSERT, Create_(), iNumCols, and pdRows.

282 : iMaxCols(nc), iNumCols(nc)
283 {
284  ASSERT(iNumCols > 0);
285  pdRows[0] = NULL;
286  pdRows[1] = NULL;
287  pdRows[2] = NULL;
288 
289  Create_(iNumCols);
290 #ifdef DEBUG
291  IsValid();
292 #endif /* DEBUG */
293 }
void Create_(integer ns)
Definition: matvec3n.cc:252
integer iNumCols
Definition: matvec3n.h:235
integer iMaxCols
Definition: matvec3n.h:234
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

Mat3xN::Mat3xN ( integer  nc,
const doublereal d 
)

Definition at line 296 of file matvec3n.cc.

References ASSERT, Create_(), iNumCols, pdRows, and Reset().

297 : iMaxCols(nc), iNumCols(nc)
298 {
299  ASSERT(iNumCols > 0);
300  pdRows[0] = NULL;
301  pdRows[1] = NULL;
302  pdRows[2] = NULL;
303 
304  Create_(iNumCols);
305 #ifdef DEBUG
306  IsValid();
307 #endif /* DEBUG */
308  Reset(d);
309 }
void Create_(integer ns)
Definition: matvec3n.cc:252
integer iNumCols
Definition: matvec3n.h:235
integer iMaxCols
Definition: matvec3n.h:234
doublereal * pdRows[3]
Definition: matvec3n.h:236
void Reset(const doublereal &d=0.)
Definition: matvec3n.cc:334
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

Mat3xN::~Mat3xN ( void  )

Definition at line 312 of file matvec3n.cc.

References Destroy_().

313 {
314  Destroy_();
315 }
void Destroy_(void)
Definition: matvec3n.cc:264

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 316 of file matvec3n.h.

References ASSERT, iNumCols, and pdRows.

Referenced by Modal::GetCurrFEMNodesPosition(), and Modal::GetCurrFEMNodesVelocity().

317 {
318 #ifdef DEBUG
319  IsValid();
320 #endif /* DEBUG */
321  ASSERT(i > 0 && i <= 3);
322  ASSERT(j > 0 && j <= iNumCols);
323  pdRows[--i][--j] += d;
324 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
void Mat3xN::AddMat3x3 ( integer  iCol,
const Mat3x3 m 
)

Definition at line 652 of file matvec3n.cc.

References ASSERT, iNumCols, M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3::pdMat, pdRows, V1, V2, and V3.

Referenced by ReadModal().

653 {
654 #ifdef DEBUG
655  IsValid();
656 #endif /* DEBUG */
657  ASSERT(iFirstCol >= 1 && iFirstCol <= iNumCols-2);
658 
659  --iFirstCol;
660  pdRows[V1][iFirstCol] += m.pdMat[M11];
661  pdRows[V2][iFirstCol] += m.pdMat[M21];
662  pdRows[V3][iFirstCol] += m.pdMat[M31];
663 
664  iFirstCol++;
665  pdRows[V1][iFirstCol] += m.pdMat[M12];
666  pdRows[V2][iFirstCol] += m.pdMat[M22];
667  pdRows[V3][iFirstCol] += m.pdMat[M32];
668 
669  iFirstCol++;
670  pdRows[V1][iFirstCol] += m.pdMat[M13];
671  pdRows[V2][iFirstCol] += m.pdMat[M23];
672  pdRows[V3][iFirstCol] += m.pdMat[M33];
673 }
Definition: matvec3.h:59
Definition: matvec3.h:50
integer iNumCols
Definition: matvec3n.h:235
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
doublereal * pdRows[3]
Definition: matvec3n.h:236
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
void Mat3xN::AddVec ( integer  iCol,
const Vec3 v 
)

Definition at line 579 of file matvec3n.cc.

References ASSERT, iNumCols, pdRows, and Vec3::pdVec.

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

580 {
581 #ifdef DEBUG
582  IsValid();
583 #endif /* DEBUG */
584  ASSERT(iCol > 0 && iCol <= iNumCols);
585 
586  --iCol;
587  pdRows[0][iCol] += v.pdVec[0];
588  pdRows[1][iCol] += v.pdVec[1];
589  pdRows[2][iCol] += v.pdVec[2];
590 }
doublereal pdVec[3]
Definition: matvec3.h:109
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
const Mat3xN & Mat3xN::Copy ( const Mat3xN m)

Definition at line 407 of file matvec3n.cc.

References iNumCols, pdRows, and Resize().

Referenced by PiezoActuatorBeam::PiezoActuatorBeam(), PiezoActuatorBeam2::PiezoActuatorBeam2(), PiezoActuatorVEBeam::PiezoActuatorVEBeam(), PiezoActuatorVEBeam2::PiezoActuatorVEBeam2(), ReadBeam(), and ReadModal().

408 {
409 #ifdef DEBUG
410  m.IsValid();
411 #endif /* DEBUG */
412  Resize(m.iNumCols);
413  for (integer j = m.iNumCols; j-- > 0; ) {
414  pdRows[0][j] = m.pdRows[0][j];
415  pdRows[1][j] = m.pdRows[1][j];
416  pdRows[2][j] = m.pdRows[2][j];
417  }
418  return *this;
419 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
void Resize(integer ns)
Definition: matvec3n.cc:318
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void Mat3xN::Create_ ( integer  ns)
protected

Definition at line 252 of file matvec3n.cc.

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

Referenced by Mat3xN(), and Resize().

253 {
254  ASSERT(ns > 0);
255  if (pdRows[0] != NULL) {
256  Destroy_();
257  }
258  SAFENEWARR(pdRows[0], doublereal, 3*ns);
259  pdRows[1] = pdRows[0]+ns;
260  pdRows[2] = pdRows[1]+ns;
261 }
void Destroy_(void)
Definition: matvec3n.cc:264
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
#define SAFENEWARR(pnt, item, sz)
Definition: mynewmem.h:701
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

void Mat3xN::Destroy_ ( void  )
protected

Definition at line 264 of file matvec3n.cc.

References pdRows, and SAFEDELETEARR.

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

265 {
266  if (pdRows[0] != NULL) {
267  SAFEDELETEARR(pdRows[0]);
268  }
269 }
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
doublereal * pdRows[3]
Definition: matvec3n.h:236
const doublereal & Mat3xN::dGet ( int  i,
integer  j 
) const
inline

Definition at line 336 of file matvec3n.h.

References ASSERT, iNumCols, and pdRows.

Referenced by Modal::GetCurrFEMNodesPosition(), Modal::GetCurrFEMNodesVelocity(), Modal::InitialAssRes(), and ReadModal().

337 {
338 #ifdef DEBUG
339  IsValid();
340 #endif /* DEBUG */
341  ASSERT(i > 0 && i <= 3);
342  ASSERT(j > 0 && j <= iNumCols);
343  return pdRows[--i][--j];
344 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
Mat3x3 Mat3xN::GetMat3x3 ( integer  iFirstCol) const

Definition at line 607 of file matvec3n.cc.

References ASSERT, iNumCols, and pdRows.

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

608 {
609 #ifdef DEBUG
610  IsValid();
611 #endif /* DEBUG */
612  ASSERT(iFirstCol >= 1 && iFirstCol <= iNumCols-2);
613 
614  --iFirstCol;
615  return Mat3x3(
616  pdRows[0][iFirstCol],
617  pdRows[1][iFirstCol],
618  pdRows[2][iFirstCol],
619  pdRows[0][iFirstCol+1],
620  pdRows[1][iFirstCol+1],
621  pdRows[2][iFirstCol+1],
622  pdRows[0][iFirstCol+2],
623  pdRows[1][iFirstCol+2],
624  pdRows[2][iFirstCol+2]);
625 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
Mat3x3 Mat3xN::GetMat3x3ScalarMult ( integer  iFirstCol,
const doublereal d 
) const

Definition at line 700 of file matvec3n.cc.

References ASSERT, iNumCols, and pdRows.

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

701 {
702 #ifdef DEBUG
703  IsValid();
704 #endif /* DEBUG */
705  ASSERT(iFirstCol >= 1 && iFirstCol <= iNumCols-2);
706 
707  --iFirstCol;
708  return Mat3x3(
709  pdRows[0][iFirstCol]*d,
710  pdRows[1][iFirstCol]*d,
711  pdRows[2][iFirstCol]*d,
712  pdRows[0][iFirstCol+1]*d,
713  pdRows[1][iFirstCol+1]*d,
714  pdRows[2][iFirstCol+1]*d,
715  pdRows[0][iFirstCol+2]*d,
716  pdRows[1][iFirstCol+2]*d,
717  pdRows[2][iFirstCol+2]*d);
718 
719 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
Vec3 Mat3xN::GetVec ( integer  iCol) const

Definition at line 553 of file matvec3n.cc.

References ASSERT, iNumCols, and pdRows.

Referenced by AerodynamicBody::AssJac(), Modal::AssJac(), AerodynamicBeam::AssJac(), AerodynamicBeam2::AssJac(), ModalForce::AssRes(), Modal::AssRes(), Modal::dGetPrivData(), Modal::InitialAssJac(), and ReadModal().

554 {
555 #ifdef DEBUG
556  IsValid();
557 #endif /* DEBUG */
558  ASSERT(iCol > 0 && iCol <= iNumCols);
559 
560  --iCol;
561  return Vec3(pdRows[0][iCol], pdRows[1][iCol], pdRows[2][iCol]);
562 }
Definition: matvec3.h:98
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
integer Mat3xN::iGetNumRows ( void  ) const
inline
const Mat3xN & Mat3xN::LeftMult ( const Mat3x3 m)

Definition at line 348 of file matvec3n.cc.

References iNumCols, M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3::pdMat, and pdRows.

Referenced by Modal::AssJac(), Modal::AssRes(), PiezoActuatorBeam::AssStiffnessMat(), PiezoActuatorBeam2::AssStiffnessMat(), PiezoActuatorVEBeam2::AssStiffnessMat(), PiezoActuatorVEBeam::AssStiffnessMat(), Modal::GetCurrFEMNodesPosition(), Modal::GetCurrFEMNodesVelocity(), Modal::InitialAssJac(), and ReadModal().

349 {
350 #ifdef DEBUG
351  IsValid();
352 #endif /* DEBUG */
353  for (integer i = iNumCols; i-- > 0; ) {
354  doublereal d[3] = { 0., 0., 0. };
355 
356  d[0] =
357  m.pdMat[M11] * pdRows[0][i]
358  + m.pdMat[M12] * pdRows[1][i]
359  + m.pdMat[M13] * pdRows[2][i];
360  d[1] =
361  m.pdMat[M21] * pdRows[0][i]
362  + m.pdMat[M22] * pdRows[1][i]
363  + m.pdMat[M23] * pdRows[2][i];
364  d[2] =
365  m.pdMat[M31] * pdRows[0][i]
366  + m.pdMat[M32] * pdRows[1][i]
367  + m.pdMat[M33] * pdRows[2][i];
368 
369  pdRows[0][i] = d[0];
370  pdRows[1][i] = d[1];
371  pdRows[2][i] = d[2];
372  }
373  return *this;
374 }
Definition: matvec3.h:59
integer iNumCols
Definition: matvec3n.h:235
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
doublereal * pdRows[3]
Definition: matvec3n.h:236
Definition: matvec3.h:57
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
const Mat3xN & Mat3xN::LeftMult ( const Mat3x3 m,
const Mat3xN n 
)

Definition at line 377 of file matvec3n.cc.

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

378 {
379 #ifdef DEBUG
380  IsValid();
381  n.IsValid();
382 #endif /* DEBUG */
383 
384  if (iNumCols != n.iNumCols) {
385  Resize(n.iNumCols);
386  /* FIXME: sicuri di voler fare resize? non si azzera? */
387  }
388 
389  for (integer i = iNumCols; i-- > 0; ) {
390  pdRows[0][i] =
391  m.pdMat[M11] * n.pdRows[0][i]
392  + m.pdMat[M12] * n.pdRows[1][i]
393  + m.pdMat[M13] * n.pdRows[2][i];
394  pdRows[1][i] =
395  m.pdMat[M21] * n.pdRows[0][i]
396  + m.pdMat[M22] * n.pdRows[1][i]
397  + m.pdMat[M23] * n.pdRows[2][i];
398  pdRows[2][i] =
399  m.pdMat[M31] * n.pdRows[0][i]
400  + m.pdMat[M32] * n.pdRows[1][i]
401  + m.pdMat[M33] * n.pdRows[2][i];
402  }
403  return *this;
404 }
Definition: matvec3.h:59
integer iNumCols
Definition: matvec3n.h:235
Definition: matvec3.h:58
Definition: matvec3.h:55
Definition: matvec3.h:56
Definition: matvec3.h:63
Definition: matvec3.h:62
Definition: matvec3.h:61
doublereal * pdRows[3]
Definition: matvec3n.h:236
Definition: matvec3.h:57
void Resize(integer ns)
Definition: matvec3n.cc:318
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

const Mat3xN& Mat3xN::Mult ( const Mat3xN m,
const MatNxN n 
)
Vec3 Mat3xN::Mult ( const ArrayView vm,
const VecN v 
) const

Definition at line 506 of file matvec3n.cc.

References ASSERT, iNumCols, VecN::iNumRows, ArrayView::Last(), ArrayView::Number(), ArrayView::Offset(), pdRows, VecN::pdVec, and ArrayView::Start().

507 {
508 #ifdef DEBUG
509  IsValid();
510 #endif /* DEBUG */
511  ASSERT(iNumCols >= vm.Last());
512  ASSERT(vm.Number() == v.iNumRows);
513 
514  doublereal d[3] = { 0., 0., 0. };
515  integer jm = vm.Start() - 1;
516  for (integer j = 0; j < vm.Number(); j++) {
517  d[0] += pdRows[0][jm]*v.pdVec[j];
518  d[1] += pdRows[1][jm]*v.pdVec[j];
519  d[2] += pdRows[2][jm]*v.pdVec[j];
520 
521  jm += vm.Offset();
522  }
523 
524  return Vec3(d);
525 }
Definition: matvec3.h:98
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdVec
Definition: matvec3n.h:89
integer Number(void) const
Definition: matvec3n.h:67
integer iNumRows
Definition: matvec3n.h:88
integer Offset(void) const
Definition: matvec3n.h:63
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
integer Last(void) const
Definition: matvec3n.h:71
double doublereal
Definition: colamd.c:52
integer Start(void) const
Definition: matvec3n.h:59
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

Vec3 Mat3xN::Mult ( const ArrayView vm,
const VecN v,
const ArrayView vv 
) const

Definition at line 528 of file matvec3n.cc.

References ASSERT, iNumCols, VecN::iNumRows, ArrayView::Last(), ArrayView::Number(), ArrayView::Offset(), pdRows, VecN::pdVec, and ArrayView::Start().

529 {
530 #ifdef DEBUG
531  IsValid();
532 #endif /* DEBUG */
533  ASSERT(iNumCols >= vm.Last());
534  ASSERT(v.iNumRows >= vv.Last());
535  ASSERT(vm.Number() == vv.Number());
536 
537  doublereal d[3] = { 0., 0., 0. };
538  integer jm = vm.Start() - 1;
539  integer jv = vv.Start() - 1;
540  for (integer j = 0; j < vm.Number(); j++) {
541  d[0] += pdRows[0][jm]*v.pdVec[jv];
542  d[1] += pdRows[1][jm]*v.pdVec[jv];
543  d[2] += pdRows[2][jm]*v.pdVec[jv];
544 
545  jm += vm.Offset();
546  jv += vv.Offset();
547  }
548 
549  return Vec3(d);
550 }
Definition: matvec3.h:98
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdVec
Definition: matvec3n.h:89
integer Number(void) const
Definition: matvec3n.h:67
integer iNumRows
Definition: matvec3n.h:88
integer Offset(void) const
Definition: matvec3n.h:63
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
integer Last(void) const
Definition: matvec3n.h:71
double doublereal
Definition: colamd.c:52
integer Start(void) const
Definition: matvec3n.h:59
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

doublereal & Mat3xN::operator() ( integer  i,
integer  j 
)
inline

Definition at line 347 of file matvec3n.h.

References ASSERT, iNumCols, and pdRows.

348 {
349 #ifdef DEBUG
350  IsValid();
351 #endif /* DEBUG */
352  ASSERT(i > 0 && i <= 3);
353  ASSERT(j > 0 && j <= iNumCols);
354  return pdRows[--i][--j];
355 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
const doublereal & Mat3xN::operator() ( integer  i,
integer  j 
) const
inline

Definition at line 358 of file matvec3n.h.

References ASSERT, iNumCols, and pdRows.

359 {
360 #ifdef DEBUG
361  IsValid();
362 #endif /* DEBUG */
363  ASSERT(i > 0 && i <= 3);
364  ASSERT(j > 0 && j <= iNumCols);
365  return pdRows[--i][--j];
366 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
Vec3 Mat3xN::operator* ( const VecN v) const

Definition at line 488 of file matvec3n.cc.

References ASSERT, iNumCols, VecN::iNumRows, pdRows, and VecN::pdVec.

489 {
490 #ifdef DEBUG
491  IsValid();
492 #endif /* DEBUG */
493  ASSERT(iNumCols == v.iNumRows);
494 
495  doublereal d[3] = { 0., 0., 0. };
496  for (integer j = iNumCols; j-- > 0; ) {
497  d[0] += pdRows[0][j]*v.pdVec[j];
498  d[1] += pdRows[1][j]*v.pdVec[j];
499  d[2] += pdRows[2][j]*v.pdVec[j];
500  }
501 
502  return Vec3(d);
503 }
Definition: matvec3.h:98
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdVec
Definition: matvec3n.h:89
integer iNumRows
Definition: matvec3n.h:88
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
const Mat3xN & Mat3xN::operator*= ( const doublereal d)

Definition at line 422 of file matvec3n.cc.

References iNumCols, and pdRows.

423 {
424 #ifdef DEBUG
425  IsValid();
426 #endif /* DEBUG */
427 
428  if (d != 1.) {
429  for (integer j = iNumCols; j-- > 0; ) {
430  pdRows[0][j] *= d;
431  pdRows[1][j] *= d;
432  pdRows[2][j] *= d;
433  }
434  }
435  return *this;
436 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
long int integer
Definition: colamd.c:51
const Mat3xN & Mat3xN::operator+= ( const Mat3xN m)

Definition at line 459 of file matvec3n.cc.

References iNumCols, and pdRows.

460 {
461 #ifdef DEBUG
462  IsValid();
463 #endif /* DEBUG */
464  for (integer j = m.iNumCols; j-- > 0; ) {
465  pdRows[0][j] += m.pdRows[0][j];
466  pdRows[1][j] += m.pdRows[1][j];
467  pdRows[2][j] += m.pdRows[2][j];
468  }
469  return *this;
470 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
long int integer
Definition: colamd.c:51
const Mat3xN & Mat3xN::operator-= ( const Mat3xN m)

Definition at line 473 of file matvec3n.cc.

References iNumCols, and pdRows.

474 {
475 #ifdef DEBUG
476  IsValid();
477 #endif /* DEBUG */
478  for (integer j = m.iNumCols; j-- > 0; ) {
479  pdRows[0][j] -= m.pdRows[0][j];
480  pdRows[1][j] -= m.pdRows[1][j];
481  pdRows[2][j] -= m.pdRows[2][j];
482  }
483  return *this;
484 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
long int integer
Definition: colamd.c:51
const Mat3xN & Mat3xN::operator/= ( const doublereal d)

Definition at line 439 of file matvec3n.cc.

References iNumCols, MBDYN_EXCEPT_ARGS, and pdRows.

440 {
441 #ifdef DEBUG
442  IsValid();
443 #endif /* DEBUG */
444  if (d == 0.) {
445  silent_cerr("division by zero" << std::endl);
447  }
448  if (d != 1.) {
449  for (integer j = iNumCols; j-- > 0; ) {
450  pdRows[0][j] /= d;
451  pdRows[1][j] /= d;
452  pdRows[2][j] /= d;
453  }
454  }
455  return *this;
456 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
long int integer
Definition: colamd.c:51
const Mat3xN& Mat3xN::operator= ( const Mat3xN )
private
void Mat3xN::Put ( int  i,
integer  j,
const doublereal d 
)
inline

Definition at line 306 of file matvec3n.h.

References ASSERT, iNumCols, and pdRows.

Referenced by TheodorsenAeroData::AssJac(), MBDynParser::GetMat6xN(), Modal::InitialAssRes(), and ReadModal().

307 {
308 #ifdef DEBUG
309  IsValid();
310 #endif /* DEBUG */
311  ASSERT(i > 0 && i <= 3);
312  ASSERT(j > 0 && j <= iNumCols);
313  pdRows[--i][--j] = d;
314 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
void Mat3xN::PutMat3x3 ( integer  iCol,
const Mat3x3 m 
)

Definition at line 628 of file matvec3n.cc.

References ASSERT, iNumCols, M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3::pdMat, pdRows, V1, V2, and V3.

Referenced by AerodynamicBody::AssJac(), AerodynamicBeam::AssJac(), and AerodynamicBeam2::AssJac().

629 {
630 #ifdef DEBUG
631  IsValid();
632 #endif /* DEBUG */
633  ASSERT(iFirstCol >= 1 && iFirstCol <= iNumCols-2);
634 
635  --iFirstCol;
636  pdRows[V1][iFirstCol] = m.pdMat[M11];
637  pdRows[V2][iFirstCol] = m.pdMat[M21];
638  pdRows[V3][iFirstCol] = m.pdMat[M31];
639 
640  iFirstCol++;
641  pdRows[V1][iFirstCol] = m.pdMat[M12];
642  pdRows[V2][iFirstCol] = m.pdMat[M22];
643  pdRows[V3][iFirstCol] = m.pdMat[M32];
644 
645  iFirstCol++;
646  pdRows[V1][iFirstCol] = m.pdMat[M13];
647  pdRows[V2][iFirstCol] = m.pdMat[M23];
648  pdRows[V3][iFirstCol] = m.pdMat[M33];
649 }
Definition: matvec3.h:59
Definition: matvec3.h:50
integer iNumCols
Definition: matvec3n.h:235
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
doublereal * pdRows[3]
Definition: matvec3n.h:236
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
void Mat3xN::PutVec ( integer  iCol,
const Vec3 v 
)

Definition at line 565 of file matvec3n.cc.

References ASSERT, iNumCols, pdRows, and Vec3::pdVec.

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

566 {
567 #ifdef DEBUG
568  IsValid();
569 #endif /* DEBUG */
570  ASSERT(iCol > 0 && iCol <= iNumCols);
571 
572  --iCol;
573  pdRows[0][iCol] = v.pdVec[0];
574  pdRows[1][iCol] = v.pdVec[1];
575  pdRows[2][iCol] = v.pdVec[2];
576 }
doublereal pdVec[3]
Definition: matvec3.h:109
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
void Mat3xN::Reset ( const doublereal d = 0.)

Definition at line 334 of file matvec3n.cc.

References iNumCols, and pdRows.

Referenced by Modal::AssRes(), MBDynParser::GetMat6xN(), and Mat3xN().

335 {
336 #ifdef DEBUG
337  IsValid();
338 #endif /* DEBUG */
339 
340  for (integer j = iNumCols; j-- > 0; ) {
341  pdRows[0][j] = d;
342  pdRows[1][j] = d;
343  pdRows[2][j] = d;
344  }
345 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
long int integer
Definition: colamd.c:51
void Mat3xN::Resize ( integer  ns)

Definition at line 318 of file matvec3n.cc.

References ASSERT, Create_(), Destroy_(), iMaxCols, and iNumCols.

Referenced by Copy(), LeftMult(), ReadBeam(), ReadBeam2(), and ReadHBeam().

319 {
320  ASSERT(ns > 0);
321  if (ns <= iMaxCols) {
322  iNumCols = ns;
323  } else {
324  Destroy_();
325  Create_(ns);
326  iMaxCols = iNumCols = ns;
327  }
328 #ifdef DEBUG
329  IsValid();
330 #endif /* DEBUG */
331 }
void Create_(integer ns)
Definition: matvec3n.cc:252
integer iNumCols
Definition: matvec3n.h:235
void Destroy_(void)
Definition: matvec3n.cc:264
integer iMaxCols
Definition: matvec3n.h:234
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

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

Definition at line 326 of file matvec3n.h.

References ASSERT, iNumCols, and pdRows.

327 {
328 #ifdef DEBUG
329  IsValid();
330 #endif /* DEBUG */
331  ASSERT(i > 0 && i <= 3);
332  ASSERT(j > 0 && j <= iNumCols);
333  pdRows[--i][--j] -= d;
334 }
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977
void Mat3xN::SubMat3x3 ( integer  iCol,
const Mat3x3 m 
)

Definition at line 676 of file matvec3n.cc.

References ASSERT, iNumCols, M11, M12, M13, M21, M22, M23, M31, M32, M33, Mat3x3::pdMat, pdRows, V1, V2, and V3.

677 {
678 #ifdef DEBUG
679  IsValid();
680 #endif /* DEBUG */
681  ASSERT(iFirstCol >= 1 && iFirstCol <= iNumCols-2);
682 
683  --iFirstCol;
684  pdRows[V1][iFirstCol] -= m.pdMat[M11];
685  pdRows[V2][iFirstCol] -= m.pdMat[M21];
686  pdRows[V3][iFirstCol] -= m.pdMat[M31];
687 
688  iFirstCol++;
689  pdRows[V1][iFirstCol] -= m.pdMat[M12];
690  pdRows[V2][iFirstCol] -= m.pdMat[M22];
691  pdRows[V3][iFirstCol] -= m.pdMat[M32];
692 
693  iFirstCol++;
694  pdRows[V1][iFirstCol] -= m.pdMat[M13];
695  pdRows[V2][iFirstCol] -= m.pdMat[M23];
696  pdRows[V3][iFirstCol] -= m.pdMat[M33];
697 }
Definition: matvec3.h:59
Definition: matvec3.h:50
integer iNumCols
Definition: matvec3n.h:235
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
doublereal * pdRows[3]
Definition: matvec3n.h:236
Definition: matvec3.h:57
#define ASSERT(expression)
Definition: colamd.c:977
Definition: matvec3.h:49
doublereal pdMat[9]
Definition: matvec3.h:559
Definition: matvec3.h:60
void Mat3xN::SubVec ( integer  iCol,
const Vec3 v 
)

Definition at line 593 of file matvec3n.cc.

References ASSERT, iNumCols, pdRows, and Vec3::pdVec.

Referenced by ReadModal().

594 {
595 #ifdef DEBUG
596  IsValid();
597 #endif /* DEBUG */
598  ASSERT(iCol > 0 && iCol <= iNumCols);
599 
600  --iCol;
601  pdRows[0][iCol] -= v.pdVec[0];
602  pdRows[1][iCol] -= v.pdVec[1];
603  pdRows[2][iCol] -= v.pdVec[2];
604 }
doublereal pdVec[3]
Definition: matvec3.h:109
integer iNumCols
Definition: matvec3n.h:235
doublereal * pdRows[3]
Definition: matvec3n.h:236
#define ASSERT(expression)
Definition: colamd.c:977

Friends And Related Function Documentation

friend class MatNx3
friend

Definition at line 224 of file matvec3n.h.

friend class MatNxN
friend

Definition at line 225 of file matvec3n.h.

Member Data Documentation

integer Mat3xN::iMaxCols
protected

Definition at line 234 of file matvec3n.h.

Referenced by Resize().


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