CPPLapack
 All Classes Files Functions Variables Friends Pages
Functions
drovector_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 drovector_small< l > &A)
 
template<CPPL_INT n>
dcovector_small< n > t (const drovector_small< n > &A)
 
template<CPPL_INT l>
double nrm2 (const drovector_small< l > &A)
 
template<CPPL_INT l>
void idamax (CPPL_INT &K, const drovector_small< l > &A)
 
template<CPPL_INT l>
double damax (const drovector_small< l > &A)
 
template<CPPL_INT l>
drovector_small< l > & operator+= (drovector_small< l > &A, const drovector_small< l > &B)
 
template<CPPL_INT l>
drovector_small< l > & operator-= (drovector_small< l > &A, const drovector_small< l > &B)
 
template<CPPL_INT l>
drovector_small< l > & operator*= (drovector_small< l > &A, const double &d)
 
template<CPPL_INT l>
drovector_small< l > & operator/= (drovector_small< l > &A, const double &d)
 
template<CPPL_INT l>
const drovector_small< l > & operator+ (const drovector_small< l > &A)
 
template<CPPL_INT l>
drovector_small< l > operator- (const drovector_small< l > &A)
 
template<CPPL_INT l>
drovector_small< l > operator+ (const drovector_small< l > &A, const drovector_small< l > &B)
 
template<CPPL_INT l>
drovector_small< l > operator- (const drovector_small< l > &A, const drovector_small< l > &B)
 
template<CPPL_INT l>
double operator* (const drovector_small< l > &A, const dcovector_small< l > &B)
 
template<CPPL_INT m, CPPL_INT n>
drovector_small< n > operator* (const drovector_small< m > &A, const dgematrix_small< m, n > &B)
 
template<CPPL_INT l>
drovector_small< l > operator* (const drovector_small< l > &A, const dsymatrix_small< l > &B)
 
template<CPPL_INT l>
drovector_small< l > operator* (const drovector_small< l > &A, const double &v)
 
template<CPPL_INT l>
drovector_small< l > operator/ (const drovector_small< l > &A, const double &v)
 
template<CPPL_INT l>
double operator% (const drovector_small< l > &A, const drovector_small< l > &B)
 
template<CPPL_INT l>
drovector_small< l > hadamard (const drovector_small< l > &A, const drovector_small< l > &B)
 

Function Documentation

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

operator<<

Definition at line 63 of file drovector_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::flush;
68  }
69  s << std::endl;
70  return s;
71 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT n>
dcovector_small<n> t ( const drovector_small< n > &  A)
inline

return transposed column vector

Definition at line 151 of file drovector_small-functions.hpp.

References i().

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

Definition at line 163 of file drovector_small-functions.hpp.

References i().

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

Definition at line 175 of file drovector_small-functions.hpp.

Referenced by damax().

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

Definition at line 190 of file drovector_small-functions.hpp.

References idamax().

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

Definition at line 225 of file drovector_small-functions.hpp.

References i().

