Module for generic functions on vectors. Generic implementations for vectors are gathered in the namespace array
. These are generic functions, that can be used to build new linear classes. The type R
must provide the following definitions or methods:
More...
|
template<class OS , class R > |
OS & | print (OS &os, const R &v) |
| Output function for general vectors: [v1, v2, ...] . More...
|
|
template<class OS , class R > |
OS & | print (OS &os, const R &v, unsigned sz) |
| Output function for general vectors: [v1, v2, ...] . More...
|
|
template<class IS , class R > |
IS & | read (IS &is, R &V) |
|
template<class V1 , class V2 > |
bool | equal_n (const V1 &v1, const V2 &v2, int n) |
|
template<class V1 , class V2 > |
bool | equal (const V1 &v1, const V2 &v2) |
|
template<class V , class C > |
void | init_n (V &a, const C &v, int n) |
|
template<class V , class C > |
void | set_cst (V &a, const C &v) |
| Set all the entries of a to the values v . More...
|
|
template<class V , class W > |
void | set (V &a, const W &b) |
|
template<class V > |
void | reverse_n (V &v, int a, int n) |
| Reverse the entries of v , from the index a to n-1 . More...
|
|
template<class V > |
void | reverse (V &v, int n) |
|
template<class V , class I > |
void | reverse (V &v, I d) |
| Reverse the entries of v , from the index 0 to d-1 . More...
|
|
template<class V , class W > |
void | neg_range (V &r, const W &w, int a, int b) |
|
template<class V , class W > |
void | neg_range (V &r, int a, int b) |
|
template<class VI > |
void | neg_i (VI a, VI eda) |
|
template<class VI > |
void | neg_i (VI a, VI eda, VI b) |
|
template<class V > |
void | neg (V &v) |
|
template<class V > |
void | neg (V &a, const V &b) |
|
template<class V , class W > |
void | copy_range (V &v, const W &w, int a, int b) |
|
template<class V , class W > |
void | add_n (V &a, const W &b, int n) |
|
template<class VI , class WI > |
void | add_i (VI a, VI ea, WI b) |
|
template<class V , class W > |
void | add (V &a, const W &b) |
| Addition of two vectors. More...
|
|
template<class V , class W , class X > |
void | add_n (V &a, const W &b, const X &c, int n) |
|
template<class V , class W , class X > |
void | add_g (V &r, const W &a, const X &b) |
|
template<class V , class W , class X > |
void | add (V &r, const W &a, const X &b) |
|
template<class V > |
void | add (V &r, const V &a, const V &b) |
|
template<class V , class W > |
void | sub_n (V &a, const W &b, int n) |
|
template<class V , class W > |
void | sub (V &a, const W &b) |
| Substraction of two vectors. More...
|
|
template<class V , class W , class X > |
void | sub_n (V &a, const W &b, const X &c, int n) |
|
template<class V , class W , class X > |
void | sub_g (V &r, const W &a, const X &b) |
|
template<class V , class W , class X > |
void | sub (V &r, const W &a, const X &b) |
|
template<class V > |
void | sub (V &r, const V &a, const V &b) |
|
template<class V , class W > |
void | mul_ext_n (V &a, const W &c, int n) |
|
template<class V , class W , class S > |
void | mul_ext_n (V &a, const W &b, const S &c, int n) |
|
template<class VI , class W > |
void | mul_ext_i (VI bga, VI eda, const W &c) |
|
template<class VI , class VII , class W > |
void | mul_ext_i (VI bga, VI eda, VII bgb, const W &c) |
|
template<class V , class W > |
void | mul_ext (V &a, const V &b, const W &c) |
| Scalar multiplication. More...
|
|
template<class V , class W > |
void | mul_ext (V &a, const W &c) |
|
template<class V , class SC > |
void | div_ext_n (V &a, const SC &sc, int n) |
|
template<class V1 , class V2 , class SC > |
void | div_ext_n (V1 &a, const V2 &b, const SC &sc, int n) |
|
template<class VI , class SC > |
void | div_ext_i (VI bga, VI eda, const SC &sc) |
|
template<class VI , class SC > |
void | div_ext_i (VI a, VI eda, VI b, const SC &sc) |
|
template<class V , class SC > |
void | div_ext (V &a, const V &b, const SC &sc) |
| Scalar division. More...
|
|
template<class V , class W > |
void | div_ext (V &a, const W &c) |
| Scalar division. More...
|
|
template<class V , class W > |
void | div (V &a, const W &c) |
| Inplace scalar division. More...
|
|
template<class R , class S , class C > |
void | apply_mult (R &result, const S &a, const C &m) |
|
template<class C , class R > |
C | norm (const R &v) |
| The $L_{2}$ norm for vectors. More...
|
|
template<class C , class R > |
C | norm (const R &v, int p) |
| Norm $L_{p}$ of a vector. More...
|
|
template<class R , class S > |
R::value_type | innerprod_n (const S &v, const R &w, unsigned n) |
| Innerproduct of two vectors. More...
|
|
template<class R , class S > |
R::value_type | innerprod (const S &v, const R &w) |
|
template<class R > |
R::value_type | max_abs (const R &v) |
|
template<class U , class R > |
void | lcm_denominator (U &r, const R &v) |
|
template<typename V > |
void | reverse (V &v) |
|
template<class Ia , class Ib > |
void | assign_i (Ia a, Ia eda, Ib b) |
|
template<class Ra , class Rb > |
void | assign (Ra &a, const Rb &b) |
|
template<class R , class C > |
void | vaddsc (R &r, const C &x) |
|
Module for generic functions on vectors. Generic implementations for vectors are gathered in the namespace array
. These are generic functions, that can be used to build new linear classes. The type R
must provide the following definitions or methods:
typename index_t;
typename value_type;
typename iterator;
typename const_iterator;
value_type this->operator[](index_t);
iterator begin();
iterator end();
const_iterator begin() const;
const_iterator end() const;