BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
BasicVector3D< T > Class Template Reference
Collaboration diagram for BasicVector3D< T >:

Public Member Functions

 BasicVector3D ()
 
 BasicVector3D (const T x1, const T y1, const T z1)
 
operator[] (int i) const
 
T & operator[] (int i)
 
x () const
 
y () const
 
z () const
 
void setX (const T &a)
 
void setY (const T &a)
 
void setZ (const T &a)
 
BasicVector3D< T > & operator+= (const BasicVector3D< T > &v)
 
BasicVector3D< T > & operator-= (const BasicVector3D< T > &v)
 
template<class U >
auto operator*= (U a)
 
template<class U >
auto operator/= (U a)
 
BasicVector3D< T > conj () const
 
double mag2 () const
 
double mag () const
 
double magxy2 () const
 
double magxy () const
 
double phi () const
 
double theta () const
 
double cosTheta () const
 
double sin2Theta () const
 
BasicVector3D< T > unit () const
 
BasicVector3D< std::complex< double > > complex () const
 
BasicVector3D< double > real () const
 
template<class U >
auto dot (const BasicVector3D< U > &v) const
 
template<class U >
auto cross (const BasicVector3D< U > &v) const
 
double angle (const BasicVector3D< T > &v) const
 
BasicVector3D< T > project (const BasicVector3D< T > &v) const
 
BasicVector3D< T > rotatedX (double a) const
 
BasicVector3D< T > rotatedY (double a) const
 
BasicVector3D< T > rotatedZ (double a) const
 
BasicVector3D< T > rotated (double a, const BasicVector3D< T > &v) const
 
BasicVector3D< complex_tconj () const
 
BasicVector3D< double > real () const
 
BasicVector3D< complex_tunit () const
 

Private Attributes

v_ [3]
 

Related Functions

(Note that these are not member functions.)

template<class T >
std::ostream & operator<< (std::ostream &os, const BasicVector3D< T > &a)
 
template<class T >
BasicVector3D< T > operator+ (const BasicVector3D< T > &v)
 
template<class T >
BasicVector3D< T > operator- (const BasicVector3D< T > &v)
 
template<class T >
BasicVector3D< T > operator+ (const BasicVector3D< T > &a, const BasicVector3D< T > &b)
 
template<class T >
BasicVector3D< T > operator- (const BasicVector3D< T > &a, const BasicVector3D< T > &b)
 
template<class T , class U >
auto operator* (const BasicVector3D< T > &v, const U a)
 
template<class T , class U >
auto operator* (const U a, const BasicVector3D< T > &v)
 
template<class T , class U >
BasicVector3D< T > operator/ (const BasicVector3D< T > &v, U a)
 
template<class T >
bool operator== (const BasicVector3D< T > &a, const BasicVector3D< T > &b)
 
template<class T >
bool operator!= (const BasicVector3D< T > &a, const BasicVector3D< T > &b)
 

Detailed Description

template<class T>
class BasicVector3D< T >

Forked from CLHEP/Geometry by E.

Chernyaev Evgue.nosp@m.ni.T.nosp@m.chern.nosp@m.iaev.nosp@m.@cern.nosp@m..ch, then reworked beyond recognition. Removed split of point and vector semantics. Transforms are relegated to a separate class Transform3D. Three-dimensional vector template, for use with integer, double, or complex components.

Definition at line 27 of file BasicVector3D.h.

Constructor & Destructor Documentation

◆ BasicVector3D() [1/2]

template<class T >
BasicVector3D< T >::BasicVector3D ( )
inline

Default constructor.

Definition at line 38 of file BasicVector3D.h.

39  {
40  v_[0] = 0.0;
41  v_[1] = 0.0;
42  v_[2] = 0.0;
43  }

References BasicVector3D< T >::v_.

◆ BasicVector3D() [2/2]

template<class T >
BasicVector3D< T >::BasicVector3D ( const T  x1,
const T  y1,
const T  z1 
)
inline

Constructor from cartesian components.

Definition at line 46 of file BasicVector3D.h.

47  {
48  v_[0] = x1;
49  v_[1] = y1;
50  v_[2] = z1;
51  }

References BasicVector3D< T >::v_.

Member Function Documentation

◆ operator[]() [1/2]

template<class T >
T BasicVector3D< T >::operator[] ( int  i) const
inline

Returns components by index.

