GetFEM++  5.3
gmm_blas.h File Reference

Basic linear algebra functions. More...

#include "gmm_scaled.h"
#include "gmm_transposed.h"
#include "gmm_conjugated.h"

Go to the source code of this file.

Functions

template<typename L >
void gmm::clear (L &l)
 clear (fill with zeros) a vector or matrix. More...
 
template<typename L >
size_type gmm::nnz (const L &l)
 count the number of non-zero entries of a vector or matrix. More...
 
template<typename L >
void gmm::fill (L &l, typename gmm::linalg_traits< L >::value_type x)
 */ More...
 
template<typename L >
void gmm::fill_random (L &l)
 fill a vector or matrix with random value (uniform [-1,1]). More...
 
template<typename L >
void gmm::fill_random (L &l, double cfill)
 */ More...
 
template<typename V >
void gmm::resize (V &v, size_type n)
 */ More...
 
template<typename M >
void gmm::resize (M &v, size_type m, size_type n)
 */ More...
 
template<typename M >
void gmm::reshape (M &v, size_type m, size_type n)
 */ More...
 
template<typename V1 , typename V2 >
strongest_value_type< V1, V2 >::value_type gmm::vect_sp (const V1 &v1, const V2 &v2)
 */ More...
 
template<typename MATSP , typename V1 , typename V2 >
strongest_value_type3< V1, V2, MATSP >::value_type gmm::vect_sp (const MATSP &ps, const V1 &v1, const V2 &v2)
 scalar product between two vectors, using a matrix. More...
 
template<typename V1 , typename V2 >
strongest_value_type< V1, V2 >::value_type gmm::vect_hp (const V1 &v1, const V2 &v2)
 */ More...
 
template<typename MATSP , typename V1 , typename V2 >
strongest_value_type3< V1, V2, MATSP >::value_type gmm::vect_hp (const MATSP &ps, const V1 &v1, const V2 &v2)
 Hermitian product with a matrix. More...
 
template<typename M >
linalg_traits< M >::value_type gmm::mat_trace (const M &m)
 Trace of a matrix.
 
template<typename V >
number_traits< typename linalg_traits< V >::value_type >::magnitude_type gmm::vect_norm2_sqr (const V &v)
 squared Euclidean norm of a vector. More...
 
template<typename V >
number_traits< typename linalg_traits< V >::value_type >::magnitude_type gmm::vect_norm2 (const V &v)
 Euclidean norm of a vector. More...
 
template<typename V1 , typename V2 >
number_traits< typename linalg_traits< V1 >::value_type >::magnitude_type gmm::vect_dist2_sqr (const V1 &v1, const V2 &v2)
 squared Euclidean distance between two vectors
 
template<typename V1 , typename V2 >
number_traits< typename linalg_traits< V1 >::value_type >::magnitude_type gmm::vect_dist2 (const V1 &v1, const V2 &v2)
 Euclidean distance between two vectors.
 
template<typename M >
number_traits< typename linalg_traits< M >::value_type >::magnitude_type gmm::mat_euclidean_norm_sqr (const M &m)
 */ More...
 
template<typename M >
number_traits< typename linalg_traits< M >::value_type >::magnitude_type gmm::mat_euclidean_norm (const M &m)
 Euclidean norm of a matrix. More...
 
template<typename V >
number_traits< typename linalg_traits< V >::value_type >::magnitude_type gmm::vect_norm1 (const V &v)
 1-norm of a vector
 
template<typename V1 , typename V2 >
number_traits< typename linalg_traits< V1 >::value_type >::magnitude_type gmm::vect_dist1 (const V1 &v1, const V2 &v2)
 1-distance between two vectors
 
template<typename V >
number_traits< typename linalg_traits< V >::value_type >::magnitude_type gmm::vect_norminf (const V &v)
 Infinity norm of a vector. More...
 
template<typename V1 , typename V2 >
number_traits< typename linalg_traits< V1 >::value_type >::magnitude_type gmm::vect_distinf (const V1 &v1, const V2 &v2)
 Infinity distance between two vectors.
 
template<typename M >
number_traits< typename linalg_traits< M >::value_type >::magnitude_type gmm::mat_norm1 (const M &m)
 */ More...
 
template<typename M >
number_traits< typename linalg_traits< M >::value_type >::magnitude_type gmm::mat_norminf (const M &m)
 */ More...
 
