Imagine++
|
Vector of variable size. More...
#include "Imagine/LinAlg.h"
Public Types | |
typedef Base::const_iterator | const_iterator |
Const iterator type. | |
typedef Base::iterator | iterator |
Iterator type. | |
Public Types inherited from Imagine::Array< T > | |
typedef const T * | const_iterator |
Const iterator type. | |
typedef T * | iterator |
Iterator type. | |
Public Member Functions | |
Vector () | |
Empty constructor. More... | |
Vector (size_t n) | |
Constructor (known size). More... | |
Vector (const Base &v) | |
Copy constructor. More... | |
Vector (T *ptr, size_t n, bool handleDelete=false) | |
Constructor (pre-allocated). More... | |
~Vector () | |
Destructor. More... | |
Vector | clone () const |
Cloning. More... | |
Vector & | fill (T x) |
Filling. More... | |
Vector | getSubVect (size_t offset, size_t size) const |
Sub vector. More... | |
Vector | getSubVectRef (size_t offset, size_t size) |
Sub vector by reference. More... | |
Vector & | normalize () |
Euclidean in-place normalization. More... | |
Vector | operator* (T x) const |
Scalar multiplication. More... | |
T | operator* (const Vector &v) const |
Scalar product. More... | |
Vector & | operator*= (T x) |
Scalar in place multiplication. More... | |
Vector | operator+ (const Vector &v) const |
Addition. More... | |
Vector | operator+ (T x) const |
Scalar Addition. More... | |
Vector & | operator+= (const Vector &v) |
In place Addition. More... | |
Vector & | operator+= (T x) |
Scalar in place Addition. More... | |
Vector | operator- (const Vector &v) const |
Substraction. More... | |
Vector | operator- (T x) const |
Scalar Substraction. More... | |
Vector | operator- () const |
Opposite. More... | |
Vector & | operator-= (const Vector &v) |
In place Substraction. More... | |
Vector & | operator-= (T x) |
Scalar in place substractrion. More... | |
Vector | operator/ (T x) const |
Scalar division. More... | |
Vector & | operator/= (T x) |
Scalar in place division. More... | |
Vector & | operator= (const Vector &v) |
Assignment. More... | |
Public Member Functions inherited from Imagine::Array< T > | |
Array () | |
Empty constructor. More... | |
Array (size_t size) | |
Constructor (known size). More... | |
Array (T *ptr, size_t size, bool handleDelete=false) | |
Constructor (pre-allocated). More... | |
Array (const Array &A) | |
Copy constructor. More... | |
template<typename T2 > | |
Array (const Array< T2 > &A) | |
Constructor (different type). More... | |
Array (const std::list< T > &L) | |
Constructor (from list). More... | |
virtual | ~Array () |
Destructor. More... | |
iterator | begin () |
Begin iterator. More... | |
const_iterator | begin () const |
Begin const iterator. More... | |
Array | clone () const |
Cloning. More... | |
T * | data () |
Data pointer (read/write). More... | |
const T * | data () const |
Data pointer (read). More... | |
bool | empty () const |
Is empty. More... | |
iterator | end () |
End iterator. More... | |
const_iterator | end () const |
End const iterator. More... | |
Array & | fill (const T &x) |
Filling. More... | |
Array | getSubArray (size_t offset, size_t size) const |
Sub array. More... | |
bool | operator!= (const Array &A) const |
Inequality test. More... | |
Array & | operator= (const Array &A) |
Assignment. More... | |
template<typename T2 > | |
Array & | operator= (const Array< T2 > &A) |
Assignment (different type). More... | |
bool | operator== (const Array &A) const |
Equality test. More... | |
const T & | operator[] (size_t i) const |
Read access. More... | |
T & | operator[] (size_t i) |
Write access. More... | |
void | setSize (size_t size) |
Change size. More... | |
size_t | size () const |
Size. More... | |
Static Public Member Functions | |
static Vector | Zero (size_t n) |
Zero vector. More... | |
Friends | |
Vector | convolution (const Vector &K, const Vector &v) |
Convolution. More... | |
T | correlation (const Vector &V1, const Vector &V2) |
Correlation. More... | |
double | dist (const Vector &V1, const Vector &V2) |
Distance. More... | |
T | maxNorm (const Vector &v) |
Maximum norm. More... | |
T | mean (const Vector &v) |
Mean of values. More... | |
T | norm (const Vector &v) |
Euclidean norm. More... | |
T | norm2 (const Vector &v) |
Squared Euclidean norm. More... | |
Vector | normalized (const Vector &v) |
Euclidean normalization. More... | |
T | normalizedCorrelation (const Vector &V1, const Vector &V2) |
Normalized Correlation. More... | |
Vector | operator* (T x, const Vector &v) |
Scalar multiplication. More... | |
Vector | operator+ (T x, const Vector &v) |
Scalar addition. More... | |
Vector | operator- (T x, const Vector &v) |
Scalar substraction. More... | |
T | sum (const Vector &v) |
Sum of values. More... | |
Vector | truncConvolution (const Vector &K, const Vector &v, size_t n=0) |
Truncated Convolution. More... | |
Vector of variable size. Memory is reference counted, i.e.:
T | value type |
|
inline |
Constructs an unallocated vector of variables of type T
|
inlineexplicit |
Constructs an allocated vector of size variables of type T
n | vector size |
|
inline |
Constructs a vector from another one (sharing memory!)
v | vector to copy |
|
inline |
Constructs a vector of variables of type T stored at an already allocated memory. Does not allocate fresh memory. Does not free given memory at object destruction unless handleDelete=true. This memory must indeed stay available during object life.
ptr | address of memory |
n | vector size |
handleDelete | delete memory at destruction? (default=false) |
|
inline |
Reference counted desctructor: frees memory if the object is the last one to use it.
|
inline |
Clones: creates a new vector, with fresh memory, copying values to it
|
inline |
Fills with constant value
x | value to be copied to each element |
|
inline |
Construct a sub vector, i.e. a new vector with fresh memory, initialized from a part of values of *this
offset | position of first element of sub vector |
size | size of sub vector |
|
inline |
Construct a sub vector without allocating new memory but pointing to some part of *this. Beware: *this (or its memory) must not be destroyed as long as the returned subvectref is used!
offset | position of first element of sub vector |
size | size of sub vector |
|
inline |
In-place normalization using Euclidean norm
|
inline |
Multiplies each coordinate by a scalar
x | The scalar |
|
inline |
Scalar product of Vectors
v | Vector to be combined with myself |
|
inline |
Multiplies each coordinate by a scalar
x | The scalar |
|
inline |
|
inline |
Adds a scalar to each coordinate
x | Scalar to be added to myself |
|
inline |
In place Addition of Vectors
v | Vector to be added to myself |
|
inline |
Adds a scalar to each own coordinate
x | Scalar to be added to myself |
|
inline |
Substraction of two Vectors
v | Vector to be substracted from myself |
|
inline |
Substracts a scalar to each coordinate
x | Scalar to be substracted from myself |
|
inline |
|
inline |
In place Substraction of Vectors
v | Vector to be substracted from myself |
|
inline |
Subtracts a scalar to each own coordinate
x | Scalar to be substracted from myself |
|
inline |
Divides each coordinate by a scalar
x | The scalar |
|
inline |
Divides each coordinate by a scalar
x | The scalar |
|
inline |
Assigns from another vector (sharing its memory)
v | vector to be assigned to |
|
inlinestatic |
Vector with constant 0 value
n | size |
Convolution. Returns a vector which size if sum of sizes minus 1
K | kernel |
v | vector to convolution with K |
Correlation between 2 vectors
V1,V2 | vectors |
Distance Correlation between 2 vectors
V1,V2 | vectors |
|
friend |
|
friend |
|
friend |
Euclidean norm
v | argument |
|
friend |
Normalization using Euclidean norm
v | Vector to normalize |
|
friend |
Normalized Correlation between 2 vectors
V1,V2 | vectors |
Multiplies each coordinate by a scalar
x | The scalar |
v | The Vector |
Adds a scalar to each coordinate
x | The scalar |
v | The Vector |
Substract each coordinate to a scalar
x | The scalar |
v | The Vector |
|
friend |
|
friend |
Truncated convolution. Returns a vector of the same size than v.
K | kernel |
v | vector to convolution with K |
n | shift |