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

#include <mh.h>

Inheritance diagram for MatrixHandler:

Classes

class  ErrGeneric
 
class  ErrMatrixIsSingular
 
class  ErrRebuildMatrix
 

Public Types

enum  Norm_t { NORM_1, NORM_INF }
 

Public Member Functions

virtual ~MatrixHandler (void)
 
virtual void Resize (integer, integer)=0
 
virtual void ResizeReset (integer, integer)
 
virtual const doublerealpdGetMat (void) const
 
virtual doublerealpdGetMat (void)
 
virtual integerpiGetRows (void) const
 
virtual integerpiGetCols (void) const
 
virtual integer PacMat (void)
 
virtual void Reset (void)=0
 
virtual void PutCoef (integer iRow, integer iCol, const doublereal &dCoef)
 
virtual void IncCoef (integer iRow, integer iCol, const doublereal &dCoef)
 
virtual void DecCoef (integer iRow, integer iCol, const doublereal &dCoef)
 
virtual const doublerealdGetCoef (integer iRow, integer iCol) const
 
virtual const doublerealoperator() (integer iRow, integer iCol) const =0
 
virtual doublerealoperator() (integer iRow, integer iCol)=0
 
virtual integer iGetNumRows (void) const =0
 
virtual integer iGetNumCols (void) const =0
 
virtual MatrixHandleroperator= (const MatrixHandler &MH)
 
virtual MatrixHandleroperator+= (const SubMatrixHandler &SubMH)
 
virtual MatrixHandleroperator-= (const SubMatrixHandler &SubMH)
 
virtual MatrixHandleroperator+= (const VariableSubMatrixHandler &SubMH)
 
virtual MatrixHandleroperator-= (const VariableSubMatrixHandler &SubMH)
 
virtual MatrixHandlerScalarMul (const doublereal &d)
 
virtual MatrixHandlerMatMatMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatTMatMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatMatIncMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatTMatIncMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatMatDecMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatTMatDecMul (MatrixHandler &out, const MatrixHandler &in) const
 