Definition at line 58 of file BasicVector3D.h.

58 { return v_[i]; }

References BasicVector3D< T >::v_.

◆ operator[]() [2/2]

template<class T >
T& BasicVector3D< T >::operator[] ( int  i)
inline

Sets components by index.

Definition at line 61 of file BasicVector3D.h.

61 { return v_[i]; }

References BasicVector3D< T >::v_.

◆ x()

template<class T >
T BasicVector3D< T >::x ( ) const
inline

Returns x-component in cartesian coordinate system.

Definition at line 64 of file BasicVector3D.h.

64 { return v_[0]; }

References BasicVector3D< T >::v_.

Referenced by DetectionProperties::analyzerOperator(), SpecularMagneticStrategy::calculateTR(), MatrixRTCoefficients_v3::computeDeltaMatrix(), Lattice::computeInverseVectors(), SpecularMagneticNewNCStrategy::computeRoughnessMatrices(), BasicVector3D< T >::cross(), SimulationToPython::defineDetectorPolarizationAnalysis(), SampleToPython::defineLattices(), SampleToPython::defineMaterials(), BasicVector3D< T >::dot(), InterferenceFunction2DSuperLattice::evaluate(), Prism::evaluate_for_q(), FormFactorBox::evaluate_for_q(), FormFactorCylinder::evaluate_for_q(), FormFactorEllipsoidalCylinder::evaluate_for_q(), FormFactorFullSpheroid::evaluate_for_q(), FormFactorHollowSphere::evaluate_for_q(), FormFactorLongBoxGauss::evaluate_for_q(), FormFactorLongBoxLorentz::evaluate_for_q(), IProfileRipple::evaluate_for_q(), FormFactorGaussSphere::evaluate_for_q(), FormFactorSphereGaussianRadius::evaluate_for_q(), FormFactorDWBAPol::evaluatePol(), someff::ffSphere(), LayerRoughness::getCorrFun(), Beam::getPolarization(), LayerRoughness::getSpectralFun(), InterferenceFunction1DLattice::iff_without_dw(), InterferenceFunction2DLattice::iff_without_dw(), InterferenceFunction2DParaCrystal::iff_without_dw(), InterferenceFunction2DSuperLattice::iff_without_dw(), InterferenceFunctionFinite2DLattice::iff_without_dw(), InterferenceFunctionHardDisk::iff_without_dw(), InterferenceFunctionRadialParaCrystal::iff_without_dw(), FormFactorCone::Integrand(), FormFactorHemiEllipsoid::Integrand(), FormFactorTruncatedSphere::Integrand(), FormFactorTruncatedSpheroid::Integrand(), anonymous_namespace{SimulationToPython.cpp}::isDefaultDirection(), SpecularMagneticStrategy::nullifyBottomReflection(), BasicVector3D< T >::operator!=(), BasicVector3D< T >::operator*(), BasicVector3D< T >::operator+(), BasicVector3D< T >::operator-(), BasicVector3D< T >::operator/(), BasicVector3D< T >::operator<<(), BasicVector3D< T >::operator==(), MatrixRTCoefficients_v3::pMatrixHelper(), pyfmt::printKvector(), BasicVector3D< T >::rotatedZ(), SampleToPython::setPositionInformation(), IParameterized::setVectorValue(), MatrixRTCoefficients_v3::TransformationMatrix(), Transform3D::transformed(), and Transform3D::transformedInverse().

◆ y()

template<class T >
T BasicVector3D< T >::y ( ) const
inline

Returns y-component in cartesian coordinate system.

Definition at line 66 of file BasicVector3D.h.

66 { return v_[1]; }

References BasicVector3D< T >::v_.

