Skip to content
Snippets Groups Projects
Commit d581efa7 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rename -> Vec3

parent 25802854
No related branches found
No related tags found
1 merge request!486Merge BasicVector3D into Vectors3D.h, make it header only, and decouple from Complex.h
Showing
with 1659 additions and 86842 deletions
......@@ -18,16 +18,16 @@
#include "Base/Types/Complex.h"
#include <array>
template <class T> class BasicVector3D;
template <class T> class Vec3;
using I3 = BasicVector3D<int>;
using R3 = BasicVector3D<double>;
using C3 = BasicVector3D<complex_t>;
using I3 = Vec3<int>;
using R3 = Vec3<double>;
using C3 = Vec3<complex_t>;
//! Three-dimensional vector template, for use with integer, double, or complex components.
template <class T> class BasicVector3D : public std::array<T,3> {
template <class T> class Vec3 : public std::array<T,3> {
private:
using super = std::array<T,3>;
......@@ -37,10 +37,10 @@ public:
// -------------------------------------------------------------------------
//! Constructs the null vector.
BasicVector3D() : super{0., 0., 0.} {}
Vec3() : super{0., 0., 0.} {}
//! Constructs a vector from cartesian components.
BasicVector3D(const T x, const T y, const T z) : super{x,y,z} {}
Vec3(const T x, const T y, const T z) : super{x,y,z} {}
// -------------------------------------------------------------------------
// Component access
......@@ -65,7 +65,7 @@ public:
// -------------------------------------------------------------------------
//! Adds other vector to this, and returns result.
BasicVector3D<T>& operator+=(const BasicVector3D<T>& v)
Vec3<T>& operator+=(const Vec3<T>& v)
{
(*this)[0] += v[0];
(*this)[1] += v[1];
......@@ -74,7 +74,7 @@ public:
}
//! Subtracts other vector from this, and returns result.
BasicVector3D<T>& operator-=(const BasicVector3D<T>& v)
Vec3<T>& operator-=(const Vec3<T>& v)
{
(*this)[0] -= v[0];
(*this)[1] -= v[1];
......@@ -109,7 +109,7 @@ public:
// -------------------------------------------------------------------------
//! Returns complex conjugate vector
BasicVector3D<T> conj() const;
Vec3<T> conj() const;
//! Returns magnitude squared of the vector.
double mag2() const { return std::norm(x()) + std::norm(y()) + std::norm(z()); }
......@@ -136,7 +136,7 @@ public:
double sin2Theta() const;
//! Returns unit vector in direction of this. Throws for null vector.
BasicVector3D<T> unit() const;
Vec3<T> unit() const;
//! Returns this, trivially converted to complex type.
C3 complex() const;
......@@ -150,19 +150,19 @@ public:
//! Returns dot product of vectors (antilinear in the first [=self] argument).
#ifndef SWIG
template <class U> auto dot(const BasicVector3D<U>& v) const;
template <class U> auto dot(const Vec3<U>& v) const;
#endif // USER_API
//! Returns cross product of vectors (linear in both arguments).
#ifndef SWIG
template <class U> auto cross(const BasicVector3D<U>& v) const;
template <class U> auto cross(const Vec3<U>& v) const;
#endif // USER_API
//! Returns angle with respect to another vector.
double angle(const BasicVector3D<T>& v) const;
double angle(const Vec3<T>& v) const;
//! Returns projection of this onto other vector: (this*v)*v/|v|^2.
BasicVector3D<T> project(const BasicVector3D<T>& v) const
Vec3<T> project(const Vec3<T>& v) const
{
return dot(v) * v / v.mag2();
}
......@@ -172,16 +172,16 @@ public:
// -------------------------------------------------------------------------
//! Returns result of rotation around x-axis.
BasicVector3D<T> rotatedX(double a) const;
Vec3<T> rotatedX(double a) const;
//! Returns result of rotation around y-axis.
BasicVector3D<T> rotatedY(double a) const;
Vec3<T> rotatedY(double a) const;
//! Returns result of rotation around z-axis.
BasicVector3D<T> rotatedZ(double a) const
Vec3<T> rotatedZ(double a) const
{
return BasicVector3D<T>(cos(a) * x() + sin(a) * y(), -sin(a) * x() + cos(a) * y(), z());
return Vec3<T>(cos(a) * x() + sin(a) * y(), -sin(a) * x() + cos(a) * y(), z());
}
//! Returns result of rotation around the axis specified by another vector.
BasicVector3D<T> rotated(double a, const BasicVector3D<T>& v) const;
Vec3<T> rotated(double a, const Vec3<T>& v) const;
};
// =============================================================================
......@@ -189,8 +189,8 @@ public:
// =============================================================================
//! Output to stream.
//! @relates BasicVector3D
template <class T> std::ostream& operator<<(std::ostream& os, const BasicVector3D<T>& a)
//! @relates Vec3
template <class T> std::ostream& operator<<(std::ostream& os, const Vec3<T>& a)
{
return os << "(" << a.x() << "," << a.y() << "," << a.z() << ")";
}
......@@ -200,15 +200,15 @@ template <class T> std::ostream& operator<<(std::ostream& os, const BasicVector3
// -----------------------------------------------------------------------------
//! Unary plus.
//! @relates BasicVector3D
template <class T> inline BasicVector3D<T> operator+(const BasicVector3D<T>& v)
//! @relates Vec3
template <class T> inline Vec3<T> operator+(const Vec3<T>& v)
{
return v;
}
//! Unary minus.
//! @relates BasicVector3D
template <class T> inline BasicVector3D<T> operator-(const BasicVector3D<T>& v)
//! @relates Vec3
template <class T> inline Vec3<T> operator-(const Vec3<T>& v)
{
return {-v.x(), -v.y(), -v.z()};
}
......@@ -218,36 +218,36 @@ template <class T> inline BasicVector3D<T> operator-(const BasicVector3D<T>& v)
// -----------------------------------------------------------------------------
//! Addition of two vectors.
//! @relates BasicVector3D
//! @relates Vec3
template <class T>
inline BasicVector3D<T> operator+(const BasicVector3D<T>& a, const BasicVector3D<T>& b)
inline Vec3<T> operator+(const Vec3<T>& a, const Vec3<T>& b)
{
return {a.x() + b.x(), a.y() + b.y(), a.z() + b.z()};
}
//! Subtraction of two vectors.
//! @relates BasicVector3D
//! @relates Vec3
template <class T>
inline BasicVector3D<T> operator-(const BasicVector3D<T>& a, const BasicVector3D<T>& b)
inline Vec3<T> operator-(const Vec3<T>& a, const Vec3<T>& b)
{
return {a.x() - b.x(), a.y() - b.y(), a.z() - b.z()};
}
//! Multiplication vector by scalar.
//! @relates BasicVector3D
//! @relates Vec3
#ifndef SWIG
template <class T, class U> inline auto operator*(const BasicVector3D<T>& v, const U a)
template <class T, class U> inline auto operator*(const Vec3<T>& v, const U a)
{
return BasicVector3D<decltype(v.x() * v.x())>(v.x() * a, v.y() * a, v.z() * a);
return Vec3<decltype(v.x() * v.x())>(v.x() * a, v.y() * a, v.z() * a);
}
#endif // USER_API
//! Multiplication scalar by vector.
//! @relates BasicVector3D
//! @relates Vec3
#ifndef SWIG
template <class T, class U> inline auto operator*(const U a, const BasicVector3D<T>& v)
template <class T, class U> inline auto operator*(const U a, const Vec3<T>& v)
{
return BasicVector3D<decltype(a * v.x())>(a * v.x(), a * v.y(), a * v.z());
return Vec3<decltype(a * v.x())>(a * v.x(), a * v.y(), a * v.z());
}
#endif // USER_API
......@@ -257,10 +257,10 @@ template <class T, class U> inline auto operator*(const U a, const BasicVector3D
// in general it tends to make expressions more difficult to read.)
//! Division vector by scalar.
//! @relates BasicVector3D
template <class T, class U> inline BasicVector3D<T> operator/(const BasicVector3D<T>& v, U a)
//! @relates Vec3
template <class T, class U> inline Vec3<T> operator/(const Vec3<T>& v, U a)
{
return BasicVector3D<T>(v.x() / a, v.y() / a, v.z() / a);
return Vec3<T>(v.x() / a, v.y() / a, v.z() / a);
}
// =============================================================================
......@@ -271,9 +271,9 @@ template <class T, class U> inline BasicVector3D<T> operator/(const BasicVector3
#ifndef SWIG
template <class T>
template <class U>
inline auto BasicVector3D<T>::dot(const BasicVector3D<U>& v) const
inline auto Vec3<T>::dot(const Vec3<U>& v) const
{
BasicVector3D<T> left_star = this->conj();
Vec3<T> left_star = this->conj();
return left_star.x() * v.x() + left_star.y() * v.y() + left_star.z() * v.z();
}
#endif // USER_API
......@@ -282,9 +282,9 @@ inline auto BasicVector3D<T>::dot(const BasicVector3D<U>& v) const
#ifndef SWIG
template <class T>
template <class U>
inline auto BasicVector3D<T>::cross(const BasicVector3D<U>& v) const
inline auto Vec3<T>::cross(const Vec3<U>& v) const
{
return BasicVector3D<decltype(this->x() * v.x())>(
return Vec3<decltype(this->x() * v.x())>(
y() * v.z() - v.y() * z(), z() * v.x() - v.z() * x(), x() * v.y() - v.x() * y());
}
#endif // USER_API
......
......@@ -66,7 +66,7 @@ public:
double area() const { return m_area; }
double pyramidalVolume() const { return m_rperp * m_area / 3; }
double radius3d() const { return m_radius_3d; }
//! Returns conj(q)*normal [BasicVector3D::dot is antilinear in 'this' argument]
//! Returns conj(q)*normal [Vec3::dot is antilinear in 'this' argument]
complex_t normalProjectionConj(C3 q) const { return q.dot(m_normal); }
complex_t ff_n(int n, C3 q) const;
complex_t ff(C3 q, bool sym_Ci) const;
......
......@@ -35,7 +35,7 @@ const Eigen::Matrix2cd Pauli_Z((Eigen::Matrix2cd() << 1, 0, 0, -1).finished());
template <typename T>
Eigen::Matrix2cd MaterialUtils::MagnetizationCorrection(complex_t unit_factor,
double magnetic_factor,
BasicVector3D<T> polarization)
Vec3<T> polarization)
{
Eigen::Matrix2cd result =
unit_factor * Unit_Matrix
......
......@@ -42,7 +42,7 @@ Eigen::Matrix2cd PolarizedReducedPotential(complex_t n, R3 b_field, R3 k, double
template <typename T>
Eigen::Matrix2cd MagnetizationCorrection(complex_t unit_factor, double magnetic_factor,
BasicVector3D<T> polarization);
Vec3<T> polarization);
//! Checks if all non-default materials in _materials_ are of the same type and returns this type.
//! If several types of materials are involved, InvalidMaterialType identifier is returned.
......
......@@ -22,7 +22,7 @@ TEST_F(CVectorTest, BasicArithmetics)
Eigen::Vector3cd vc(complex_t(1., 1.), complex_t(2., -5.), complex_t(3., 4.));
EXPECT_TRUE(va.dot(vc) == complex_t(14., 3.));
// Dot product defined in BasicVector3D
// Dot product defined in Vec3
C3 vec_a(complex_t(1., 0.), complex_t(2., 0.), complex_t(3., 0.));
C3 vec_b(complex_t(2., 0.), complex_t(3., 0.), complex_t(4., 0.));
C3 vec_c(complex_t(1., 1.), complex_t(2., -5.), complex_t(3., 4.));
......
......@@ -4,7 +4,7 @@
%import(module="libBornAgainBase") "Base/Vector/Transform3D.h"
%import(module="libBornAgainBase") "Base/Axis/IAxis.h"
%template(R3) BasicVector3D<double>;
%template(vector_R3) std::vector<BasicVector3D<double>>;
%template(C3) BasicVector3D<std::complex<double>>;
%template(vector_C3) std::vector<BasicVector3D<std::complex<double>>>;
%template(R3) Vec3<double>;
%template(vector_R3) std::vector<Vec3<double>>;
%template(C3) Vec3<std::complex<double>>;
%template(vector_C3) std::vector<Vec3<std::complex<double>>>;
%ignore BasicVector3D<std::complex<double>>::complex() const;
%ignore BasicVector3D<std::complex<double>>::angle(const BasicVector3D<std::complex<double>>&) const;
%ignore BasicVector3D<std::complex<double>>::perp2(const BasicVector3D<std::complex<double>>&) const;
%ignore BasicVector3D<std::complex<double>>::sin2Theta() const;
%ignore BasicVector3D<std::complex<double>>::cosTheta() const;
%ignore BasicVector3D<std::complex<double>>::theta() const;
%ignore BasicVector3D<std::complex<double>>::phi() const;
%ignore BasicVector3D<std::complex<double>>::rotated(double, const BasicVector3D<std::complex<double>>&) const;
%ignore BasicVector3D<std::complex<double>>::rotatedX(double) const;
%ignore BasicVector3D<std::complex<double>>::rotatedY(double) const;
%ignore BasicVector3D<std::complex<double>>::rotatedZ(double) const;
%ignore Vec3<std::complex<double>>::complex() const;
%ignore Vec3<std::complex<double>>::angle(const Vec3<std::complex<double>>&) const;
%ignore Vec3<std::complex<double>>::perp2(const Vec3<std::complex<double>>&) const;
%ignore Vec3<std::complex<double>>::sin2Theta() const;
%ignore Vec3<std::complex<double>>::cosTheta() const;
%ignore Vec3<std::complex<double>>::theta() const;
%ignore Vec3<std::complex<double>>::phi() const;
%ignore Vec3<std::complex<double>>::rotated(double, const Vec3<std::complex<double>>&) const;
%ignore Vec3<std::complex<double>>::rotatedX(double) const;
%ignore Vec3<std::complex<double>>::rotatedY(double) const;
%ignore Vec3<std::complex<double>>::rotatedZ(double) const;
%ignore BasicVector3D<std::complex<double>>::cross(const BasicVector3D<std::complex<double>>&) const;
%ignore BasicVector3D<std::complex<double>>::perp(const BasicVector3D<std::complex<double>>&) const;
%ignore Vec3<std::complex<double>>::cross(const Vec3<std::complex<double>>&) const;
%ignore Vec3<std::complex<double>>::perp(const Vec3<std::complex<double>>&) const;
%ignore BasicVector3D<double>::rotated(double, const BasicVector3D<double>&) const;
%ignore BasicVector3D<double>::rotatedX(double) const;
%ignore BasicVector3D<double>::rotatedY(double) const;
%ignore BasicVector3D<double>::rotatedZ(double) const;
%ignore Vec3<double>::rotated(double, const Vec3<double>&) const;
%ignore Vec3<double>::rotatedX(double) const;
%ignore Vec3<double>::rotatedY(double) const;
%ignore Vec3<double>::rotatedZ(double) const;
......@@ -51,10 +51,10 @@
%include "Base/Axis/CustomBinAxis.h"
%include "Base/Axis/FixedBinAxis.h"
%template(R3) BasicVector3D<double>;
%template(vector_R3) std::vector<BasicVector3D<double>>;
%template(C3) BasicVector3D<std::complex<double>>;
%template(vector_C3) std::vector<BasicVector3D<std::complex<double>>>;
%template(R3) Vec3<double>;
%template(vector_R3) std::vector<Vec3<double>>;
%template(C3) Vec3<std::complex<double>>;
%template(vector_C3) std::vector<Vec3<std::complex<double>>>;
%extend FixedBinAxis {
double __getitem__(unsigned int i) { return (*($self))[i]; }
......
......@@ -124,14 +124,14 @@
%include "Core/Residual/ChiSquaredModule.h"
%include "Core/Residual/VarianceFunctions.h"
%extend BasicVector3D<double> {
BasicVector3D<double> __add__(const BasicVector3D<double>& rhs) const {
%extend Vec3<double> {
Vec3<double> __add__(const Vec3<double>& rhs) const {
return *($self) + rhs; }
BasicVector3D<double> __mul__(double c) const {
Vec3<double> __mul__(double c) const {
return c * *($self); }
BasicVector3D<double> __rmul__(double c) const {
Vec3<double> __rmul__(double c) const {
return *($self) * c; }
BasicVector3D<double> __neg__() const {
Vec3<double> __neg__() const {
return - *($self); }
};
......
......@@ -63,14 +63,14 @@
%include "BAVersion.h"
%include "Resample/Swig/MultiLayerFuncs.h"
%extend BasicVector3D<double> {
BasicVector3D<double> __add__(const BasicVector3D<double>& rhs) const {
%extend Vec3<double> {
Vec3<double> __add__(const Vec3<double>& rhs) const {
return *($self) + rhs; }
BasicVector3D<double> __mul__(double c) const {
Vec3<double> __mul__(double c) const {
return c * *($self); }
BasicVector3D<double> __rmul__(double c) const {
Vec3<double> __rmul__(double c) const {
return *($self) * c; }
BasicVector3D<double> __neg__() const {
Vec3<double> __neg__() const {
return - *($self); }
};
......
......@@ -208,13 +208,13 @@
%include "Sample/Lattice/Lattice2D.h"
%include "Sample/Lattice/BakeLattice.h"
%extend BasicVector3D<double> {
BasicVector3D<double> __add__(const BasicVector3D<double>& rhs) const {
%extend Vec3<double> {
Vec3<double> __add__(const Vec3<double>& rhs) const {
return *($self) + rhs; }
BasicVector3D<double> __mul__(double c) const {
Vec3<double> __mul__(double c) const {
return c * *($self); }
BasicVector3D<double> __rmul__(double c) const {
Vec3<double> __rmul__(double c) const {
return *($self) * c; }
BasicVector3D<double> __neg__() const {
Vec3<double> __neg__() const {
return - *($self); }
};
// File: index.xml
// File: classBasicVector3D.xml
%feature("docstring") BasicVector3D "
Three-dimensional vector template, for use with integer, double, or complex components.
C++ includes: BasicVector3D.h
";
%feature("docstring") BasicVector3D::BasicVector3D "BasicVector3D< T >::BasicVector3D()
Constructs the null vector.
";
%feature("docstring") BasicVector3D::BasicVector3D "BasicVector3D< T >::BasicVector3D(const T x, const T y, const T z)
Constructs a vector from cartesian components.
";
%feature("docstring") BasicVector3D::x "T BasicVector3D< T >::x() const
Returns x-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::y "T BasicVector3D< T >::y() const
Returns y-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::z "T BasicVector3D< T >::z() const
Returns z-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::setX "void BasicVector3D< T >::setX(const T &a)
Sets x-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::setY "void BasicVector3D< T >::setY(const T &a)
Sets y-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::setZ "void BasicVector3D< T >::setZ(const T &a)
Sets z-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::conj "BasicVector3D<T> BasicVector3D< T >::conj() const
Returns complex conjugate vector.
";
%feature("docstring") BasicVector3D::mag2 "double BasicVector3D< T >::mag2() const
Returns magnitude squared of the vector.
";
%feature("docstring") BasicVector3D::mag "double BasicVector3D< T >::mag() const
Returns magnitude of the vector.
";
%feature("docstring") BasicVector3D::magxy2 "double BasicVector3D< T >::magxy2() const
Returns squared distance from z axis.
";
%feature("docstring") BasicVector3D::magxy "double BasicVector3D< T >::magxy() const
Returns distance from z axis.
";
%feature("docstring") BasicVector3D::phi "double BasicVector3D< T >::phi() const
Returns azimuth angle.
";
%feature("docstring") BasicVector3D::theta "double BasicVector3D< T >::theta() const
Returns polar angle.
";
%feature("docstring") BasicVector3D::cosTheta "double BasicVector3D< T >::cosTheta() const
Returns cosine of polar angle.
";
%feature("docstring") BasicVector3D::sin2Theta "double BasicVector3D< T >::sin2Theta() const
Returns squared sine of polar angle.
";
%feature("docstring") BasicVector3D::unit "BasicVector3D<T> BasicVector3D< T >::unit() const
Returns unit vector in direction of this. Throws for null vector.
";
%feature("docstring") BasicVector3D::complex "BasicVector3D<complex_t> BasicVector3D< T >::complex() const
Returns this, trivially converted to complex type.
";
%feature("docstring") BasicVector3D::real "BasicVector3D<double> BasicVector3D< T >::real() const
Returns real parts.
";
%feature("docstring") BasicVector3D::dot "auto BasicVector3D< T >::dot(const BasicVector3D< U > &v) const
Returns dot product of vectors (antilinear in the first [=self] argument).
Returns dot product of (complex) vectors (antilinear in the first [=self] argument).
";
%feature("docstring") BasicVector3D::cross "auto BasicVector3D< T >::cross(const BasicVector3D< U > &v) const
Returns cross product of vectors (linear in both arguments).
Returns cross product of (complex) vectors.
";
%feature("docstring") BasicVector3D::angle "double BasicVector3D< T >::angle(const BasicVector3D< T > &v) const
Returns angle with respect to another vector.
";
%feature("docstring") BasicVector3D::project "BasicVector3D<T> BasicVector3D< T >::project(const BasicVector3D< T > &v) const
Returns projection of this onto other vector: (this*v)*v/|v|^2.
";
%feature("docstring") BasicVector3D::rotatedX "BasicVector3D<T> BasicVector3D< T >::rotatedX(double a) const
Returns result of rotation around x-axis.
";
%feature("docstring") BasicVector3D::rotatedY "BasicVector3D<T> BasicVector3D< T >::rotatedY(double a) const
Returns result of rotation around y-axis.
";
%feature("docstring") BasicVector3D::rotatedZ "BasicVector3D<T> BasicVector3D< T >::rotatedZ(double a) const
Returns result of rotation around z-axis.
";
%feature("docstring") BasicVector3D::rotated "BasicVector3D<T> BasicVector3D< T >::rotated(double a, const BasicVector3D< T > &v) const
Returns result of rotation around the axis specified by another vector.
";
%feature("docstring") BasicVector3D::BasicVector3D "BasicVector3D< T >::BasicVector3D()
Constructs the null vector.
";
%feature("docstring") BasicVector3D::BasicVector3D "BasicVector3D< T >::BasicVector3D(const T x, const T y, const T z)
Constructs a vector from cartesian components.
";
%feature("docstring") BasicVector3D::x "T BasicVector3D< T >::x() const
Returns x-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::y "T BasicVector3D< T >::y() const
Returns y-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::z "T BasicVector3D< T >::z() const
Returns z-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::setX "void BasicVector3D< T >::setX(const T &a)
Sets x-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::setY "void BasicVector3D< T >::setY(const T &a)
Sets y-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::setZ "void BasicVector3D< T >::setZ(const T &a)
Sets z-component in cartesian coordinate system.
";
%feature("docstring") BasicVector3D::conj "BasicVector3D<T> BasicVector3D< T >::conj() const
Returns complex conjugate vector.
";
%feature("docstring") BasicVector3D::mag2 "double BasicVector3D< T >::mag2() const
Returns magnitude squared of the vector.
";
%feature("docstring") BasicVector3D::mag "double BasicVector3D< T >::mag() const
Returns magnitude of the vector.
";
%feature("docstring") BasicVector3D::magxy2 "double BasicVector3D< T >::magxy2() const
Returns squared distance from z axis.
";
%feature("docstring") BasicVector3D::magxy "double BasicVector3D< T >::magxy() const
Returns distance from z axis.
";
%feature("docstring") BasicVector3D::phi "double BasicVector3D< T >::phi() const
Returns azimuth angle.
";
%feature("docstring") BasicVector3D::theta "double BasicVector3D< T >::theta() const
Returns polar angle.
";
%feature("docstring") BasicVector3D::cosTheta "double BasicVector3D< T >::cosTheta() const
Returns cosine of polar angle.
";
%feature("docstring") BasicVector3D::sin2Theta "double BasicVector3D< T >::sin2Theta() const
Returns squared sine of polar angle.
";
%feature("docstring") BasicVector3D::unit "BasicVector3D<T> BasicVector3D< T >::unit() const
Returns unit vector in direction of this. Throws for null vector.
";
%feature("docstring") BasicVector3D::complex "C3 BasicVector3D< T >::complex() const
Returns this, trivially converted to complex type.
";
%feature("docstring") BasicVector3D::real "R3 BasicVector3D< T >::real() const
Returns real parts.
";
%feature("docstring") BasicVector3D::dot "auto BasicVector3D< T >::dot(const BasicVector3D< U > &v) const
Returns dot product of vectors (antilinear in the first [=self] argument).
";
%feature("docstring") BasicVector3D::cross "auto BasicVector3D< T >::cross(const BasicVector3D< U > &v) const
Returns cross product of vectors (linear in both arguments).
";
%feature("docstring") BasicVector3D::angle "double BasicVector3D< T >::angle(const BasicVector3D< T > &v) const
Returns angle with respect to another vector.
";
%feature("docstring") BasicVector3D::project "BasicVector3D<T> BasicVector3D< T >::project(const BasicVector3D< T > &v) const
Returns projection of this onto other vector: (this*v)*v/|v|^2.
";
%feature("docstring") BasicVector3D::rotatedX "BasicVector3D<T> BasicVector3D< T >::rotatedX(double a) const
Returns result of rotation around x-axis.
";
%feature("docstring") BasicVector3D::rotatedY "BasicVector3D<T> BasicVector3D< T >::rotatedY(double a) const
Returns result of rotation around y-axis.
";
%feature("docstring") BasicVector3D::rotatedZ "BasicVector3D<T> BasicVector3D< T >::rotatedZ(double a) const
Returns result of rotation around z-axis.
";
%feature("docstring") BasicVector3D::rotated "BasicVector3D<T> BasicVector3D< T >::rotated(double a, const BasicVector3D< T > &v) const
Returns result of rotation around the axis specified by another vector.
";
// File: structBin1D.xml
%feature("docstring") Bin1D "";
......@@ -1361,6 +1068,159 @@ Clips this axis to the given values.
";
// File: classVec3.xml
%feature("docstring") Vec3 "
Three-dimensional vector template, for use with integer, double, or complex components.
C++ includes: Vectors3D.h
";
%feature("docstring") Vec3::Vec3 "Vec3< T >::Vec3()
Constructs the null vector.
";
%feature("docstring") Vec3::Vec3 "Vec3< T >::Vec3(const T x, const T y, const T z)
Constructs a vector from cartesian components.
";
%feature("docstring") Vec3::x "T Vec3< T >::x() const
Returns x-component in cartesian coordinate system.
";
%feature("docstring") Vec3::y "T Vec3< T >::y() const
Returns y-component in cartesian coordinate system.
";
%feature("docstring") Vec3::z "T Vec3< T >::z() const
Returns z-component in cartesian coordinate system.
";
%feature("docstring") Vec3::setX "void Vec3< T >::setX(const T &a)
Sets x-component in cartesian coordinate system.
";
%feature("docstring") Vec3::setY "void Vec3< T >::setY(const T &a)
Sets y-component in cartesian coordinate system.
";
%feature("docstring") Vec3::setZ "void Vec3< T >::setZ(const T &a)
Sets z-component in cartesian coordinate system.
";
%feature("docstring") Vec3::conj "Vec3<T> Vec3< T >::conj() const
Returns complex conjugate vector.
";
%feature("docstring") Vec3::mag2 "double Vec3< T >::mag2() const
Returns magnitude squared of the vector.
";
%feature("docstring") Vec3::mag "double Vec3< T >::mag() const
Returns magnitude of the vector.
";
%feature("docstring") Vec3::magxy2 "double Vec3< T >::magxy2() const
Returns squared distance from z axis.
";
%feature("docstring") Vec3::magxy "double Vec3< T >::magxy() const
Returns distance from z axis.
";
%feature("docstring") Vec3::phi "double Vec3< T >::phi() const
Returns azimuth angle.
";
%feature("docstring") Vec3::theta "double Vec3< T >::theta() const
Returns polar angle.
";
%feature("docstring") Vec3::cosTheta "double Vec3< T >::cosTheta() const
Returns cosine of polar angle.
";
%feature("docstring") Vec3::sin2Theta "double Vec3< T >::sin2Theta() const
Returns squared sine of polar angle.
";
%feature("docstring") Vec3::unit "Vec3<T> Vec3< T >::unit() const
Returns unit vector in direction of this. Throws for null vector.
";
%feature("docstring") Vec3::complex "C3 Vec3< T >::complex() const
Returns this, trivially converted to complex type.
";
%feature("docstring") Vec3::real "R3 Vec3< T >::real() const
Returns real parts.
";
%feature("docstring") Vec3::dot "auto Vec3< T >::dot(const Vec3< U > &v) const
Returns dot product of vectors (antilinear in the first [=self] argument).
Returns dot product of (complex) vectors (antilinear in the first [=self] argument).
";
%feature("docstring") Vec3::cross "auto Vec3< T >::cross(const Vec3< U > &v) const
Returns cross product of vectors (linear in both arguments).
Returns cross product of (complex) vectors.
";
%feature("docstring") Vec3::angle "double Vec3< T >::angle(const Vec3< T > &v) const
Returns angle with respect to another vector.
";
%feature("docstring") Vec3::project "Vec3<T> Vec3< T >::project(const Vec3< T > &v) const
Returns projection of this onto other vector: (this*v)*v/|v|^2.
";
%feature("docstring") Vec3::rotatedX "Vec3<T> Vec3< T >::rotatedX(double a) const
Returns result of rotation around x-axis.
";
%feature("docstring") Vec3::rotatedY "Vec3<T> Vec3< T >::rotatedY(double a) const
Returns result of rotation around y-axis.
";
%feature("docstring") Vec3::rotatedZ "Vec3<T> Vec3< T >::rotatedZ(double a) const
Returns result of rotation around z-axis.
";
%feature("docstring") Vec3::rotated "Vec3<T> Vec3< T >::rotated(double a, const Vec3< T > &v) const
Returns result of rotation around the axis specified by another vector.
";
// File: classWavevectorInfo.xml
%feature("docstring") WavevectorInfo "
......@@ -2011,9 +1871,6 @@ This templated function is used in catalogs in form of a function pointer 'creat
// File: ThreadInfo_8h.xml
// File: BasicVector3D_8h.xml
// File: Direction_8cpp.xml
%feature("docstring") vecOfLambdaAlphaPhi "R3 vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi)
";
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.2
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#ifndef SWIG_libBornAgainDevice_WRAP_H_
#define SWIG_libBornAgainDevice_WRAP_H_
#include <map>
#include <string>
#endif
This diff is collapsed.
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.2
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#ifndef SWIG_libBornAgainResample_WRAP_H_
#define SWIG_libBornAgainResample_WRAP_H_
#include <map>
#include <string>
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment