Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Vector3D Class Reference

Vector3D is the object that effeciently stores information about about three-deminsional vectors. It is also the parent class of MsqVertex. More...

#include <Vector3D.hpp>

Inheritance diagram for Vector3D:

Public Member Functions

 Vector3D ()
 
 Vector3D (const double &x, const double &y, const double &z)
 
 Vector3D (const double xyz[3])
 
 Vector3D (const Vector3D &to_copy)
 
double x () const
 
double y () const
 
double z () const
 
void get_coordinates (double &x, double &y, double &z) const
 
void get_coordinates (double xyz[3]) const
 
const double & operator[] (size_t index) const
 
void x (const double x)
 
void y (const double y)
 
void z (const double z)
 
void set (const double x, const double y, const double z)
 
void set (const double xyz[3])
 
void set (const Vector3D &to_copy)
 
double & operator[] (size_t index)
 
Vector3Doperator= (const Vector3D &to_copy)
 
Vector3Doperator= (const double &to_copy)
 
Vector3D operator- () const
 
Vector3Doperator*= (const double scalar)
 
Vector3Doperator/= (const double scalar)
 divides each Vector3D entry by the given scalar. More...
 
Vector3Doperator*= (const Vector3D &rhs)
 
Vector3Doperator+= (const Vector3D &rhs)
 
Vector3Doperator-= (const Vector3D &rhs)
 
int within_tolerance_box (const Vector3D &compare_to, double tolerance) const
 
double length_squared () const
 
double length () const
 
void set_length (const double new_length)
 
void normalize ()
 
const double * to_array () const
 
 Vector3D ()
 
 Vector3D (const double &x, const double &y, const double &z)
 
 Vector3D (const double xyz[3])
 
 Vector3D (const Vector3D &to_copy)
 
double x () const
 
double y () const
 
double z () const
 
void get_coordinates (double &x, double &y, double &z) const
 
void get_coordinates (double xyz[3]) const
 
const double & operator[] (size_t index) const
 
void x (const double x)
 
void y (const double y)
 
void z (const double z)
 
void set (const double x, const double y, const double z)
 
void set (const double xyz[3])
 
void set (const Vector3D &to_copy)
 
double & operator[] (size_t index)
 
Vector3Doperator= (const Vector3D &to_copy)
 
Vector3Doperator= (const double &to_copy)
 
Vector3D operator- () const
 
Vector3Doperator*= (const double scalar)
 
Vector3Doperator/= (const double scalar)
 
Vector3Doperator*= (const Vector3D &rhs)
 
Vector3Doperator+= (const Vector3D &rhs)
 
Vector3Doperator-= (const Vector3D &rhs)
 
int within_tolerance_box (const Vector3D &compare_to, double tolerance) const
 
double length_squared () const
 
double length () const
 
void set_length (const double new_length)
 
void normalize ()
 
const double * to_array () const
 

Static Public Member Functions

static double distance_between (const Vector3D &p1, const Vector3D &p2)
 
static double interior_angle (const Vector3D &a, const Vector3D &b, MsqError &err)
 
static Vector3D interpolate (const double param, const Vector3D &p1, const Vector3D &p2)
 
static double distance_between (const Vector3D &p1, const Vector3D &p2)
 
static double interior_angle (const Vector3D &a, const Vector3D &b, MsqError &err)
 
static Vector3D interpolate (const double param, const Vector3D &p1, const Vector3D &p2)
 

Protected Attributes

double mCoords [3]
 

Friends

const Vector3D operator+ (const Vector3D &lhs, const Vector3D &rhs)
 
const Vector3D operator- (const Vector3D &lhs, const Vector3D &rhs)
 
const Vector3D operator* (const Vector3D &lhs, const double scalar)
 lhs * scalar More...
 
const Vector3D operator* (const double scalar, const Vector3D &rhs)
 scalar * rhs More...
 
const Vector3D operator/ (const Vector3D &lhs, const double scalar)
 
double operator% (const Vector3D &v1, const Vector3D &v2)
 dot product More...
 
double inner (const Vector3D v1[], const Vector3D v2[], int n)
 dot product for array More...
 
