Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::numeric::ublas::blas_1 Namespace Reference

Interface and implementation of BLAS level 1 This includes functions which perform vector-vector operations. More...

Functions

template<class V >
type_traits< typename
V::value_type >::real_type 
asum (const V &v)
 1-Norm: $\sum_i |x_i|$ (also called $\mathcal{L}_1$ or Manhattan norm) More...
 
template<class V >
type_traits< typename
V::value_type >::real_type 
nrm2 (const V &v)
 2-Norm: $\sum_i |x_i|^2$ (also called $\mathcal{L}_2$ or Euclidean norm) More...
 
template<class V >
type_traits< typename
V::value_type >::real_type 
amax (const V &v)
 Infinite-norm: $\max_i |x_i|$ (also called $\mathcal{L}_\infty$ norm) More...
 
template<class V1 , class V2 >
promote_traits< typename
V1::value_type, typename
V2::value_type >::promote_type 
dot (const V1 &v1, const V2 &v2)
 Inner product of vectors $v_1$ and $v_2$. More...
 
template<class V1 , class V2 >
V1 & copy (V1 &v1, const V2 &v2)
 Copy vector $v_2$ to $v_1$. More...
 
template<class V1 , class V2 >
void swap (V1 &v1, V2 &v2)
 Swap vectors $v_1$ and $v_2$. More...
 
template<class V , class T >
V & scal (V &v, const T &t)
 scale vector $v$ with scalar $t$ More...
 
template<class V1 , class T , class V2 >
V1 & axpy (V1 &v1, const T &t, const V2 &v2)
 Compute $v_1= v_1 + t.v_2$. More...
 
template<class T1 , class V1 , class T2 , class V2 >
void rot (const T1 &t1, V1 &v1, const T2 &t2, V2 &v2)
 Performs rotation of points in the plane and assign the result to the first vector. More...
 

Detailed Description

Interface and implementation of BLAS level 1 This includes functions which perform vector-vector operations.

More information about BLAS can be found at http://en.wikipedia.org/wiki/BLAS

Function Documentation

template<class V >
type_traits<typename V::value_type>::real_type boost::numeric::ublas::blas_1::amax ( const V &  v)

Infinite-norm: $\max_i |x_i|$ (also called $\mathcal{L}_\infty$ norm)

Parameters
va vector or vector expression
Returns
the Infinite-Norm with type of the vector's type
Template Parameters
Vtype of the vector (not needed by default)

References boost::numeric::ublas::norm_inf().

template<class V >
type_traits<typename V::value_type>::real_type boost::numeric::ublas::blas_1::asum ( const V &  v)

1-Norm: $\sum_i |x_i|$ (also called $\mathcal{L}_1$ or Manhattan norm)

Parameters
va vector or vector expression
Returns
the 1-Norm with type of the vector's type
Template Parameters
Vtype of the vector (not needed by default)

References boost::numeric::ublas::norm_1().

template<class V1 , class T , class V2 >
V1& boost::numeric::ublas::blas_1::axpy ( V1 &  v1,
const T t,
const V2 &  v2 
)

Compute $v_1= v_1 + t.v_2$.

Parameters
v1target and first vector
tthe scalar
v2second vector
Returns
a reference to the first and target vector
Template Parameters
V1type of the first vector (not needed by default)
Ttype of the scalar (not needed by default)
V2type of the second vector (not needed by default)
template<class V1 , class V2 >
V1& boost::numeric::ublas::blas_1::copy ( V1 &  v1,
const V2 &  v2 
)

Copy vector $v_2$ to $v_1$.

Parameters
v1target vector
v2source vector
Returns
a reference to the target vector
Template Parameters
V1type of first vector (not needed by default)
V2type of second vector (not needed by default)
template<class V1 , class V2 >
promote_traits<typename V1::value_type, typename V2::value_type>::promote_type boost::numeric::ublas::blas_1::dot ( const V1 &  v1,
const V2 &  v2 
)

Inner product of vectors $v_1$ and $v_2$.

Parameters
v1first vector of the inner product
v2second vector of the inner product
Returns
the inner product of the type of the most generic type of the 2 vectors
Template Parameters
V1type of first vector (not needed by default)
V2type of second vector (not needed by default)

References boost::numeric::ublas::inner_prod().

Referenced by boost::numeric::ublas::vector_inner_prod< V1, V2, TV >::apply(), boost::numeric::ublas::matrix_vector_prod1< M1, M2, TV >::apply(), boost::numeric::ublas::matrix_vector_prod2< M1, M2, TV >::apply(), and boost::numeric::ublas::matrix_matrix_prod< M1, M2, TV >::apply().

template<class V >
type_traits<typename V::value_type>::real_type boost::numeric::ublas::blas_1::nrm2 ( const V &  v)

2-Norm: $\sum_i |x_i|^2$ (also called $\mathcal{L}_2$ or Euclidean norm)

Parameters
va vector or vector expression
Returns
the 2-Norm with type of the vector's type
Template Parameters
Vtype of the vector (not needed by default)

References boost::numeric::ublas::norm_2().

template<class T1 , class V1 , class T2 , class V2 >
void boost::numeric::ublas::blas_1::rot ( const T1 &  t1,
V1 &  v1,
const T2 &  t2,
V2 &  v2 
)

Performs rotation of points in the plane and assign the result to the first vector.

Each point is defined as a pair v1(i) and v2(i), being respectively the $x$ and $y$ coordinates. The parameters t1 and are respectively the cosine and sine of the angle of the rotation. Results are not returned but directly written into v1.

Parameters
t1cosine of the rotation
v1vector of $x$ values
t2sine of the rotation
v2vector of $y$ values
Template Parameters
T1type of the cosine value (not needed by default)
V1type of the $x$ vector (not needed by default)
T2type of the sine value (not needed by default)
V2type of the $y$ vector (not needed by default)
template<class V , class T >
V& boost::numeric::ublas::blas_1::scal ( V &  v,
const T t 
)

scale vector $v$ with scalar $t$

Parameters
vvector to be scaled
tthe scalar
Returns
t*v
Template Parameters
Vtype of the vector (not needed by default)
Ttype of the scalar (not needed by default)

References boost::flyweights::t.

template<class V1 , class V2 >
void boost::numeric::ublas::blas_1::swap ( V1 &  v1,
V2 &  v2 
)

Swap vectors $v_1$ and $v_2$.

Parameters
v1first vector
v2second vector
\tparam V1 type of first vector (not needed by default)
Template Parameters
V2type of second vector (not needed by default)