MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
VecExp Class Reference

#include <matvecexp.h>

Collaboration diagram for VecExp:

Public Member Functions

 VecExp (void)
 
 ~VecExp (void)
 
 VecExp (const VecExp &vin)
 
 VecExp (const Vec6 &vin)
 
 VecExp (const doublereal &d1, const doublereal &d2, const doublereal &d3, const doublereal &d4, const doublereal &d5, const doublereal &d6)
 
 VecExp (const Vec3 &v1, const Vec3 &v2)
 
const Vec3GetVec (void) const
 
const Vec3GetMom (void) const
 
void PutVec (const Vec3 &x)
 
void PutMom (const Vec3 &x)
 
VecExpoperator= (const VecExp &v)
 
VecExpoperator+= (const VecExp &v)
 
VecExpoperator-= (const VecExp &v)
 
VecExpoperator*= (const doublereal &d)
 
VecExpoperator/= (const doublereal &d)
 
VecExp operator+ (const VecExp &v) const
 
VecExp operator- (const VecExp &v) const
 
VecExp operator* (const doublereal &d) const
 
VecExp operator/ (const doublereal &d) const
 
VecExp operator* (const ScalExp &d) const
 
VecExp operator/ (const ScalExp &d) const
 
ScalExp operator* (const VecExp &v) const
 
VecExp Cross (const VecExp &v) const
 
MatExp Cross (void) const
 
MatExp Tens (const VecExp &v) const
 
std::ostream & Write (std::ostream &out, const char *sFill=" ") const
 

Protected Attributes

Vec3 vec
 
Vec3 mom
 

Detailed Description

Definition at line 165 of file matvecexp.h.

Constructor & Destructor Documentation

VecExp::VecExp ( void  )
inline

Definition at line 171 of file matvecexp.h.

References NO_OP.

Referenced by Cross(), operator*(), operator+(), operator-(), and operator/().

171  {
172  NO_OP;
173  };
#define NO_OP
Definition: myassert.h:74
VecExp::~VecExp ( void  )
inline

Definition at line 175 of file matvecexp.h.

References NO_OP.

175  {
176  NO_OP;
177  };
#define NO_OP
Definition: myassert.h:74
VecExp::VecExp ( const VecExp vin)
inline

Definition at line 179 of file matvecexp.h.

References NO_OP.

179  : vec(vin.vec), mom(vin.mom) {
180  NO_OP;
181  };
#define NO_OP
Definition: myassert.h:74
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167
VecExp::VecExp ( const Vec6 vin)
inline

Definition at line 183 of file matvecexp.h.

References NO_OP.

183  : vec(vin.GetVec1()), mom(vin.GetVec2()) {
184  NO_OP;
185  };
const Vec3 & GetVec2(void) const
Definition: matvec6.h:76
#define NO_OP
Definition: myassert.h:74
const Vec3 & GetVec1(void) const
Definition: matvec6.h:72
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167
VecExp::VecExp ( const doublereal d1,
const doublereal d2,
const doublereal d3,
const doublereal d4,
const doublereal d5,
const doublereal d6 
)
inline

Definition at line 187 of file matvecexp.h.

References NO_OP.

190  : vec(Vec3(d1, d2, d3)), mom(Vec3(d4, d5, d6)) {
191  NO_OP;
192  };
Definition: matvec3.h:98
#define NO_OP
Definition: myassert.h:74
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167
VecExp::VecExp ( const Vec3 v1,
const Vec3 v2 
)
inline

Definition at line 194 of file matvecexp.h.

References NO_OP.

194  : vec(v1), mom(v2) {
195  NO_OP;
196  };
#define NO_OP
Definition: myassert.h:74
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167

Member Function Documentation

VecExp VecExp::Cross ( const VecExp v) const
inline

Definition at line 300 of file matvecexp.h.

References Vec3::Cross(), mom, vec, and VecExp().

Referenced by RoTrManip::Elle().

300  {
301  return VecExp(vec.Cross(v.vec),
302  vec.Cross(v.mom)+mom.Cross(v.vec));
303  };
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Vec3 mom
Definition: matvecexp.h:168
VecExp(void)
Definition: matvecexp.h:171
Vec3 vec
Definition: matvecexp.h:167

