MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
MinMaxDriveCaller Class Referenceabstract
Inheritance diagram for MinMaxDriveCaller:
Collaboration diagram for MinMaxDriveCaller:

Public Member Functions

virtual ~MinMaxDriveCaller ()
 
bool bIsDifferentiable (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
doublereal dGet (void) const
 
doublereal dGetP (void) const
 
doublereal dGet (const doublereal &dVar) const
 
virtual doublereal dGetP (const doublereal &dVar) const
 
- Public Member Functions inherited from DriveCaller
 DriveCaller (const DriveHandler *pDH)
 
virtual ~DriveCaller (void)
 
virtual DriveCallerpCopy (void) const =0
 
virtual void SetDrvHdl (const DriveHandler *pDH)
 
virtual const DriveHandlerpGetDrvHdl (void) const
 
virtual void Output (OutputHandler &OH) const
 
virtual void Trace (OutputHandler &OH) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from Traceable
 Traceable (flag fTrace=0)
 
virtual ~Traceable (void)
 
virtual flag fToBeTraced (void) const
 
virtual void SetTraceFlag (flag f=TRACE)
 

Protected Types

typedef std::vector
< DriveOwner >::const_iterator 
iterator
 

Protected Member Functions

 MinMaxDriveCaller (const std::vector< DriveOwner > &drives)
 
virtual bool bCompare (doublereal lhs, doublereal rhs) const =0
 
virtual const char * c_str (void) const =0
 

Protected Attributes

const std::vector< DriveOwnerdrives
 
- Protected Attributes inherited from DriveCaller
DriveHandlerpDrvHdl
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 

Additional Inherited Members

- Public Types inherited from DriveCaller
enum  OutputFlags { OUTPUT_VALUE = OUTPUT_PRIVATE << 0, OUTPUT_DERIVATIVE = OUTPUT_PRIVATE << 1 }
 
enum  TraceFlags { TRACE_VALUE = TRACE_PRIVATE << 0, TRACE_DERIVATIVE = TRACE_PRIVATE << 1 }
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 
- Public Types inherited from Traceable
enum  { TRACE = 0x01U, TRACE_PUBLIC_MASK = 0x0FU, TRACE_PRIVATE = 0x10U, TRACE_PRIVATE_MASK = ~TRACE_PUBLIC_MASK }
 

Detailed Description

Definition at line 55 of file module-minmaxdrive.cc.

Member Typedef Documentation

typedef std::vector<DriveOwner>::const_iterator MinMaxDriveCaller::iterator
protected

Definition at line 71 of file module-minmaxdrive.cc.

Constructor & Destructor Documentation

MinMaxDriveCaller::MinMaxDriveCaller ( const std::vector< DriveOwner > &  drives)
protected

Definition at line 112 of file module-minmaxdrive.cc.

References NO_OP.

113 : DriveCaller(0),
114  drives(drives)
115 {
116  NO_OP;
117 }
#define NO_OP
Definition: myassert.h:74
DriveCaller(const DriveHandler *pDH)
Definition: drive.cc:475
const std::vector< DriveOwner > drives
MinMaxDriveCaller::~MinMaxDriveCaller ( )
virtual

Definition at line 119 of file module-minmaxdrive.cc.

References NO_OP.

120 {
121  NO_OP;
122 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

virtual bool MinMaxDriveCaller::bCompare ( doublereal  lhs,
doublereal  rhs 
) const
protectedpure virtual

Implemented in MaxDriveCaller, and MinDriveCaller.

Referenced by dGet(), and dGetP().

bool MinMaxDriveCaller::bIsDifferentiable ( void  ) const
virtual

Reimplemented from DriveCaller.

Definition at line 194 of file module-minmaxdrive.cc.

References drives.

195 {
196  for (iterator i = drives.begin(); i != drives.end(); ++i) {
197  if (!i->bIsDifferentiable()) {
198  return false;
199  }
200  }
201 
202  return true;
203 }
std::vector< DriveOwner >::const_iterator iterator
const std::vector< DriveOwner > drives
virtual const char* MinMaxDriveCaller::c_str ( void  ) const
protectedpure virtual

Implemented in MaxDriveCaller, and MinDriveCaller.

Referenced by Restart().

doublereal MinMaxDriveCaller::dGet ( void  ) const
virtual

Reimplemented from DriveCaller.

Definition at line 125 of file module-minmaxdrive.cc.

References bCompare(), and drives.

126 {
127  iterator i = drives.begin();
128  doublereal dVal = i++->dGet();
129 
130  for ( ; i != drives.end(); ++i) {
131  const doublereal dTmp = i->dGet();
132 
133  if (bCompare(dTmp, dVal)) {
134  dVal = dTmp;
135  }
136  }
137 
138  return dVal;
139 }
std::vector< DriveOwner >::const_iterator iterator
const std::vector< DriveOwner > drives
double doublereal
Definition: colamd.c:52
virtual bool bCompare(doublereal lhs, doublereal rhs) const =0

Here is the call graph for this function:

doublereal MinMaxDriveCaller::dGet ( const doublereal dVar) const
virtual

Implements DriveCaller.

Definition at line 160 of file module-minmaxdrive.cc.

References bCompare(), and drives.

161 {
162  iterator i = drives.begin();
163  doublereal dVal = i++->dGet(dVar);
164 
165  for ( ; i != drives.end(); ++i) {
166  const doublereal dTmp = i->dGet(dVar);
167 
168  if (bCompare(dTmp, dVal)) {
169  dVal = dTmp;
170  }
171  }
172 
173  return dVal;
174 }
std::vector< DriveOwner >::const_iterator iterator
const std::vector< DriveOwner > drives
double doublereal
Definition: colamd.c:52
virtual bool bCompare(doublereal lhs, doublereal rhs) const =0

Here is the call graph for this function:

doublereal MinMaxDriveCaller::dGetP ( void  ) const
virtual

Reimplemented from DriveCaller.

Definition at line 141 of file module-minmaxdrive.cc.

References bCompare(), and drives.

142 {
143  iterator i = drives.begin();
144  iterator iMin = i;
145  doublereal dVal = i++->dGet();
146 
147  for ( ; i != drives.end(); ++i) {
148  const doublereal dTmp = i->dGet();
149 
150  if (bCompare(dTmp, dVal)) {
151  dVal = dTmp;
152  iMin = i;
153  }
154  }
155 
156  return iMin->dGetP();
157 }
std::vector< DriveOwner >::const_iterator iterator
const std::vector< DriveOwner > drives
double doublereal
Definition: colamd.c:52
virtual bool bCompare(doublereal lhs, doublereal rhs) const =0

Here is the call graph for this function:

doublereal MinMaxDriveCaller::dGetP ( const doublereal dVar) const
virtual

Reimplemented from DriveCaller.

Definition at line 176 of file module-minmaxdrive.cc.

References bCompare(), and drives.

177 {
178  iterator i = drives.begin();
179  iterator iMin = i;
180  doublereal dVal = i++->dGet(dVar);
181 
182  for ( ; i != drives.end(); ++i) {
183  const doublereal dTmp = i->dGet(dVar);
184 
185  if (bCompare(dTmp, dVal)) {
186  dVal = dTmp;
187  iMin = i;
188  }
189  }
190 
191  return iMin->dGetP(dVar);
192 }
std::vector< DriveOwner >::const_iterator iterator
const std::vector< DriveOwner > drives
double doublereal
Definition: colamd.c:52
virtual bool bCompare(doublereal lhs, doublereal rhs) const =0

Here is the call graph for this function:

std::ostream & MinMaxDriveCaller::Restart ( std::ostream &  out) const
virtual

Implements DriveCaller.

Definition at line 207 of file module-minmaxdrive.cc.

References c_str(), and drives.

208 {
209  out << c_str() << ", "
210  << drives.size() << ", ";
211 
212  for (iterator i = drives.begin(); i != drives.end(); ++i) {
213  i->pGetDriveCaller()->Restart(out);
214 
215  if (drives.end() - i > 1) {
216  out << ", ";
217  }
218  }
219 
220  return out;
221 }
std::vector< DriveOwner >::const_iterator iterator
const std::vector< DriveOwner > drives
virtual const char * c_str(void) const =0

Here is the call graph for this function:

Member Data Documentation

const std::vector<DriveOwner> MinMaxDriveCaller::drives
protected

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