library of assembled shared sources

http://lass.cocamware.com

lass::num::Vector< T, S > Class Template Reference

a dynamic sized n-dimensional vector with vector expression templates More...

#include <vector.h>


Data Structures

struct  Rebind

Public Types

typedef Vector< T, S > TSelf
typedef S TStorage
typedef util::CallTraits< T >
::TValue 
TValue
typedef util::CallTraits< T >
::TParam 
TParam
typedef util::CallTraits< T >
::TReference 
TReference
typedef util::CallTraits< T >
::TConstReference 
TConstReference
typedef num::NumTraits< T > TNumTraits
typedef size_t TSize

Public Member Functions

 Vector ()
 Vector (TSize iDimension, TParam iInitialValue=TNumTraits::zero)
 Construct a vector of dimension iDimension.
 Vector (const TStorage &iStorage)
 construct vector from storage type
template<typename VectorType >
 Vector (const VectorType &iVector)
 contruct by any particular type supporting [] and size().
template<typename T2 , typename S2 >
 Vector (const Vector< T2, S2 > &iOther)
 construct storage/expression vector to this (this should be a storage vector).
template<typename T2 , typename S2 >
Vector< T, S > & operator= (const Vector< T2, S2 > &iOther)
 assign storage/expression vector to this (this should be a storage vector).
const TSize size () const
 return dimension of vector.
const TValue operator[] (TSize iIndex) const
 return the iIndex'th component value.
TReference operator[] (TSize iIndex)
 access the iIndex'th component value.
const TValue at (TSize iIndex) const
 return the iIndex'th component value and wrap index if necessary.
TReference at (TSize iIndex)
 access the iIndex'th component value and wrap index if necessary.
const Vector< T, S > & operator+ () const
 A weird way to get back the same object.
const Vector< T, impl::VNeg< T,
S > > 
operator- () const
 return a vector with all components negated (-v)[i] == -(v[i]).
template<typename T2 , typename S2 >
Vector< T, S > & operator+= (const Vector< T2, S2 > &iB)
 add storage/expression vector to this (this should be a storage vector).
template<typename T2 , typename S2 >
Vector< T, S > & operator-= (const Vector< T2, S2 > &iB)
 subtract storage/expression vector from this (this should be a storage vector).
template<typename T2 , typename S2 >
Vector< T, S > & operator*= (const Vector< T2, S2 > &iB)
 multiply storage/expression vector with this (this should be a storage vector).
template<typename T2 , typename S2 >
Vector< T, S > & operator/= (const Vector< T2, S2 > &iB)
 divide this by storage/expression vector (this should be a storage vector).
template<typename T2 >
Vector< T, S > & operator+= (const T2 &iB)
 add iB to all components
template<typename T2 >
Vector< T, S > & operator-= (const T2 &iB)
 subtract iB from all components
template<typename T2 >
Vector< T, S > & operator*= (const T2 &iB)
 multiply all components with iB.
template<typename T2 >
Vector< T, S > & operator/= (const T2 &iB)
 divide all components by iB.
const bool isEmpty () const
 return true if vector contains no dataa at all
const bool isZero () const
 Return true if all the components are (exactly!) zero.
const TValue sum () const
 Return sum of all components of vector.
const TValue min () const
 Return minimum of all components of vector.
const TValue max () const
 Return maximum of all components of vector.
const TValue squaredNorm () const
 Return squared norm of vector.
const TValue norm () const
 Return norm of vector.
const Vector< T, impl::VMul< T,
S, impl::VScalar< T > > > 
normal () const
 return a unit vector with same direction/sense as this vector.
const Vector< T, impl::VRec< T,
S > > 
reciprocal () const
 return a vector with each component being the reciprocal value of this vector.
template<typename S2 >
const Vector< T, impl::VMul< T,
S, impl::VScalar< T > > > 
project (const Vector< T, S2 > &iB) const
 Project vector on this one.
template<typename S2 >
const Vector< T, impl::VSub< T,
S2, impl::VMul< T, S,
impl::VScalar< T > > > > 
reject (const Vector< T, S2 > &iB) const
 Project vector on this one.
const Vector< T, impl::VFun< T,
S > > 
transform (T(*iOperator)(T))
void normalize ()
 Normalize vector.
