Documentation


vector
[Linear algebra]


Detailed Description

operations involving a single vector: assignment, norm, mutliplication with a scalar, etc.


Functions

template<class Cont, class Value> void animal::v_assign (Cont &v, const Value &a)
 Assign a value to all the entries $ \forall i \;\; v[i] = a $.

template<class Cont, class Value> void animal::v_addall (Cont &v, const Value &a)
 Add a value to all the entries $ \forall i \;\; v[i] = a $.

template<class Cont, class Real> void animal::v_teq (Cont &v, const Real &a)
 $\forall i \;\; v[i] = *a $

template<class Cont> value_type< Cont >::type animal::v_norm (const Cont &v)
 norm 2 of vector $ \sqrt{ \sum_i v[i]^2 } $ Euclidian norm

template<class Cont> void animal::v_normalize (Cont &v)
 normalize the vector: $ v *= 1/\|v\| $

template<class Cont> container_traits< Cont
>::value_type 
animal::v_norm1 (const Cont &v)
 norm 1 of vector $ \sum_i |v[i]| $ Sum of all absolute values of the entries

template<class Cont> container_traits< Cont
>::value_type 
animal::v_normInf (const Cont &v)
 infinite norm of vector $ \max_i |v[i]| $ The maximum absolute value among all the entries

template<class Cont> container_traits< Cont
>::value_type 
animal::v_sum (const Cont &v)
 sum of vector elements $ \sum_i v[i] $

template<class Cont> container_traits< Cont
>::value_type 
animal::v_sqsum (const Cont &v)
 the sum of the squares of the vector entries $ \sum_i v[i]^2 $

template<class Cont> container_traits< Cont
>::value_type 
animal::v_mean (const Cont &v)
 the mean of vector entries $ \sum_i v[i] / size(v)$

template<class Cont> container_traits< Cont
>::value_type 
animal::v_variance (const Cont &v)
 variance of vector elements $ \sum_i (v[i]-\bar{v})^2 / size(v) $


Function Documentation

template<class Cont, class Value>
void v_addall Cont &  v,
const Value &  a
[inline]
 

Add a value to all the entries $ \forall i \;\; v[i] = a $.

Parameters:
v the vector
a the value to add to all the entries of the vector

Definition at line 71 of file linear.h.

References animal::begin(), and animal::end().

Referenced by animal::SimpleSolver< t_Positions, t_Vector, t_InvMasses, t_Real >::applyGravity(), and animal::PhysicalSolver< t_Positions, t_Vector, t_InvMasses, t_Real >::applyGravity().

template<class Cont, class Value>
void v_assign Cont &  v,
const Value &  a
[inline]
 

Assign a value to all the entries $ \forall i \;\; v[i] = a $.

Parameters:
v the vector
a the value to copy to all the entries of the vector
Examples:
linear_test.cpp, and matrix_test.cpp.

Definition at line 59 of file linear.h.

References animal::begin(), and animal::end().

Referenced by animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >::compute_implicit_euler_step(), animal::SimpleSolver< t_Positions, t_Vector, t_InvMasses, t_Real >::computeForces(), animal::PhysicalSolver< t_Positions, t_Vector, t_InvMasses, t_Real >::computeForces(), animal::OdeImplicitSolver< t_Positions, t_Vector, t_Real >::implicit_euler(), animal::m_eq_luinv(), and animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::v_eq_h_dfdx_x().

template<class Cont>
container_traits<Cont>::value_type v_mean const Cont &  v  )  [inline]
 

the mean of vector entries $ \sum_i v[i] / size(v)$

Parameters:
v the vector
Examples:
linear_test.cpp.

Definition at line 173 of file linear.h.

References animal::size(), and animal::v_sum().

Referenced by animal::v_variance().

template<class Cont>
value_type<Cont>::type v_norm const Cont &  v  )  [inline]
 

norm 2 of vector $ \sqrt{ \sum_i v[i]^2 } $ Euclidian norm

Parameters:
v the vector

Definition at line 96 of file linear.h.

References animal::v_dot().

Referenced by animal::MassSpringSolver< t_Positions, t_Vector, t_InvMasses, t_VecReal, t_VecIndex >::computeDistanceAndDirection(), animal::MassSpringSolver< X3DTK::MFVec3f, X3DTK::MFVec3f, X3DTK::MFFloat, X3DTK::MFFloat, X3DTK::MFInt32 >::create_rest_lengths(), animal::MassSpringEngine< Inv_Masses, Velocities, SpringStiffness, IndexedSprings, Points, Real >::draw(), animal::findClosestPointToLine(), animal::MassSpringEngine< Inv_Masses, Velocities, SpringStiffness, IndexedSprings, Points, Real >::reset(), and animal::v_normalize().

template<class Cont>
container_traits<Cont>::value_type v_norm1 const Cont &  v  )  [inline]
 

norm 1 of vector $ \sum_i |v[i]| $ Sum of all absolute values of the entries

Parameters:
v the vector

Definition at line 116 of file linear.h.

References animal::begin(), and animal::end().

template<class Cont>
void v_normalize Cont &  v  )  [inline]
 

normalize the vector: $ v *= 1/\|v\| $

Parameters:
v the vector

Definition at line 106 of file linear.h.

References animal::v_norm(), and animal::v_teq().

Referenced by animal::Quaternion_Traits< RealT >::normalize().

template<class Cont>
container_traits<Cont>::value_type v_normInf const Cont &  v  )  [inline]
 

infinite norm of vector $ \max_i |v[i]| $ The maximum absolute value among all the entries

Parameters:
v the vector

Definition at line 130 of file linear.h.

References animal::begin(), and animal::end().

template<class Cont>
container_traits<Cont>::value_type v_sqsum const Cont &  v  )  [inline]
 

the sum of the squares of the vector entries $ \sum_i v[i]^2 $

Parameters:
v the vector
Examples:
linear_test.cpp.

Definition at line 159 of file linear.h.

References animal::begin(), and animal::end().

template<class Cont>
container_traits<Cont>::value_type v_sum const Cont &  v  )  [inline]
 

sum of vector elements $ \sum_i v[i] $

Parameters:
v the vector
Examples:
linear_test.cpp.

Definition at line 145 of file linear.h.

References animal::begin(), and animal::end().

Referenced by animal::v_mean().

template<class Cont, class Real>
void v_teq Cont &  v,
const Real &  a
[inline]
 

$\forall i \;\; v[i] = *a $

Parameters:
v the vector
a the value to multiply all the entries
Examples:
linear_test.cpp, matrix_test.cpp, and odeSolver_test.cpp.

Definition at line 83 of file linear.h.

References animal::begin(), and animal::end().

template<class Cont>
container_traits<Cont>::value_type v_variance const Cont &  v  )  [inline]
 

variance of vector elements $ \sum_i (v[i]-\bar{v})^2 / size(v) $

Parameters:
v the vector
Examples:
linear_test.cpp.

Definition at line 182 of file linear.h.

References animal::begin(), animal::end(), animal::size(), and animal::v_mean().


Generated on Thu Dec 23 13:52:29 2004 by doxygen 1.3.6