Here is the call graph for this function:

MatExp VecExp::Cross ( void  ) const
inline

Definition at line 421 of file matvecexp.h.

References MatCross, mom, and vec.

421  {
422  return MatExp(Mat3x3(MatCross, vec), Mat3x3(MatCross, mom));
423 }
const MatCross_Manip MatCross
Definition: matvec3.cc:639
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167
const Vec3& VecExp::GetMom ( void  ) const
inline

Definition at line 202 of file matvecexp.h.

References mom.

Referenced by Compute(), MatExp::MatExp(), MatExp::operator*(), operator-(), operator<<(), and Tens().

202  {
203  return mom;
204  };
Vec3 mom
Definition: matvecexp.h:168
VecExp VecExp::operator* ( const doublereal d) const
inline

Definition at line 277 of file matvecexp.h.

References mom, vec, and VecExp().

277  {
278  return VecExp(vec*d, mom*d);
279  };
Vec3 mom
Definition: matvecexp.h:168
VecExp(void)
Definition: matvecexp.h:171
Vec3 vec
Definition: matvecexp.h:167

Here is the call graph for this function:

VecExp VecExp::operator* ( const ScalExp d) const
inline

Definition at line 286 of file matvecexp.h.

References ScalExp::GetMom(), ScalExp::GetVec(), mom, vec, and VecExp().

286  {
287  return VecExp(vec*d.GetVec(), mom*d.GetVec()+vec*d.GetMom());
288  };
const doublereal & GetVec(void) const
Definition: matvecexp.h:90
const doublereal & GetMom(void) const
Definition: matvecexp.h:94
Vec3 mom
Definition: matvecexp.h:168
VecExp(void)
Definition: matvecexp.h:171
Vec3 vec
Definition: matvecexp.h:167

Here is the call graph for this function:

ScalExp VecExp::operator* ( const VecExp v) const
inline

Definition at line 296 of file matvecexp.h.

References mom, and vec.

296  {
297  return ScalExp(vec*v.vec, mom*v.vec+vec*v.mom);
298  };
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167
VecExp& VecExp::operator*= ( const doublereal d)
inline

Definition at line 232 of file matvecexp.h.

References mom, and vec.

232  {
233  //M> ma si guadagna? spero di no, chi e' cosi' fessacchiotto
234  //M> da moltiplicare spesso
235  //M> per 1. o per zero di questi tempi?
236  //P> tutte le volte che moltiplichi per una variabile
237  //P> di cui non conosci il valore (forse sono paranoico ...)
238 #ifdef __MBDYN_PARANOID__
239  if (d == 1.) {
240  return *this; /* No operations */
241  }
242  if (d == 0.) {
243  vec = Vec3(0.); /* Reset vector */
244  mom = Vec3(0.);
245  return *this;
246  }
247  /* else */
248 #endif /* __MBDYN_PARANOID__ */
249  vec *= d; /* Multiply */
250  mom *= d;
251  return *this;
252  };
Definition: matvec3.h:98
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167
VecExp VecExp::operator+ ( const VecExp v) const
inline

Definition at line 269 of file matvecexp.h.

References mom, vec, and VecExp().

269  {
270  return VecExp(vec+v.vec, mom+v.mom);
271  };
Vec3 mom
Definition: matvecexp.h:168
VecExp(void)
Definition: matvecexp.h:171
Vec3 vec
Definition: matvecexp.h:167

Here is the call graph for this function:

VecExp& VecExp::operator+= ( const VecExp v)
inline

Definition at line 220 of file matvecexp.h.

References mom, and vec.

220  {
221  vec += v.vec;
222  mom += v.mom;
223  return *this;
224  };
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167
VecExp VecExp::operator- ( const VecExp v) const
inline

Definition at line 273 of file matvecexp.h.

References mom, vec, and VecExp().

273  {
274  return VecExp(vec-v.vec, mom-v.mom);
275  };
Vec3 mom
Definition: matvecexp.h:168
VecExp(void)
Definition: matvecexp.h:171
Vec3 vec
Definition: matvecexp.h:167