double operator% (const double scalar, const Vector3D &v2)
 scalar * sum_i v2[i] More...
 
double operator% (const Vector3D &v1, const double scalar)
 scalar * sum_i v1[i] More...
 
const Vector3D operator* (const Vector3D &v1, const Vector3D &v2)
 cross product More...
 
void eqAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v = A*x $ More...
 
void plusEqAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v += A*x $ More...
 
void plusEqTransAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v += A^T*x $ More...
 
bool operator== (const Vector3D &lhs, const Vector3D &rhs)
 
bool operator!= (const Vector3D &lhs, const Vector3D &rhs)
 
double length (Vector3D *const v, int n)
 L2 norm for an array of Vector3Ds. More...
 
double Linf (Vector3D *const v, int n)
 L inf norm for array of Vector3Ds. More...
 
const Vector3D operator+ (const Vector3D &lhs, const Vector3D &rhs)
 
const Vector3D operator- (const Vector3D &lhs, const Vector3D &rhs)
 
const Vector3D operator* (const Vector3D &lhs, const double scalar)
 lhs * scalar More...
 
const Vector3D operator* (const double scalar, const Vector3D &rhs)
 scalar * rhs More...
 
const Vector3D operator/ (const Vector3D &lhs, const double scalar)
 
double operator% (const Vector3D &v1, const Vector3D &v2)
 dot product More...
 
double inner (const Vector3D v1[], const Vector3D v2[], int n)
 dot product for array More...
 
double operator% (const double scalar, const Vector3D &v2)
 scalar * sum_i v2[i] More...
 
double operator% (const Vector3D &v1, const double scalar)
 scalar * sum_i v1[i] More...
 
const Vector3D operator* (const Vector3D &v1, const Vector3D &v2)
 cross product More...
 
void eqAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v = A*x $ More...
 
void plusEqAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v += A*x $ More...
 
void plusEqTransAx (Vector3D &v, const Matrix3D &A, const Vector3D &x)
 $ v += A^T*x $ More...
 
bool operator== (const Vector3D &lhs, const Vector3D &rhs)
 
bool operator!= (const Vector3D &lhs, const Vector3D &rhs)
 
double length (Vector3D *const v, int n)
 L2 norm for an array of Vector3Ds. More...
 
double Linf (Vector3D *const v, int n)
 L inf norm for array of Vector3Ds. More...
 

Detailed Description

Vector3D is the object that effeciently stores information about about three-deminsional vectors. It is also the parent class of MsqVertex.

Definition at line 64 of file includeLinks/Vector3D.hpp.

Constructor & Destructor Documentation

Vector3D ( )
inline

Definition at line 171 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

Referenced by Vector3D::operator-().

172  {
173  mCoords[0] = 0;
174  mCoords[1] = 0;
175  mCoords[2] = 0;
176  }

Here is the caller graph for this function:

Vector3D ( const double &  x,
const double &  y,
const double &  z 
)
inline

Definition at line 177 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords, Vector3D::x(), Vector3D::y(), and Vector3D::z().

180  {
181  mCoords[0] = x;
182  mCoords[1] = y;
183  mCoords[2] = z;
184  }

Here is the call graph for this function:

Vector3D ( const double  xyz[3])
inline

Definition at line 185 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

186  { msq_stdc::memcpy(mCoords, xyz, 3*sizeof(double)); }
Vector3D ( const Vector3D to_copy)
inline

Definition at line 187 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

188  { msq_stdc::memcpy(mCoords, to_copy.mCoords, 3*sizeof(double)); }
Vector3D ( )
Vector3D ( const double &  x,
const double &  y,
const double &  z 
)
Vector3D ( const double  xyz[3])
Vector3D ( const Vector3D to_copy)

Member Function Documentation

double distance_between ( const Vector3D p1,
const Vector3D p2 
)
inlinestatic

Definition at line 373 of file includeLinks/Vector3D.hpp.

References Vector3D::length(), p1, and v.

375  {
376  Vector3D v = p2 - p1;
377  return v.length();
378  }
NT p1
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20

Here is the call graph for this function:

static double distance_between ( const Vector3D p1,
const Vector3D p2 
)
static
void get_coordinates ( double &  x,
double &  y,
double &  z 
) const
inline