const TStoragestorage () const
TStoragestorage ()
void swap (Vector< T, S > &iOther)
 swap storage of two vectors

Private Member Functions

template<typename IntegralType >
void init (IntegralType iDimension, meta::Wrap< meta::True >)
template<typename VectorType >
void init (const VectorType &iVector, meta::Wrap< meta::False >)

Private Attributes

TStorage storage_

Friends

class Vector
 constructs an empty vector

Related Functions

(Note that these are not member functions.)

template<typename T , typename S1 , typename S2 >
Vector< T, impl::MVRightProd
< T, S1, S2 > > 
operator* (const Matrix< T, S1 > &iA, const Vector< T, S2 > &iB)
 multiply matrix with column vector
template<typename T , typename S >
Matrix< T, impl::MVDiag< T, S > > diagonal (const Vector< T, S > &iB)
 Create diagonal matrix from vector.
template<typename T , typename S >
bool solve (const Matrix< T, S > &iA, Vector< T > &iB)
 Solves set of equation A * X == B.
template<typename T , typename S1 , typename S2 >
const T dot (const Vector< T, S1 > &iA, const Vector< T, S2 > &iB)
 dot product.
template<typename T , typename S1 , typename S2 >
const Vector< T, impl::VAdd< T,
S1, S2 > > 
operator+ (const Vector< T, S1 > &iA, const Vector< T, S2 > &iB)
 componentwise addition
template<typename T , typename S1 , typename S2 >
const Vector< T, impl::VSub< T,
S1, S2 > > 
operator- (const Vector< T, S1 > &iA, const Vector< T, S2 > &iB)
 componentwise subtraction
template<typename T , typename S1 , typename S2 >
const Vector< T, impl::VMul< T,
S1, S2 > > 
operator* (const Vector< T, S1 > &iA, const Vector< T, S2 > &iB)
 componentwise multiplication
template<typename T , typename S1 , typename S2 >
const Vector< T, impl::VDiv< T,
S1, S2 > > 
operator/ (const Vector< T, S1 > &iA, const Vector< T, S2 > &iB)
 componentwise division
template<typename T , typename S >
const Vector< T, impl::VAdd< T,
impl::VScalar< T >, S > > 
operator+ (const T &iA, const Vector< T, S > &iB)
 add iA to all components of iB
template<typename T , typename S >
const Vector< T, impl::VSub< T,
impl::VScalar< T >, S > > 
operator- (const T &iA, const Vector< T, S > &iB)
 add iA to all negated components of iB
template<typename T , typename S >
const Vector< T, impl::VMul< T,
impl::VScalar< T >, S > > 
operator* (const T &iA, const Vector< T, S > &iB)
 multiply iA with all components of iB
template<typename T , typename S >
const Vector< T, impl::VDiv< T,
impl::VScalar< T >, S > > 
operator/ (const T &iA, const Vector< T, S > &iB)
 multiply iA with all reciprocal components of iB
template<typename T , typename S >
const Vector< T, impl::VAdd< T,
S, impl::VScalar< T > > > 
operator+ (const Vector< T, S > &iA, const T &iB)
 add iB to all components of iA
template<typename T , typename S >
const Vector< T, impl::VSub< T,
S, impl::VScalar< T > > > 
operator- (const Vector< T, S > &iA, const T &iB)
 subtract iB from all components of iA
template<typename T , typename S >
const Vector< T, impl::VMul< T,
S, impl::VScalar< T > > > 
operator* (const Vector< T, S > &iA, const T &iB)
 multiply all components of iA with iB.
template<typename T , typename S >
const Vector< T, impl::VDiv< T,
S, impl::VScalar< T > > > 
operator/ (const Vector< T, S > &iA, const T &iB)
 multiply all components of iA with iB.


Detailed Description

template<typename T, typename S = impl::VStorage<T>>
class lass::num::Vector< T, S >

a dynamic sized n-dimensional vector with vector expression templates

Author:
Bram de Greve [BdG]

Definition at line 70 of file vector.h.


Member Typedef Documentation

template<typename T , typename S = impl::VStorage<T>>
typedef Vector<T, S> lass::num::Vector< T, S >::TSelf

Definition at line 74 of file vector.h.

template<typename T , typename S = impl::VStorage<T>>
typedef S lass::num::Vector< T, S >::TStorage

