MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
ArrayTplDriveCaller< T > Class Template Reference
Inheritance diagram for ArrayTplDriveCaller< T >:
Collaboration diagram for ArrayTplDriveCaller< T >:

Public Member Functions

 ArrayTplDriveCaller (std::vector< DrivesArray< T > > &dc)
 
 ~ArrayTplDriveCaller (void)
 
virtual TplDriveCaller< T > * pCopy (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual std::ostream & Restart_int (std::ostream &out) const
 
Get (const doublereal &dVar) const
 
Get (void) const
 
bool bIsDifferentiable (void) const
 
GetP (void) const
 
int getNDrives (void) const
 
- Public Member Functions inherited from TplDriveCaller< T >
virtual ~TplDriveCaller (void)
 

Protected Attributes

std::vector< DrivesArray< T > > m_dc
 

Detailed Description

template<class T>
class ArrayTplDriveCaller< T >

Definition at line 510 of file tpldrive_impl.cc.

Constructor & Destructor Documentation

template<class T >
ArrayTplDriveCaller< T >::ArrayTplDriveCaller ( std::vector< DrivesArray< T > > &  dc)
inline

Definition at line 515 of file tpldrive_impl.cc.

References ASSERT.

516  : m_dc(dc) {
517  ASSERT(!dc.empty());
518  };
#define ASSERT(expression)
Definition: colamd.c:977
std::vector< DrivesArray< T > > m_dc
template<class T >
ArrayTplDriveCaller< T >::~ArrayTplDriveCaller ( void  )
inline

Definition at line 520 of file tpldrive_impl.cc.

References ArrayTplDriveCaller< T >::m_dc, and SAFEDELETE.

520  {
521  for (unsigned i = 0; i < m_dc.size(); i++) {
522  SAFEDELETE(m_dc[i].pDriveCaller);
523  }
524  };
std::vector< DrivesArray< T > > m_dc
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

template<class T >
bool ArrayTplDriveCaller< T >::bIsDifferentiable ( void  ) const
inlinevirtual

Reimplemented from TplDriveCaller< T >.

Definition at line 578 of file tpldrive_impl.cc.

References ArrayTplDriveCaller< T >::m_dc.

578  {
579  for (unsigned i = 0; i < m_dc.size(); i++) {
580  if (!m_dc[i].pDriveCaller->bIsDifferentiable()) {
581  return false;
582  }
583  }
584  return true;
585  };
std::vector< DrivesArray< T > > m_dc
template<class T >
T ArrayTplDriveCaller< T >::Get ( const doublereal dVar) const
inlinevirtual

Implements TplDriveCaller< T >.

Definition at line 562 of file tpldrive_impl.cc.

References ArrayTplDriveCaller< T >::m_dc.

562  {
563  T v = mb_zero<T>();
564  for (unsigned i = 0; i < m_dc.size(); i++) {
565  v += (m_dc[i].t)*(m_dc[i].pDriveCaller->dGet(dVar));
566  }
567  return v;
568  };
std::vector< DrivesArray< T > > m_dc
template<class T >
T ArrayTplDriveCaller< T >::Get ( void  ) const
inlinevirtual

Reimplemented from TplDriveCaller< T >.

Definition at line 570 of file tpldrive_impl.cc.

References ArrayTplDriveCaller< T >::m_dc.

570  {
571  T v = mb_zero<T>();
572  for (unsigned i = 0; i < m_dc.size(); i++) {
573  v += (m_dc[i].t)*(m_dc[i].pDriveCaller->dGet());
574  }
575  return v;
576  };
std::vector< DrivesArray< T > > m_dc
template<class T >
int ArrayTplDriveCaller< T >::getNDrives ( void  ) const
inlinevirtual

Implements TplDriveCaller< T >.

Definition at line 595 of file tpldrive_impl.cc.

References ArrayTplDriveCaller< T >::m_dc.

595  {
596  return m_dc.size();
597  };
std::vector< DrivesArray< T > > m_dc
template<class T >
T ArrayTplDriveCaller< T >::GetP ( void  ) const
inlinevirtual

Reimplemented from TplDriveCaller< T >.

Definition at line 587 of file tpldrive_impl.cc.

References ArrayTplDriveCaller< T >::m_dc.

587  {
588  T v = mb_zero<T>();
589  for (unsigned i = 0; i < m_dc.size(); i++) {
590  v += (m_dc[i].t)*(m_dc[i].pDriveCaller->dGetP());
591  }
592  return v;
593  };
std::vector< DrivesArray< T > > m_dc
template<class T >
virtual TplDriveCaller<T>* ArrayTplDriveCaller< T >::pCopy ( void  ) const
inlinevirtual

Implements TplDriveCaller< T >.

Definition at line 527 of file tpldrive_impl.cc.

References ArrayTplDriveCaller< T >::m_dc, and SAFENEWWITHCONSTRUCTOR.

527  {
528  std::vector<DrivesArray<T> > dc(m_dc.size());
529  for (unsigned i = 0; i < m_dc.size(); i++) {
530  dc[i].pDriveCaller = m_dc[i].pDriveCaller->pCopy();
531  dc[i].t = m_dc[i].t;
532  }
533 
534  typedef ArrayTplDriveCaller<T> dc_t;
535  TplDriveCaller<T>* pDC = 0;
536 
537  SAFENEWWITHCONSTRUCTOR(pDC, dc_t, dc_t(dc));
538 
539  return pDC;
540  };
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
std::vector< DrivesArray< T > > m_dc
template<class T >
virtual std::ostream& ArrayTplDriveCaller< T >::Restart ( std::ostream &  out) const
inlinevirtual

Implements TplDriveCaller< T >.

Definition at line 543 of file tpldrive_impl.cc.

References ArrayTplDriveCaller< T >::m_dc, and Write().

543  {
544  out << "array, " << m_dc.size();
545  for (unsigned i = 0; i < m_dc.size(); i++) {
546  out << ", ",
547  Write(out, m_dc[i].t, ", ") << ", ",
548  m_dc[i].pDriveCaller->Restart(out);
549  }
550  return out;
551  };
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
std::vector< DrivesArray< T > > m_dc

Here is the call graph for this function:

template<class T >
virtual std::ostream& ArrayTplDriveCaller< T >::Restart_int ( std::ostream &  out) const
inlinevirtual

Implements TplDriveCaller< T >.

Definition at line 553 of file tpldrive_impl.cc.

References ArrayTplDriveCaller< T >::m_dc, and Write().

553  {
554  for (unsigned i = 0; i < m_dc.size(); i++) {
555  out << ", ",
556  Write(out, m_dc[i].t, ", ") << ", ",
557  m_dc[i].pDriveCaller->Restart(out);
558  }
559  return out;
560  };
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
std::vector< DrivesArray< T > > m_dc

Here is the call graph for this function:

Member Data Documentation


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