Referenced by DetectionProperties::analyzerOperator(), SpecularMagneticStrategy::calculateTR(), MatrixRTCoefficients_v3::computeDeltaMatrix(), Lattice::computeInverseVectors(), BasicVector3D< T >::cross(), SimulationToPython::defineDetectorPolarizationAnalysis(), SampleToPython::defineLattices(), SampleToPython::defineMaterials(), BasicVector3D< T >::dot(), InterferenceFunction2DSuperLattice::evaluate(), Prism::evaluate_for_q(), FormFactorBox::evaluate_for_q(), FormFactorCylinder::evaluate_for_q(), FormFactorEllipsoidalCylinder::evaluate_for_q(), FormFactorFullSpheroid::evaluate_for_q(), FormFactorHollowSphere::evaluate_for_q(), FormFactorLongBoxGauss::evaluate_for_q(), FormFactorLongBoxLorentz::evaluate_for_q(), IProfileRipple::evaluate_for_q(), FormFactorGaussSphere::evaluate_for_q(), FormFactorSphereGaussianRadius::evaluate_for_q(), FormFactorDWBAPol::evaluatePol(), someff::ffSphere(), LayerRoughness::getCorrFun(), Beam::getPolarization(), LayerRoughness::getSpectralFun(), InterferenceFunction1DLattice::iff_without_dw(), InterferenceFunction2DLattice::iff_without_dw(), InterferenceFunction2DParaCrystal::iff_without_dw(), InterferenceFunction2DSuperLattice::iff_without_dw(), InterferenceFunctionFinite2DLattice::iff_without_dw(), InterferenceFunctionHardDisk::iff_without_dw(), InterferenceFunctionRadialParaCrystal::iff_without_dw(), FormFactorCone::Integrand(), FormFactorHemiEllipsoid::Integrand(), FormFactorTruncatedSphere::Integrand(), FormFactorTruncatedSpheroid::Integrand(), anonymous_namespace{SimulationToPython.cpp}::isDefaultDirection(), SpecularMagneticStrategy::nullifyBottomReflection(), BasicVector3D< T >::operator!=(), BasicVector3D< T >::operator*(), BasicVector3D< T >::operator+(), BasicVector3D< T >::operator-(), BasicVector3D< T >::operator/(), BasicVector3D< T >::operator<<(), BasicVector3D< T >::operator==(), MatrixRTCoefficients_v3::pMatrixHelper(), pyfmt::printKvector(), BasicVector3D< T >::rotatedZ(), SampleToPython::setPositionInformation(), IParameterized::setVectorValue(), MatrixRTCoefficients_v3::TransformationMatrix(), Transform3D::transformed(), and Transform3D::transformedInverse().

◆ z()

template<class T >
T BasicVector3D< T >::z ( ) const
inline

Returns z-component in cartesian coordinate system.

Definition at line 68 of file BasicVector3D.h.

68 { return v_[2]; }

References BasicVector3D< T >::v_.

Referenced by DetectionProperties::analyzerOperator(), FormFactorFullSphere::bottomZ(), FormFactorDecoratorPositionFactor::bottomZ(), anonymous_namespace{SpecularMagneticOldStrategy.cpp}::CalculateEigenvalues(), SpecularMagneticStrategy::calculateTR(), MatrixRTCoefficients_v3::computeDeltaMatrix(), Lattice::computeInverseVectors(), KzComputation::computeKzFromRefIndices(), KzComputation::computeReducedKz(), IFormFactorBorn::computeSlicingEffects(), BasicVector3D< T >::cross(), SimulationToPython::defineDetectorPolarizationAnalysis(), SampleToPython::defineLattices(), SampleToPython::defineMaterials(), BasicVector3D< T >::dot(), FormFactorDWBA::evaluate(), Polyhedron::evaluate_for_q(), Prism::evaluate_for_q(), FormFactorBox::evaluate_for_q(), FormFactorCylinder::evaluate_for_q(), FormFactorEllipsoidalCylinder::evaluate_for_q(), FormFactorFullSphere::evaluate_for_q(), FormFactorFullSpheroid::evaluate_for_q(), FormFactorHollowSphere::evaluate_for_q(), FormFactorLongBoxGauss::evaluate_for_q(), FormFactorLongBoxLorentz::evaluate_for_q(), FormFactorTruncatedSphere::evaluate_for_q(), FormFactorTruncatedSpheroid::evaluate_for_q(), IProfileRipple::evaluate_for_q(), FormFactorGaussSphere::evaluate_for_q(), FormFactorSphereGaussianRadius::evaluate_for_q(), someff::ffSphere(), Beam::getPolarization(), ProcessedSample::initBFields(), RectangularDetector::initNormalVector(), FormFactorCone::Integrand(), FormFactorHemiEllipsoid::Integrand(), FormFactorTruncatedSphere::Integrand(), FormFactorTruncatedSpheroid::Integrand(), anonymous_namespace{SimulationToPython.cpp}::isDefaultDirection(), SpecularMagneticStrategy::nullifyBottomReflection(), BasicVector3D< T >::operator!=(), BasicVector3D< T >::operator*(), BasicVector3D< T >::operator+(), BasicVector3D< T >::operator-(), BasicVector3D< T >::operator/(), BasicVector3D< T >::operator<<(), BasicVector3D< T >::operator==(), MatrixRTCoefficients_v3::pMatrixHelper(), pyfmt::printKvector(), BasicVector3D< T >::rotatedZ(), SampleToPython::setPositionInformation(), IParameterized::setVectorValue(), anonymous_namespace{IFormFactor.cpp}::ShapeIsContainedInLimits(), anonymous_namespace{IFormFactor.cpp}::ShapeOutsideLimits(), FormFactorFullSphere::topZ(), FormFactorDecoratorPositionFactor::topZ(), MatrixRTCoefficients_v3::TransformationMatrix(), Transform3D::transformed(), and Transform3D::transformedInverse().