template<typename M >
number_traits< typename linalg_traits< M >::value_type >::magnitude_type gmm::mat_maxnorm (const M &m)
 */ More...
 
template<typename L >
void gmm::clean (L &l, double threshold)
 Clean a vector or matrix (replace near-zero entries with zeroes). More...
 
template<typename L1 , typename L2 >
void gmm::copy (const L1 &l1, L2 &l2)
 */ More...
 
template<typename L1 , typename L2 >
void gmm::add (const L1 &l1, L2 &l2)
 */ More...
 
template<typename L1 , typename L2 , typename L3 >
void gmm::add (const L1 &l1, const L2 &l2, L3 &l3)
 */ More...
 
template<typename L1 , typename L2 , typename L3 >
void gmm::mult (const L1 &l1, const L2 &l2, L3 &l3)
 */ More...
 
template<typename L1 , typename L2 , typename L3 >
void gmm::mult_add (const L1 &l1, const L2 &l2, L3 &l3)
 */ More...
 
template<typename MAT >
bool gmm::is_symmetric (const MAT &A, magnitude_of_linalg(MAT) tol=magnitude_of_linalg(MAT)(-1))
 */ More...
 
template<typename MAT >
bool gmm::is_hermitian (const MAT &A, magnitude_of_linalg(MAT) tol=magnitude_of_linalg(MAT)(-1))
 */ More...
 

Detailed Description

Basic linear algebra functions.

Author
Yves Renard Yves..nosp@m.Rena.nosp@m.rd@in.nosp@m.sa-l.nosp@m.yon.f.nosp@m.r
Date
October 13, 2002.

Definition in file gmm_blas.h.

Function Documentation

template<typename L >
void gmm::clear ( L &  l)
inline

clear (fill with zeros) a vector or matrix.

Definition at line 59 of file gmm_blas.h.

template<typename L >
size_type gmm::nnz ( const L &  l)
inline

count the number of non-zero entries of a vector or matrix.

Definition at line 68 of file gmm_blas.h.

template<typename L >
void gmm::fill ( L &  l,
typename gmm::linalg_traits< L >::value_type  x 
)
inline

*/

fill a vector or matrix with x.

Definition at line 103 of file gmm_blas.h.

template<typename L >
void gmm::fill_random ( L &  l)
inline

fill a vector or matrix with random value (uniform [-1,1]).

Definition at line 129 of file gmm_blas.h.

template<typename L >
void gmm::fill_random ( L &  l,
double  cfill 
)
inline

*/

fill a vector or matrix with random value.

Parameters
la vector or matrix.
cfillprobability of a non-zero value.

Definition at line 154 of file gmm_blas.h.

template<typename V >
void gmm::resize ( V &  v,
size_type  n 
)
inline

*/

resize a vector.

Definition at line 209 of file gmm_blas.h.

template<typename M >
void gmm::resize ( M &  v,
size_type  m,
size_type  n 
)
inline

*/

resize a matrix

Definition at line 231 of file gmm_blas.h.

template<typename M >
void gmm::reshape ( M &  v,
size_type  m,
size_type  n 
)
inline

*/

reshape a matrix

Definition at line 250 of file gmm_blas.h.

template<typename V1 , typename V2 >
strongest_value_type<V1,V2>::value_type gmm::vect_sp ( const V1 &  v1,
const V2 &  v2 
)
inline

*/

scalar product between two vectors

Definition at line 263 of file gmm_blas.h.

template<typename MATSP , typename V1 , typename V2 >
strongest_value_type3<V1,V2,MATSP>::value_type gmm::vect_sp ( const MATSP &  ps,
const V1 &  v1,
const V2 &  v2 
)
inline

scalar product between two vectors, using a matrix.

Parameters
psthe matrix of the scalar product.
v1the first vector
v2the second vector

Definition at line 278 of file gmm_blas.h.

template<typename V1 , typename V2 >
strongest_value_type<V1,V2>::value_type gmm::vect_hp ( const V1 &  v1,
const V2 &  v2 
)
inline

*/

Hermitian product.

Definition at line 511 of file gmm_blas.h.

template<typename MATSP , typename V1 , typename V2 >
strongest_value_type3<V1,V2,MATSP>::value_type gmm::vect_hp ( const MATSP &  ps,
const V1 &  v1,
const V2 &  v2 
)
inline