226 {CPPL_VERBOSE_REPORT;
227  for(CPPL_INT i=0; i<l; i++){
228  A(i) +=B(i);
229  }
230  return A;
231 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
drovector_small<l>& operator-= ( drovector_small< l > &  A,
const drovector_small< l > &  B 
)
inline

Definition at line 236 of file drovector_small-functions.hpp.

References i().

237 {CPPL_VERBOSE_REPORT;
238  for(CPPL_INT i=0; i<l; i++){
239  A(i) -=B(i);
240  }
241  return A;
242 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
drovector_small<l>& operator*= ( drovector_small< l > &  A,
const double &  d 
)
inline

Definition at line 247 of file drovector_small-functions.hpp.

References i().

248 {CPPL_VERBOSE_REPORT;
249  for(CPPL_INT i=0; i<l; i++){
250  A(i) *=d;
251  }
252  return A;
253 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
drovector_small<l>& operator/= ( drovector_small< l > &  A,
const double &  d 
)
inline

Definition at line 258 of file drovector_small-functions.hpp.

References i().

259 {CPPL_VERBOSE_REPORT;
260  for(CPPL_INT i=0; i<l; i++){
261  A(i) /=d;
262  }
263  return A;
264 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
const drovector_small<l>& operator+ ( const drovector_small< l > &  A)
inline

unary

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

274 {CPPL_VERBOSE_REPORT;
275  return A;
276 }
template<CPPL_INT l>
drovector_small<l> operator- ( const drovector_small< l > &  A)
inline

unary

Definition at line 281 of file drovector_small-functions.hpp.

References i().

282 {CPPL_VERBOSE_REPORT;
284  for(CPPL_INT i=0; i<l; i++){
285  X(i) =-A(i);
286  }
287  return X;
288 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Row Vector Class.
template<CPPL_INT l>
drovector_small<l> operator+ ( const drovector_small< l > &  A,
const drovector_small< l > &  B 
)
inline

Definition at line 297 of file drovector_small-functions.hpp.

References i().

298 {CPPL_VERBOSE_REPORT;
300  for(CPPL_INT i=0; i<l; i++){
301  X(i) =A(i)+B(i);
302  }
303  return X;
304 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Row Vector Class.
template<CPPL_INT l>
drovector_small<l> operator- ( const drovector_small< l > &  A,
const drovector_small< l > &  B 
)
inline

Definition at line 309 of file drovector_small-functions.hpp.

References i().

310 {CPPL_VERBOSE_REPORT;
312  for(CPPL_INT i=0; i<l; i++){
313  X(i) =A(i)-B(i);
314  }
315  return X;
316 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Row Vector Class.
template<CPPL_INT l>
double operator* ( const drovector_small< l > &  A,
const dcovector_small< l > &  B 
)
inline

Definition at line 325 of file drovector_small-functions.hpp.

References i().

326 {CPPL_VERBOSE_REPORT;
327  double x =0.;
328  for(CPPL_INT i=0; i<l; i++){
329  x +=A(i)*B(i);
330  }
331  return x;
332 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT m, CPPL_INT n>
drovector_small<n> operator* ( const drovector_small< m > &  A,
const dgematrix_small< m, n > &  B 
)
inline

Definition at line 337 of file drovector_small-functions.hpp.

References i(), and drovector_small< l >::zero().

338 {CPPL_VERBOSE_REPORT;
340  C.zero();
341  for(CPPL_INT j=0; j<n; j++){
342  for(CPPL_INT i=0; i<m; i++){
343  C(j) +=A(i)*B(i,j);
344  }
345  }
346  return C;
347 }
drovector_small< l > & zero()
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Row Vector Class.
template<CPPL_INT l>
drovector_small<l> operator* ( const drovector_small< l > &  A,
const dsymatrix_small< l > &  B 
)
inline

Definition at line 352 of file drovector_small-functions.hpp.

References i(), and drovector_small< l >::zero().

353 {CPPL_VERBOSE_REPORT;
355  C.zero();
356  for(CPPL_INT j=0; j<l; j++){
357  for(CPPL_INT i=0; i<j; i++){
358  C(j) +=A(i)*B(j,i);
359  }
360  for(CPPL_INT i=j; i<l; i++){
361  C(j) +=A(i)*B(i,j);
362  }
363  }
364  return C;
365 }
drovector_small< l > & zero()
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Row Vector Class.
template<CPPL_INT l>
drovector_small<l> operator* ( const drovector_small< l > &  A,
const double &  v 
)
inline

Definition at line 370 of file drovector_small-functions.hpp.

References i().

371 {CPPL_VERBOSE_REPORT;
373  for(CPPL_INT i=0; i<l; i++){
374  C(i) =A(i)*v;
375  }
376  return C;
377 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Row Vector Class.
template<CPPL_INT l>
drovector_small<l> operator/ ( const drovector_small< l > &  A,
const double &  v 
)
inline

Definition at line 386 of file drovector_small-functions.hpp.

References i().

387 {CPPL_VERBOSE_REPORT;
389  for(CPPL_INT i=0; i<l; i++){
390  C(i) =A(i)/v;
391  }
392  return C;
393 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Row Vector Class.
template<CPPL_INT l>
double operator% ( const drovector_small< l > &  A,
const drovector_small< l > &  B 
)
inline

drovector_smalldrovector_small (inner product) operator

Definition at line 402 of file drovector_small-functions.hpp.

References i().

403 {CPPL_VERBOSE_REPORT;
404  double v(0.);
405  for(CPPL_INT i=0; i<l; i++){
406  v +=A(i)*B(i);
407  }
408  return v;
409 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
drovector_small<l> hadamard ( const drovector_small< l > &  A,
const drovector_small< l > &  B 
)
inline

Hadamard product

Definition at line 418 of file drovector_small-functions.hpp.

References i().

419 {CPPL_VERBOSE_REPORT;
421  for(CPPL_INT i=0; i<l; i++){
422  C(i) =A(i)*B(i);
423  }
424  return C;
425 }
_dgematrix i(const _dgbmatrix &mat)
Samll Real Double-precision Row Vector Class.