◆ setX()

template<class T >
void BasicVector3D< T >::setX ( const T &  a)
inline

Sets x-component in cartesian coordinate system.

Definition at line 71 of file BasicVector3D.h.

71 { v_[0] = a; }

References BasicVector3D< T >::v_.

Referenced by Lattice::computeInverseVectors().

◆ setY()

template<class T >
void BasicVector3D< T >::setY ( const T &  a)
inline

Sets y-component in cartesian coordinate system.

Definition at line 73 of file BasicVector3D.h.

73 { v_[1] = a; }

References BasicVector3D< T >::v_.

Referenced by Lattice::computeInverseVectors().

◆ setZ()

template<class T >
void BasicVector3D< T >::setZ ( const T &  a)
inline

◆ operator+=()

template<class T >
BasicVector3D<T>& BasicVector3D< T >::operator+= ( const BasicVector3D< T > &  v)
inline

Adds other vector to this, and returns result.

Definition at line 82 of file BasicVector3D.h.

83  {
84  v_[0] += v.v_[0];
85  v_[1] += v.v_[1];
86  v_[2] += v.v_[2];
87  return *this;
88  }

References BasicVector3D< T >::v_.

◆ operator-=()

template<class T >
BasicVector3D<T>& BasicVector3D< T >::operator-= ( const BasicVector3D< T > &  v)
inline

Subtracts other vector from this, and returns result.

Definition at line 91 of file BasicVector3D.h.

92  {
93  v_[0] -= v.v_[0];
94  v_[1] -= v.v_[1];
95  v_[2] -= v.v_[2];
96  return *this;
97  }

References BasicVector3D< T >::v_.

◆ operator*=()

template<class T >
template<class U >
auto BasicVector3D< T >::operator*= ( a)
inline

Multiplies this with a scalar, and returns result.

Definition at line 101 of file BasicVector3D.h.

102  {
103  v_[0] *= a;
104  v_[1] *= a;
105  v_[2] *= a;
106  return *this;
107  }

References BasicVector3D< T >::v_.

◆ operator/=()

template<class T >
template<class U >
auto BasicVector3D< T >::operator/= ( a)
inline

Divides this by a scalar, and returns result.

Definition at line 112 of file BasicVector3D.h.

113  {
114  v_[0] /= a;
115  v_[1] /= a;
116  v_[2] /= a;
117  return *this;
118  }

References BasicVector3D< T >::v_.

◆ conj() [1/2]

template<class T >
BasicVector3D<T> BasicVector3D< T >::conj ( ) const

Returns complex conjugate vector.

◆ mag2()

◆ mag()

template<class T >
double BasicVector3D< T >::mag ( ) const
inline

Returns magnitude of the vector.

Definition at line 132 of file BasicVector3D.h.

132 { return sqrt(mag2()); }
double mag2() const
Returns magnitude squared of the vector.

References BasicVector3D< T >::mag2().

Referenced by DetectionProperties::analyzerOperator(), anonymous_namespace{SpecularMagneticOldStrategy.cpp}::CalculateEigenvalues(), FormFactorCrystal::calculateLargestReciprocalDistance(), RectangularPixel::calculateSolidAngle(), SpecularMagneticStrategy::calculateTR(), DetectionProperties::checkAnalyzerProperties(), MatrixRTCoefficients_v3::computeDeltaMatrix(), KzComputation::computeReducedKz(), SpecularMagneticStrategy::computeTR(), PolyhedralFace::decompose_q(), SimulationToPython::defineDetectorPolarizationAnalysis(), GaussFisherPeakShape::evaluate(), LorentzFisherPeakShape::evaluate(), MisesFisherGaussPeakShape::evaluate(), MisesGaussPeakShape::evaluate(), Polyhedron::evaluate_centered(), FormFactorCone::evaluate_for_q(), FormFactorHemiEllipsoid::evaluate_for_q(), FormFactorTruncatedSphere::evaluate_for_q(), FormFactorTruncatedSpheroid::evaluate_for_q(), PolyhedralFace::ff(), PolyhedralFace::ff_2D(), PolyhedralFace::ff_n(), RectangularPixel::getIntegrationFactor(), InterferenceFunction3DLattice::iff_without_dw(), InterferenceFunction3DLattice::initRecRadius(), RectangularDetector::initUandV(), anonymous_namespace{SpecularMagneticNewStrategy.cpp}::magneticSLD(), MatrixRTCoefficients_v3::MatrixRTCoefficients_v3(), SpecularMagneticStrategy::nullifyBottomReflection(), Slice::polarizedReducedPotential(), Slice::scalarReducedPotential(), DetectionProperties::setAnalyzerProperties(), Beam::setPolarization(), RectangularDetector::setPosition(), MatrixRTCoefficients_v3::TransformationMatrix(), and Lattice::vectorsWithinRadius().

Here is the call graph for this function:

◆ magxy2()

template<class T >
double BasicVector3D< T >::magxy2 ( ) const
inline

Returns squared distance from z axis.

Definition at line 135 of file BasicVector3D.h.

135 { return std::norm(v_[0]) + std::norm(v_[1]); }

References BasicVector3D< T >::v_.

Referenced by BasicVector3D< T >::magxy().

◆ magxy()

template<class T >
double BasicVector3D< T >::magxy ( ) const
inline

Returns distance from z axis.

Definition at line 138 of file BasicVector3D.h.

138 { return sqrt(magxy2()); }
double magxy2() const
Returns squared distance from z axis.

References BasicVector3D< T >::magxy2().

Referenced by SSCApproximationStrategy::polarizedCalculation(), and SSCApproximationStrategy::scalarCalculation().

Here is the call graph for this function:

◆ phi()

template<class T >
double BasicVector3D< T >::phi ( ) const

Returns azimuth angle.

Referenced by RectangularConverter::axisAngle(), and SimulationElement::getPhi().

◆ theta()

template<class T >
double BasicVector3D< T >::theta ( ) const

◆ cosTheta()

template<class T >
double BasicVector3D< T >::cosTheta ( ) const

Returns cosine of polar angle.

◆ sin2Theta()

template<class T >
double BasicVector3D< T >::sin2Theta ( ) const

Returns squared sine of polar angle.

Referenced by MaterialUtils::ScalarReducedPotential().

◆ unit() [1/2]

◆ complex()

template<class T >
BasicVector3D<std::complex<double> > BasicVector3D< T >::complex ( ) const

◆ real() [1/2]

template<class T >
BasicVector3D<double> BasicVector3D< T >::real ( ) const

Returns real parts.

Referenced by FormFactorCrystal::evaluate(), and FormFactorCrystal::evaluatePol().

◆ dot()

template<class T >
template<class U >
auto BasicVector3D< T >::dot ( const BasicVector3D< U > &  v) const
inline

Returns dot product of vectors (antilinear in the first [=self] argument).

Returns dot product of (complex) vectors (antilinear in the first [=self] argument).

Definition at line 310 of file BasicVector3D.h.

