cgv
Loading...
Searching...
No Matches
cgv::math::fvec< T, N > Class Template Reference

A vector with zero based index. More...

#include <fvec.h>

Inheritance diagram for cgv::math::fvec< T, N >:
cgv::math::fmat< volume::coord_type, 3, 3 > cgv::math::fmat< float, 4, 4 > cgv::math::fmat< float, 3, 3 > cgv::math::fmat< float, 3, 4 > cgv::math::quaternion< float >

Public Types

enum  { dims = N }
 compile-time constant indicating the dimensionality of the vector More...
 
typedef T value_type
 
typedef T & reference
 
typedef const T & const_reference
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef T * iterator
 
typedef const T * const_iterator
 
typedef std::reverse_iterator< iterator > reverse_iterator
 
typedef std::reverse_iterator< const_iterator > const_reverse_iterator
 

Public Member Functions

iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 reverse iterator pointing to the end of reverse iteration
 
 fvec ()
 creates a vector not initialized
 
 fvec (const T &a)
 creates a vector, where all N components are initialized to the constant value a
 
 fvec (const T &x, const T &y)
 construct and init first two coordinates to the given values
 
 fvec (const T &x, const T &y, const T &z)
 construct and init first three coordinates to the given values
 
 fvec (const T &x, const T &y, const T &z, const T &w)
 construct and init first four coordinates to the given values
 
 fvec (cgv::type::uint32_type n, const T *a)
 creates a vector from a n-element array a, if n < N remaining N-n elements are set to zero
 
template<typename S >
 fvec (cgv::type::uint32_type n, const S *a)
 creates a column vector initialized to array of a different type with zeros filled to not copied components
 
 fvec (const fvec< T, N > &rhs)
 copy constructor
 
template<typename S >
 fvec (const fvec< S, N > &fv)
 copies a column vector of a different type
 
template<typename S1 , typename S2 >
 fvec (const fvec< S1, N - 1 > &fv, S2 w)
 construct from vector of one dimension less plus a scalar
 
template<typename S >
 fvec (const fvec< S, N+1 > &fv)
 construct from vector of one dimension higher by cutting of the highest dimension
 
 fvec (const std::array< T, N > &arr)
 construct from std::array of same size
 
fvecoperator= (const fvec< T, N > &rhs)
 assign vector rhs, if vector and rhs have different sizes, vector has been resized to match the size of
 
fvecoperator= (const T &a)
 set all components of vector to constant value a
 
void assign (const std::array< T, N > &arr)
 set to the contents of the given std::array with same size
 
void set (const T &x, const T &y)
 set the first two components
 
void set (const T &x, const T &y, const T &z)
 set the first three components
 
void set (const T &x, const T &y, const T &z, const T &w)
 set the first four components
 
void fill (const T &a)
 fill elements of vector with scalar v
 
void zeros ()
 fill the vector with zeros
 
void zerosh ()
 fill the vector with zeros except for the last component, which will be set to one
 
void ones ()
 fill the vector with ones
 
fvec< T, N+1 > lift () const
 convert to homogeneous version by adding a 1
 
vec< T > to_vec () const
 conversion to vector type
 
T & x ()
 first element
 
const T & x () const
 first element of const vector
 
T & y ()
 second element
 
const T & y () const
 second element of const vector
 
T & z ()
 third element
 
const T & z () const
 third element of const vector
 
T & w ()
 fourth element
 
const T & w () const
 fourth element of const vector
 
T & operator() (const int i)
 access i'th element
 
const T & operator() (const int i) const
 access i'th element of const vector
 
T & operator[] (const int i)
 access i'th element
 
const T & operator[] (const int i) const
 access i'th element of const vector
 
T * data ()
 cast into array. This allows calls like glVertex<N><T>v(p.data()) instead of glVertex<N><T,N>(p.x(),p.y(),....)
 
const T * data () const
 cast into const array
 
fvec< T, N > & operator+= (const T &s)
 in place addition of a scalar s
 
fvec< T, N > & operator-= (const T &s)
 in place subtraction by scalar s
 
fvec< T, N > & operator*= (const T &s)
 in place multiplication with s
 
fvec< T, N > & operator/= (const T &s)
 in place division by scalar s
 
template<typename S >
fvec< T, N > & operator+= (const fvec< S, N > &_v)
 in place vector addition
 
template<typename S >
fvec< T, N > & operator-= (const fvec< S, N > &_v)
 in place vector subtraction
 
