tfel
Loading...
Searching...
No Matches
numodis::Vect3 Struct Reference

class Vect3 handles a vector of double in 3 dimensions More...

#include </home/runner/work/tfel/tfel/include/NUMODIS/Vect3.hxx>

Public Member Functions

 Vect3 (const Vect3 &vec)
 Vect3 (double x, double y, double z)
bool operator== (const Vect3 &vec)
Vect3 operator- () const
Vect3 operator+ (const Vect3 &vec) const
Vect3 operator- (const Vect3 &vec) const
Vect3 operator- (const double scalar) const
Vect3 operator* (const double scalar) const
Vect3 operator/ (const double scalar) const
Vect3 & operator= (const Vect3 &vec)
Vect3 & operator= (const double scalar)
Vect3 & operator/= (const double scalar)
Vect3 & operator*= (const double scalar)
Vect3 & operator+= (const Vect3 &vec)
Vect3 & operator+= (const double scalar)
Vect3 & operator-= (const Vect3 &vec)
Vect3 UnitVector () const
Vect3 Cross (const Vect3 &vec) const
Vect3 UnitCross (const Vect3 &vec) const
double & operator[] (int i)
double operator[] (int i) const
double Length () const
double SquareLength () const
double Dot (const Vect3 &vec) const
void Swap (Vect3 &vec)
bool Normalize ()
double & X ()
 Return a reference to the first component of the vector.
double & Y ()
 Return a reference to the second component of the vector.
double & Z ()
 Return a reference to the third component of the vector.
double X () const
 Return the first component of the vector.
double Y () const
 Return the second component of the vector.
double Z () const
 Return the third component of the vector.
double Norm () const
 Return the length of the vector.

Protected Attributes

double _vector [3]

Friends

TFELNUMODIS_VISIBILITY_FRIEND_EXPORT friend std::ostream & operator<< (std::ostream &, const Vect3 &)

Detailed Description

class Vect3 handles a vector of double in 3 dimensions

The first author of this method is A. Etcheverry who basically got rid of all the valarray<double>(3) in NUMODIS to improve computation efficiency.

This class offers several interesting operators to make 3D calculations almost as simple as in Fortran90 ;-)

Member Function Documentation

◆ Norm()

double numodis::Vect3::Norm ( ) const
inlinenodiscard

Return the length of the vector.

Returns
length of the vector

◆ X() [1/2]

double & numodis::Vect3::X ( )
inlinenodiscard

Return a reference to the first component of the vector.

Returns
reference to the component

◆ X() [2/2]

double numodis::Vect3::X ( ) const
inlinenodiscard

Return the first component of the vector.

Returns
first component

◆ Y() [1/2]

double & numodis::Vect3::Y ( )
inlinenodiscard

Return a reference to the second component of the vector.

Returns
reference to the component

◆ Y() [2/2]

double numodis::Vect3::Y ( ) const
inlinenodiscard

Return the second component of the vector.

Returns
second component

◆ Z() [1/2]

double & numodis::Vect3::Z ( )
inlinenodiscard

Return a reference to the third component of the vector.

Returns
reference to the component

◆ Z() [2/2]

double numodis::Vect3::Z ( ) const
inlinenodiscard

Return the third component of the vector.

Returns
third component

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