Definition at line 197 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

Referenced by NonSmoothSteepestDescent::validity_check(), and MesqPane::vertex_set_coordinates().

198  {
199  x = mCoords[0];
200  y = mCoords[1];
201  z = mCoords[2];
202  }

Here is the caller graph for this function:

void get_coordinates ( double &  x,
double &  y,
double &  z 
) const
void get_coordinates ( double  xyz[3]) const
void get_coordinates ( double  xyz[3]) const
inline

Definition at line 203 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

204  { msq_stdc::memcpy(xyz, mCoords, 3*sizeof(double)); }
double interior_angle ( const Vector3D a,
const Vector3D b,
MsqError err 
)
static

Definition at line 49 of file Misc/Vector3D.cpp.

References cimg_library::acos(), MsqError::INTERNAL_ERROR, len1, len2, Vector3D::length(), MSQ_SETERR, and rhs.

52  {
53  double len1 = lhs.length();
54  double len2 = rhs.length();
55  double angle_cos = (lhs % rhs)/(len1 * len2);
56  if (!finite( angle_cos ))
57  {
59  return 0.0;
60  }
61 
62  // Adjust the cosine if slightly out of range
63  if ((angle_cos > 1.0) && (angle_cos < 1.0001))
64  {
65  angle_cos = 1.0;
66  }
67  else if (angle_cos < -1.0 && angle_cos > -1.0001)
68  {
69  angle_cos = -1.0;
70  }
71 
72  return msq_stdc::acos(angle_cos);
73  }
void const int char const int long int long int len2
Definition: mapptr.h:80
NT rhs
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
void const int char const int long int len1
Definition: mapptr.h:80
CImg< _cimg_Tfloat > acos(const CImg< T > &instance)
Definition: CImg.h:6051

Here is the call graph for this function:

static double interior_angle ( const Vector3D a,
const Vector3D b,
MsqError err 
)
static
Vector3D interpolate ( const double  param,
const Vector3D p1,
const Vector3D p2 
)
inlinestatic

Definition at line 430 of file includeLinks/Vector3D.hpp.

433  {
434  return (1-param)*p1 + param*p2;
435  }
NT p1
static Vector3D interpolate ( const double  param,
const Vector3D p1,
const Vector3D p2 
)
static
double length ( ) const
inline
double length_squared ( ) const
inline

Definition at line 388 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

Referenced by AspectRatioGammaQualityMetric::evaluate_element(), and PatchData::get_max_vertex_movement_squared().

389  {
390  return (mCoords[0]*mCoords[0] +
391  mCoords[1]*mCoords[1] +
392  mCoords[2]*mCoords[2]);
393  }

Here is the caller graph for this function:

double length_squared ( ) const
inline
void normalize ( )
inline

Definition at line 426 of file includeLinks/Vector3D.hpp.

References Vector3D::set_length().

Referenced by SphericalDomain::closest_point(), MsqMeshEntity::compute_corner_normals(), RI_DFT::evaluate_element(), PatchData::get_domain_normal_at_vertex(), and PlanarDomain::set_plane().

427  { set_length(1.0); }
void set_length(const double new_length)

Here is the call graph for this function:

Here is the caller graph for this function:

void normalize ( )
inline
Vector3D & operator*= ( const double  scalar)
inline

Definition at line 254 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

255  {
256  mCoords[0] *= scalar;
257  mCoords[1] *= scalar;
258  mCoords[2] *= scalar;
259  return *this;
260  }
Vector3D& operator*= ( const double  scalar)
Vector3D & operator*= ( const Vector3D rhs)
inline

Definition at line 269 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

270  {
271  double new_coords[3] =
272  {mCoords[1]*rhs.mCoords[2] - mCoords[2]*rhs.mCoords[1],
273  mCoords[2]*rhs.mCoords[0] - mCoords[0]*rhs.mCoords[2],
274  mCoords[0]*rhs.mCoords[1] - mCoords[1]*rhs.mCoords[0]
275  };
276  msq_stdc::memcpy(mCoords, new_coords, 3*sizeof(double));
277  return *this;
278  }
NT rhs
Vector3D& operator*= ( const Vector3D rhs)
Vector3D & operator+= ( const Vector3D rhs)
inline