template<typename S >
fvec< T, N > & operator*= (const fvec< S, N > &_v)
 in place componentwise vector multiplication
 
template<typename S >
fvec< T, N > & operator/= (const fvec< S, N > &_v)
 in place componentwise vector division
 
template<typename S >
fvec< T, N > operator+ (const fvec< S, N > &v) const
 vector addition
 
fvec< T, N > operator+ (const T &s) const
 componentwise addition of scalar
 
fvec< T, N > operator- (const T &s) const
 componentwise subtraction of scalar
 
template<typename S >
fvec< T, N > operator- (const fvec< S, N > &v) const
 vector subtraction
 
template<typename S >
fvec< T, N > operator* (const fvec< S, N > &v) const
 componentwise vector multiplication
 
template<typename S >
fvec< T, N > operator/ (const fvec< S, N > &v) const
 componentwise vector division
 
fvec< T, N > operator- (void) const
 negates the vector
 
fvec< T, N > operator* (const T &s) const
 multiplication with scalar s
 
fvec< T, N > operator/ (const T &s) const
 divides vector by scalar s
 
template<typename S >
bool operator== (const fvec< S, N > &v) const
 test for equality
 
template<typename S >
bool operator!= (const fvec< S, N > &v) const
 test for inequality
 
length () const
 length of the vector L2-Norm
 
void sign ()
 componentwise sign values
 
void step (const fvec< T, N > &r)
 componentwise sign values
 
void abs ()
 componentwise absolute values
 
void ceil ()
 ceil componentwise
 
void floor ()
 floor componentwise
 
void round ()
 round componentwise
 
sqr_length () const
 square length of vector
 
normalize ()
 normalize the vector using the L2-Norm and return the length
 
safe_normalize ()
 normalize the vector if length is not zero using the L2-Norm and return the length
 

Static Public Member Functions

static fvec< T, N > zeroh ()
 creates a homogeneous zero-vector (yields same result as calling fvec<T,N-1>(0).lift() but is faster)
 
static fvec< T, N > from_vec (const vec< T > &)
 conversion from vector
 
static cgv::type::uint32_type size ()
 return number of elements
 

Protected Attributes

v [N]
 

Detailed Description

template<typename T, cgv::type::uint32_type N>
class cgv::math::fvec< T, N >

A vector with zero based index.

Definition at line 25 of file fvec.h.

Member Typedef Documentation

◆ const_iterator

template<typename T , cgv::type::uint32_type N>
typedef const T* cgv::math::fvec< T, N >::const_iterator

Definition at line 50 of file fvec.h.

◆ const_pointer

template<typename T , cgv::type::uint32_type N>
typedef const T* cgv::math::fvec< T, N >::const_pointer

Definition at line 46 of file fvec.h.

◆ const_reference

template<typename T , cgv::type::uint32_type N>
typedef const T& cgv::math::fvec< T, N >::const_reference

Definition at line 38 of file fvec.h.

◆ const_reverse_iterator

template<typename T , cgv::type::uint32_type N>
typedef std::reverse_iterator<const_iterator> cgv::math::fvec< T, N >::const_reverse_iterator

Definition at line 54 of file fvec.h.

◆ difference_type

template<typename T , cgv::type::uint32_type N>
typedef std::ptrdiff_t cgv::math::fvec< T, N >::difference_type

Definition at line 42 of file fvec.h.

◆ iterator

template<typename T , cgv::type::uint32_type N>
typedef T* cgv::math::fvec< T, N >::iterator

Definition at line 48 of file fvec.h.

◆ pointer

template<typename T , cgv::type::uint32_type N>
typedef T* cgv::math::fvec< T, N >::pointer

Definition at line 44 of file fvec.h.

◆ reference

template<typename T , cgv::type::uint32_type N>
typedef T& cgv::math::fvec< T, N >::reference

Definition at line 36 of file fvec.h.

◆ reverse_iterator

template<typename T , cgv::type::uint32_type N>
typedef std::reverse_iterator<iterator> cgv::math::fvec< T, N >::reverse_iterator

Definition at line 52 of file fvec.h.

◆ size_type

template<typename T , cgv::type::uint32_type N>
typedef std::size_t cgv::math::fvec< T, N >::size_type

Definition at line 40 of file fvec.h.

◆ value_type

template<typename T , cgv::type::uint32_type N>
typedef T cgv::math::fvec< T, N >::value_type

Definition at line 34 of file fvec.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename T , cgv::type::uint32_type N>
anonymous enum

