MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
fullmh.cc File Reference
#include "mbconfig.h"
#include <cstring>
#include <iostream>
#include <iomanip>
#include <fullmh.h>
#include <submat.h>
Include dependency graph for fullmh.cc:

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &out, const FullMatrixHandler &m)
 
std::ostream & Write (std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
 

Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const FullMatrixHandler m 
)

Definition at line 352 of file fullmh.cc.

References FullMatrixHandler::iNumCols, FullMatrixHandler::iNumRows, and FullMatrixHandler::ppdColsm1.

353 {
354 #ifdef HAVE_FMTFLAGS_IN_IOS
355  std::ios::fmtflags oldbits = out.setf(std::ios::scientific);
356 #else /* !HAVE_FMTFLAGS_IN_IOS */
357  long oldbits = out.setf(ios::scientific);
358 #endif /* !HAVE_FMTFLAGS_IN_IOS */
359 
360  out << "<FullMatrixHandler> n. rows: " << m.iNumRows
361  << "; n. cols: " << m.iNumCols << std::endl;
362  for (int i = 1; i <= m.iNumRows; i++) {
363  out << "Row " << std::setw(8) << i;
364  for (int j = 1; j <= m.iNumCols; j++) {
365  out << std::setw(10) << std::setprecision(2)
366  << m.ppdColsm1[j][i];
367  }
368  out << std::endl;
369  }
370 
371  out.flags(oldbits);
372  return out;
373 }
integer iNumRows
Definition: fullmh.h:63
integer iNumCols
Definition: fullmh.h:64
doublereal ** ppdColsm1
Definition: fullmh.h:72
std::ostream& Write ( std::ostream &  out,
const FullMatrixHandler m,
const char *  s,
const char *  s2 
)

Definition at line 376 of file fullmh.cc.

References FullMatrixHandler::iNumCols, FullMatrixHandler::iNumRows, and FullMatrixHandler::ppdColsm1.

Referenced by ReadAerodynamicBeam(), ReadAerodynamicBeam2(), ReadAerodynamicBody(), ReadStructNode(), PrismaticJoint::Restart(), UniversalHingeJoint::Restart(), SphericalHingeJoint::Restart(), GimbalRotationJoint::Restart(), ViscousBody::Restart(), DriveHingeJoint::Restart(), DeformableAxialJoint::Restart(), Brake::Restart(), PlaneHingeJoint::Restart(), DeformableDispJoint::Restart(), DeformableHingeJoint::Restart(), SingleTplDriveCaller< T >::Restart(), DeformableJoint::Restart(), UniversalRotationJoint::Restart(), PlaneRotationJoint::Restart(), UniversalPinJoint::Restart(), AerodynamicBody::Restart(), Body::Restart(), LinearElasticGenericConstitutiveLaw< T, Tder >::Restart(), ShockAbsorberConstitutiveLaw< doublereal, doublereal >::Restart(), AerodynamicBeam::Restart(), AxialRotationJoint::Restart(), LinearElasticGenericAxialTorsionCouplingConstitutiveLaw< Vec6, Mat6x6 >::Restart(), AerodynamicBeam2::Restart(), CubicElasticGenericConstitutiveLaw< doublereal, doublereal >::Restart(), ArrayTplDriveCaller< T >::Restart(), PlanePinJoint::Restart(), CubicElasticGenericConstitutiveLaw< Vec3, Mat3x3 >::Restart(), StructNode::Restart(), LinearViscousGenericConstitutiveLaw< T, Tder >::Restart(), LinearViscoElasticGenericConstitutiveLaw< T, Tder >::Restart(), LTVViscoElasticGenericConstitutiveLaw< T, Tder >::Restart(), LinearViscoElasticGenericAxialTorsionCouplingConstitutiveLaw< Vec6, Mat6x6 >::Restart(), CubicViscoElasticGenericConstitutiveLaw< doublereal, doublereal >::Restart(), CubicViscoElasticGenericConstitutiveLaw< Vec3, Mat3x3 >::Restart(), HBeam::Restart_(), Beam2::Restart_(), Beam::Restart_(), SingleTplDriveCaller< T >::Restart_int(), ElasticConstitutiveLaw< doublereal, doublereal >::Restart_int(), and ArrayTplDriveCaller< T >::Restart_int().

380 {
381 #ifdef HAVE_FMTFLAGS_IN_IOS
382  std::ios::fmtflags oldbits = out.setf(std::ios::scientific);
383 #else /* !HAVE_FMTFLAGS_IN_IOS */
384  long oldbits = out.setf(ios::scientific);
385 #endif /* !HAVE_FMTFLAGS_IN_IOS */
386 
387  if (s2 == NULL) {
388  s2 = s;
389  }
390 
391  for (int i = 1; i <= m.iNumRows; i++) {
392  for (int j = 1; j <= m.iNumCols; j++) {
393  out << std::setw(20) << std::setprecision(12)
394  << m.ppdColsm1[j][i] << s;
395  }
396  out << s2;
397  }
398 
399  out.flags(oldbits);
400  return out;
401 }
integer iNumRows
Definition: fullmh.h:63
integer iNumCols
Definition: fullmh.h:64
doublereal ** ppdColsm1
Definition: fullmh.h:72