Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Mantid::Geometry::V3R Class Reference

#include <V3R.h>

Public Member Functions

V3R getPositiveVector () const
 Returns a V3R with absolute components. More...
 
 operator Kernel::V3D () const
 Returns an instance of Kernel::V3D with floating point approximations of the components. More...
 
 operator std::vector< double > () const
 Returns an std::vector<double> with approximations of the components. More...
 
bool operator!= (const V3R &other) const
 Returns true if the compared vectors are not equal. More...
 
bool operator!= (int other) const
 Returns true if any component is different from the integer. More...
 
V3R operator* (const RationalNumber &other) const
 Performs the operation v' = v1 * r, which multiplies each component of v1 with the RationalNumber r. More...
 
V3R operator* (int other) const
 Performs the operation v' = v1 * i, which multiplies each component of v1 with the integer i. More...
 
V3Roperator*= (const RationalNumber &other)
 Performs the operation v1 *= r in place, which multiplies each component of v1 with the RationalNumber r. More...
 
V3Roperator*= (int other)
 Performs the operation v1 *= i in place, which multiplies each component of v1 with the integer i. More...
 
Kernel::V3D operator+ (const Kernel::V3D &other) const
 Returns the result of the operation d3' = r3 + d3, which is again a Kernel::V3D. More...
 
V3R operator+ (const RationalNumber &other) const
 Performs the operation v' = v1 + r, which adds the RationalNumber r to each component of v1. More...
 
V3R operator+ (const V3R &other) const
 Performs the operation v1 + v2, which sums the vectors component-wise. More...
 
V3R operator+ (int other) const
 Performs the operation v' = v1 + i, which adds the integer i to each component of v1. More...
 
V3Roperator+= (const RationalNumber &other)
 Performs the operation v1 += r in place, which adds the RationalNumber r to each component of v1. More...
 
V3Roperator+= (const V3R &other)
 Performs the operation v1 += v2 in place, which adds the components of v2 to the components of v1. More...
 
V3Roperator+= (int other)
 Performs the operation v1 += i in place, which adds the integer i to each component of v1. More...
 
V3R operator- () const
 Negates all components of the vector. More...
 
Kernel::V3D operator- (const Kernel::V3D &other) const
 Returns the result of the operation d3' = r3 - d3, which is again a Kernel::V3D. More...
 
V3R operator- (const RationalNumber &other) const
 Performs the operation v' = v1 - r, which subtracts the RationalNumber r from each component of v1. More...
 
V3R operator- (const V3R &other) const
 Performs the operation v1 - v2, which subtracts the vectors component-wise. More...
 
V3R operator- (int other) const
 Performs the operation v' = v1 - i, which subtracts the integer i from each component of v1. More...
 
V3Roperator-= (const RationalNumber &other)
 Performs the operation v1 -= r, which subtracts the RationalNumber r from each component of v1. More...
 
V3Roperator-= (const V3R &other)
 Performs the operation v1 -= v2 in place, which subtracts the components of v2 from the components of v1. More...
 
V3Roperator-= (int other)
 Performs the operation v1 -= i in place, which subtracts the integer i from each component of v1. More...
 
V3R operator/ (const RationalNumber &other) const
 Performs the operation v' = v1 / r, which divides each component of v1 by the RationalNumber r. More...
 
V3R operator/ (int other) const
 Performs the operation v' = v1 / i, which divides each component of v1 by the integer i. More...
 
V3Roperator/= (const RationalNumber &other)
 Performs the operation v1 /= r in place, which divides each component of v1 by the RationalNumber r. More...
 
V3Roperator/= (int other)
 Performs the operation v1 /= i in place, which divides each component of v1 by the integer i. More...
 
bool operator< (const V3R &other) const
 Compares x of both vectors first, if those are equal the function compares y and finally z. More...
 
bool operator== (const V3R &other) const
 Returns true if all components of the compared vectors are equal, false otherwise. More...
 
bool operator== (int other) const
 Returns true if all components are equal to the integer used for comparison. More...
 
RationalNumberoperator[] (size_t index)
 Array-style non-const access to the components. More...
 
const RationalNumberoperator[] (size_t index) const
 Array-style const access to the components. More...
 
void setX (const RationalNumber &newX)
 Assigns a new value to the x-component. More...
 
void setY (const RationalNumber &newY)
 Assigns a new value to the y-component. More...
 
void setZ (const RationalNumber &newZ)
 Assigns a new value to the z-component. More...
 
 V3R ()
 Default constructor, all elements 0. More...
 
 V3R (const RationalNumber &x, const RationalNumber &y, const RationalNumber &z)
 Constructor from three RationalNumbers, which may also be integers. More...
 
 V3R (const std::vector< int > &vector)
 Constructor from an appropriately sized integer vector. More...
 
const RationalNumberx () const
 Returns the x-component of the vector. More...
 
const RationalNumbery () const
 Returns the y-component of the vector. More...
 
const RationalNumberz () const
 Returns the z-component of the vector. More...
 

Protected Attributes

RationalNumber m_x
 