virtual VectorHandlerMatVecMul (VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatTVecMul (VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatVecIncMul (VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatTVecIncMul (VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatVecDecMul (VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatTVecDecMul (VectorHandler &out, const VectorHandler &in) const
 
virtual doublereal ConditionNumber (enum Norm_t eNorm=NORM_1) const
 
virtual doublereal Norm (enum Norm_t eNorm=NORM_1) const
 

Protected Member Functions

virtual MatrixHandlerMatMatMul_base (void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
 
virtual MatrixHandlerMatTMatMul_base (void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
 
virtual VectorHandlerMatVecMul_base (void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
 
virtual VectorHandlerMatTVecMul_base (void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
 

Detailed Description

Definition at line 60 of file mh.h.

Member Enumeration Documentation

Enumerator
NORM_1 
NORM_INF 

Definition at line 62 of file mh.h.

Constructor & Destructor Documentation

MatrixHandler::~MatrixHandler ( void  )
virtual

Definition at line 49 of file mh.cc.

References NO_OP.

50 {
51  NO_OP;
52 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

doublereal MatrixHandler::ConditionNumber ( enum Norm_t  eNorm = NORM_1) const
virtual

Definition at line 451 of file mh.cc.

References ASSERT, MBDYN_EXCEPT_ARGS, NORM_1, and NORM_INF.

Referenced by LineSearchSolver::Jacobian(), and NewtonRaphsonSolver::Solve().

452 {
453 #if HAVE_CONDITION_NUMBER
454  integer M;
455  integer N;
456  std::vector<doublereal> A;
457 
458  LapackCopyMatrix(*this, A, M, N);
459 
460  const doublereal ANORM = LapackMatrixNorm(A, M, N, eNorm);
461 
462 #ifdef DEBUG
463  std::cerr << "ANORM=" << ANORM << std::endl;
464  std::cerr << "A=" << std::endl;
465  for (int i = 0; i < M; ++i) {
466  for (int j = 0; j < N; ++j) {
467  std::cerr << A[j * M + i] << '\t';
468  }
469  std::cerr << std::endl;
470  }
471 #endif // DEBUG
472 
473  integer INFO = 0;
474  std::vector<integer> IPIV(std::min(M,N));
475 
476  __FC_DECL__(dgetrf)(&M, &N, &A[0], &M, &IPIV[0], &INFO);
477 
478  ASSERT(INFO == 0); // should not fail because the Jacobian has already been factorised before
479 
480  std::vector<doublereal> WORK(4*N);
481  std::vector<integer> IWORK(N);
482  doublereal RCOND = 0.;
483  char norm;
484 
485  switch (eNorm) {
486  case NORM_1:
487  norm = '1';
488  break;
489  case NORM_INF:
490  norm = 'I';
491  break;
492  default:
493  ASSERT(0);
495  }
496 
497  __FC_DECL__(dgecon)(&norm, &N, &A[0], &M, &ANORM, &RCOND, &WORK[0], &IWORK[0], &INFO);
498 
499  ASSERT(INFO == 0); // should not fail
500 
501 #ifdef DEBUG
502  std::cerr << "RCOND=" << RCOND << std::endl;
503 #endif // DEBUG
504 
505  return 1. / RCOND;
506 #else // ! HAVE_CONDITION_NUMBER
507  silent_cerr("Condition number is not available in this version of MBDyn" << std::endl);
509 #endif // ! HAVE_CONDITION_NUMBER
510 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
#define ASSERT(expression)
Definition: colamd.c:977
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
void MatrixHandler::DecCoef ( integer  iRow,
integer  iCol,
const doublereal dCoef 
)
virtual

Reimplemented in SparseSubMatrixHandler, SchurMatrixHandlerUm, FullSubMatrixHandler, FullMatrixHandler, SpMapMatrixHandler, and SchurMatrixHandler.

Definition at line 379 of file mh.cc.

References operator()().

Referenced by SchurMatrixHandler::DecCoef(), SchurMatrixHandlerUm::DecCoef(), MatMatDecMul(), MatMatMul_base(), FullMatrixHandler::MatMatMul_base(), MatTMatDecMul(), MatTMatMul_base(), and FullMatrixHandler::MatTMatMul_base().

379  {
380  operator()(ix, iy) -= inc;
381 }
virtual const doublereal & operator()(integer iRow, integer iCol) const =0

Here is the call graph for this function:

const doublereal & MatrixHandler::dGetCoef ( integer  iRow,
integer  iCol 
) const
virtual

Reimplemented in SparseSubMatrixHandler, SchurMatrixHandlerUm, FullSubMatrixHandler, FullMatrixHandler, SpMapMatrixHandler, and SchurMatrixHandler.

Definition at line 389 of file mh.cc.

References operator()().

389  {
390  return operator()(ix, iy);
391 }
virtual const doublereal & operator()(integer iRow, integer iCol) const =0

Here is the call graph for this function:

virtual integer MatrixHandler::iGetNumCols ( void  ) const
pure virtual

Implemented in SparseSubMatrixHandler, FullSubMatrixHandler, FullMatrixHandler, SparseMatrixHandler, NaiveMatrixHandler, and SchurMatrixHandler.

Referenced by FullSubMatrixHandler::AddTo(), SparseSubMatrixHandler::AddTo(), FullSubMatrixHandler::AddToT(), SparseSubMatrixHandler::AddToT(), DataManager::AssJac(), DirCColMatrixHandler< off >::FakeThirdOrderMulAndSumWithShift(), CColMatrixHandler< off >::FakeThirdOrderMulAndSumWithShift(), SpMapMatrixHandler::FakeThirdOrderMulAndSumWithShift(), StepNIntegrator::Jacobian(), NaiveMatrixHandler::MatMatMul_base(), MatMatMul_base(), CompactSparseMatrixHandler_tpl< off >::MatMatMul_base(), SpMapMatrixHandler::MatMatMul_base(), FullMatrixHandler::MatMatMul_base(), NaivePermMatrixHandler::MatMatMul_base(), NaiveMatrixHandler::MatTMatMul_base(), MatTMatMul_base(), CompactSparseMatrixHandler_tpl< off >::MatTMatMul_base(), SpMapMatrixHandler::MatTMatMul_base(), FullMatrixHandler::MatTMatMul_base(), NaivePermMatrixHandler::MatTMatMul_base(), MatTVecMul_base(), MatVecMul_base(), DirCColMatrixHandler< off >::MulAndSumWithShift(), CColMatrixHandler< off >::MulAndSumWithShift(), SpMapMatrixHandler::MulAndSumWithShift(), NaiveMatrixHandler::operator+=(), NaiveMatrixHandler::operator-=(), operator<<(), operator=(), DataManager::OutputEigenvectors(), MatrixScaleBase::PrepareCols(), ReportMatScale(), ScalarMul(), SetupSystem(), LineSearchSolver::Solve(), FullSubMatrixHandler::SubFrom(), SparseSubMatrixHandler::SubFrom(), FullSubMatrixHandler::SubFromT(), and SparseSubMatrixHandler::SubFromT().

virtual integer MatrixHandler::iGetNumRows ( void  ) const
pure virtual

Implemented in SparseSubMatrixHandler, FullSubMatrixHandler, FullMatrixHandler, SparseMatrixHandler, NaiveMatrixHandler, and SchurMatrixHandler.

Referenced by FullSubMatrixHandler::AddTo(), SparseSubMatrixHandler::AddTo(), FullSubMatrixHandler::AddToT(), SparseSubMatrixHandler::AddToT(), DataManager::AssJac(), DirCColMatrixHandler< off >::FakeThirdOrderMulAndSumWithShift(), CColMatrixHandler< off >::FakeThirdOrderMulAndSumWithShift(), SpMapMatrixHandler::FakeThirdOrderMulAndSumWithShift(), StepNIntegrator::Jacobian(), NaiveMatrixHandler::MatMatMul_base(), MatMatMul_base(), CompactSparseMatrixHandler_tpl< off >::MatMatMul_base(), SpMapMatrixHandler::MatMatMul_base(), FullMatrixHandler::MatMatMul_base(), NaivePermMatrixHandler::MatMatMul_base(), NaiveMatrixHandler::MatTMatMul_base(), MatTMatMul_base(), CompactSparseMatrixHandler_tpl< off >::MatTMatMul_base(), SpMapMatrixHandler::MatTMatMul_base(), FullMatrixHandler::MatTMatMul_base(), NaivePermMatrixHandler::MatTMatMul_base(), MatTVecMul_base(), MatVecMul_base(), DirCColMatrixHandler< off >::MulAndSumWithShift(), CColMatrixHandler< off >::MulAndSumWithShift(), SpMapMatrixHandler::MulAndSumWithShift(), NaiveMatrixHandler::operator+=(), NaiveMatrixHandler::operator-=(), operator<<(), operator=(), DataManager::OutputEigenvectors(), MatrixScaleBase::PrepareRows(), ReportMatScale(), ScalarMul(), SetupSystem(), LineSearchSolver::Solve(), FullSubMatrixHandler::SubFrom(), SparseSubMatrixHandler::SubFrom(), FullSubMatrixHandler::SubFromT(), and SparseSubMatrixHandler::SubFromT().

MatrixHandler & MatrixHandler::MatMatDecMul ( MatrixHandler out,
const MatrixHandler in 
) const
virtual

Definition at line 262 of file mh.cc.

References DecCoef(), and MatMatMul_base().

263 {
264  return MatMatMul_base(&MatrixHandler::DecCoef, out, in);
265 }
virtual void DecCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:379
virtual MatrixHandler & MatMatMul_base(void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
Definition: mh.cc:135

Here is the call graph for this function:

MatrixHandler & MatrixHandler::MatMatIncMul ( MatrixHandler out,
const MatrixHandler in 
) const
virtual

Definition at line 250 of file mh.cc.

References IncCoef(), and MatMatMul_base().

251 {
252  return MatMatMul_base(&MatrixHandler::IncCoef, out, in);
253 }
virtual void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:374
virtual MatrixHandler & MatMatMul_base(void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
Definition: mh.cc:135

Here is the call graph for this function:

MatrixHandler & MatrixHandler::MatMatMul ( MatrixHandler out,
const MatrixHandler in 
) const
virtual

Definition at line 232 of file mh.cc.

References IncCoef(), MatMatMul_base(), and Reset().

Referenced by Membrane4EAS::AssJac(), Shell4EAS::AssJac(), Shell4EASANS::AssJac(), Shell4EASANS::AssRes(), main(), Shell4EAS::Shell4EAS(), and Shell4EASANS::Shell4EASANS().

233 {
234  /* Put is implemented resetting out first, then passing IncCoef()
235  * so that out-of-order assignments work */
236  out.Reset();
237  return MatMatMul_base(&MatrixHandler::IncCoef, out, in);
238 }
virtual void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:374
virtual void Reset(void)=0
virtual MatrixHandler & MatMatMul_base(void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
Definition: mh.cc:135

Here is the call graph for this function:

MatrixHandler & MatrixHandler::MatMatMul_base ( void(MatrixHandler::*)(integer iRow, integer iCol, const doublereal &dCoef)  op,
MatrixHandler out,
const MatrixHandler in 
) const
protectedvirtual

Reimplemented in NaivePermMatrixHandler, FullMatrixHandler, SpMapMatrixHandler, CompactSparseMatrixHandler_tpl< off >, and NaiveMatrixHandler.

Definition at line 135 of file mh.cc.

References c, DecCoef(), iGetNumCols(), iGetNumRows(), IncCoef(), MBDYN_EXCEPT_ARGS, operator()(), and PutCoef().

Referenced by MatMatDecMul(), MatMatIncMul(), MatMatMul(), and FullMatrixHandler::MatMatMul_base().

138 {
139  integer out_nc = out.iGetNumCols();
140  integer out_nr = out.iGetNumRows();
141  integer in_nr = in.iGetNumRows();
142 
143  if (out_nr != iGetNumRows()
144  || out_nc != in.iGetNumCols()
145  || in_nr != iGetNumCols())
146  {
147  const char *strop;
148 
149  if (op == &MatrixHandler::IncCoef) {
150  strop = "+=";
151  } else if (op == &MatrixHandler::DecCoef) {
152  strop = "-=";
153  } else if (op == &MatrixHandler::PutCoef) {
154  strop = "=";
155  } else {
157  }
158 
159  silent_cerr("MatrixHandler::MatMatMul_base: size mismatch "
160  "out(" << out_nr << ", " << out_nc << ") "
161  << strop << " this(" << iGetNumRows() << ", " << iGetNumCols() << ") "
162  "* in(" << in_nr << ", " << in.iGetNumCols() << ")"
163  << std::endl);
165  }
166 
167  for (integer c = 1; c <= out_nc; c++) {
168  for (integer r = 1; r <= out_nr; r++) {
169  doublereal d = 0.;
170 
171  for (integer k = 1; k <= in_nr; k++) {
172  d += this->operator()(r, k)*in(k, c);
173  }
174 
175  (out.*op)(r, c, d);
176  }
177  }
178 
179  return out;
180 }
virtual integer iGetNumCols(void) const =0
virtual void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:374
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual void DecCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:379
virtual const doublereal & operator()(integer iRow, integer iCol) const =0
virtual void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:384
static std::stack< cleanup * > c
Definition: cleanup.cc:59
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual integer iGetNumRows(void) const =0

Here is the call graph for this function:

MatrixHandler & MatrixHandler::MatTMatDecMul ( MatrixHandler out,
const MatrixHandler in 
) const
virtual

Definition at line 268 of file mh.cc.

References DecCoef(), and MatTMatMul_base().

269 {
270  return MatTMatMul_base(&MatrixHandler::DecCoef, out, in);
271 }
virtual void DecCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:379
virtual MatrixHandler & MatTMatMul_base(void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
Definition: mh.cc:183

Here is the call graph for this function:

MatrixHandler & MatrixHandler::MatTMatIncMul ( MatrixHandler out,
const MatrixHandler in 
) const
virtual

Definition at line 256 of file mh.cc.

References IncCoef(), and MatTMatMul_base().

257 {
258  return MatTMatMul_base(&MatrixHandler::IncCoef, out, in);
259 }
virtual void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:374
virtual MatrixHandler & MatTMatMul_base(void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
Definition: mh.cc:183

Here is the call graph for this function:

MatrixHandler & MatrixHandler::MatTMatMul ( MatrixHandler out,
const MatrixHandler in 
) const
virtual

Definition at line 241 of file mh.cc.

References IncCoef(), MatTMatMul_base(), and Reset().

Referenced by main(), Shell4EAS::Shell4EAS(), and Shell4EASANS::Shell4EASANS().

242 {
243  /* Put is implemented resetting out first, then passing IncCoef()
244  * so that out-of-order assignments work */
245  out.Reset();
246  return MatTMatMul_base(&MatrixHandler::IncCoef, out, in);
247 }
virtual void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:374
virtual void Reset(void)=0
virtual MatrixHandler & MatTMatMul_base(void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
Definition: mh.cc:183

Here is the call graph for this function:

MatrixHandler & MatrixHandler::MatTMatMul_base ( void(MatrixHandler::*)(integer iRow, integer iCol, const doublereal &dCoef)  op,
MatrixHandler out,
const MatrixHandler in 
) const
protectedvirtual

Reimplemented in NaivePermMatrixHandler, FullMatrixHandler, SpMapMatrixHandler, CompactSparseMatrixHandler_tpl< off >, and NaiveMatrixHandler.

Definition at line 183 of file mh.cc.

References c, DecCoef(), iGetNumCols(), iGetNumRows(), IncCoef(), MBDYN_EXCEPT_ARGS, operator()(), and PutCoef().

Referenced by MatTMatDecMul(), MatTMatIncMul(), MatTMatMul(), and FullMatrixHandler::MatTMatMul_base().

186 {
187  integer out_nc = out.iGetNumCols();
188  integer out_nr = out.iGetNumRows();
189  integer in_nr = in.iGetNumRows();
190 
191  if (out_nr != iGetNumCols()
192  || out_nc != in.iGetNumCols()
193  || in_nr != iGetNumRows())
194  {
195  const char *strop;
196 
197  if (op == &MatrixHandler::IncCoef) {
198  strop = "+=";
199  } else if (op == &MatrixHandler::DecCoef) {
200  strop = "-=";
201  } else if (op == &MatrixHandler::PutCoef) {
202  strop = "=";
203  } else {
205  }
206 
207  silent_cerr("MatrixHandler::MatTMatMul_base: size mismatch "
208  "out(" << out_nr << ", " << out_nc << ") "
209  << strop << " this(" << iGetNumRows() << ", " << iGetNumCols() << ")^T "
210  "* in(" << in_nr << ", " << in.iGetNumCols() << ")"
211  << std::endl);
214  }
215 
216  for (integer c = 1; c <= out_nc; c++) {
217  for (integer r = 1; r <= out_nr; r++) {
218  doublereal d = 0.;
219 
220  for (integer k = 1; k <= in_nr; k++) {
221  d += this->operator()(k, r)*in(k, c);
222  }
223 
224  (out.*op)(r, c, d);
225  }
226  }
227 
228  return out;
229 }
virtual integer iGetNumCols(void) const =0
virtual void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:374
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual void DecCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:379
virtual const doublereal & operator()(integer iRow, integer iCol) const =0
virtual void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: mh.cc:384
static std::stack< cleanup * > c
Definition: cleanup.cc:59
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual integer iGetNumRows(void) const =0

Here is the call graph for this function:

VectorHandler & MatrixHandler::MatTVecDecMul ( VectorHandler out,
const VectorHandler in 
) const
virtual

Definition at line 368 of file mh.cc.

References VectorHandler::DecCoef(), and MatTVecMul_base().

Referenced by LineSearchSolver::Solve().

369 {
370  return MatTVecMul_base(&VectorHandler::DecCoef, out, in);
371 }
virtual void DecCoef(integer iRow, const doublereal &dCoef)=0
virtual VectorHandler & MatTVecMul_base(void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
Definition: mh.cc:304

Here is the call graph for this function:

VectorHandler & MatrixHandler::MatTVecIncMul ( VectorHandler out,
const VectorHandler in 
) const
virtual

Definition at line 356 of file mh.cc.

References VectorHandler::IncCoef(), and MatTVecMul_base().

357 {
358  return MatTVecMul_base(&VectorHandler::IncCoef, out, in);
359 }
virtual void IncCoef(integer iRow, const doublereal &dCoef)=0
virtual VectorHandler & MatTVecMul_base(void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
Definition: mh.cc:304

Here is the call graph for this function:

VectorHandler & MatrixHandler::MatTVecMul ( VectorHandler out,
const VectorHandler in 
) const
virtual

Definition at line 341 of file mh.cc.

References VectorHandler::IncCoef(), MatTVecMul_base(), and VectorHandler::Reset().

Referenced by main(), ModalMappingExt::Recv(), StructMappingExtForce::RecvFromFileDes(), and StructMembraneMappingExtForce::RecvFromFileDes().

342 {
343  /* Put is implemented resetting out first, then passing IncCoef()
344  * so that out-of-order assignments work */
345  out.Reset();
346  return MatTVecMul_base(&VectorHandler::IncCoef, out, in);
347 }
virtual void Reset(void)=0
virtual void IncCoef(integer iRow, const doublereal &dCoef)=0
virtual VectorHandler & MatTVecMul_base(void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
Definition: mh.cc:304

Here is the call graph for this function:

VectorHandler & MatrixHandler::MatTVecMul_base ( void(VectorHandler::*)(integer iRow, const doublereal &dCoef)  op,
VectorHandler out,
const VectorHandler in 
) const
protectedvirtual

Reimplemented in NaivePermMatrixHandler, SpMapMatrixHandler, FullMatrixHandler, CompactSparseMatrixHandler_tpl< off >, and NaiveMatrixHandler.

Definition at line 304 of file mh.cc.

References c, iGetNumCols(), iGetNumRows(), VectorHandler::iGetSize(), MBDYN_EXCEPT_ARGS, and operator()().

Referenced by MatTVecDecMul(), MatTVecIncMul(), and MatTVecMul().

307 {
308  integer nr = iGetNumRows();
309  integer nc = iGetNumCols();
310 
311  if (out.iGetSize() != nc || in.iGetSize() != nr) {
312  silent_cerr("MatrixHandler::MatVecMul_base(): size mismatch "
313  "out(" << out.iGetSize() << ", 1) "
314  "= this(" << nr << ", " << nc << ")^T "
315  "* in(" << in.iGetSize() << ", 1)" << std::endl);
317  }
318 
319  for (integer r = 1; r <= nc; r++) {
320  doublereal d = 0.;
321 
322  for (integer c = 1; c <= nr; c++) {
323  d += this->operator()(c, r)*in(c);
324  }
325  (out.*op)(r, d);
326  }
327 
328  return out;
329 }
virtual integer iGetNumCols(void) const =0
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual integer iGetSize(void) const =0
virtual const doublereal & operator()(integer iRow, integer iCol) const =0
static std::stack< cleanup * > c
Definition: cleanup.cc:59
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual integer iGetNumRows(void) const =0

Here is the call graph for this function:

VectorHandler & MatrixHandler::MatVecDecMul ( VectorHandler out,
const VectorHandler in 
) const
virtual

Definition at line 362 of file mh.cc.

References VectorHandler::DecCoef(), and MatVecMul_base().

Referenced by SchurMatrixHandler::CompNewg().

363 {
364  return MatVecMul_base(&VectorHandler::DecCoef, out, in);
365 }
virtual VectorHandler & MatVecMul_base(void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
Definition: mh.cc:275
virtual void DecCoef(integer iRow, const doublereal &dCoef)=0

Here is the call graph for this function:

VectorHandler & MatrixHandler::MatVecIncMul ( VectorHandler out,
const VectorHandler in 
) const
virtual

Definition at line 350 of file mh.cc.

References VectorHandler::IncCoef(), and MatVecMul_base().

Referenced by AerodynamicModal::AssVec(), and main().

351 {
352  return MatVecMul_base(&VectorHandler::IncCoef, out, in);
353 }
virtual VectorHandler & MatVecMul_base(void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
Definition: mh.cc:275
virtual void IncCoef(integer iRow, const doublereal &dCoef)=0

Here is the call graph for this function:

VectorHandler & MatrixHandler::MatVecMul ( VectorHandler out,
const VectorHandler in 
) const
virtual

Definition at line 332 of file mh.cc.

References VectorHandler::IncCoef(), MatVecMul_base(), and VectorHandler::Reset().

Referenced by main(), ModuleNonsmoothNode::mbs_get_force_frictional(), ModalMappingExt::Send(), StructMappingExtForce::SendToFileDes(), and StructMembraneMappingExtForce::SendToFileDes().

333 {
334  /* Put is implemented resetting out first, then passing IncCoef()
335  * so that out-of-order assignments work */
336  out.Reset();
337  return MatVecMul_base(&VectorHandler::IncCoef, out, in);
338 }
virtual void Reset(void)=0
virtual VectorHandler & MatVecMul_base(void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
Definition: mh.cc:275
virtual void IncCoef(integer iRow, const doublereal &dCoef)=0

Here is the call graph for this function:

VectorHandler & MatrixHandler::MatVecMul_base ( void(VectorHandler::*)(integer iRow, const doublereal &dCoef)  op,
VectorHandler out,
const VectorHandler in 
) const
protectedvirtual

Reimplemented in NaivePermMatrixHandler, SpMapMatrixHandler, FullMatrixHandler, CompactSparseMatrixHandler_tpl< off >, and NaiveMatrixHandler.

Definition at line 275 of file mh.cc.

References c, iGetNumCols(), iGetNumRows(), VectorHandler::iGetSize(), MBDYN_EXCEPT_ARGS, and operator()().

Referenced by MatVecDecMul(), MatVecIncMul(), and MatVecMul().

278 {
279  integer nr = iGetNumRows();
280  integer nc = iGetNumCols();
281 
282  if (out.iGetSize() != nr || in.iGetSize() != nc) {
283  silent_cerr("MatrixHandler::MatVecMul_base(): size mismatch "
284  "out(" << out.iGetSize() << ", 1) "
285  "= this(" << nr << ", " << nc << ") "
286  "* in(" << in.iGetSize() << ", 1)" << std::endl);
288  }
289 
290  for (integer r = 1; r <= nr; r++) {
291  doublereal d = 0.;
292 
293  for (integer c = 1; c <= nc; c++) {
294  d += this->operator()(r, c)*in(c);
295  }
296  (out.*op)(r, d);
297  }
298 
299  return out;
300 
301 }
virtual integer iGetNumCols(void) const =0
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual integer iGetSize(void) const =0
virtual const doublereal & operator()(integer iRow, integer iCol) const =0
static std::stack< cleanup * > c
Definition: cleanup.cc:59
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual integer iGetNumRows(void) const =0

Here is the call graph for this function:

doublereal MatrixHandler::Norm ( enum Norm_t  eNorm = NORM_1) const
virtual

Definition at line 512 of file mh.cc.

513 {
514  integer M;
515  integer N;
516  std::vector<doublereal> A;
517 
518  LapackCopyMatrix(*this, A, M, N);
519 
520  return LapackMatrixNorm(A, M, N, eNorm);
521 }
long int integer
Definition: colamd.c:51
MatrixHandler & MatrixHandler::operator+= ( const SubMatrixHandler SubMH)
virtual

Reimplemented in FullMatrixHandler, and NaiveMatrixHandler.

Definition at line 92 of file mh.cc.

References SubMatrixHandler::AddTo().

93 {
94  return SubMH.AddTo(*this);
95 }
virtual MatrixHandler & AddTo(MatrixHandler &MH) const =0

Here is the call graph for this function:

MatrixHandler & MatrixHandler::operator+= ( const VariableSubMatrixHandler SubMH)
virtual

Reimplemented in FullMatrixHandler, and NaiveMatrixHandler.

Definition at line 106 of file mh.cc.

References VariableSubMatrixHandler::AddTo().

107 {
108  return SubMH.AddTo(*this);
109 }
MatrixHandler & AddTo(MatrixHandler &MH) const
Definition: submat.h:1261

Here is the call graph for this function:

MatrixHandler & MatrixHandler::operator-= ( const SubMatrixHandler SubMH)
virtual

Reimplemented in FullMatrixHandler, and NaiveMatrixHandler.

Definition at line 99 of file mh.cc.

References SubMatrixHandler::SubFrom().

100 {
101  return SubMH.SubFrom(*this);
102 }
virtual MatrixHandler & SubFrom(MatrixHandler &MH) const =0

Here is the call graph for this function:

MatrixHandler & MatrixHandler::operator-= ( const VariableSubMatrixHandler SubMH)
virtual

Reimplemented in FullMatrixHandler, and NaiveMatrixHandler.

Definition at line 113 of file mh.cc.

References VariableSubMatrixHandler::SubFrom().

114 {
115  return SubMH.SubFrom(*this);
116 }
MatrixHandler & SubFrom(MatrixHandler &MH) const
Definition: submat.h:1325

Here is the call graph for this function:

MatrixHandler & MatrixHandler::operator= ( const MatrixHandler MH)
virtual

Definition at line 72 of file mh.cc.

References iGetNumCols(), iGetNumRows(), operator()(), and Resize().

73 {
74  integer nr = MH.iGetNumRows();
75  integer nc = MH.iGetNumCols();
76 
77  Resize(nr, nc);
78 
79  for (integer i = 1; i <= nr; i++) {
80  for (integer ii = 1; ii <= nc; ii++) {
81  this->operator()(i, ii) = MH(i, ii);
82  }
83  }
84 
85  return *this;
86 }
virtual integer iGetNumCols(void) const =0
virtual const doublereal & operator()(integer iRow, integer iCol) const =0
virtual void Resize(integer, integer)=0
long int integer
Definition: colamd.c:51
virtual integer iGetNumRows(void) const =0

Here is the call graph for this function:

integer MatrixHandler::PacMat ( void  )
virtual

Definition at line 65 of file mh.cc.

66 {
67  return 0L;
68 }
const doublereal * MatrixHandler::pdGetMat ( void  ) const
inlinevirtual

Reimplemented in CompactSparseMatrixHandler, and FullMatrixHandler.

Definition at line 209 of file mh.h.

210 {
211  return NULL;
212 }
doublereal * MatrixHandler::pdGetMat ( void  )
inlinevirtual

Reimplemented in FullMatrixHandler.

Definition at line 215 of file mh.h.

216 {
217  return NULL;
218 }
integer * MatrixHandler::piGetCols ( void  ) const
inlinevirtual

Definition at line 229 of file mh.h.

230 {
231  return NULL;
232 }
integer * MatrixHandler::piGetRows ( void  ) const
inlinevirtual

Definition at line 222 of file mh.h.

223 {
224  return NULL;
225 }
void MatrixHandler::PutCoef ( integer  iRow,
integer  iCol,
const doublereal dCoef 
)
virtual

Reimplemented in SparseSubMatrixHandler, SchurMatrixHandlerUm, FullSubMatrixHandler, SpMapMatrixHandler, FullMatrixHandler, and SchurMatrixHandler.

Definition at line 384 of file mh.cc.

References operator()().

Referenced by NRTrim::DoTrim(), DataManager::InitialJointAssembly(), MatMatMul_base(), FullMatrixHandler::MatMatMul_base(), MatTMatMul_base(), FullMatrixHandler::MatTMatMul_base(), SchurMatrixHandler::PutCoef(), and SchurMatrixHandlerUm::PutCoef().

384  {
385  operator()(ix, iy) = val;
386 }
virtual const doublereal & operator()(integer iRow, integer iCol) const =0

Here is the call graph for this function:

void MatrixHandler::ResizeReset ( integer  iNewRow,
integer  iNewCol 
)
virtual

Reimplemented in SparseSubMatrixHandler, FullSubMatrixHandler, and SubMatrixHandler.

Definition at line 56 of file mh.cc.

References Reset(), and Resize().

57 {
58  Resize(iNewRow, iNewCol);
59  Reset();
60 }
virtual void Reset(void)=0
virtual void Resize(integer, integer)=0

Here is the call graph for this function:

MatrixHandler & MatrixHandler::ScalarMul ( const doublereal d)
virtual

Definition at line 119 of file mh.cc.

References iGetNumCols(), iGetNumRows(), and operator()().

120 {
121  integer nr = iGetNumRows();
122  integer nc = iGetNumCols();
123 
124  for (integer i = 1; i <= nr; i++) {
125  for (integer j = 1; j <= nc; j++) {
126  this->operator()(i, j) *= d;
127  }
128  }
129 
130  return *this;
131 }
virtual integer iGetNumCols(void) const =0
virtual const doublereal & operator()(integer iRow, integer iCol) const =0
long int integer
Definition: colamd.c:51
virtual integer iGetNumRows(void) const =0

Here is the call graph for this function:


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