1 #ifndef LAP_DoubleVector_H
2 #define LAP_DoubleVector_H
57 inline static SP::LAP_DoubleVector
New() {
82 inline static SP::LAP_DoubleVector
New(SPC::LAP_DoubleVector s) {
95 inline static SP::LAP_DoubleVector
New(
const vector<lapack_real>& vs) {
96 SP::LAP_DoubleVector p=
New();
139 const double *vs=&(*this)[0];
140 for (i=nvs-1;i>0;i--) n+=(fabs(vs[i])<eps);
141 if (nvs>0) n+=(fabs(vs[i])<eps);
241 virtual void copy(
const vector<lapack_real>& vs) {
257 throw LAP_Exception(
"math/linalg/core",
"LAD_DoubleVector::product",
"incompatible dimension of vectors");
283 throw LAP_Exception(
"math/linalg/core",
"LAP_DoubleVector::add",
"incompatible dimension of vector");
419 inline double distance2(SPC::LAP_DoubleVector b)
const {
tLVectorIndex getCapacity() const
get the capacity
Definition: LAP_Vector.h:524
LAP_DoubleVector & operator-=(const double &s)
sub operator
Definition: LAP_DoubleVector.h:156
LAP_DoubleVector & operator=(const LAP_DoubleVector &s)
copy operator the view is taken into account
Definition: LAP_DoubleVector.h:120
this class describes the exceptions raised for LAP package
Definition: LAP_Exception.h:14
void scale(const lapack_real &alpha)
return this*=a the view is taken into account dscal blas method called
Definition: LAP_DoubleVector.h:320
LAP_DoubleVector & operator=(const vector< lapack_real > &s)
copy the vector of double
Definition: LAP_DoubleVector.h:113
double norm2() const
return the sqrt(sum([xi|^2)) dnrm2 blas method called
Definition: LAP_DoubleVector.h:396
static void swap(LAP_DoubleVector &x, LAP_DoubleVector &y)
swap the two vectors with the same length dswap method called
Definition: LAP_DoubleVector.h:352
void sub(const lapack_real &s)
sub operator
Definition: LAP_Vector.h:166
DEFINE_SVPTR(LAP_DoubleVector)
LAP_DoubleVector & operator/=(const LAP_DoubleVector &s)
division elementt by elementt vector operator
Definition: LAP_DoubleVector.h:169
void DoubleVectorSwap(const tLVectorIndex &nX, const tLVectorIncrement &incX, double *X, const tLVectorIncrement &incY, double *Y)
Definition: dvector_functions.cpp:165
Definition: LAP_DoubleVector.h:20
#define lapack_int
Definition: lapack_functions.h:7
tLVectorIndex indexMax() const
return the i such that |xi| is maximum idamax blas method called
Definition: LAP_DoubleVector.h:370
static SP::LAP_DoubleVector New(SPC::LAP_DoubleVector s)
create a new copy of s the view is taken into account
Definition: LAP_DoubleVector.h:82
T sum() const
compute the sum of the elements
Definition: LAP_Vector.hpp:170
tLVectorIndex getSize() const
get the size of the vector
Definition: LAP_ConstVector.h:170
T maxValue(tLVectorIndex &i) const
return the max value of the vector and the corresponding index
Definition: LAP_Vector.hpp:15
LAP_DoubleVector & operator*=(const lapack_real &s)
scale operator
Definition: LAP_DoubleVector.h:186
virtual tString toString() const
turn the class to string
Definition: LAP_DoubleVector.cpp:23
void DoubleVectorAdd(const tLVectorIndex &nX, const tLVectorIncrement &incX, const double *X, const double &alpha, const tLVectorIncrement &incY, double *y)
Definition: dvector_functions.cpp:94
#define lapack_real
Definition: lapack_functions.h:9
virtual void add(const tLVectorIndex &i, const lapack_real &v)
return this[i]+=v the view is taken into account
Definition: LAP_DoubleVector.h:308
#define null
Definition: types.h:13
const tLVectorIncrement & getIncrement() const
get the increment of the vector
Definition: LAP_Vector.h:529
double normInf() const
return the the maximum value of [xi|
Definition: LAP_DoubleVector.h:408
void DoubleVectorRotationPlane(double &dx, double &dy, double &c, double &s)
Definition: dvector_functions.cpp:160
LAP_DoubleVector & operator^=(const double &s)
power operator
Definition: LAP_DoubleVector.h:163
LAP_DoubleVector & operator/=(const lapack_real &s)
divide operator
Definition: LAP_DoubleVector.h:192
tLVectorIndex DoubleVectorIndexMax(const tLVectorIndex &nX, const tLVectorIncrement &incX, const double *x)
Definition: dvector_functions.cpp:175
tLVectorIndex getSize() const
get the size of the vector
Definition: LAP_Vector.h:519
double DoubleVectorNorm2(const tLVectorIndex &nX, const tLVectorIncrement &incX, const double *x)
Definition: dvector_functions.cpp:192
double norm1() const
return the sum(|xi|) dasum blas method called
Definition: LAP_DoubleVector.h:389
void copy(const LAP_ConstVector< lapack_real > &v)
copy the vector the view is set to [0,v.getSize()[ the viewed values of v is copied into this use (dc...
Definition: LAP_DoubleVector.h:234
static SP::LAP_DoubleVector New(const tLVectorIndex &s)
create a new vector of double of size s
Definition: LAP_DoubleVector.h:65
tReal distance2(const LAP_Vector< T > &a) const
compute the distance between this and a
Definition: LAP_Vector.h:583
static void rotate(LAP_DoubleVector &dx, LAP_DoubleVector &dy, const lapack_real &c, const lapack_real &s)
make a rotation of vector dx= c*dx+s*dy dy=-s*dx+c*dy the view is taken into account drot blas method...
void DoubleVectorScale(const tLVectorIndex &nX, const tLVectorIncrement &incX, double *X, const double &alpha)
Definition: dvector_functions.cpp:130
LAP_DoubleVector & operator*=(const LAP_DoubleVector &s)
division elementt by elementt vector operator
Definition: LAP_DoubleVector.h:175
static void buildRotation(lapack_real &dx, lapack_real &dy, lapack_real &c, lapack_real &s)
build rotation the view is taken into account drotg blas method called
Definition: LAP_DoubleVector.h:341
double product(const LAP_DoubleVector &v) const
return result= the view is taken into account ddot blas method called
Definition: LAP_DoubleVector.h:254
this class describes a vector of double
Definition: LAP_Vector.h:16
void power(const lapack_real &s)
power operator
Definition: LAP_Vector.h:178
double distance2(SPC::LAP_DoubleVector b) const
return the norm2 of (this-b)
Definition: LAP_DoubleVector.h:419
void DoubleVectorCopy(const tLVectorIndex &nx, const tLVectorIncrement &incx, const double *x, const tLVectorIncrement &incy, double *y)
Definition: dvector_functions.cpp:82
static double product(const LAP_DoubleVector &v, const LAP_DoubleVector &w)
Definition: LAP_DoubleVector.h:265
DEFINE_SPTR(LAP_DoubleVector)
LAP_DoubleVector & operator+=(const double &s)
add operator
Definition: LAP_DoubleVector.h:149
static SP::LAP_DoubleVector New(const LAP_DoubleVector &s)
create a new copy of s the view is taken into account
Definition: LAP_DoubleVector.h:74
void add(const lapack_real &alpha, const tLVectorIndex n, const lapack_real *x)
return this+=alpha. x the view is taken into account daxpy blas method called
Definition: LAP_DoubleVector.h:295
virtual void copy(const vector< T > &s)
copy the vector
Definition: LAP_Vector.h:250
LAP_Vector< lapack_real > & divideBy(const LAP_Vector< lapack_real > &s)
division elementt by elementt vector operator
Definition: LAP_Vector.h:225
#define tLVectorIndex
Definition: lapack_types.h:13
virtual tLVectorIndex getNullValuesNumber(const tReal &eps) const
Definition: LAP_DoubleVector.h:136
static SP::LAP_DoubleVector New()
create a new vector of double
Definition: LAP_DoubleVector.h:57
#define tString
Definition: types.h:49
const tLVectorIncrement & getIncrement() const
get the increment of the vector
Definition: LAP_ConstVector.h:175
LAP_DoubleVector & operator-=(const LAP_Vector< lapack_real > &s)
sub vector operator use daxpy blas method
Definition: LAP_DoubleVector.h:207
double DoubleVectorDot(const tLVectorIndex &nX, const tLVectorIncrement &incX, const double *x, const tLVectorIncrement &incY, const double *y)
Definition: dvector_functions.cpp:139
void multiplyBy(const LAP_Vector< lapack_real > &s)
multiplication element by element vector operator
Definition: LAP_Vector.h:208
LAP_DoubleVector & operator=(const lapack_real &s)
copy operator the view is taken into account
Definition: LAP_DoubleVector.h:106
double minValue(tLVectorIndex &i) const
set the i index such that xi is minimum and return its value
Definition: LAP_DoubleVector.h:382
void add(const T &s)
add operator
Definition: LAP_Vector.h:154
LAP_DoubleVector & operator=(const LAP_ConstDoubleVector &s)
copy operator the view is taken into account
Definition: LAP_DoubleVector.h:126
LAP_DoubleVector & operator+=(const LAP_Vector< lapack_real > &s)
add vector operator use daxpy blas method
Definition: LAP_DoubleVector.h:200
double sum() const
return the sum(xi)
Definition: LAP_DoubleVector.h:402
void init(const lapack_real &v)
init the value to v from the view
Definition: LAP_Vector.h:423
static SP::LAP_DoubleVector New(const vector< lapack_real > &vs)
create a new copy of s the view is taken into account
Definition: LAP_DoubleVector.h:95
double distance2(const LAP_DoubleVector &b) const
return the norm2 of (this-b)
Definition: LAP_DoubleVector.h:414
T minValue(tLVectorIndex &i) const
return the min value of the vector and the corresponding index
Definition: LAP_Vector.hpp:35
void copy(const LAP_Vector< lapack_real > &v)
copy the vector v into this. the view is set to [0,v.getSize()[ the viewed values of v is copied into...
Definition: LAP_DoubleVector.h:222
double maxValue(tLVectorIndex &i) const
set the i index such that xi is maximum and return its value
Definition: LAP_DoubleVector.h:377
virtual ~LAP_DoubleVector()
destroy a vector
Definition: LAP_DoubleVector.cpp:19
virtual void copy(const vector< lapack_real > &vs)
copy a vector of real
Definition: LAP_DoubleVector.h:241
Definition: LAP_ConstDoubleVector.h:25
LAP_DoubleVector()
build a vector
Definition: LAP_DoubleVector.cpp:3
#define tReal
Definition: types.h:18
double DoubleVectorNorm1(const tLVectorIndex &nX, const tLVectorIncrement &incX, const double *x)
Definition: dvector_functions.cpp:184
void add(const lapack_real &alpha, const LAP_Vector< lapack_real > &x)
return this+=alpha. x the view is taken into account daxpy blas method called
Definition: LAP_DoubleVector.h:279
void setSize(const tLVectorIndex &n)
set the view to [0,n[ by 1 increment if values is too small, re-alocate it
Definition: LAP_Vector.h:360
#define ASSERT_IN(a)
Definition: types.h:96
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106