RationalNumber m_y
 
RationalNumber m_z
 

Detailed Description

Definition at line 37 of file V3R.h.

Constructor & Destructor Documentation

◆ V3R() [1/3]

Mantid::Geometry::V3R::V3R ( )

Default constructor, all elements 0.

Definition at line 11 of file V3R.cpp.

Referenced by getPositiveVector(), and operator-().

◆ V3R() [2/3]

Mantid::Geometry::V3R::V3R ( const RationalNumber x,
const RationalNumber y,
const RationalNumber z 
)

Constructor from three RationalNumbers, which may also be integers.

Definition at line 14 of file V3R.cpp.

◆ V3R() [3/3]

Mantid::Geometry::V3R::V3R ( const std::vector< int > &  vector)

Constructor from an appropriately sized integer vector.

Definition at line 17 of file V3R.cpp.

References m_x, m_y, and m_z.

Member Function Documentation

◆ getPositiveVector()

V3R Mantid::Geometry::V3R::getPositiveVector ( ) const

Returns a V3R with absolute components.

Definition at line 293 of file V3R.cpp.

References m_x, m_y, m_z, and V3R().

Referenced by Mantid::Geometry::SymmetryElementMirrorGenerator::determineSymbol().

◆ operator Kernel::V3D()

Mantid::Geometry::V3R::operator Kernel::V3D ( ) const

Returns an instance of Kernel::V3D with floating point approximations of the components.

Definition at line 251 of file V3R.cpp.

◆ operator std::vector< double >()

Mantid::Geometry::V3R::operator std::vector< double > ( ) const

Returns an std::vector<double> with approximations of the components.

Definition at line 296 of file V3R.cpp.

◆ operator!=() [1/2]

bool Mantid::Geometry::V3R::operator!= ( const V3R other) const

Returns true if the compared vectors are not equal.

Definition at line 269 of file V3R.cpp.

References operator==().

◆ operator!=() [2/2]

bool Mantid::Geometry::V3R::operator!= ( int  other) const

Returns true if any component is different from the integer.

Definition at line 290 of file V3R.cpp.

References operator==().

◆ operator*() [1/2]

V3R Mantid::Geometry::V3R::operator* ( const RationalNumber other) const

Performs the operation v' = v1 * r, which multiplies each component of v1 with the RationalNumber r.

Definition at line 217 of file V3R.cpp.

◆ operator*() [2/2]

V3R Mantid::Geometry::V3R::operator* ( int  other) const

Performs the operation v' = v1 * i, which multiplies each component of v1 with the integer i.

Definition at line 148 of file V3R.cpp.

◆ operator*=() [1/2]

V3R & Mantid::Geometry::V3R::operator*= ( const RationalNumber other)

Performs the operation v1 *= r in place, which multiplies each component of v1 with the RationalNumber r.

Definition at line 224 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator*=() [2/2]

V3R & Mantid::Geometry::V3R::operator*= ( int  other)

Performs the operation v1 *= i in place, which multiplies each component of v1 with the integer i.

Definition at line 155 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator+() [1/4]

Kernel::V3D Mantid::Geometry::V3R::operator+ ( const Kernel::V3D other) const

Returns the result of the operation d3' = r3 + d3, which is again a Kernel::V3D.

Definition at line 258 of file V3R.cpp.

◆ operator+() [2/4]

V3R Mantid::Geometry::V3R::operator+ ( const RationalNumber other) const

Performs the operation v' = v1 + r, which adds the RationalNumber r to each component of v1.

Definition at line 183 of file V3R.cpp.

◆ operator+() [3/4]

V3R Mantid::Geometry::V3R::operator+ ( const V3R other) const

Performs the operation v1 + v2, which sums the vectors component-wise.

Definition at line 77 of file V3R.cpp.

◆ operator+() [4/4]

V3R Mantid::Geometry::V3R::operator+ ( int  other) const

Performs the operation v' = v1 + i, which adds the integer i to each component of v1.

Definition at line 114 of file V3R.cpp.

◆ operator+=() [1/3]

V3R & Mantid::Geometry::V3R::operator+= ( const RationalNumber other)

Performs the operation v1 += r in place, which adds the RationalNumber r to each component of v1.

Definition at line 190 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator+=() [2/3]

V3R & Mantid::Geometry::V3R::operator+= ( const V3R other)

Performs the operation v1 += v2 in place, which adds the components of v2 to the components of v1.

Definition at line 84 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator+=() [3/3]

V3R & Mantid::Geometry::V3R::operator+= ( int  other)

Performs the operation v1 += i in place, which adds the integer i to each component of v1.

Definition at line 121 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator-() [1/5]

V3R Mantid::Geometry::V3R::operator- ( ) const

Negates all components of the vector.

Definition at line 93 of file V3R.cpp.

References m_x, m_y, m_z, and V3R().

◆ operator-() [2/5]

Kernel::V3D Mantid::Geometry::V3R::operator- ( const Kernel::V3D other) const

Returns the result of the operation d3' = r3 - d3, which is again a Kernel::V3D.