Here is the call graph for this function:

VecExp& VecExp::operator-= ( const VecExp v)
inline

Definition at line 226 of file matvecexp.h.

References mom, and vec.

226  {
227  vec -= v.vec;
228  mom -= v.mom;
229  return *this;
230  };
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167
VecExp VecExp::operator/ ( const doublereal d) const
inline

Definition at line 281 of file matvecexp.h.

References ASSERT, mom, vec, and VecExp().

281  {
282  ASSERT(d != 0.);
283  return VecExp(vec/d, mom/d);
284  };
#define ASSERT(expression)
Definition: colamd.c:977
Vec3 mom
Definition: matvecexp.h:168
VecExp(void)
Definition: matvecexp.h:171
Vec3 vec
Definition: matvecexp.h:167

Here is the call graph for this function:

VecExp VecExp::operator/ ( const ScalExp d) const
inline

Definition at line 290 of file matvecexp.h.

References ASSERT, ScalExp::GetMom(), ScalExp::GetVec(), mom, vec, and VecExp().

290  {
291  ASSERT(d.GetVec() != 0.);
292  return VecExp(vec/d.GetVec(),
293  (mom*d.GetVec()-vec*d.GetMom())/(d.GetVec()*d.GetVec()));
294  };
const doublereal & GetVec(void) const
Definition: matvecexp.h:90
const doublereal & GetMom(void) const
Definition: matvecexp.h:94
#define ASSERT(expression)
Definition: colamd.c:977
Vec3 mom
Definition: matvecexp.h:168
VecExp(void)
Definition: matvecexp.h:171
Vec3 vec
Definition: matvecexp.h:167

Here is the call graph for this function:

VecExp& VecExp::operator/= ( const doublereal d)
inline

Definition at line 254 of file matvecexp.h.

References MBDYN_EXCEPT_ARGS, mom, and vec.

254  {
255 #ifdef __MBDYN_PARANOID__
256  if (d == 1.) {
257  return *this; /* No operations */
258  }
259  if (d == 0.) {
260  throw ErrDivideByZero(MBDYN_EXCEPT_ARGS); /* error */
261  }
262  /* else */
263 #endif /* __MBDYN_PARANOID__ */
264  vec /= d; /* divide */
265  mom /= d;
266  return *this;
267  };
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167
VecExp& VecExp::operator= ( const VecExp v)
inline

Definition at line 214 of file matvecexp.h.

References mom, and vec.

214  {
215  vec = v.vec;
216  mom = v.mom;
217  return *this;
218  };
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167
void VecExp::PutMom ( const Vec3 x)
inline

Definition at line 210 of file matvecexp.h.

References mom.

210  {
211  mom = x;
212  };
Vec3 mom
Definition: matvecexp.h:168
void VecExp::PutVec ( const Vec3 x)
inline

Definition at line 206 of file matvecexp.h.

References vec.

206  {
207  vec = x;
208  };
Vec3 vec
Definition: matvecexp.h:167
MatExp VecExp::Tens ( const VecExp v) const
inline

Definition at line 431 of file matvecexp.h.

References GetMom(), GetVec(), mom, Vec3::Tens(), and vec.

431  {
432  return MatExp(vec.Tens(v.GetVec()), mom.Tens(v.GetMom()));
433 };
const Vec3 & GetVec(void) const
Definition: matvecexp.h:198
const Vec3 & GetMom(void) const
Definition: matvecexp.h:202
Mat3x3 Tens(const Vec3 &v) const
Definition: matvec3.cc:53
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167

Here is the call graph for this function:

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

Definition at line 139 of file matvecexp.cc.

References Vec3::dGet(), mom, and vec.

Referenced by Write().

140 {
141  return out
142  << vec.dGet(1) << sFill
143  << vec.dGet(2) << sFill
144  << vec.dGet(3) << sFill
145  << mom.dGet(1) << sFill
146  << mom.dGet(2) << sFill
147  << mom.dGet(3);
148 }
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
Vec3 mom
Definition: matvecexp.h:168
Vec3 vec
Definition: matvecexp.h:167

Here is the call graph for this function:

Member Data Documentation


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