compile-time constant indicating the dimensionality of the vector

Definition at line 58 of file fvec.h.

Constructor & Destructor Documentation

◆ fvec() [1/12]

template<typename T , cgv::type::uint32_type N>
cgv::math::fvec< T, N >::fvec ( )
inline

creates a vector not initialized

Definition at line 83 of file fvec.h.

◆ fvec() [2/12]

template<typename T , cgv::type::uint32_type N>
cgv::math::fvec< T, N >::fvec ( const T &  a)
inline

creates a vector, where all N components are initialized to the constant value a

Definition at line 85 of file fvec.h.

◆ fvec() [3/12]

template<typename T , cgv::type::uint32_type N>
cgv::math::fvec< T, N >::fvec ( const T &  x,
const T &  y 
)
inline

construct and init first two coordinates to the given values

Definition at line 87 of file fvec.h.

References cgv::math::fvec< T, N >::set(), cgv::math::fvec< T, N >::x(), and cgv::math::fvec< T, N >::y().

◆ fvec() [4/12]

template<typename T , cgv::type::uint32_type N>
cgv::math::fvec< T, N >::fvec ( const T &  x,
const T &  y,
const T &  z 
)
inline

construct and init first three coordinates to the given values

Definition at line 89 of file fvec.h.

References cgv::math::fvec< T, N >::set(), cgv::math::fvec< T, N >::x(), cgv::math::fvec< T, N >::y(), and cgv::math::fvec< T, N >::z().

◆ fvec() [5/12]

template<typename T , cgv::type::uint32_type N>
cgv::math::fvec< T, N >::fvec ( const T &  x,
const T &  y,
const T &  z,
const T &  w 
)
inline

construct and init first four coordinates to the given values

Definition at line 91 of file fvec.h.

References cgv::math::fvec< T, N >::set(), cgv::math::fvec< T, N >::w(), cgv::math::fvec< T, N >::x(), cgv::math::fvec< T, N >::y(), and cgv::math::fvec< T, N >::z().

◆ fvec() [6/12]

template<typename T , cgv::type::uint32_type N>
cgv::math::fvec< T, N >::fvec ( cgv::type::uint32_type  n,
const T *  a 
)
inline

creates a vector from a n-element array a, if n < N remaining N-n elements are set to zero

Definition at line 93 of file fvec.h.

◆ fvec() [7/12]

template<typename T , cgv::type::uint32_type N>
template<typename S >
cgv::math::fvec< T, N >::fvec ( cgv::type::uint32_type  n,
const S *  a 
)
inline

creates a column vector initialized to array of a different type with zeros filled to not copied components

Definition at line 100 of file fvec.h.

◆ fvec() [8/12]

template<typename T , cgv::type::uint32_type N>
cgv::math::fvec< T, N >::fvec ( const fvec< T, N > &  rhs)
inline

copy constructor

Definition at line 106 of file fvec.h.

◆ fvec() [9/12]

template<typename T , cgv::type::uint32_type N>
template<typename S >
cgv::math::fvec< T, N >::fvec ( const fvec< S, N > &  fv)
inline

copies a column vector of a different type

Definition at line 109 of file fvec.h.

◆ fvec() [10/12]

template<typename T , cgv::type::uint32_type N>
template<typename S1 , typename S2 >
cgv::math::fvec< T, N >::fvec ( const fvec< S1, N - 1 > &  fv,
S2  w 
)
inline

construct from vector of one dimension less plus a scalar

Definition at line 112 of file fvec.h.

References cgv::math::fvec< T, N >::w().

◆ fvec() [11/12]

template<typename T , cgv::type::uint32_type N>
template<typename S >
cgv::math::fvec< T, N >::fvec ( const fvec< S, N+1 > &  fv)
inline

construct from vector of one dimension higher by cutting of the highest dimension

Definition at line 115 of file fvec.h.

◆ fvec() [12/12]

template<typename T , cgv::type::uint32_type N>
cgv::math::fvec< T, N >::fvec ( const std::array< T, N > &  arr)
inline

construct from std::array of same size

Definition at line 117 of file fvec.h.

Member Function Documentation

◆ abs()

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::abs ( )
inline

componentwise absolute values

Definition at line 267 of file fvec.h.

◆ assign()

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::assign ( const std::array< T, N > &  arr)
inline

set to the contents of the given std::array with same size

Definition at line 123 of file fvec.h.

◆ begin() [1/2]