Definition at line 75 of file vector.h.

template<typename T , typename S = impl::VStorage<T>>
typedef util::CallTraits<T>::TValue lass::num::Vector< T, S >::TValue

Definition at line 77 of file vector.h.

template<typename T , typename S = impl::VStorage<T>>
typedef util::CallTraits<T>::TParam lass::num::Vector< T, S >::TParam

Definition at line 78 of file vector.h.

template<typename T , typename S = impl::VStorage<T>>
typedef util::CallTraits<T>::TReference lass::num::Vector< T, S >::TReference

Definition at line 79 of file vector.h.

template<typename T , typename S = impl::VStorage<T>>
typedef util::CallTraits<T>::TConstReference lass::num::Vector< T, S >::TConstReference

Definition at line 80 of file vector.h.

template<typename T , typename S = impl::VStorage<T>>
typedef num::NumTraits<T> lass::num::Vector< T, S >::TNumTraits

Definition at line 81 of file vector.h.

template<typename T , typename S = impl::VStorage<T>>
typedef size_t lass::num::Vector< T, S >::TSize

Definition at line 82 of file vector.h.


Constructor & Destructor Documentation

template<typename T , typename S = impl::VStorage<T>>
lass::num::Vector< T, S >::Vector (  ) 

template<typename T , typename S >
lass::num::Vector< T, S >::Vector ( TSize  iDimension,
TParam  iInitialValue = TNumTraits::zero 
) [inline, explicit]

Construct a vector of dimension iDimension.

Parameters:
iDimension the dimension of the vector to be created. You can pass zero, but you shouldn't pass negative dimensions though.
iInitialValue the initial value of all vector components, zero by default.
Complexity:
O(iDimension)
Exception safety:
strong guarentee.

Definition at line 93 of file vector.inl.

template<typename T , typename S >
lass::num::Vector< T, S >::Vector ( const TStorage iStorage  )  [inline, explicit]

construct vector from storage type

Complexity:
O(iStorage.size())
Exception safety:
strong guarentee.

Definition at line 109 of file vector.inl.

template<typename T , typename S >
template<typename VectorType >
lass::num::Vector< T, S >::Vector ( const VectorType &  iVector  )  [inline, explicit]

contruct by any particular type supporting [] and size().

Should only be used with writable storage type (like std::vector which is the default).

Complexity:
O(iVector.size())
Exception safety:
strong guarentee.

Definition at line 127 of file vector.inl.

References lass::num::Vector< T, S >::init().

template<typename T , typename S >
template<typename T2 , typename S2 >
lass::num::Vector< T, S >::Vector ( const Vector< T2, S2 > &  iOther  )  [inline]

construct storage/expression vector to this (this should be a storage vector).

Precondition:
this must be an l-value.
Complexity:
O(iOther.size())
Exception safety:
strong guarentee.

Definition at line 146 of file vector.inl.

References lass::num::Vector< T, S >::storage_.


Member Function Documentation

template<typename T , typename S >
template<typename T2 , typename S2 >
Vector< T, S > & lass::num::Vector< T, S >::operator= ( const Vector< T2, S2 > &  iOther  )  [inline]

assign storage/expression vector to this (this should be a storage vector).

Precondition:
this must be an l-value.
Complexity:
O(iOther.size())
Exception safety:
basic guarentee.

Definition at line 170 of file vector.inl.

References lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
const Vector< T, S >::TSize lass::num::Vector< T, S >::size (  )  const [inline]

template<typename T , typename S >
const Vector< T, S >::TValue lass::num::Vector< T, S >::operator[] ( TSize  iIndex  )  const [inline]

return the iIndex'th component value.

Precondition:
iIndex must be in [0, this->size()), unless you're asking for trouble.
Exception safety:
strong guarentee.

Definition at line 207 of file vector.inl.

References LASS_ASSERT, lass::num::Vector< T, S >::size(), and lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
util::CallTraits< T >::TReference lass::num::Vector< T, S >::operator[] ( TSize  iIndex  )  [inline]

access the iIndex'th component value.

Precondition:
  • iIndex must be in [0, this->size()), unless you're asking for trouble.
  • this must be an l-value.
Exception safety:
strong guarentee.

Definition at line 226 of file vector.inl.

