11 template <
typename T>
class Matrix;
12 template <
typename T>
class SymMatrix;
43 explicit Vector(
size_t n) : Base(n) {}
62 Vector(T* ptr,
size_t n,
bool handleDelete=
false):Base(ptr,n,handleDelete) {}
103 memset(Z.
data(),0,n*
sizeof(T));
127 assert(offset+size<=this->
size());
197 for (iterator it = this->
begin() ; it != this->
end() ; ++it)
220 for (iterator it = this->
begin() ; it != this->
end() ; ++it)
231 return (*
this)*T(-1);
252 multiply((
int)this->
size(), x, this->
data());
263 return (*
this)*(1/x);
312 return scalarProduct((
int)this->
size(), this->
data(), v.
data());
322 return squaredNorm((
int) v.
size(), v.
data());
365 if (v.
empty())
return 0;
366 const_iterator it = v.
begin();
368 for ( ++it ; it != v.
end() ; ++it) {
383 return std::accumulate(v.
begin(),v.
end(),T(0));
407 for (
size_t i=0; i<v.
size(); i++) {
408 combine((
int)K.
size(), v[i], K.
data(), p.data()+i);
425 for (
size_t i=0; i<v.
size(); i++) {
426 int start = std::max((
int)(0),(
int)(n)-(
int)(i));
427 int end = std::min((
int)(K.
size()),(
int)(v.
size()+n)-(
int)(i));
428 combine((end - start), v[i], K.
data()+start, p.data() + start + (i - n));
469 for (
size_t i=0;i<V1.
size();i++) {
470 double e=double(V1[i])-double(V2[i]);
Vector operator/(T x) const
Scalar division.
Definition: Vector.h:262
Vector & fill(T x)
Filling.
Definition: Vector.h:93
Vector(const Base &v)
Copy constructor.
Definition: Vector.h:50
Vector clone() const
Cloning.
Definition: Vector.h:80
Vector of variable size.
Definition: Vector.h:24
Vector()
Empty constructor.
Definition: Vector.h:36
friend T norm2(const Vector &v)
Squared Euclidean norm.
Definition: Vector.h:331
Vector & operator=(const Vector &v)
Assignment.
Definition: Vector.h:73
Vector operator+(T x) const
Scalar Addition.
Definition: Vector.h:185
Vector operator+(const Vector &v) const
Addition.
Definition: Vector.h:137
friend T normalizedCorrelation(const Vector &V1, const Vector &V2)
Normalized Correlation.
Definition: Vector.h:451
Vector getSubVectRef(size_t offset, size_t size)
Sub vector by reference.
Definition: Vector.h:126
Vector operator-() const
Opposite.
Definition: Vector.h:230
Array of variable size.
Definition: Array.h:20
Array & operator=(const Array &A)
Assignment.
Definition: Array.h:154
friend T sum(const Vector &v)
Sum of values.
Definition: Vector.h:382
size_t size() const
Size.
Definition: Array.h:194
friend Vector truncConvolution(const Vector &K, const Vector &v, size_t n=0)
Truncated Convolution.
Definition: Vector.h:421
Vector(T *ptr, size_t n, bool handleDelete=false)
Constructor (pre-allocated).
Definition: Vector.h:62
Vector operator-(T x) const
Scalar Substraction.
Definition: Vector.h:208
friend Vector normalized(const Vector &v)
Euclidean normalization.
Definition: Vector.h:352
Base::const_iterator const_iterator
Const iterator type.
Definition: Vector.h:30
Vector operator*(T x) const
Scalar multiplication.
Definition: Vector.h:240
~Vector()
Destructor.
Definition: Vector.h:65
T * data()
Data pointer (read/write).
Definition: Array.h:217
Vector & normalize()
Euclidean in-place normalization.
Definition: Vector.h:340
Vector getSubVect(size_t offset, size_t size) const
Sub vector.
Definition: Vector.h:114
bool empty() const
Is empty.
Definition: Array.h:187
friend Vector convolution(const Vector &K, const Vector &v)
Convolution.
Definition: Vector.h:403
friend T norm(const Vector &v)
Euclidean norm.
Definition: Vector.h:321
Vector(size_t n)
Constructor (known size).
Definition: Vector.h:43
Base::iterator iterator
Iterator type.
Definition: Vector.h:28
friend T mean(const Vector &v)
Mean of values.
Definition: Vector.h:392
friend double dist(const Vector &V1, const Vector &V2)
Distance.
Definition: Vector.h:467
T operator*(const Vector &v) const
Scalar product.
Definition: Vector.h:310
Vector & operator+=(const Vector &v)
In place Addition.
Definition: Vector.h:149
friend T correlation(const Vector &V1, const Vector &V2)
Correlation.
Definition: Vector.h:439
Vector & operator+=(T x)
Scalar in place Addition.
Definition: Vector.h:196
Vector & operator/=(T x)
Scalar in place division.
Definition: Vector.h:272
Vector & operator-=(T x)
Scalar in place substractrion.
Definition: Vector.h:219
Array & fill(const T &x)
Filling.
Definition: Array.h:276
Array getSubArray(size_t offset, size_t size) const
Sub array.
Definition: Array.h:262
Vector operator-(const Vector &v) const
Substraction.
Definition: Vector.h:161
Vector & operator-=(const Vector &v)
In place Substraction.
Definition: Vector.h:173
iterator begin()
Begin iterator.
Definition: Array.h:231
Imagine++ namespace.
Definition: Array.h:7
RED GREEN BLUE color.
Definition: Color.h:26
const T * const_iterator
Const iterator type.
Definition: Array.h:73
static Vector Zero(size_t n)
Zero vector.
Definition: Vector.h:101
iterator end()
End iterator.
Definition: Array.h:245
Vector & operator*=(T x)
Scalar in place multiplication.
Definition: Vector.h:251
friend T maxNorm(const Vector &v)
Maximum norm.
Definition: Vector.h:364