template<typename T , cgv::type::uint32_type N>
iterator cgv::math::fvec< T, N >::begin ( )
inline

Definition at line 63 of file fvec.h.

◆ begin() [2/2]

template<typename T , cgv::type::uint32_type N>
const_iterator cgv::math::fvec< T, N >::begin ( ) const
inline

Definition at line 67 of file fvec.h.

◆ ceil()

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::ceil ( )
inline

ceil componentwise

Definition at line 275 of file fvec.h.

References cgv::math::fvec< T, N >::ceil().

Referenced by cgv::math::fvec< T, N >::ceil().

◆ data() [1/2]

◆ data() [2/2]

template<typename T , cgv::type::uint32_type N>
const T * cgv::math::fvec< T, N >::data ( ) const
inline

cast into const array

Definition at line 183 of file fvec.h.

◆ end() [1/2]

template<typename T , cgv::type::uint32_type N>
iterator cgv::math::fvec< T, N >::end ( )
inline

Definition at line 65 of file fvec.h.

◆ end() [2/2]

template<typename T , cgv::type::uint32_type N>
const_iterator cgv::math::fvec< T, N >::end ( ) const
inline

Definition at line 69 of file fvec.h.

◆ fill()

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::fill ( const T &  a)
inline

fill elements of vector with scalar v

Definition at line 131 of file fvec.h.

Referenced by cgv::math::fvec< T, N >::ones(), and cgv::math::fvec< T, N >::zeros().

◆ floor()

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::floor ( )
inline

floor componentwise

Definition at line 281 of file fvec.h.

References cgv::math::fvec< T, N >::floor().

Referenced by cgv::math::fvec< T, N >::floor(), and cgv::math::fvec< T, N >::round().

◆ from_vec()

template<typename T , cgv::type::uint32_type N>
fvec< T, N > cgv::math::fvec< T, N >::from_vec ( const vec< T > &  v)
static

conversion from vector

Definition at line 738 of file fvec.h.

References cgv::math::vec< T >::dim().

◆ length()

◆ lift()

template<typename T , cgv::type::uint32_type N>
fvec< T, N+1 > cgv::math::fvec< T, N >::lift ( ) const
inline

convert to homogeneous version by adding a 1

Definition at line 139 of file fvec.h.

◆ normalize()

◆ ones()

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::ones ( )
inline

fill the vector with ones

Definition at line 137 of file fvec.h.

References cgv::math::fvec< T, N >::fill().

◆ operator!=()

template<typename T , cgv::type::uint32_type N>
template<typename S >
bool cgv::math::fvec< T, N >::operator!= ( const fvec< S, N > &  v) const
inline

test for inequality

Definition at line 239 of file fvec.h.

◆ operator()() [1/2]

template<typename T , cgv::type::uint32_type N>
T & cgv::math::fvec< T, N >::operator() ( const int  i)
inline

access i'th element

Definition at line 171 of file fvec.h.

◆ operator()() [2/2]

template<typename T , cgv::type::uint32_type N>
const T & cgv::math::fvec< T, N >::operator() ( const int  i) const
inline

access i'th element of const vector

Definition at line 173 of file fvec.h.

◆ operator*() [1/2]

template<typename T , cgv::type::uint32_type N>
template<typename S >
fvec< T, N > cgv::math::fvec< T, N >::operator* ( const fvec< S, N > &  v) const
inline

componentwise vector multiplication

Definition at line 220 of file fvec.h.

◆ operator*() [2/2]

template<typename T , cgv::type::uint32_type N>
fvec< T, N > cgv::math::fvec< T, N >::operator* ( const T &  s) const
inline

multiplication with scalar s

Definition at line 227 of file fvec.h.

◆ operator*=() [1/2]

template<typename T , cgv::type::uint32_type N>
template<typename S >
fvec< T, N > & cgv::math::fvec< T, N >::operator*= ( const fvec< S, N > &  _v)
inline

in place componentwise vector multiplication

Definition at line 204 of file fvec.h.

◆ operator*=() [2/2]

template<typename T , cgv::type::uint32_type N>
fvec< T, N > & cgv::math::fvec< T, N >::operator*= ( const T &  s)
inline

in place multiplication with s

Definition at line 193 of file fvec.h.

◆ operator+() [1/2]

template<typename T , cgv::type::uint32_type N>
template<typename S >
fvec< T, N > cgv::math::fvec< T, N >::operator+ ( const fvec< S, N > &  v) const
inline

vector addition

Definition at line 210 of file fvec.h.

