CPPLapack
 All Classes Files Functions Variables Friends Pages
Functions
dcovector_small-functions.hpp File Reference

Go to the source code of this file.

Functions

template<CPPL_INT l>
std::ostream & operator<< (std::ostream &s, const dcovector_small< l > &A)
 
template<CPPL_INT l>
drovector_small< l > t (const dcovector_small< l > &A)
 
template<CPPL_INT l>
double nrm2 (const dcovector_small< l > &A)
 
template<CPPL_INT l>
void idamax (CPPL_INT &K, const dcovector_small< l > &A)
 
template<CPPL_INT l>
double damax (const dcovector_small< l > &A)
 
template<CPPL_INT l>
dcovector_small< l > & operator+= (dcovector_small< l > &A, const dcovector_small< l > &B)
 
template<CPPL_INT l>
dcovector_small< l > & operator-= (dcovector_small< l > &A, const dcovector_small< l > &B)
 
template<CPPL_INT l>
dcovector_small< l > & operator*= (dcovector_small< l > &A, const double &d)
 
template<CPPL_INT l>
dcovector_small< l > & operator/= (dcovector_small< l > &A, const double &d)
 
template<CPPL_INT l>
const dcovector_small< l > & operator+ (const dcovector_small< l > &A)
 
template<CPPL_INT l>
dcovector_small< l > operator- (const dcovector_small< l > &A)
 
template<CPPL_INT l>
dcovector_small< l > operator+ (const dcovector_small< l > &A, const dcovector_small< l > &B)
 
template<CPPL_INT l>
dcovector_small< l > operator- (const dcovector_small< l > &A, const dcovector_small< l > &B)
 
template<CPPL_INT n>
dcovector_small< n > operator* (const dcovector_small< n > &A, const double &v)
 
template<CPPL_INT m, CPPL_INT n>
dgematrix_small< m, n > operator* (const dcovector_small< m > &A, const drovector_small< n > &B)
 
template<CPPL_INT n>
dcovector_small< n > operator/ (const dcovector_small< n > &A, const double &v)
 
template<CPPL_INT l>
double operator% (const dcovector_small< l > &A, const dcovector_small< l > &B)
 
template<CPPL_INT l>
dcovector_small< l > hadamard (const dcovector_small< l > &A, const dcovector_small< l > &B)
 

Function Documentation

template<CPPL_INT l>
std::ostream& operator<< ( std::ostream &  s,
const dcovector_small< l > &  A 
)
inline

operator<<

Definition at line 63 of file dcovector_small-functions.hpp.

References i().

