Generic implementations for vectors are gathered in the namespace {VECTOR}. These are generic functions, that can be used to build new linear classes. The type {R} must provide the following definitions or methods: {SIGNATURE} typename index_t; typename value_type; typename iterator; typename const_iterator;
index_t this->size(); value_type this->operator[](index_t);
iterator begin(); iterator end(); const_iterator begin() const; const_iterator end() const; {SIGNATURE}
Functions | |
template<class OS, class R> | |
OS & | print (OS &os, const R &v) |
Output function for general vectors: [v1, v2, ...] . | |
template<class OS, class R> | |
OS & | print (OS &os, const R &v, unsigned sz) |
Output function for general vectors: [v1, v2, ...] . | |
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 | init (V &a, const C &v) |
Set all the entries of a to the values v . | |
template<class V> | |
void | reverse_n (V &v, int a, int n) |
Reverse the entries of v , from the index a to n-1 . | |
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 . | |
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. | |
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. | |
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. | |
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. | |
template<class V, class W> | |
void | div_ext (V &a, const W &c) |
Scalar division. | |
template<class V, class W> | |
void | div (V &a, const W &c) |
Inplace scalar division. | |
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. | |
template<class C, class R> | |
C | norm (const R &v, int p) |
Norm $L_{p}$ of a vector. | |
template<class R, class S> | |
R::value_type | innerprod_n (const S &v, const R &w, unsigned n) |
Innerproduct of two vectors. | |
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 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) |
void VECTOR::add | ( | V & | r, | |
const V & | a, | |||
const V & | b | |||
) |
void VECTOR::add | ( | V & | r, | |
const W & | a, | |||
const X & | b | |||
) |
void VECTOR::add | ( | V & | a, | |
const W & | b | |||
) |
void VECTOR::add_g | ( | V & | r, | |
const W & | a, | |||
const X & | b | |||
) |
Addition of two vectors. r
should be allocated to the correct size and with 0 entries.
Definition at line 171 of file VECTOR.m.
References add_n(), and copy_range().
Referenced by add().
void VECTOR::div | ( | V & | a, | |
const W & | c | |||
) |
void VECTOR::div_ext | ( | V & | a, | |
const W & | c | |||
) |
void VECTOR::div_ext | ( | V & | a, | |
const V & | b, | |||
const SC & | sc | |||
) |
Scalar division.
Definition at line 309 of file VECTOR.m.
References div_ext_i().
Referenced by div(), div(), and quotient::ModUPol< C, R >::mul().
void VECTOR::init | ( | V & | a, | |
const C & | v | |||
) |
Set all the entries of a
to the values v
.
Definition at line 102 of file VECTOR.m.
References init_n().
Referenced by projection::eval_to_double(), quotient::ModUPol< C, R >::horner_to_monomial(), quotient::ModUPol< C, R >::monomial_to_horner(), UPOLDAR::mul(), UPOLDAR::mul_index(), UPOLDAR::set_monomial(), quotient::ModUPol< C, R >::square(), and UPolDse< C, R >::UPolDse().
R::value_type VECTOR::innerprod_n | ( | const S & | v, | |
const R & | w, | |||
unsigned | n | |||
) |
void VECTOR::mul_ext | ( | V & | a, | |
const V & | b, | |||
const W & | c | |||
) |
Scalar multiplication.
Definition at line 284 of file VECTOR.m.
References mul_ext_i().
Referenced by mul().
C VECTOR::norm | ( | const R & | v, | |
int | p | |||
) |
C VECTOR::norm | ( | const R & | v | ) |
OS& VECTOR::print | ( | OS & | os, | |
const R & | v, | |||
unsigned | sz | |||
) |
OS& VECTOR::print | ( | OS & | os, | |
const R & | v | |||
) |
Output function for general vectors: [v1, v2, ...]
.
Definition at line 43 of file VECTOR.m.
Referenced by bezier::sbd2d< X, C, USLV >::connect_xy(), and operator<<().
IS& VECTOR::read | ( | IS & | is, | |
R & | V | |||
) |
void VECTOR::reverse | ( | V & | v, | |
I | d | |||
) |
void VECTOR::reverse_n | ( | V & | v, | |
int | a, | |||
int | n | |||
) |
void VECTOR::sub | ( | V & | r, | |
const V & | a, | |||
const V & | b | |||
) |
void VECTOR::sub | ( | V & | r, | |
const W & | a, | |||
const X & | b | |||
) |
void VECTOR::sub | ( | V & | a, | |
const W & | b | |||
) |