18 const T* v=&(*this)(0);
38 const T* v=&(*this)(0);
63 if ((n<=1) || (incx==0))
return idamin;
65 vmin=fabs((*
this)[index++]);
67 v=fabs((*
this)[index]);
76 vmin=fabs((*
this)[index]);
79 v=fabs((*
this)[index]);
110 for (i=0;i<n-1;i++) {
119 for (i=0;i<p-1;i++) {
134 "LAP_Vector::distance2",
135 "incompatible dimension of vectors");
136 tReal scale,ssq,distance=0;
144 if ((incx==0) || incy==0) distance=0;
145 else if (n==1) distance=fabs(a[sx]-b[sy]);
156 ssq=1+ssq*(scale*scale/(absd*absd));
158 ssq+=(absd*absd)/(scale*scale);
164 distance=scale*sqrt(ssq);
177 const T *iter=&(*this)[sx];
178 const T *end=&(*this)[sx+n-1];
203 T *values=&(*this)(0);
213 if (compare(values[i*inc],
220 values[j*inc]=values[(j-h)*inc];
223 (!compare(values[(j-h)*inc],
236 quickSort(&(*
this)(0),getIncrement(),0,n-1);
245 if (from>=to)
return;
250 T pivotValue=v[pivotLLVectorIndex*incv];
254 while (left<=right) {
255 while ((left<=to) && (v[left*incv]>pivotValue)) left++;
256 while ((right>from) && (v[right*incv]<pivotValue)) right--;
258 std::swap(v[left*incv],v[right*incv]);
260 if (right>0) right--;
265 quickSort(v, incv,from, right);
266 quickSort(v, incv,left, to);
280 (*this)[k]=(*this)[i];
this class describes the exceptions raised for LAP package
Definition: LAP_Exception.h:14
const tLVectorIndex & getStart() const
get the start of the vector
Definition: LAP_Vector.h:534
T sum() const
compute the sum of the elements
Definition: LAP_Vector.hpp:170
T maxValue(tLVectorIndex &i) const
return the max value of the vector and the corresponding index
Definition: LAP_Vector.hpp:15
const tLVectorIncrement & getIncrement() const
get the increment of the vector
Definition: LAP_Vector.h:529
tLVectorIndex getSize() const
get the size of the vector
Definition: LAP_Vector.h:519
tReal distance2(const LAP_Vector< T > &a) const
compute the distance between this and a
Definition: LAP_Vector.h:583
void merge(const T &alpha, const LAP_Vector< T > &x, const T &beta, const LAP_Vector< T > &y)
this is the merging of 2 vectors This = [alpha.x,beta.y]
Definition: LAP_Vector.hpp:96
void quickSort()
quit sort the vector in an increasing order
Definition: LAP_Vector.hpp:233
this class describes a vector of double
Definition: LAP_Vector.h:16
#define tLVectorIndex
Definition: lapack_types.h:13
void sort()
sort in ascent order view untaken into account
Definition: LAP_Vector.h:614
tLVectorIndex indexMin() const
retun the index min of th evector
Definition: LAP_Vector.hpp:56
#define tLVectorIncrement
Definition: lapack_types.h:16
T minValue(tLVectorIndex &i) const
return the min value of the vector and the corresponding index
Definition: LAP_Vector.hpp:35
#define tReal
Definition: types.h:18
void reverse()
reverse the vector
Definition: LAP_Vector.hpp:270
#define tFlag
Definition: types.h:14