Definition at line 279 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

280  {
281  mCoords[0] += rhs.mCoords[0];
282  mCoords[1] += rhs.mCoords[1];
283  mCoords[2] += rhs.mCoords[2];
284  return *this;
285  }
NT rhs
Vector3D& operator+= ( const Vector3D rhs)
Vector3D operator- ( void  ) const
inline

Definition at line 250 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords, and Vector3D::Vector3D().

251  {
252  return Vector3D(-mCoords[0], -mCoords[1], -mCoords[2]);
253  }

Here is the call graph for this function:

Vector3D operator- ( ) const
Vector3D& operator-= ( const Vector3D rhs)
Vector3D & operator-= ( const Vector3D rhs)
inline

Definition at line 286 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

287  {
288  mCoords[0] -= rhs.mCoords[0];
289  mCoords[1] -= rhs.mCoords[1];
290  mCoords[2] -= rhs.mCoords[2];
291  return *this;
292  }
NT rhs
Vector3D & operator/= ( const double  scalar)
inline

divides each Vector3D entry by the given scalar.

Definition at line 262 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

263  {
264  mCoords[0] /= scalar;
265  mCoords[1] /= scalar;
266  mCoords[2] /= scalar;
267  return *this;
268  }
Vector3D& operator/= ( const double  scalar)
Vector3D& operator= ( const Vector3D to_copy)
Vector3D & operator= ( const Vector3D to_copy)
inline

Definition at line 232 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

Referenced by MsqVertex::operator=().

233  {
234  mCoords[0] = to_copy.mCoords[0];
235  mCoords[1] = to_copy.mCoords[1];
236  mCoords[2] = to_copy.mCoords[2];
237 // memcpy(mCoords, to_copy.mCoords, 3*sizeof(double));
238  return *this;
239  }

Here is the caller graph for this function:

Vector3D & operator= ( const double &  to_copy)
inline

Definition at line 241 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

242  {
243  mCoords[0] = to_copy;
244  mCoords[1] = to_copy;
245  mCoords[2] = to_copy;
246  return *this;
247  }
Vector3D& operator= ( const double &  to_copy)
const double& operator[] ( size_t  index) const
const double & operator[] ( size_t  index) const
inline

Definition at line 205 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

206  {
207  return mCoords[index];
208  }
double& operator[] ( size_t  index)
double & operator[] ( size_t  index)
inline

Definition at line 229 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

230  { return mCoords[index]; }
void set ( const double  x,
const double  y,
const double  z 
)
void set ( const double  x,
const double  y,
const double  z 
)
inline
void set ( const double  xyz[3])
inline

Definition at line 225 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

226  { msq_stdc::memcpy(mCoords, xyz, 3*sizeof(double)); }
void set ( const double  xyz[3])
void set ( const Vector3D to_copy)
void set ( const Vector3D to_copy)
inline

Definition at line 227 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

228  { msq_stdc::memcpy(mCoords, to_copy.mCoords, 3*sizeof(double)); }
void set_length ( const double  new_length)
inline

Definition at line 421 of file includeLinks/Vector3D.hpp.

References Vector3D::length().

Referenced by Vector3D::normalize().

422  {
423  double factor = new_length / length();
424  *this *= factor;
425  }

Here is the call graph for this function:

Here is the caller graph for this function:

void set_length ( const double  new_length)
inline
const double* to_array ( ) const
inline
const double* to_array ( ) const
inline

Definition at line 163 of file src/Misc/Vector3D.hpp.

References Vector3D::mCoords.

164  { return mCoords; }
int within_tolerance_box ( const Vector3D compare_to,
double  tolerance 
) const
inline

Definition at line 379 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords.

381  {
382  return ((msq_stdc::fabs(this->mCoords[0] - compare_to.mCoords[0]) < tolerance) &&
383  (msq_stdc::fabs(this->mCoords[1] - compare_to.mCoords[1]) < tolerance) &&
384  (msq_stdc::fabs(this->mCoords[2] - compare_to.mCoords[2]) < tolerance));
385  }
int within_tolerance_box ( const Vector3D compare_to,
double  tolerance 
) const
double x ( ) const
void x ( const double  x)
inline