Definition at line 262 of file V3R.cpp.

◆ operator-() [3/5]

V3R Mantid::Geometry::V3R::operator- ( const RationalNumber other) const

Performs the operation v' = v1 - r, which subtracts the RationalNumber r from each component of v1.

Definition at line 200 of file V3R.cpp.

◆ operator-() [4/5]

V3R Mantid::Geometry::V3R::operator- ( const V3R other) const

Performs the operation v1 - v2, which subtracts the vectors component-wise.

Definition at line 96 of file V3R.cpp.

◆ operator-() [5/5]

V3R Mantid::Geometry::V3R::operator- ( int  other) const

Performs the operation v' = v1 - i, which subtracts the integer i from each component of v1.

Definition at line 131 of file V3R.cpp.

◆ operator-=() [1/3]

V3R & Mantid::Geometry::V3R::operator-= ( const RationalNumber other)

Performs the operation v1 -= r, which subtracts the RationalNumber r from each component of v1.

Definition at line 207 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator-=() [2/3]

V3R & Mantid::Geometry::V3R::operator-= ( const V3R other)

Performs the operation v1 -= v2 in place, which subtracts the components of v2 from the components of v1.

Definition at line 103 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator-=() [3/3]

V3R & Mantid::Geometry::V3R::operator-= ( int  other)

Performs the operation v1 -= i in place, which subtracts the integer i from each component of v1.

Definition at line 138 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator/() [1/2]

V3R Mantid::Geometry::V3R::operator/ ( const RationalNumber other) const

Performs the operation v' = v1 / r, which divides each component of v1 by the RationalNumber r.

Definition at line 234 of file V3R.cpp.

◆ operator/() [2/2]

V3R Mantid::Geometry::V3R::operator/ ( int  other) const

Performs the operation v' = v1 / i, which divides each component of v1 by the integer i.

Definition at line 165 of file V3R.cpp.

◆ operator/=() [1/2]

V3R & Mantid::Geometry::V3R::operator/= ( const RationalNumber other)

Performs the operation v1 /= r in place, which divides each component of v1 by the RationalNumber r.

Definition at line 241 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator/=() [2/2]

V3R & Mantid::Geometry::V3R::operator/= ( int  other)

Performs the operation v1 /= i in place, which divides each component of v1 by the integer i.

Definition at line 172 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator<()

bool Mantid::Geometry::V3R::operator< ( const V3R other) const

Compares x of both vectors first, if those are equal the function compares y and finally z.

Definition at line 273 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator==() [1/2]

bool Mantid::Geometry::V3R::operator== ( const V3R other) const

Returns true if all components of the compared vectors are equal, false otherwise.

Definition at line 266 of file V3R.cpp.

References m_x, m_y, and m_z.

Referenced by operator!=().

◆ operator==() [2/2]

bool Mantid::Geometry::V3R::operator== ( int  other) const

Returns true if all components are equal to the integer used for comparison.

Useful for checking against 0.

Definition at line 287 of file V3R.cpp.

References m_x, m_y, and m_z.

◆ operator[]() [1/2]

RationalNumber & Mantid::Geometry::V3R::operator[] ( size_t  index)

Array-style non-const access to the components.

Throws Kernel::Exception::IndexError if index is out of range.

Definition at line 47 of file V3R.cpp.

References index, m_x, m_y, and m_z.

◆ operator[]() [2/2]

const RationalNumber & Mantid::Geometry::V3R::operator[] ( size_t  index) const

Array-style const access to the components.

Throws Kernel::Exception::IndexError if index is out of range.

Definition at line 62 of file V3R.cpp.

References index, m_x, m_y, and m_z.

◆ setX()

void Mantid::Geometry::V3R::setX ( const RationalNumber newX)

Assigns a new value to the x-component.

Definition at line 31 of file V3R.cpp.

References m_x.

◆ setY()

void Mantid::Geometry::V3R::setY ( const RationalNumber newY)

Assigns a new value to the y-component.

Definition at line 37 of file V3R.cpp.

References m_y.

◆ setZ()

void Mantid::Geometry::V3R::setZ ( const RationalNumber newZ)

Assigns a new value to the z-component.

Definition at line 43 of file V3R.cpp.

References m_z.

◆ x()

const RationalNumber & Mantid::Geometry::V3R::x ( ) const

Returns the x-component of the vector.

Definition at line 28 of file V3R.cpp.

References m_x.

◆ y()

const RationalNumber & Mantid::Geometry::V3R::y ( ) const

Returns the y-component of the vector.

Definition at line 34 of file V3R.cpp.

References m_y.

◆ z()

const RationalNumber & Mantid::Geometry::V3R::z ( ) const

Returns the z-component of the vector.

Definition at line 40 of file V3R.cpp.

References m_z.

Member Data Documentation

◆ m_x

RationalNumber Mantid::Geometry::V3R::m_x
protected

◆ m_y

RationalNumber Mantid::Geometry::V3R::m_y
protected

◆ m_z

RationalNumber Mantid::Geometry::V3R::m_z
protected

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