◆ operator+() [2/2]

template<typename T , cgv::type::uint32_type N>
fvec< T, N > cgv::math::fvec< T, N >::operator+ ( const T &  s) const
inline

componentwise addition of scalar

Definition at line 212 of file fvec.h.

◆ operator+=() [1/2]

template<typename T , cgv::type::uint32_type N>
template<typename S >
fvec< T, N > & cgv::math::fvec< T, N >::operator+= ( const fvec< S, N > &  _v)
inline

in place vector addition

Definition at line 198 of file fvec.h.

◆ operator+=() [2/2]

template<typename T , cgv::type::uint32_type N>
fvec< T, N > & cgv::math::fvec< T, N >::operator+= ( const T &  s)
inline

in place addition of a scalar s

Definition at line 189 of file fvec.h.

◆ operator-() [1/3]

template<typename T , cgv::type::uint32_type N>
template<typename S >
fvec< T, N > cgv::math::fvec< T, N >::operator- ( const fvec< S, N > &  v) const
inline

vector subtraction

Definition at line 217 of file fvec.h.

◆ operator-() [2/3]

template<typename T , cgv::type::uint32_type N>
fvec< T, N > cgv::math::fvec< T, N >::operator- ( const T &  s) const
inline

componentwise subtraction of scalar

Definition at line 214 of file fvec.h.

◆ operator-() [3/3]

template<typename T , cgv::type::uint32_type N>
fvec< T, N > cgv::math::fvec< T, N >::operator- ( void  ) const
inline

negates the vector

Definition at line 225 of file fvec.h.

◆ operator-=() [1/2]

template<typename T , cgv::type::uint32_type N>
template<typename S >
fvec< T, N > & cgv::math::fvec< T, N >::operator-= ( const fvec< S, N > &  _v)
inline

in place vector subtraction

Definition at line 201 of file fvec.h.

◆ operator-=() [2/2]

template<typename T , cgv::type::uint32_type N>
fvec< T, N > & cgv::math::fvec< T, N >::operator-= ( const T &  s)
inline

in place subtraction by scalar s

Definition at line 191 of file fvec.h.

◆ operator/() [1/2]

template<typename T , cgv::type::uint32_type N>
template<typename S >
fvec< T, N > cgv::math::fvec< T, N >::operator/ ( const fvec< S, N > &  v) const
inline

componentwise vector division

Definition at line 223 of file fvec.h.

◆ operator/() [2/2]

template<typename T , cgv::type::uint32_type N>
fvec< T, N > cgv::math::fvec< T, N >::operator/ ( const T &  s) const
inline

divides vector by scalar s

Definition at line 229 of file fvec.h.

◆ operator/=() [1/2]

template<typename T , cgv::type::uint32_type N>
template<typename S >
fvec< T, N > & cgv::math::fvec< T, N >::operator/= ( const fvec< S, N > &  _v)
inline

in place componentwise vector division

Definition at line 207 of file fvec.h.

◆ operator/=() [2/2]

template<typename T , cgv::type::uint32_type N>
fvec< T, N > & cgv::math::fvec< T, N >::operator/= ( const T &  s)
inline

in place division by scalar s

Definition at line 195 of file fvec.h.

◆ operator=() [1/2]

template<typename T , cgv::type::uint32_type N>
fvec & cgv::math::fvec< T, N >::operator= ( const fvec< T, N > &  rhs)
inline

assign vector rhs, if vector and rhs have different sizes, vector has been resized to match the size of

Definition at line 119 of file fvec.h.

◆ operator=() [2/2]

template<typename T , cgv::type::uint32_type N>
fvec & cgv::math::fvec< T, N >::operator= ( const T &  a)
inline

set all components of vector to constant value a

Definition at line 121 of file fvec.h.

◆ operator==()

template<typename T , cgv::type::uint32_type N>
template<typename S >
bool cgv::math::fvec< T, N >::operator== ( const fvec< S, N > &  v) const
inline

test for equality

Definition at line 232 of file fvec.h.

◆ operator[]() [1/2]

template<typename T , cgv::type::uint32_type N>
T & cgv::math::fvec< T, N >::operator[] ( const int  i)
inline

access i'th element

Definition at line 175 of file fvec.h.

◆ operator[]() [2/2]

template<typename T , cgv::type::uint32_type N>
const T & cgv::math::fvec< T, N >::operator[] ( const int  i) const
inline

access i'th element of const vector

Definition at line 177 of file fvec.h.