References LASS_ASSERT, lass::num::Vector< T, S >::size(), and lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
const Vector< T, S >::TValue lass::num::Vector< T, S >::at ( TSize  iIndex  )  const [inline]

return the iIndex'th component value and wrap index if necessary.

if iIndex is out of the range [0, this->size()), it will be wrapped to map in this range. This is simply a modulus operation: mod(iIndex, this->size()).

Exception safety:
strong guarentee.

Definition at line 242 of file vector.inl.

References lass::num::mod(), and lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
util::CallTraits< T >::TReference lass::num::Vector< T, S >::at ( TSize  iIndex  )  [inline]

access the iIndex'th component value and wrap index if necessary.

if iIndex is out of the range [0, this->size()), it will be wrapped to map in this range. This is simply a modulus operation: mod(iIndex, this->size()).

Precondition:
this must be an l-value.
Exception safety:
strong guarentee.

Definition at line 260 of file vector.inl.

References lass::num::mod(), and lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
const Vector< T, S > & lass::num::Vector< T, S >::operator+ (  )  const [inline]

A weird way to get back the same object.

Complexity:
O(1)
Exception safety:
nofail guarentee.

Definition at line 277 of file vector.inl.

template<typename T , typename S >
const Vector< T, impl::VNeg< T, S > > lass::num::Vector< T, S >::operator- (  )  const [inline]

return a vector with all components negated (-v)[i] == -(v[i]).

Complexity:
O(1)
Exception safety:
nofail.

Definition at line 295 of file vector.inl.

References lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
template<typename T2 , typename S2 >
Vector< T, S > & lass::num::Vector< T, S >::operator+= ( const Vector< T2, S2 > &  iB  )  [inline]

add storage/expression vector to this (this should be a storage vector).

Precondition:
  • this->size() == iB.size()
  • this must be an l-value.
Complexity:
O(this->size())
Exception safety:
basic guarentee.

Definition at line 317 of file vector.inl.

References LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION, and lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
template<typename T2 , typename S2 >
Vector< T, S > & lass::num::Vector< T, S >::operator-= ( const Vector< T2, S2 > &  iB  )  [inline]

subtract storage/expression vector from this (this should be a storage vector).

Precondition:
  • this->size() == iB.size()
  • this must be an l-value.
Complexity:
O(this->size())
Exception safety:
basic guarentee.

Definition at line 344 of file vector.inl.

References LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION, and lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
template<typename T2 , typename S2 >
Vector< T, S > & lass::num::Vector< T, S >::operator*= ( const Vector< T2, S2 > &  iB  )  [inline]

multiply storage/expression vector with this (this should be a storage vector).

Precondition:
  • this->size() == iB.size()
  • this must be an l-value.
Complexity:
O(this->size())
Exception safety:
basic guarentee.

Definition at line 371 of file vector.inl.

References LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION, and lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
template<typename T2 , typename S2 >
Vector< T, S > & lass::num::Vector< T, S >::operator/= ( const Vector< T2, S2 > &  iB  )  [inline]

divide this by storage/expression vector (this should be a storage vector).

Precondition:
  • this->size() == iB.size()
  • this must be an l-value.
Complexity:
O(this->size())
Exception safety:
basic guarentee.

Definition at line 398 of file vector.inl.

References LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION, and lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
template<typename T2 >
Vector< T, S > & lass::num::Vector< T, S >::operator+= ( const T2 &  iB  )  [inline]

add iB to all components

Precondition:
this must be an l-value.
Complexity:
O(this->size())

Definition at line 420 of file vector.inl.

References lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
template<typename T2 >
Vector< T, S > & lass::num::Vector< T, S >::operator-= ( const T2 &  iB  )  [inline]

subtract iB from all components

Precondition:
this must be an l-value.
Complexity:
O(this->size())

Definition at line 441 of file vector.inl.

References lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
template<typename T2 >
Vector< T, S > & lass::num::Vector< T, S >::operator*= ( const T2 &  iB  )  [inline]

multiply all components with iB.

Precondition:
this must be an l-value.
Complexity:
O(this->size())

Definition at line 462 of file vector.inl.

References lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
template<typename T2 >
Vector< T, S > & lass::num::Vector< T, S >::operator/= ( const T2 &  iB  )  [inline]

