MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
RowMaxMatrixScale< T > Class Template Reference

#include <dgeequ.h>

Inheritance diagram for RowMaxMatrixScale< T >:
Collaboration diagram for RowMaxMatrixScale< T >:

Public Member Functions

 RowMaxMatrixScale (const SolutionManager::ScaleOpt &scale)
 
virtual ~RowMaxMatrixScale ()
 
- Public Member Functions inherited from MatrixScale< T >
 MatrixScale (const SolutionManager::ScaleOpt &scale)
 
virtual ~MatrixScale ()
 
T & ScaleMatrix (T &mh) const
 
bool ComputeScaleFactors (const T &mh)
 
- Public Member Functions inherited from MatrixScaleBase
 MatrixScaleBase (const SolutionManager::ScaleOpt &scale)
 
virtual ~MatrixScaleBase ()
 
VectorHandlerScaleRightHandSide (VectorHandler &bVH) const
 
VectorHandlerScaleSolution (VectorHandler &xVH) const
 
std::ostream & Report (std::ostream &os) const
 
const std::vector< doublereal > & GetRowScale () const
 
const std::vector< doublereal > & GetColScale () const
 
bool bGetInitialized () const
 

Protected Member Functions

virtual bool ComputeScaleFactors (const T &mh, std::vector< doublereal > &rowScale, std::vector< doublereal > &colScale)
 
virtual std::ostream & vReport (std::ostream &os) const
 
- Protected Member Functions inherited from MatrixScaleBase
MatrixHandler::Norm_t GetCondNumNorm () const
 
void Prepare (const MatrixHandler &mh, integer &nrows, integer &ncols)
 
void PrepareRows (const MatrixHandler &mh, integer &nrows)
 
void PrepareCols (const MatrixHandler &mh, integer &ncols)
 
bool bReport () const
 

Private Attributes

std::vector< doublerealnormRow
 

Additional Inherited Members

- Static Public Member Functions inherited from MatrixScale< T >
static MatrixScale< T > * Allocate (const SolutionManager::ScaleOpt &scale)
 
- Protected Attributes inherited from MatrixScaleBase
std::vector< doublerealrowScale
 
std::vector< doublerealcolScale
 
doublereal dCondBefore
 
doublereal dCondAfter
 
const unsigned uFlags
 
bool bOK
 

Detailed Description

template<typename T>
class RowMaxMatrixScale< T >

Definition at line 108 of file dgeequ.h.

Constructor & Destructor Documentation

template<typename T >
RowMaxMatrixScale< T >::RowMaxMatrixScale ( const SolutionManager::ScaleOpt scale)
inline

Definition at line 411 of file dgeequ.h.

412  :MatrixScale<T>(scale)
413 {
414 
415 }
template<typename T >
RowMaxMatrixScale< T >::~RowMaxMatrixScale ( )
virtual

Definition at line 418 of file dgeequ.h.

419 {
420 
421 }

Member Function Documentation

template<typename T >
bool RowMaxMatrixScale< T >::ComputeScaleFactors ( const T &  mh,
std::vector< doublereal > &  rowScale,
std::vector< doublereal > &  colScale 
)
protectedvirtual

Implements MatrixScale< T >.

Definition at line 424 of file dgeequ.h.

References MatrixScaleBase::PrepareRows().

425 {
426  integer nrows;
427 
428  MatrixScaleBase::PrepareRows(mh, nrows);
429 
430  if (normRow.empty()) {
431  normRow.resize(nrows, 0.);
432  } else {
433  std::fill(normRow.begin(), normRow.end(), 0.);
434  }
435 
436  for (typename T::const_iterator i = mh.begin(); i != mh.end(); ++i) {
437  const doublereal d = std::abs(i->dCoef);
438 
439  if (d > normRow[i->iRow]) {
440  normRow[i->iRow] = d;
441  }
442  }
443 
444  for (int i = 0; i < nrows; ++i) {
445  rowScale[i] = 1. / normRow[i];
446  }
447 
448  return true;
449 }
std::vector< doublereal > normRow
Definition: dgeequ.h:119
std::vector< doublereal > rowScale
Definition: dgeequ.h:68
void PrepareRows(const MatrixHandler &mh, integer &nrows)
Definition: dgeequ.cc:82
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

template<typename T >
std::ostream & RowMaxMatrixScale< T >::vReport ( std::ostream &  os) const
protectedvirtual

Implements MatrixScaleBase.

Definition at line 452 of file dgeequ.h.

453 {
454  return os;
455 }

Member Data Documentation

template<typename T >
std::vector<doublereal> RowMaxMatrixScale< T >::normRow
private

Definition at line 119 of file dgeequ.h.


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