64 {CPPL_VERBOSE_REPORT;
65  s << std::setiosflags(std::ios::showpos);
66  for(CPPL_INT i=0; i<l; i++){
67  s << A(i) << std::endl;
68  }
69  return s;
70 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
drovector_small<l> t ( const dcovector_small< l > &  A)
inline

return transposed drovector_small

Definition at line 149 of file dcovector_small-functions.hpp.

References i().

150 {CPPL_VERBOSE_REPORT;
152  for(CPPL_INT i=0; i<l; i++){
153  X(i) =A(i);
154  }
155  return X;
156 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Row Vector Class.
template<CPPL_INT l>
double nrm2 ( const dcovector_small< l > &  A)
inline

return its 2-norm

Definition at line 161 of file dcovector_small-functions.hpp.

References i().

162 {CPPL_VERBOSE_REPORT;
163  double v(0);
164  for(CPPL_INT i=0; i<l; i++){
165  v+=A(i)*A(i);
166  }
167  return std::sqrt(v);
168 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
void idamax ( CPPL_INT &  K,
const dcovector_small< l > &  A 
)
inline

return index of the maximum component

Definition at line 173 of file dcovector_small-functions.hpp.

Referenced by damax().

174 {CPPL_VERBOSE_REPORT;
175  double max(-1.);
176  for(int k=0; k<l; k++){
177  if( max<fabs(A(k)) ){
178  K=k;
179  max =fabs(A(k));
180  }
181  }
182  return;
183 }
template<CPPL_INT l>
double damax ( const dcovector_small< l > &  A)
inline

return the maximum component

Definition at line 188 of file dcovector_small-functions.hpp.

References idamax().

189 {CPPL_VERBOSE_REPORT;
190  CPPL_INT k(0);
191  idamax(k,A);
192  return A(k);
193 }
void idamax(CPPL_INT &K, const dcovector_small< l > &A)
template<CPPL_INT l>
dcovector_small<l>& operator+= ( dcovector_small< l > &  A,
const dcovector_small< l > &  B 
)
inline

dcovector_small+=dcovector_small operator

Definition at line 217 of file dcovector_small-functions.hpp.

References i().

218 {CPPL_VERBOSE_REPORT;
219  for(CPPL_INT i=0; i<l; i++){
220  A(i) +=B(i);
221  }
222  return A;
223 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
dcovector_small<l>& operator-= ( dcovector_small< l > &  A,
const dcovector_small< l > &  B 
)
inline

dcovector_small-=dcovector_small operator

Definition at line 228 of file dcovector_small-functions.hpp.

References i().

229 {CPPL_VERBOSE_REPORT;
230  for(CPPL_INT i=0; i<l; i++){
231  A(i) -=B(i);
232  }
233  return A;
234 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
dcovector_small<l>& operator*= ( dcovector_small< l > &  A,
const double &  d 
)
inline

dcovector_small*=double operator

Definition at line 239 of file dcovector_small-functions.hpp.

References i().

240 {CPPL_VERBOSE_REPORT;
241  for(CPPL_INT i=0; i<l; i++){
242  A(i) *=d;
243  }
244  return A;
245 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
dcovector_small<l>& operator/= ( dcovector_small< l > &  A,
const double &  d 
)
inline

dcovector_small/=double operator

Definition at line 250 of file dcovector_small-functions.hpp.

References i().

251 {CPPL_VERBOSE_REPORT;
252  for(CPPL_INT i=0; i<l; i++){
253  A(i) /=d;
254  }
255  return A;
256 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
const dcovector_small<l>& operator+ ( const dcovector_small< l > &  A)
inline

unary + operator

Definition at line 265 of file dcovector_small-functions.hpp.

266 {CPPL_VERBOSE_REPORT;
267  return A;
268 }
template<CPPL_INT l>
dcovector_small<l> operator- ( const dcovector_small< l > &  A)
inline

unary - operator

Definition at line 273 of file dcovector_small-functions.hpp.

References i().

274 {CPPL_VERBOSE_REPORT;
276  for(CPPL_INT i=0; i<l; i++){
277  X(i) =-A(i);
278  }
279  return X;
280 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Column Vector Class.
template<CPPL_INT l>
dcovector_small<l> operator+ ( const dcovector_small< l > &  A,
const dcovector_small< l > &  B 
)
inline

dcovector_small+dcovector_small operator

Definition at line 289 of file dcovector_small-functions.hpp.

References i().

290 {CPPL_VERBOSE_REPORT;
292  for(CPPL_INT i=0; i<l; i++){
293  X(i) =A(i)+B(i);
294  }
295  return X;
296 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Column Vector Class.
template<CPPL_INT l>
dcovector_small<l> operator- ( const dcovector_small< l > &  A,
const dcovector_small< l > &  B 
)
inline

dcovector_small-dcovector_small operator

Definition at line 301 of file dcovector_small-functions.hpp.

References i().

302 {CPPL_VERBOSE_REPORT;
304  for(CPPL_INT i=0; i<l; i++){
305  X(i) =A(i)-B(i);
306  }
307  return X;
308 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Column Vector Class.
template<CPPL_INT n>
dcovector_small<n> operator* ( const dcovector_small< n > &  A,
const double &  v 
)
inline

dcovector_small*double operator

Definition at line 317 of file dcovector_small-functions.hpp.

References i().

318 {CPPL_VERBOSE_REPORT;
320  for(CPPL_INT i=0; i<n; i++){
321  C(i) =A(i)*v;
322  }
323  return C;
324 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Column Vector Class.
template<CPPL_INT m, CPPL_INT n>
dgematrix_small<m,n> operator* ( const dcovector_small< m > &  A,
const drovector_small< n > &  B 
)
inline

dcovector_small*drovector_small operator

Definition at line 329 of file dcovector_small-functions.hpp.

References i().

330 {CPPL_VERBOSE_REPORT;
332  for(CPPL_INT i=0; i<m; i++){
333  for(CPPL_INT j=0; j<n; j++){
334  mat(i,j) =A(i)*B(j);
335  }
336  }
337  return mat;
338 }
Samll Real Double-precision General Dence Matrix Class.
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT n>
dcovector_small<n> operator/ ( const dcovector_small< n > &  A,
const double &  v 
)
inline

dcovector_small/double operator

Definition at line 347 of file dcovector_small-functions.hpp.

References i().

348 {CPPL_VERBOSE_REPORT;
350  for(CPPL_INT i=0; i<n; i++){
351  C(i) =A(i)/v;
352  }
353  return C;
354 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Column Vector Class.
template<CPPL_INT l>
double operator% ( const dcovector_small< l > &  A,
const dcovector_small< l > &  B 
)
inline

dcovector_smalldcovector_small (inner product) operator

Definition at line 363 of file dcovector_small-functions.hpp.

References i().

364 {CPPL_VERBOSE_REPORT;
365  double v(0.);
366  for(CPPL_INT i=0; i<l; i++){
367  v +=A(i)*B(i);
368  }
369  return v;
370 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
dcovector_small<l> hadamard ( const dcovector_small< l > &  A,
const dcovector_small< l > &  B 
)
inline

Hadamard product

Definition at line 379 of file dcovector_small-functions.hpp.

References i().

380 {CPPL_VERBOSE_REPORT;
382  for(CPPL_INT i=0; i<l; i++){
383  C(i) =A(i)*B(i);
384  }
385  return C;
386 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Column Vector Class.