divide all components by iB.

Precondition:
this must be an l-value.
Complexity:
O(this->size())

Definition at line 483 of file vector.inl.

References lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
const bool lass::num::Vector< T, S >::isEmpty (  )  const [inline]

return true if vector contains no dataa at all

Complexity:
O(1)
Exception safety:
nofail.

Definition at line 503 of file vector.inl.

References lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
const bool lass::num::Vector< T, S >::isZero (  )  const [inline]

Return true if all the components are (exactly!) zero.

Complexity:
O(this->size())

Definition at line 516 of file vector.inl.

References lass::num::Vector< T, S >::storage_, and lass::num::NumTraits< C >::zero.

template<typename T , typename S >
const Vector< T, S >::TValue lass::num::Vector< T, S >::sum (  )  const [inline]

Return sum of all components of vector.

Complexity:
O(this->size())

Definition at line 540 of file vector.inl.

References lass::num::Vector< T, S >::storage_, and lass::num::NumTraits< C >::zero.

template<typename T , typename S >
const Vector< T, S >::TValue lass::num::Vector< T, S >::min (  )  const [inline]

Return minimum of all components of vector.

Complexity:
O(this->size())

Definition at line 560 of file vector.inl.

References lass::num::Vector< T, S >::storage_, and lass::num::NumTraits< C >::zero.

template<typename T , typename S >
const Vector< T, S >::TValue lass::num::Vector< T, S >::max (  )  const [inline]

Return maximum of all components of vector.

Complexity:
O(this->size())

Definition at line 584 of file vector.inl.

References lass::num::Vector< T, S >::storage_, and lass::num::NumTraits< C >::zero.

template<typename T , typename S >
const Vector< T, S >::TValue lass::num::Vector< T, S >::squaredNorm (  )  const [inline]

Return squared norm of vector.

Returns:
dot(*this, *this)
Complexity:
O(this->size())

Definition at line 609 of file vector.inl.

References lass::num::sqr(), lass::num::Vector< T, S >::storage_, and lass::num::NumTraits< C >::zero.

Referenced by lass::num::Vector< T, S >::norm(), and lass::num::Vector< T, S >::project().

template<typename T , typename S >
const Vector< T, S >::TValue lass::num::Vector< T, S >::norm (  )  const [inline]

Return norm of vector.

Returns:
sqrt(this->squaredNorm())
Complexity:
O(this->size())

Definition at line 630 of file vector.inl.

References lass::num::sqrt(), and lass::num::Vector< T, S >::squaredNorm().

Referenced by lass::num::Vector< T, S >::normal(), and lass::num::Vector< T, S >::normalize().

template<typename T , typename S >
const Vector< T, impl::VMul< T, S, impl::VScalar< T > > > lass::num::Vector< T, S >::normal (  )  const [inline]

return a unit vector with same direction/sense as this vector.

The normalized vector of X is a vector in the same direction but with norm (length) 1. It is denoted X^ and given by X^ = X / |X|, http://mathworld.wolfram.com/dimension_ormalizedVector.html.

Returns:
*this / this->norm()
Complexity:
O(this->size())

Definition at line 650 of file vector.inl.

References lass::num::Vector< T, S >::norm(), lass::num::NumTraits< C >::one, and lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
const Vector< T, impl::VRec< T, S > > lass::num::Vector< T, S >::reciprocal (  )  const [inline]

return a vector with each component being the reciprocal value of this vector.

Complexity:
O(1)

Definition at line 666 of file vector.inl.

References lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
template<typename S2 >
const Vector< T, impl::VMul< T, S, impl::VScalar< T > > > lass::num::Vector< T, S >::project ( const Vector< T, S2 > &  iB  )  const [inline]

Project vector on this one.

Precondition:
this->size() == iB.size()
Complexity:
O(this->size())

Definition at line 684 of file vector.inl.

References lass::num::Vector< T, S >::dot(), LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION, lass::num::Vector< T, S >::squaredNorm(), and lass::num::Vector< T, S >::storage_.

Referenced by lass::num::Vector< T, S >::reject().

template<typename T , typename S >
template<typename S2 >
const Vector< T, impl::VSub< T, S2, impl::VMul< T, S, impl::VScalar< T > > > > lass::num::Vector< T, S >::reject ( const Vector< T, S2 > &  iB  )  const [inline]

Project vector on this one.

Precondition:
this->size() == iB.size()
Complexity:
O(this->size())

Definition at line 704 of file vector.inl.

References lass::num::Vector< T, S >::project().

template<typename T , typename S = impl::VStorage<T>>
const Vector<T, impl::VFun<T, S> > lass::num::Vector< T, S >::transform ( T(*)(T)  iOperator  ) 

template<typename T , typename S >
void lass::num::Vector< T, S >::normalize (  )  [inline]

Normalize vector.

Precondition:
this must be an l-value.
Complexity:
O(this->size())

Definition at line 719 of file vector.inl.

References lass::num::Vector< T, S >::norm().

template<typename T , typename S >
const Vector< T, S >::TStorage & lass::num::Vector< T, S >::storage (  )  const [inline]

template<typename T , typename S >
Vector< T, S >::TStorage & lass::num::Vector< T, S >::storage (  )  [inline]

Definition at line 737 of file vector.inl.

References lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
void lass::num::Vector< T, S >::swap ( Vector< T, S > &  iOther  )  [inline]

swap storage of two vectors

Precondition:
this and @ a iOther must be l-values
Complexity:
O(1)
Exception safety:
no-fail

Definition at line 755 of file vector.inl.

References lass::num::Vector< T, S >::storage_.

template<typename T , typename S >
template<typename IntegralType >
void lass::num::Vector< T, S >::init ( IntegralType  iDimension,
meta::Wrap< meta::True  
) [inline, private]

Definition at line 766 of file vector.inl.

References lass::num::Vector< T, S >::storage_, and lass::stde::T.

Referenced by lass::num::Vector< T, S >::Vector().

template<typename T , typename S >
template<typename VectorType >
void lass::num::Vector< T, S >::init ( const VectorType &  iVector,
meta::Wrap< meta::False  
) [inline, private]

Definition at line 776 of file vector.inl.

References lass::num::Vector< T, S >::storage_, and lass::stde::T.


Friends And Related Function Documentation

template<typename T , typename S = impl::VStorage<T>>
lass::num::Vector< T, S >::Vector [friend]

constructs an empty vector

Exception safety:
strong guarentee.

Definition at line 140 of file vector.h.

template<typename T , typename S1 , typename S2 >
Vector< T, impl::MVRightProd< T, S1, S2 > > operator* ( const Matrix< T, S1 > &  iA,
const Vector< T, S2 > &  iB 
) [related]

multiply matrix with column vector

Definition at line 74 of file matrix_vector.inl.

template<typename T , typename S >
Matrix< T, impl::MVDiag< T, S > > diagonal ( const Vector< T, S > &  iB  )  [related]

Create diagonal matrix from vector.

See also:
lass::num::Matrix::isDiagonal

Definition at line 89 of file matrix_vector.inl.

template<typename T , typename S >
bool solve ( const Matrix< T, S > &  iA,
Vector< T > &  iB 
) [related]

Solves set of equation A * X == B.

See also:
lass::num::Matrix::solve

Definition at line 103 of file matrix_vector.inl.

template<typename T , typename S1 , typename S2 >
const T dot ( const Vector< T, S1 > &  iA,
const Vector< T, S2 > &  iB 
) [related]

dot product.

Precondition:
iA.size() == iB.size()
Complexity:
O(iA.size())

Definition at line 842 of file vector.inl.

References LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION, lass::num::Vector< T, S >::size(), and lass::stde::T.

Referenced by lass::num::Vector< T, S >::project().

template<typename T , typename S1 , typename S2 >
const Vector< T, impl::VAdd< T, S1, S2 > > operator+ ( const Vector< T, S1 > &  iA,
const Vector< T, S2 > &  iB 
) [related]

componentwise addition

Precondition:
iA.size() == iB.size()
Complexity:
O(1)

Definition at line 868 of file vector.inl.

References LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION, and lass::num::Vector< T, S >::storage().

template<typename T , typename S1 , typename S2 >
const Vector< T, impl::VSub< T, S1, S2 > > operator- ( const Vector< T, S1 > &  iA,
const Vector< T, S2 > &  iB 
) [related]

componentwise subtraction