Definition at line 211 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords, and Vector3D::x().

212  { mCoords[0] = x; }

Here is the call graph for this function:

void x ( const double  x)
double y ( ) const
void y ( const double  y)
inline

Definition at line 213 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords, and Vector3D::y().

214  { mCoords[1] = y; }

Here is the call graph for this function:

void y ( const double  y)
double z ( ) const
void z ( const double  z)
void z ( const double  z)
inline

Definition at line 215 of file includeLinks/Vector3D.hpp.

References Vector3D::mCoords, and Vector3D::z().

216  { mCoords[2] = z; }

Here is the call graph for this function:

Friends And Related Function Documentation

void eqAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v = A*x $

Definition at line 522 of file includeLinks/Matrix3D.hpp.

523  {
524  v.mCoords[0] = A.v_[0]*x[0] + A.v_[1]*x.mCoords[1] + A.v_[2]*x.mCoords[2];
525  v.mCoords[1] = A.v_[3]*x[0] + A.v_[4]*x.mCoords[1] + A.v_[5]*x.mCoords[2];
526  v.mCoords[2] = A.v_[6]*x[0] + A.v_[7]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
527  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67
void eqAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v = A*x $

Definition at line 522 of file includeLinks/Matrix3D.hpp.

523  {
524  v.mCoords[0] = A.v_[0]*x[0] + A.v_[1]*x.mCoords[1] + A.v_[2]*x.mCoords[2];
525  v.mCoords[1] = A.v_[3]*x[0] + A.v_[4]*x.mCoords[1] + A.v_[5]*x.mCoords[2];
526  v.mCoords[2] = A.v_[6]*x[0] + A.v_[7]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
527  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67
double inner ( const Vector3D  v1[],
const Vector3D  v2[],
int  n 
)
friend

dot product for array

Dot product for arrays of Vector3Ds. see also operator% .

Definition at line 340 of file includeLinks/Vector3D.hpp.

342  {
343  int i;
344  double dot=0;
345  for (i=0; i<n; ++i)
346  dot+= lhs[i].mCoords[0] * rhs[i].mCoords[0] +
347  lhs[i].mCoords[1] * rhs[i].mCoords[1] +
348  lhs[i].mCoords[2] * rhs[i].mCoords[2];
349  return dot;
350  }
NT rhs
blockLoc i
Definition: read.cpp:79
const NT & n
double inner ( const Vector3D  v1[],
const Vector3D  v2[],
int  n 
)
friend

dot product for array

Dot product for arrays of Vector3Ds. see also operator% .

Definition at line 340 of file includeLinks/Vector3D.hpp.

342  {
343  int i;
344  double dot=0;
345  for (i=0; i<n; ++i)
346  dot+= lhs[i].mCoords[0] * rhs[i].mCoords[0] +
347  lhs[i].mCoords[1] * rhs[i].mCoords[1] +
348  lhs[i].mCoords[2] * rhs[i].mCoords[2];
349  return dot;
350  }
NT rhs
blockLoc i
Definition: read.cpp:79
const NT & n
double length ( Vector3D *const  v,
int  n 
)
friend

L2 norm for an array of Vector3Ds.

Definition at line 400 of file includeLinks/Vector3D.hpp.

401  {
402  double l=0;
403  for (int j=0; j<n; ++j)
404  l += v[j].mCoords[0]*v[j].mCoords[0] +
405  v[j].mCoords[1]*v[j].mCoords[1] +
406  v[j].mCoords[2]*v[j].mCoords[2];
407  return msq_stdc::sqrt(l);
408  }
double sqrt(double d)
Definition: double.h:73
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
const NT & n
j indices j
Definition: Indexing.h:6
double length ( Vector3D *const  v,
int  n 
)
friend

L2 norm for an array of Vector3Ds.

Definition at line 400 of file includeLinks/Vector3D.hpp.

401  {
402  double l=0;
403  for (int j=0; j<n; ++j)
404  l += v[j].mCoords[0]*v[j].mCoords[0] +
405  v[j].mCoords[1]*v[j].mCoords[1] +
406  v[j].mCoords[2]*v[j].mCoords[2];
407  return msq_stdc::sqrt(l);
408  }
double sqrt(double d)
Definition: double.h:73
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
const NT & n
j indices j
Definition: Indexing.h:6
double Linf ( Vector3D *const  v,
int  n 
)
friend

L inf norm for array of Vector3Ds.

Definition at line 409 of file includeLinks/Vector3D.hpp.

410  {
411  double max=0;
412  //loop over the length of the array
413  for(int i=0;i<n;++i){
414  if ( max < msq_stdc::fabs(v[i][0]) ) max=msq_stdc::fabs(v[i][0]) ;
415  if ( max < msq_stdc::fabs(v[i][1]) ) max=msq_stdc::fabs(v[i][1]) ;
416  if ( max < msq_stdc::fabs(v[i][2]) ) max=msq_stdc::fabs(v[i][2]) ;
417  }
418  //return the value of the largest entry in the array
419  return max;
420  }
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
blockLoc i
Definition: read.cpp:79
const NT & n
double Linf ( Vector3D *const  v,
int  n 
)
friend

L inf norm for array of Vector3Ds.

Definition at line 409 of file includeLinks/Vector3D.hpp.

410  {
411  double max=0;
412  //loop over the length of the array
413  for(int i=0;i<n;++i){
414  if ( max < msq_stdc::fabs(v[i][0]) ) max=msq_stdc::fabs(v[i][0]) ;
415  if ( max < msq_stdc::fabs(v[i][1]) ) max=msq_stdc::fabs(v[i][1]) ;
416  if ( max < msq_stdc::fabs(v[i][2]) ) max=msq_stdc::fabs(v[i][2]) ;
417  }
418  //return the value of the largest entry in the array
419  return max;
420  }
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
blockLoc i
Definition: read.cpp:79
const NT & n
bool operator!= ( const Vector3D lhs,
const Vector3D rhs 
)
friend

Definition at line 442 of file includeLinks/Vector3D.hpp.

443  { return v1.mCoords[0] != v2.mCoords[0] ||
444  v1.mCoords[1] != v2.mCoords[1] ||
445  v1.mCoords[2] != v2.mCoords[2]; }
bool operator!= ( const Vector3D lhs,
const Vector3D rhs 
)
friend

Definition at line 442 of file includeLinks/Vector3D.hpp.

443  { return v1.mCoords[0] != v2.mCoords[0] ||
444  v1.mCoords[1] != v2.mCoords[1] ||
445  v1.mCoords[2] != v2.mCoords[2]; }
double operator% ( const Vector3D v1,
const Vector3D v2 
)
friend

dot product

Definition at line 331 of file includeLinks/Vector3D.hpp.

333  {
334  return( lhs.mCoords[0] * rhs.mCoords[0] +
335  lhs.mCoords[1] * rhs.mCoords[1] +
336  lhs.mCoords[2] * rhs.mCoords[2] );
337  }
NT rhs
double operator% ( const Vector3D v1,
const Vector3D v2 
)
friend

dot product

Definition at line 331 of file includeLinks/Vector3D.hpp.

333  {
334  return( lhs.mCoords[0] * rhs.mCoords[0] +
335  lhs.mCoords[1] * rhs.mCoords[1] +
336  lhs.mCoords[2] * rhs.mCoords[2] );
337  }
NT rhs
double operator% ( const double  scalar,
const Vector3D v2 
)
friend

scalar * sum_i v2[i]

Definition at line 352 of file includeLinks/Vector3D.hpp.

354  {
355  return( scalar * (rhs.mCoords[0] + rhs.mCoords[1] + rhs.mCoords[2]) );
356  }
NT rhs
double operator% ( const double  scalar,
const Vector3D v2 
)
friend

scalar * sum_i v2[i]

Definition at line 352 of file includeLinks/Vector3D.hpp.

354  {
355  return( scalar * (rhs.mCoords[0] + rhs.mCoords[1] + rhs.mCoords[2]) );
356  }
NT rhs
double operator% ( const Vector3D v1,
const double  scalar 
)
friend

scalar * sum_i v1[i]

Definition at line 357 of file includeLinks/Vector3D.hpp.

359  {
360  return( scalar * (lhs.mCoords[0] + lhs.mCoords[1] + lhs.mCoords[2]) );
361  }
double operator% ( const Vector3D v1,
const double  scalar 
)
friend

scalar * sum_i v1[i]

Definition at line 357 of file includeLinks/Vector3D.hpp.

359  {
360  return( scalar * (lhs.mCoords[0] + lhs.mCoords[1] + lhs.mCoords[2]) );
361  }
const Vector3D operator* ( const Vector3D lhs,
const double  scalar 
)
friend

lhs * scalar

Definition at line 309 of file includeLinks/Vector3D.hpp.

311  {
312  return Vector3D(lhs.x() * scalar,
313  lhs.y() * scalar,
314  lhs.z() * scalar);
315  }
const Vector3D operator* ( const Vector3D lhs,
const double  scalar 
)
friend

lhs * scalar

Definition at line 309 of file includeLinks/Vector3D.hpp.

311  {
312  return Vector3D(lhs.x() * scalar,
313  lhs.y() * scalar,
314  lhs.z() * scalar);
315  }
const Vector3D operator* ( const double  scalar,
const Vector3D rhs 
)
friend

scalar * rhs

Definition at line 316 of file includeLinks/Vector3D.hpp.

318  {
319  return Vector3D(rhs.x() * scalar,
320  rhs.y() * scalar,
321  rhs.z() * scalar);
322  }
NT rhs
const Vector3D operator* ( const double  scalar,
const Vector3D rhs 
)
friend

scalar * rhs

Definition at line 316 of file includeLinks/Vector3D.hpp.

318  {
319  return Vector3D(rhs.x() * scalar,
320  rhs.y() * scalar,
321  rhs.z() * scalar);
322  }
NT rhs
const Vector3D operator* ( const Vector3D v1,
const Vector3D v2 
)
friend

cross product

Definition at line 362 of file includeLinks/Vector3D.hpp.

364  {
365  return Vector3D(lhs.mCoords[1]*rhs.mCoords[2]-lhs.mCoords[2]*rhs.mCoords[1],
366  lhs.mCoords[2]*rhs.mCoords[0]-lhs.mCoords[0]*rhs.mCoords[2],
367  lhs.mCoords[0]*rhs.mCoords[1]-lhs.mCoords[1]*rhs.mCoords[0]);
368  }
NT rhs
const Vector3D operator* ( const Vector3D v1,
const Vector3D v2 
)
friend

cross product

Definition at line 362 of file includeLinks/Vector3D.hpp.

364  {
365  return Vector3D(lhs.mCoords[1]*rhs.mCoords[2]-lhs.mCoords[2]*rhs.mCoords[1],
366  lhs.mCoords[2]*rhs.mCoords[0]-lhs.mCoords[0]*rhs.mCoords[2],
367  lhs.mCoords[0]*rhs.mCoords[1]-lhs.mCoords[1]*rhs.mCoords[0]);
368  }
NT rhs
const Vector3D operator+ ( const Vector3D lhs,
const Vector3D rhs 
)
friend

Definition at line 295 of file includeLinks/Vector3D.hpp.

297  {
298  return Vector3D(lhs.x() + rhs.x(),
299  lhs.y() + rhs.y(),
300  lhs.z() + rhs.z());
301  }
NT rhs
const Vector3D operator+ ( const Vector3D lhs,
const Vector3D rhs 
)
friend

Definition at line 295 of file includeLinks/Vector3D.hpp.

297  {
298  return Vector3D(lhs.x() + rhs.x(),
299  lhs.y() + rhs.y(),
300  lhs.z() + rhs.z());
301  }
NT rhs
const Vector3D operator- ( const Vector3D lhs,
const Vector3D rhs 
)
friend

Definition at line 302 of file includeLinks/Vector3D.hpp.

304  {
305  return Vector3D(lhs.x() - rhs.x(),
306  lhs.y() - rhs.y(),
307  lhs.z() - rhs.z());
308  }
NT rhs
const Vector3D operator- ( const Vector3D lhs,
const Vector3D rhs 
)
friend

Definition at line 302 of file includeLinks/Vector3D.hpp.

304  {
305  return Vector3D(lhs.x() - rhs.x(),
306  lhs.y() - rhs.y(),
307  lhs.z() - rhs.z());
308  }
NT rhs
const Vector3D operator/ ( const Vector3D lhs,
const double  scalar 
)
friend

Definition at line 323 of file includeLinks/Vector3D.hpp.

325  {
326  assert (scalar != 0);
327  return Vector3D(lhs.x() / scalar,
328  lhs.y() / scalar,
329  lhs.z() / scalar);
330  }
const Vector3D operator/ ( const Vector3D lhs,
const double  scalar 
)
friend

Definition at line 323 of file includeLinks/Vector3D.hpp.

325  {
326  assert (scalar != 0);
327  return Vector3D(lhs.x() / scalar,
328  lhs.y() / scalar,
329  lhs.z() / scalar);
330  }
bool operator== ( const Vector3D lhs,
const Vector3D rhs 
)
friend

Definition at line 437 of file includeLinks/Vector3D.hpp.

438  { return v1.mCoords[0] == v2.mCoords[0] &&
439  v1.mCoords[1] == v2.mCoords[1] &&
440  v1.mCoords[2] == v2.mCoords[2]; }
bool operator== ( const Vector3D lhs,
const Vector3D rhs 
)
friend

Definition at line 437 of file includeLinks/Vector3D.hpp.

438  { return v1.mCoords[0] == v2.mCoords[0] &&
439  v1.mCoords[1] == v2.mCoords[1] &&
440  v1.mCoords[2] == v2.mCoords[2]; }
void plusEqAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v += A*x $

Definition at line 529 of file includeLinks/Matrix3D.hpp.

530  {
531  v.mCoords[0] += A.v_[0]*x[0] + A.v_[1]*x.mCoords[1] + A.v_[2]*x.mCoords[2];
532  v.mCoords[1] += A.v_[3]*x[0] + A.v_[4]*x.mCoords[1] + A.v_[5]*x.mCoords[2];
533  v.mCoords[2] += A.v_[6]*x[0] + A.v_[7]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
534  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67
void plusEqAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v += A*x $

Definition at line 529 of file includeLinks/Matrix3D.hpp.

530  {
531  v.mCoords[0] += A.v_[0]*x[0] + A.v_[1]*x.mCoords[1] + A.v_[2]*x.mCoords[2];
532  v.mCoords[1] += A.v_[3]*x[0] + A.v_[4]*x.mCoords[1] + A.v_[5]*x.mCoords[2];
533  v.mCoords[2] += A.v_[6]*x[0] + A.v_[7]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
534  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67
void plusEqTransAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v += A^T*x $

Definition at line 536 of file includeLinks/Matrix3D.hpp.

537  {
538  v.mCoords[0] += A.v_[0]*x.mCoords[0] + A.v_[3]*x.mCoords[1] + A.v_[6]*x.mCoords[2];
539  v.mCoords[1] += A.v_[1]*x.mCoords[0] + A.v_[4]*x.mCoords[1] + A.v_[7]*x.mCoords[2];
540  v.mCoords[2] += A.v_[2]*x.mCoords[0] + A.v_[5]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
541  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67
void plusEqTransAx ( Vector3D v,
const Matrix3D A,
const Vector3D x 
)
friend

$ v += A^T*x $

Definition at line 536 of file includeLinks/Matrix3D.hpp.

537  {
538  v.mCoords[0] += A.v_[0]*x.mCoords[0] + A.v_[3]*x.mCoords[1] + A.v_[6]*x.mCoords[2];
539  v.mCoords[1] += A.v_[1]*x.mCoords[0] + A.v_[4]*x.mCoords[1] + A.v_[7]*x.mCoords[2];
540  v.mCoords[2] += A.v_[2]*x.mCoords[0] + A.v_[5]*x.mCoords[1] + A.v_[8]*x.mCoords[2];
541  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
rational * A
Definition: vinci_lass.c:67

Member Data Documentation


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