versor  3.0
C++11 library for Geometric algebra
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
vsr::Multivector< algebra_type, basis_type > Struct Template Reference

Generic Geometric Number Types (templated on an algebra and a basis ) More...

#include <vsr_multivector.h>

Public Types

using algebra = algebra_type
 algebra (a metric and field)
 
using basis = basis_type
 basis is an algebraic data type created with compile-time list processing
 
using value_t = typename algebra::value_t
 the field over which the algebra is defined (e.g. float or double)
 
using space = typename algebra::types
 <>::::<>
 
template<class B >
using MultivectorB = Multivector< algebra, B >
 another Type within same algebra
 
using Dual = typename algebra::template make_gp< typename blade< algebra::dim, algebra::dim >::type, basis >
 the Dual Type (product of this and algebra::types::pseudoscalar)
 
using DualE = typename algebra::template make_gp< Basis< bits::pss(algebra::dim-2)>, basis >
 the Euclidan subspace Dual Type (product of this and algebra::types::euclidean_pseudoscalar)
 
typedef const value_t array_type[Num]
 Data Array Type
 

Public Member Functions

array_typebegin () const
 Pointer to first data.
 
constexpr value_t operator[] (int idx) const
 Get value at idx
 
value_toperator[] (int idx)
 Set value at idx
 
template<typename... Args>
constexpr Multivector (Args...v)
 Construct from list of args (cannot be longer than Num)
 
template<typename B >
constexpr Multivector (const Multivector< algebra, B > &b)
 Construct from different Basis within same Algebra.
 
template<class alg , typename B >
constexpr Multivector (const Multivector< alg, B > &b)
 Construct from different algebra signature and different basis.
 