Precondition:
iA.size() == iB.size()
Complexity:
O(1)

Definition at line 887 of file vector.inl.

References LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION, and lass::num::Vector< T, S >::storage().

template<typename T , typename S1 , typename S2 >
const Vector< T, impl::VMul< T, S1, S2 > > operator* ( const Vector< T, S1 > &  iA,
const Vector< T, S2 > &  iB 
) [related]

componentwise multiplication

Precondition:
iA.size() == iB.size()
Complexity:
O(1)

Definition at line 906 of file vector.inl.

References LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION, and lass::num::Vector< T, S >::storage().

template<typename T , typename S1 , typename S2 >
const Vector< T, impl::VDiv< T, S1, S2 > > operator/ ( const Vector< T, S1 > &  iA,
const Vector< T, S2 > &  iB 
) [related]

componentwise division

Precondition:
iA.size() == iB.size()
Complexity:
O(1)

Definition at line 925 of file vector.inl.

References LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION, and lass::num::Vector< T, S >::storage().

template<typename T , typename S >
const Vector< T, impl::VAdd< T, impl::VScalar< T >, S > > operator+ ( const T &  iA,
const Vector< T, S > &  iB 
) [related]

add iA to all components of iB

Complexity:
O(1)

Definition at line 942 of file vector.inl.

References lass::num::Vector< T, S >::size(), and lass::num::Vector< T, S >::storage().

template<typename T , typename S >
const Vector< T, impl::VSub< T, impl::VScalar< T >, S > > operator- ( const T &  iA,
const Vector< T, S > &  iB 
) [related]

add iA to all negated components of iB

Complexity:
O(1)

Definition at line 958 of file vector.inl.

References lass::num::Vector< T, S >::size(), and lass::num::Vector< T, S >::storage().

template<typename T , typename S >
const Vector< T, impl::VMul< T, impl::VScalar< T >, S > > operator* ( const T &  iA,
const Vector< T, S > &  iB 
) [related]

multiply iA with all components of iB

Complexity:
O(1)

Definition at line 974 of file vector.inl.

References lass::num::Vector< T, S >::size(), and lass::num::Vector< T, S >::storage().

template<typename T , typename S >
const Vector< T, impl::VDiv< T, impl::VScalar< T >, S > > operator/ ( const T &  iA,
const Vector< T, S > &  iB 
) [related]

multiply iA with all reciprocal components of iB

Complexity:
O(1)

Definition at line 990 of file vector.inl.

References lass::num::Vector< T, S >::size(), and lass::num::Vector< T, S >::storage().

template<typename T , typename S >
const Vector< T, impl::VAdd< T, S, impl::VScalar< T > > > operator+ ( const Vector< T, S > &  iA,
const T &  iB 
) [related]

add iB to all components of iA

Complexity:
O(1)

Definition at line 1006 of file vector.inl.

References lass::num::Vector< T, S >::size(), and lass::num::Vector< T, S >::storage().

template<typename T , typename S >
const Vector< T, impl::VSub< T, S, impl::VScalar< T > > > operator- ( const Vector< T, S > &  iA,
const T &  iB 
) [related]

subtract iB from all components of iA

Complexity:
O(1)

Definition at line 1022 of file vector.inl.

References lass::num::Vector< T, S >::size(), and lass::num::Vector< T, S >::storage().

template<typename T , typename S >
const Vector< T, impl::VMul< T, S, impl::VScalar< T > > > operator* ( const Vector< T, S > &  iA,
const T &  iB 
) [related]

multiply all components of iA with iB.

Complexity:
O(1)

Definition at line 1038 of file vector.inl.

References lass::num::Vector< T, S >::size(), and lass::num::Vector< T, S >::storage().

template<typename T , typename S >
const Vector< T, impl::VDiv< T, S, impl::VScalar< T > > > operator/ ( const Vector< T, S > &  iA,
const T &  iB 
) [related]

multiply all components of iA with iB.

Complexity:
O(1)

Definition at line 1054 of file vector.inl.

References lass::num::Vector< T, S >::size(), and lass::num::Vector< T, S >::storage().


Field Documentation

template<typename T , typename S = impl::VStorage<T>>
TStorage lass::num::Vector< T, S >::storage_ [private]


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

Generated on Mon Nov 10 14:22:10 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo