53#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_VECTOR_4D_H
54#define LASS_GUARDIAN_OF_INCLUSION_PRIM_VECTOR_4D_H
72 typedef Vector4D<T> TSelf;
74 typedef typename util::CallTraits<T>::TValue TValue;
75 typedef typename util::CallTraits<T>::TParam TParam;
76 typedef typename util::CallTraits<T>::TReference TReference;
77 typedef typename util::CallTraits<T>::TConstReference TConstReference;
78 typedef typename num::NumTraits<T> TNumTraits;
80 enum { dimension = 4 };
82 template <
typename U>
struct Rebind
84 typedef Vector4D<U> Type;
99 Vector4D(TParam x, TParam y, TParam z, TParam w);
100 template <
typename U>
explicit Vector4D(
const Vector4D<U>& other);
101 template <
typename U> Vector4D(
const U& x,
const U& y,
const U& z,
const U& w);
103 typename Vector4D::TConstReference operator[](
size_t index)
const;
104 typename Vector4D::TReference operator[](
size_t index) ;
105 typename Vector4D::TConstReference
at(
signed index)
const;
106 typename Vector4D::TReference
at(
signed index);
109 const Vector4D<T> operator-()
const;
124 const Vector4D<T> reciprocal()
const;
125 const Vector4D<T>
project(
const Vector4D<T>& other)
const;
126 const Vector4D<T>
reject(
const Vector4D<T>& other)
const;
127 const Vector4D<T> reflect(
const Vector4D<T>& other)
const;
158template<
typename T,
typename Char,
typename Traits>
159std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& stream,
const Vector4D<T>& b);
160template<
typename T,
typename Char,
typename Traits>
161std::basic_istream<Char, Traits>& operator>>(std::basic_istream<Char, Traits>& stream,
Vector4D<T>& b);
172#define LASS_PRIM_HAVE_PY_EXPORT_TRAITS_VECTOR_4D
173#ifdef LASS_GUARDIAN_OF_INCLUSION_UTIL_PYOBJECT_PLUS_H
Output stream for writing a selection of geometric primitives to XML files.
#define LASS_SIMD_ALIGN
if LASS_SIMD_ALIGNMENT is set, use LASS_SIMD_ALIGN to align some structures on SIMD alignment boundar...
set of geometrical primitives
Library for Assembled Shared Sources.
const Vector4D< T > & operator+() const
A weird way to get back the same object.
const Vector4D< T > reject(const Vector4D< T > &other) const
Project vector on this one.
Vector4D::TReference at(signed index)
Wrap index around range.
Vector4D< T > & operator-=(TParam other)
subtract other of each component of this.
const Vector4D< T > normal() const
return a unit vector with same direction/sense as this vector.
Vector4D< T > & operator*=(TParam other)
multiply each component of this with other.
Vector4D::TConstReference at(signed index) const
Wrap index around range.
const TValue norm() const
Return norm of vector.
Vector4D< T > & operator+=(TParam other)
add other to each component of this.
bool isZero() const
Return true if all the components are (exactly!) zero.
Vector4D< T > & operator/=(TParam other)
divide each component of this by other.
const TValue squaredNorm() const
Return squared norm of vector.
Vector4D< T > & operator+=(const Vector4D< T > &other)
componentwise addition
void normalize()
Normalize vector.
Vector4D< T > & operator/=(const Vector4D< T > &other)
Componentwise division.
Vector4D< T > & operator*=(const Vector4D< T > &other)
Componentwise multiplication.
const Vector4D< T > transform(T(*op)(T)) const
apply a function to every component
Vector4D< T > & operator-=(const Vector4D< T > &other)
componentwise subtraction
const Vector4D< T > project(const Vector4D< T > &other) const
Project vector on this one.
bool isNaN() const
Return true if at least one of the components is NaN.