311 {
312  BasicVector3D<T> left_star = this->conj();
313  return left_star.x() * v.x() + left_star.y() * v.y() + left_star.z() * v.z();
314 }
Forked from CLHEP/Geometry by E.
Definition: BasicVector3D.h:28
BasicVector3D< T > conj() const
Returns complex conjugate vector.
T z() const
Returns z-component in cartesian coordinate system.
Definition: BasicVector3D.h:68
T y() const
Returns y-component in cartesian coordinate system.
Definition: BasicVector3D.h:66
T x() const
Returns x-component in cartesian coordinate system.
Definition: BasicVector3D.h:64

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Referenced by RectangularPixel::calculateSolidAngle(), Lattice::computeReciprocalVectors(), PolyhedralEdge::contrib(), PolyhedralFace::decompose_q(), PolyhedralFace::edge_sum_ff(), GaussFisherPeakShape::evaluate(), LorentzFisherPeakShape::evaluate(), MisesFisherGaussPeakShape::evaluate(), MisesGaussPeakShape::evaluate(), PolyhedralFace::ff_2D(), PolyhedralFace::ff_n(), PolyhedralFace::ff_n_core(), RectangularPixel::getIntegrationFactor(), Lattice::getNearestLatticeVectorCoordinates(), Lattice::getNearestReciprocalLatticeVectorCoordinates(), FormFactorDecoratorPositionFactor::getPositionFactor(), InterferenceFunctionFinite3DLattice::iff_without_dw(), InterferenceFunctionTwin::iff_without_dw(), RectangularDetector::indexOfSpecular(), RectangularDetector::initUandV(), MisesFisherGaussPeakShape::integrand(), PolyhedralFace::normalProjectionConj(), anonymous_namespace{MagneticMaterialImpl.cpp}::OrthogonalToBaseVector(), PolyhedralFace::PolyhedralFace(), BasicVector3D< T >::project(), PolyhedralEdge::qE(), PolyhedralEdge::qR(), and Lattice::volume().

Here is the call graph for this function:

◆ cross()

template<class T >
template<class U >
auto BasicVector3D< T >::cross ( const BasicVector3D< U > &  v) const
inline

Returns cross product of vectors (linear in both arguments).

Returns cross product of (complex) vectors.

Definition at line 321 of file BasicVector3D.h.

322 {
323  return BasicVector3D<decltype(this->x() * v.x())>(
324  y() * v.z() - v.y() * z(), z() * v.x() - v.z() * x(), x() * v.y() - v.x() * y());
325 }

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Referenced by Lattice::computeReciprocalVectors(), PolyhedralFace::edge_sum_ff(), MisesFisherGaussPeakShape::evaluate(), MisesGaussPeakShape::evaluate(), PolyhedralFace::ff_n_core(), RectangularDetector::initUandV(), RectangularPixel::RectangularPixel(), and Lattice::volume().

Here is the call graph for this function:

◆ angle()

template<class T >
double BasicVector3D< T >::angle ( const BasicVector3D< T > &  v) const

Returns angle with respect to another vector.

◆ project()

template<class T >
BasicVector3D<T> BasicVector3D< T >::project ( const BasicVector3D< T > &  v) const
inline

Returns projection of this onto other vector: (this*v)*v/|v|^2.

Definition at line 179 of file BasicVector3D.h.

180  {
181  return dot(v) * v / v.mag2();
182  }
auto dot(const BasicVector3D< U > &v) const
Returns dot product of vectors (antilinear in the first [=self] argument).

References BasicVector3D< T >::dot(), and BasicVector3D< T >::mag2().

Referenced by MillerIndexOrientation::transformationMatrix().

Here is the call graph for this function:

◆ rotatedX()

template<class T >
BasicVector3D<T> BasicVector3D< T >::rotatedX ( double  a) const

Returns result of rotation around x-axis.

◆ rotatedY()

template<class T >
BasicVector3D<T> BasicVector3D< T >::rotatedY ( double  a) const

Returns result of rotation around y-axis.

◆ rotatedZ()

template<class T >
BasicVector3D<T> BasicVector3D< T >::rotatedZ ( double  a) const
inline

Returns result of rotation around z-axis.

Definition at line 193 of file BasicVector3D.h.

194  {
195  return BasicVector3D<T>(cos(a) * x() + sin(a) * y(), -sin(a) * x() + cos(a) * y(), z());
196  }

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Referenced by InterferenceFunction2DSuperLattice::interferenceForXi().

Here is the call graph for this function:

◆ rotated()

template<class T >
BasicVector3D<T> BasicVector3D< T >::rotated ( double  a,
const BasicVector3D< T > &  v 
) const

Returns result of rotation around the axis specified by another vector.

◆ conj() [2/2]

Definition at line 42 of file BasicVector3D.cpp.

43 {
44  return BasicVector3D<complex_t>(std::conj(v_[0]), std::conj(v_[1]), std::conj(v_[2]));
45 }

◆ real() [2/2]

BasicVector3D< double > BasicVector3D< complex_t >::real ( ) const

Definition at line 83 of file BasicVector3D.cpp.

84 {
85  return BasicVector3D<double>(v_[0].real(), v_[1].real(), v_[2].real());
86 }
BasicVector3D< double > real() const
Returns real parts.

◆ unit() [2/2]

Definition at line 97 of file BasicVector3D.cpp.

98 {
99  double len = mag();
100  if (len == 0.0)
101  throw Exceptions::DivisionByZeroException("Cannot normalize zero vector");
102  return BasicVector3D<complex_t>(x() / len, y() / len, z() / len);
103 }
double mag() const
Returns magnitude of the vector.

Friends And Related Function Documentation

◆ operator<<()

template<class T >
std::ostream & operator<< ( std::ostream &  os,
const BasicVector3D< T > &  a 
)
related

Output to stream.

Definition at line 207 of file BasicVector3D.h.

208 {
209  return os << "(" << a.x() << "," << a.y() << "," << a.z() << ")";
210 }

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Here is the call graph for this function:

◆ operator+() [1/2]

template<class T >
BasicVector3D< T > operator+ ( const BasicVector3D< T > &  v)
related

Unary plus.

Definition at line 218 of file BasicVector3D.h.

219 {
220  return v;
221 }

◆ operator-() [1/2]

template<class T >
BasicVector3D< T > operator- ( const BasicVector3D< T > &  v)
related

Unary minus.

Definition at line 225 of file BasicVector3D.h.

226 {
227  return BasicVector3D<T>(-v.x(), -v.y(), -v.z());
228 }

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Here is the call graph for this function:

◆ operator+() [2/2]

template<class T >
BasicVector3D< T > operator+ ( const BasicVector3D< T > &  a,
const BasicVector3D< T > &  b 
)
related

Addition of two vectors.

Definition at line 237 of file BasicVector3D.h.

238 {
239  return BasicVector3D<T>(a.x() + b.x(), a.y() + b.y(), a.z() + b.z());
240 }

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Here is the call graph for this function:

◆ operator-() [2/2]

template<class T >
BasicVector3D< T > operator- ( const BasicVector3D< T > &  a,
const BasicVector3D< T > &  b 
)
related

Subtraction of two vectors.

Definition at line 245 of file BasicVector3D.h.

246 {
247  return BasicVector3D<T>(a.x() - b.x(), a.y() - b.y(), a.z() - b.z());
248 }

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Here is the call graph for this function:

◆ operator*() [1/2]

template<class T , class U >
auto operator* ( const BasicVector3D< T > &  v,
const U  a 
)
related

Multiplication vector by scalar.

Definition at line 253 of file BasicVector3D.h.

254 {
255  return BasicVector3D<decltype(v.x() * a)>(v.x() * a, v.y() * a, v.z() * a);
256 }

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Here is the call graph for this function:

◆ operator*() [2/2]

template<class T , class U >
auto operator* ( const U  a,
const BasicVector3D< T > &  v 
)
related

Multiplication scalar by vector.

Definition at line 262 of file BasicVector3D.h.

263 {
264  return BasicVector3D<decltype(a * v.x())>(a * v.x(), a * v.y(), a * v.z());
265 }

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Here is the call graph for this function:

◆ operator/()

template<class T , class U >
BasicVector3D< T > operator/ ( const BasicVector3D< T > &  v,
a 
)
related

Division vector by scalar.

Definition at line 275 of file BasicVector3D.h.

276 {
277  return BasicVector3D<T>(v.x() / a, v.y() / a, v.z() / a);
278 }

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Here is the call graph for this function:

◆ operator==()

template<class T >
bool operator== ( const BasicVector3D< T > &  a,
const BasicVector3D< T > &  b 
)
related

Comparison of two vectors for equality.

Definition at line 282 of file BasicVector3D.h.

283 {
284  return (a.x() == b.x() && a.y() == b.y() && a.z() == b.z());
285 }

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Here is the call graph for this function:

◆ operator!=()

template<class T >
bool operator!= ( const BasicVector3D< T > &  a,
const BasicVector3D< T > &  b 
)
related

Comparison of two vectors for inequality.

Definition at line 289 of file BasicVector3D.h.

290 {
291  return (a.x() != b.x() || a.y() != b.y() || a.z() != b.z());
292 }

References BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().

Here is the call graph for this function:

Member Data Documentation

◆ v_


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