◆ rbegin() [1/2]

template<typename T , cgv::type::uint32_type N>
reverse_iterator cgv::math::fvec< T, N >::rbegin ( )
inline

Definition at line 71 of file fvec.h.

◆ rbegin() [2/2]

template<typename T , cgv::type::uint32_type N>
const_reverse_iterator cgv::math::fvec< T, N >::rbegin ( ) const
inline

Definition at line 75 of file fvec.h.

◆ rend() [1/2]

template<typename T , cgv::type::uint32_type N>
reverse_iterator cgv::math::fvec< T, N >::rend ( )
inline

Definition at line 73 of file fvec.h.

◆ rend() [2/2]

template<typename T , cgv::type::uint32_type N>
const_reverse_iterator cgv::math::fvec< T, N >::rend ( ) const
inline

reverse iterator pointing to the end of reverse iteration

Definition at line 77 of file fvec.h.

◆ round()

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::round ( )
inline

round componentwise

Definition at line 287 of file fvec.h.

References cgv::math::fvec< T, N >::floor().

◆ safe_normalize()

template<typename T , cgv::type::uint32_type N>
T cgv::math::fvec< T, N >::safe_normalize ( )
inline

normalize the vector if length is not zero using the L2-Norm and return the length

Definition at line 311 of file fvec.h.

References cgv::math::fvec< T, N >::length().

◆ set() [1/3]

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::set ( const T &  x,
const T &  y 
)
inline

◆ set() [2/3]

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::set ( const T &  x,
const T &  y,
const T &  z 
)
inline

set the first three components

Definition at line 127 of file fvec.h.

References cgv::math::fvec< T, N >::x(), cgv::math::fvec< T, N >::y(), and cgv::math::fvec< T, N >::z().

◆ set() [3/3]

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::set ( const T &  x,
const T &  y,
const T &  z,
const T &  w 
)
inline

set the first four components

Definition at line 129 of file fvec.h.

References cgv::math::fvec< T, N >::w(), cgv::math::fvec< T, N >::x(), cgv::math::fvec< T, N >::y(), and cgv::math::fvec< T, N >::z().

◆ sign()

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::sign ( )
inline

componentwise sign values

Definition at line 255 of file fvec.h.

◆ size()

◆ sqr_length()

template<typename T , cgv::type::uint32_type N>
T cgv::math::fvec< T, N >::sqr_length ( ) const
inline

square length of vector

Definition at line 294 of file fvec.h.

Referenced by cgv::math::distorted_pinhole< T >::invert_distortion_model(), and cgv::math::fvec< T, N >::length().

◆ step()

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::step ( const fvec< T, N > &  r)
inline

componentwise sign values

Definition at line 261 of file fvec.h.

◆ to_vec()

◆ w() [1/2]

◆ w() [2/2]

template<typename T , cgv::type::uint32_type N>
const T & cgv::math::fvec< T, N >::w ( ) const
inline

fourth element of const vector

Definition at line 169 of file fvec.h.

◆ x() [1/2]

◆ x() [2/2]

template<typename T , cgv::type::uint32_type N>
const T & cgv::math::fvec< T, N >::x ( ) const
inline

first element of const vector

Definition at line 157 of file fvec.h.

◆ y() [1/2]

◆ y() [2/2]

template<typename T , cgv::type::uint32_type N>
const T & cgv::math::fvec< T, N >::y ( ) const
inline

second element of const vector

Definition at line 161 of file fvec.h.

◆ z() [1/2]

◆ z() [2/2]

template<typename T , cgv::type::uint32_type N>
const T & cgv::math::fvec< T, N >::z ( ) const
inline

third element of const vector

Definition at line 165 of file fvec.h.

◆ zeroh()

template<typename T , cgv::type::uint32_type N>
static fvec< T, N > cgv::math::fvec< T, N >::zeroh ( )
inlinestatic

creates a homogeneous zero-vector (yields same result as calling fvec<T,N-1>(0).lift() but is faster)

Definition at line 141 of file fvec.h.

◆ zeros()

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::zeros ( )
inline

◆ zerosh()

template<typename T , cgv::type::uint32_type N>
void cgv::math::fvec< T, N >::zerosh ( )
inline

fill the vector with zeros except for the last component, which will be set to one

Definition at line 135 of file fvec.h.

Member Data Documentation

◆ v

template<typename T , cgv::type::uint32_type N>
T cgv::math::fvec< T, N >::v[N]
protected

Definition at line 29 of file fvec.h.


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