Hermitian product with a matrix.

Definition at line 517 of file gmm_blas.h.

template<typename V >
number_traits<typename linalg_traits<V>::value_type>::magnitude_type gmm::vect_norm2_sqr ( const V &  v)

squared Euclidean norm of a vector.

Definition at line 544 of file gmm_blas.h.

template<typename V >
number_traits<typename linalg_traits<V>::value_type>::magnitude_type gmm::vect_norm2 ( const V &  v)
inline

Euclidean norm of a vector.

Definition at line 557 of file gmm_blas.h.

template<typename M >
number_traits<typename linalg_traits<M>::value_type>::magnitude_type gmm::mat_euclidean_norm_sqr ( const M &  m)
inline

*/

squared Euclidean norm of a matrix.

Definition at line 626 of file gmm_blas.h.

template<typename M >
number_traits<typename linalg_traits<M>::value_type>::magnitude_type gmm::mat_euclidean_norm ( const M &  m)
inline

Euclidean norm of a matrix.

Definition at line 636 of file gmm_blas.h.

template<typename V >
number_traits<typename linalg_traits<V>::value_type>::magnitude_type gmm::vect_norminf ( const V &  v)

Infinity norm of a vector.

Definition at line 693 of file gmm_blas.h.

template<typename M >
number_traits<typename linalg_traits<M>::value_type>::magnitude_type gmm::mat_norm1 ( const M &  m)

*/

1-norm of a matrix

Definition at line 782 of file gmm_blas.h.

template<typename M >
number_traits<typename linalg_traits<M>::value_type>::magnitude_type gmm::mat_norminf ( const M &  m)

*/

infinity-norm of a matrix.

Definition at line 836 of file gmm_blas.h.

template<typename M >
number_traits<typename linalg_traits<M>::value_type>::magnitude_type gmm::mat_maxnorm ( const M &  m)

*/

max-norm of a matrix.

Definition at line 870 of file gmm_blas.h.

template<typename L >
void gmm::clean ( L &  l,
double  threshold 
)
inline

Clean a vector or matrix (replace near-zero entries with zeroes).

template<typename L1 , typename L2 >
void gmm::copy ( const L1 &  l1,
L2 &  l2 
)
inline

*/

Copy vectors or matrices.

Parameters
l1source vector or matrix.
l2destination.

Definition at line 977 of file gmm_blas.h.

template<typename L1 , typename L2 >
void gmm::add ( const L1 &  l1,
L2 &  l2 
)
inline

*/

Add two vectors or matrices

Parameters
l1
l2contains on output, l2+l1.

Definition at line 1268 of file gmm_blas.h.

template<typename L1 , typename L2 , typename L3 >
void gmm::add ( const L1 &  l1,
const L2 &  l2,
L3 &  l3 
)
inline

*/

Addition of two vectors/matrices

Parameters
l1
l2
l3contains l1+l2 on output

Definition at line 1425 of file gmm_blas.h.

template<typename L1 , typename L2 , typename L3 >
void gmm::mult ( const L1 &  l1,
const L2 &  l2,
L3 &  l3 
)
inline

*/

matrix-vector or matrix-matrix product.

Parameters
l1a matrix.
l2a vector or matrix.
l3the product l1*l2.

Definition at line 1652 of file gmm_blas.h.

template<typename L1 , typename L2 , typename L3 >
void gmm::mult_add ( const L1 &  l1,
const L2 &  l2,
L3 &  l3 
)
inline

*/

Multiply-accumulate. l3 += l1*l2;

Definition at line 1779 of file gmm_blas.h.

template<typename MAT >
bool gmm::is_symmetric ( const MAT &  A,
magnitude_of_linalg(MAT)  tol = magnitude_of_linalg(MAT)(-1) 
)
inline

*/

test if A is symmetric.

Parameters
Aa matrix.
tola threshold.

Definition at line 2166 of file gmm_blas.h.

template<typename MAT >
bool gmm::is_hermitian ( const MAT &  A,
magnitude_of_linalg(MAT)  tol = magnitude_of_linalg(MAT)(-1) 
)
inline

*/

test if A is Hermitian.

Parameters
Aa matrix.
tola threshold.

Definition at line 2227 of file gmm_blas.h.