template<bits::type IDX>
value_t get () const
 Immutable get value of blade type IDX (. More...
 
template<bits::type IDX>
value_tget ()
 Mutable get value of blade type IDX.
 
template<bits::type IDX>
Multivectorset (value_t v)
 Set value of blade type IDX
 
Multivectorreset (value_t v=value_t())
 Reset.
 
Multivector conjugation () const
 Conjugation Unary Operation.
 
Multivector conj () const
 Conjugation Unary Operation Shorthand.
 
Multivector involution () const
 Involution Unary Operation.
 
Multivector inv () const
 Involution Unary Operation Shorthand.
 
template<class B >
cast () const
 Casting to type B.
 
template<class B >
copy () const
 Copying to type B.
 
bool operator== (const Multivector &mv) const
 Comparison. More...
 
void print ()
 Printing.
 
template<class B >
auto operator* (const MultivectorB< B > &b) const -> decltype(algebra::gp(*this, b))
 Geometric Product \(a*b\)
 
template<class B >
Multivectoroperator*= (const MultivectorB< B > &b)
 Geometric Product in place Transformation.
 
template<class B >
auto operator^ (const MultivectorB< B > &b) const -> decltype(algebra::op(*this, b))
 Outer Product \(a \wedge b\)
 
template<class B >
auto operator<= (const MultivectorB< B > &b) const -> decltype(algebra::ip(*this, b))
 Inner Product \(a \cdot b \) Uses Hestenes Inner Contraction (a must be of lower grade than b)
 
template<class B >
auto operator% (const MultivectorB< B > &b) const -> decltype(algebra::gp(*this, b))
 Commutator Product \(a \times b\)
 
template<typename B >
Multivector spin (const MultivectorB< B > &b) const
 Rotor (even) transformation \(RA\tilde{R}\)
 
template<typename B >
Multivector reflect (const MultivectorB< B > &b) const
 Versor (Odd) Transformation \(R\hat{A}\tilde{R}\)
 
template<typename B >
Multivector sp (const MultivectorB< B > &b) const
 
template<typename B >
Multivector re (const MultivectorB< B > &b) const
 
Multivector operator~ () const
 Reversion \(\tilde{A}\)
 
Multivector operator! () const
 Inversion \(\tilde{A}/A\tilde{A}\)
 
template<class B >
auto operator/ (const MultivectorB< B > &b) const -> auto
 
Multivector< algebra, typename algebra::vector_basisnull () const
 Conformal Mapping \(\boldsymbol(x)\to n_o + \boldsymbol{x} + \boldsymbol{x}^2n_\infty \)
 
template<class B >
Multivector trs (const MultivectorB< B > &b) const
 
template<class B >
Multivector translate (const MultivectorB< B > &b) const
 
template<class... Ts>
Multivector trs (Ts...v) const
 
template<class... Ts>
Multivector translate (Ts...v) const
 
template<class B >
Multivector trv (const MultivectorB< B > &b) const
 
template<class B >
Multivector transverse (const MultivectorB< B > &b) const
 
template<class... Ts>
Multivector trv (Ts...v) const
 
template<class... Ts>
Multivector transverse (Ts...v) const
 
template<class B >
Multivector mot (const MultivectorB< B > &b) const
 
template<class B >
Multivector motor (const MultivectorB< B > &b) const
 
template<class B >
Multivector twist (const MultivectorB< B > &b) const
 
template<class B >
Multivector bst (const MultivectorB< B > &b) const
 
template<class B >
Multivector boost (const MultivectorB< B > &b) const
 
template<class B >
Multivector dil (const MultivectorB< B > &b, VSR_PRECISION t) const
 
template<class B >
Multivector dilate (const MultivectorB< B > &b, VSR_PRECISION t) const
 
auto dual () const -> Dual
 
auto undual () const -> Dual
 
auto duale () const -> DualE
 
auto unduale () const -> DualE
 
value_t wt () const
 
value_t rwt () const
 
value_t norm () const
 
value_t rnorm () const
 
Multivector unit () const
 
Multivector runit () const
 
Multivector tunit () const
 
template<class B >
auto operator+ (const MultivectorB< B > &b) -> decltype(algebra::sum(*this, b))
 
Multivector operator+ (const Multivector &a) const
 
Multivector operator- (const Multivector &a) const
 
Multivector operator- () const
 
Multivectoroperator-= (const Multivector &b)
 
Multivectoroperator+= (const Multivector &b)
 
Multivector operator/ (VSR_PRECISION f) const
 
Multivectoroperator/= (VSR_PRECISION f)
 
Multivector operator* (VSR_PRECISION f) const
 
Multivectoroperator*= (VSR_PRECISION f)
 
auto operator+ (VSR_PRECISION a) const -> decltype(algebra::sumv(a,*this))
 
template<class A >
Multivector< Algebra, B > rot (const Multivector< Algebra, A > &t) const
 
template<class A >
Multivector< Algebra, B > rotate (const Multivector< Algebra, A > &t) const
 
template<class A>
Multivector< Algebra, B > trs (const Multivector< Algebra, A > &t) const
 
template<class A>
Multivector< Algebra, B > translate (const Multivector< Algebra, A > &t) const
 
template<class... Ts>
Multivector< Algebra, B > trs (Ts...v) const
 
template<class... Ts>
Multivector< Algebra, B > translate (Ts...v) const
 
template<class A>
Multivector< Algebra, B > trv (const Multivector< Algebra, A > &t) const
 
template<class A>
Multivector< Algebra, B > transverse (const Multivector< Algebra, A > &t) const
 
template<class... Ts>
Multivector< Algebra, B > trv (Ts...v) const
 
template<class... Ts>
Multivector< Algebra, B > transverse (Ts...v) const
 
template<class A >
Multivector< Algebra, B > dil (const Multivector< Algebra, A > &s, VSR_PRECISION t) const
 
template<class A >
Multivector< Algebra, B > dilate (const Multivector< Algebra, A > &s, VSR_PRECISION t) const
 
template<class A >
Multivector< Algebra, B > bst (const Multivector< Algebra, A > &t) const
 
template<class A >
Multivector< Algebra, B > boost (const Multivector< Algebra, A > &t) const
 
template<class A >
cast () const
 
template<class A >
copy () const
 
template<bits::type IDX>
Algebra::value_t & get ()
 
template<bits::type IDX>
Algebra::value_t get () const
 
template<bits::type IDX>
Multivector< Algebra, B > & set (typename Algebra::value_t v)
 
template<class A >
Multivector< Algebra, B > mot (const Multivector< Algebra, A > &t) const
 
template<class A >
Multivector< Algebra, B > motor (const Multivector< Algebra, A > &t) const
 
template<class A >
Multivector< Algebra, B > twist (const Multivector< Algebra, A > &t) const
 
template<class B >
Multivector rot (const MultivectorB< B > &b) const
 
template<class B >
Multivector rotate (const MultivectorB< B > &b) const
 

Public Attributes

value_t val [Num]
 Data Array
 

Static Public Attributes

static const int Num = basis::Num
 number of bases
 
static Multivector x = Multivector<Algebra,B>().template set<1>(1)
 
static Multivector y = Multivector<Algebra,B>().template set<2>(1)
 
static Multivector z = Multivector<Algebra,B>().template set<4>(1)
 
static Multivector xy = Multivector<Algebra,B>().template set<3>(1)
 
static Multivector xz = Multivector<Algebra,B>().template set<5>(1)
 
static Multivector yz = Multivector<Algebra,B>().template set<6>(1)
 

Friends

ostream & operator<< (ostream &os, const Multivector &m)
 

Detailed Description

template<typename algebra_type, typename basis_type>
struct vsr::Multivector< algebra_type, basis_type >

Generic Geometric Number Types (templated on an algebra and a basis )

Multivector is the main value-storing class. All Geometric Algebra Types are template instantiations of this class.

The types of values contained here (float, double, etc) are deterimined by the algebra. The way in which the data is combined with other methods is determined by their respective basis, in coordination with the algebra.

Member Function Documentation

template<typename algebra_type, typename basis_type>
template<bits::type IDX>
value_t vsr::Multivector< algebra_type, basis_type >::get ( ) const

Immutable get value of blade type IDX (.

Todo:
make blades user-defined literals?)
template<typename algebra_type, typename basis_type>
bool vsr::Multivector< algebra_type, basis_type >::operator== ( const Multivector< algebra_type, basis_type > &  mv) const
inline

Comparison.

Todo:
use dot product, see Group
template<typename algebra_type, typename basis_type>
template<class B >
Multivector vsr::Multivector< algebra_type, basis_type >::rot ( const MultivectorB< B > &  b) const

rotate in b plane

template<typename algebra_type, typename basis_type>
template<class B >
Multivector vsr::Multivector< algebra_type, basis_type >::rotate ( const MultivectorB< B > &  b) const

rotate in b plane


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