MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
matvecexp.cc File Reference
#include "mbconfig.h"
#include "matvecexp.h"
Include dependency graph for matvecexp.cc:

Go to the source code of this file.

Functions

ScalExp pow (const ScalExp &d, const doublereal &e)
 
ScalExp sqrt (const ScalExp &d)
 
ScalExp sin (const ScalExp &d)
 
ScalExp cos (const ScalExp &d)
 
ScalExp exp (const ScalExp &d)
 
std::ostream & operator<< (std::ostream &out, const ScalExp &v)
 
std::ostream & Write (std::ostream &out, const ScalExp &v, const char *sFill)
 
VecExp operator- (const VecExp &v)
 
std::ostream & operator<< (std::ostream &out, const VecExp &v)
 
std::ostream & Write (std::ostream &out, const VecExp &v, const char *sFill)
 
std::ostream & operator<< (std::ostream &out, const MatExp &m)
 
std::ostream & Write (std::ostream &out, const MatExp &m, const char *sFill, const char *sFill2)
 

Variables

const VecExp ZeroExp (0., 0., 0., 0., 0., 0.)
 
const MatExp EyeExp (Mat3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), Mat3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.))
 

Function Documentation

ScalExp cos ( const ScalExp d)

Definition at line 93 of file matvecexp.cc.

References cos(), ScalExp::GetMom(), ScalExp::GetVec(), and sin().

Referenced by cos(), and sin().

94 {
95  doublereal p = d.GetVec();
96  return ScalExp(cos(p), d.GetMom()*(-sin(p)));
97 };
ScalExp cos(const ScalExp &d)
Definition: matvecexp.cc:93
ScalExp sin(const ScalExp &d)
Definition: matvecexp.cc:86
const doublereal & GetVec(void) const
Definition: matvecexp.h:90
const doublereal & GetMom(void) const
Definition: matvecexp.h:94
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

ScalExp exp ( const ScalExp d)

Definition at line 100 of file matvecexp.cc.

References exp(), ScalExp::GetMom(), and ScalExp::GetVec().

Referenced by exp().

101 {
102  doublereal p = exp(d.GetVec());
103  return ScalExp(p, d.GetMom()*p);
104 };
ScalExp exp(const ScalExp &d)
Definition: matvecexp.cc:100
const doublereal & GetVec(void) const
Definition: matvecexp.h:90
const doublereal & GetMom(void) const
Definition: matvecexp.h:94
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

VecExp operator- ( const VecExp v)

Definition at line 151 of file matvecexp.cc.

References VecExp::GetMom(), and VecExp::GetVec().

152 {
153  return VecExp(-v.GetVec(), -v.GetMom());
154 }
const Vec3 & GetVec(void) const
Definition: matvecexp.h:198
const Vec3 & GetMom(void) const
Definition: matvecexp.h:202

Here is the call graph for this function:

std::ostream& operator<< ( std::ostream &  out,
const ScalExp v 
)

Definition at line 125 of file matvecexp.cc.

References ScalExp::GetMom(), and ScalExp::GetVec().

126 {
127  return out
128  << v.GetVec() << " "
129  << v.GetMom();
130 }
const doublereal & GetVec(void) const
Definition: matvecexp.h:90
const doublereal & GetMom(void) const
Definition: matvecexp.h:94

Here is the call graph for this function:

std::ostream& operator<< ( std::ostream &  out,
const VecExp v 
)

Definition at line 157 of file matvecexp.cc.

References Vec3::dGet(), VecExp::GetMom(), and VecExp::GetVec().

158 {
159  const Vec3& vec = v.GetVec();
160  const Vec3& mom = v.GetMom();
161  return out
162  << vec.dGet(1) << " "
163  << vec.dGet(2) << " "
164  << vec.dGet(3) << " "
165  << mom.dGet(1) << " "
166  << mom.dGet(2) << " "
167  << mom.dGet(3);
168 }
const Vec3 & GetVec(void) const
Definition: matvecexp.h:198
Definition: matvec3.h:98
const Vec3 & GetMom(void) const
Definition: matvecexp.h:202
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285

Here is the call graph for this function:

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

Definition at line 224 of file matvecexp.cc.

References Mat3x3::dGet(), MatExp::GetMom(), and MatExp::GetVec().

225 {
226  const Mat3x3& vec = m.GetVec();
227  const Mat3x3& mom = m.GetMom();
228  return out
229  << vec.dGet(1, 1) << " "
230  << vec.dGet(1, 2) << " "
231  << vec.dGet(1, 3) << " "
232  << mom.dGet(1, 1) << " "
233  << mom.dGet(1, 2) << " "
234  << mom.dGet(1, 3) << std::endl
235  << vec.dGet(2, 1) << " "
236  << vec.dGet(2, 2) << " "
237  << vec.dGet(2, 3) << " "
238  << mom.dGet(2, 1) << " "
239  << mom.dGet(2, 2) << " "
240  << mom.dGet(2, 3) << std::endl
241  << vec.dGet(3, 1) << " "
242  << vec.dGet(3, 2) << " "
243  << vec.dGet(3, 3) << " "
244  << mom.dGet(3, 1) << " "
245  << mom.dGet(3, 2) << " "
246  << mom.dGet(3, 3) << std::endl
247  << 0. << " "
248  << 0. << " "
249  << 0. << " "
250  << vec.dGet(1, 1) << " "
251  << vec.dGet(1, 2) << " "
252  << vec.dGet(1, 3) << std::endl
253  << 0. << " "
254  << 0. << " "
255  << 0. << " "
256  << vec.dGet(2, 1) << " "
257  << vec.dGet(2, 2) << " "
258  << vec.dGet(2, 3) << std::endl
259  << 0. << " "
260  << 0. << " "
261  << 0. << " "
262  << vec.dGet(3, 1) << " "
263  << vec.dGet(3, 2) << " "
264  << vec.dGet(3, 3);
265 }
const Mat3x3 & GetVec(void) const
Definition: matvecexp.h:356
const doublereal & dGet(unsigned short int iRow, unsigned short int iCol) const
Definition: matvec3.h:770
const Mat3x3 & GetMom(void) const
Definition: matvecexp.h:360

Here is the call graph for this function:

ScalExp pow ( const ScalExp d,
const doublereal e 
)

Definition at line 66 of file matvecexp.cc.

References ScalExp::GetMom(), ScalExp::GetVec(), and pow().

Referenced by pow().

67 {
68 #ifdef MBDYN_SINGLE_PRECISION
69  double p = d.GetVec();
70  return ScalExp(doublereal(pow(p, double(e))),
71  doublereal(d.GetMom()*(e*pow(p, double(e-1.)))));
72 #else /* ! MBDYN_SINGLE_PRECISION */
73  doublereal p = d.GetVec();
74  return ScalExp(pow(p, e), d.GetMom()*(e*pow(p, e-1.)));
75 #endif /* ! MBDYN_SINGLE_PRECISION */
76 };
ScalExp pow(const ScalExp &d, const doublereal &e)
Definition: matvecexp.cc:66
const doublereal & GetVec(void) const
Definition: matvecexp.h:90
const doublereal & GetMom(void) const
Definition: matvecexp.h:94
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

ScalExp sin ( const ScalExp d)

Definition at line 86 of file matvecexp.cc.

References cos(), ScalExp::GetMom(), ScalExp::GetVec(), and sin().

Referenced by cos(), and sin().

87 {
88  doublereal p = d.GetVec();
89  return ScalExp(sin(p), d.GetMom()*cos(p));
90 };
ScalExp cos(const ScalExp &d)
Definition: matvecexp.cc:93
ScalExp sin(const ScalExp &d)
Definition: matvecexp.cc:86
const doublereal & GetVec(void) const
Definition: matvecexp.h:90
const doublereal & GetMom(void) const
Definition: matvecexp.h:94
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

ScalExp sqrt ( const ScalExp d)

Definition at line 79 of file matvecexp.cc.

References ScalExp::GetMom(), ScalExp::GetVec(), and sqrt().

Referenced by sqrt().

80 {
81  doublereal p = sqrt(d.GetVec());
82  return ScalExp(p, d.GetMom()/(p*2.));
83 };
const doublereal & GetVec(void) const
Definition: matvecexp.h:90
const doublereal & GetMom(void) const
Definition: matvecexp.h:94
double doublereal
Definition: colamd.c:52
ScalExp sqrt(const ScalExp &d)
Definition: matvecexp.cc:79

Here is the call graph for this function:

std::ostream& Write ( std::ostream &  out,
const ScalExp v,
const char *  sFill 
)

Definition at line 133 of file matvecexp.cc.

References ScalExp::Write().

134 {
135  return v.Write(out, sFill);
136 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvecexp.cc:110

Here is the call graph for this function:

std::ostream& Write ( std::ostream &  out,
const VecExp v,
const char *  sFill 
)

Definition at line 171 of file matvecexp.cc.

References VecExp::Write().

172 {
173  return v.Write(out, sFill);
174 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvecexp.cc:139

Here is the call graph for this function:

std::ostream& Write ( std::ostream &  out,
const MatExp m,
const char *  sFill,
const char *  sFill2 
)

Definition at line 268 of file matvecexp.cc.

References MatExp::Write().

269 {
270  return m.Write(out, sFill, sFill2);
271 }
std::ostream & Write(std::ostream &out, const char *sFill=" ", const char *sFill2=NULL) const
Definition: matvecexp.cc:177

Here is the call graph for this function:

Variable Documentation

const MatExp EyeExp(Mat3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), Mat3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.))
const VecExp ZeroExp(0., 0., 0., 0., 0., 0.)