Boost.uBlas 1.49
Linear Algebra in C++: matrices, vectors and numeric algorithms

boost::numeric::ublas::blas_1 Namespace Reference

Functions

template<class V >
type_traits< typename
V::value_type >::real_type 
amax (const V &v)
template<class V >
type_traits< typename
V::value_type >::real_type 
asum (const V &v)
template<class V1 , class T , class V2 >
V1 & axpy (V1 &v1, const T &t, const V2 &v2)
template<class V1 , class V2 >
V1 & copy (V1 &v1, const V2 &v2)
template<class V1 , class V2 >
promote_traits< typename
V1::value_type, typename
V2::value_type >::promote_type 
dot (const V1 &v1, const V2 &v2)
template<class V >
type_traits< typename
V::value_type >::real_type 
nrm2 (const V &v)
template<class T1 , class V1 , class T2 , class V2 >
void rot (const T1 &t1, V1 &v1, const T2 &t2, V2 &v2)
template<class V , class T >
V & scal (V &v, const T &t)
template<class V1 , class V2 >
void swap (V1 &v1, V2 &v2)

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::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)

Definition at line 34 of file blas.hpp.

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)

Definition at line 47 of file blas.hpp.

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)

Definition at line 60 of file blas.hpp.

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)

Definition at line 75 of file blas.hpp.

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)

Definition at line 89 of file blas.hpp.

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
Template Parameters:
V1type of first vector (not needed by default)
V2type of second vector (not needed by default)

Definition at line 103 of file blas.hpp.

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)

Definition at line 118 of file blas.hpp.

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)

Definition at line 135 of file blas.hpp.

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)

Definition at line 158 of file blas.hpp.