CPPLapack
 All Classes Files Functions Variables Friends Pages
Functions
zrovector_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 zrovector_small< l > &A)
 
template<CPPL_INT n>
zcovector_small< n > t (const zrovector_small< n > &A)
 
template<CPPL_INT l>
double nrm2 (const zrovector_small< l > &A)
 
template<CPPL_INT l>
void idamax (CPPL_INT &K, const zrovector_small< l > &A)
 
template<CPPL_INT l>
comple damax (const zrovector_small< l > &A)
 
template<CPPL_INT l>
zrovector_small< l > & operator+= (zrovector_small< l > &A, const zrovector_small< l > &B)
 
template<CPPL_INT l>
zrovector_small< l > & operator-= (zrovector_small< l > &A, const zrovector_small< l > &B)
 
template<CPPL_INT l>
zrovector_small< l > & operator*= (zrovector_small< l > &A, const double &v)
 
template<CPPL_INT l>
zrovector_small< l > & operator*= (zrovector_small< l > &A, const comple &v)
 
template<CPPL_INT l>
zrovector_small< l > & operator/= (zrovector_small< l > &A, const double &v)
 
template<CPPL_INT l>
zrovector_small< l > & operator/= (zrovector_small< l > &A, const comple &v)
 
template<CPPL_INT l>
const zrovector_small< l > & operator+ (const zrovector_small< l > &A)
 
template<CPPL_INT l>
zrovector_small< l > operator- (const zrovector_small< l > &A)
 
template<CPPL_INT l>
zrovector_small< l > operator+ (const zrovector_small< l > &A, const zrovector_small< l > &B)
 
template<CPPL_INT l>
zrovector_small< l > operator- (const zrovector_small< l > &A, const zrovector_small< l > &B)
 
template<CPPL_INT l>
comple operator* (const zrovector_small< l > &A, const zcovector_small< l > &B)
 
template<CPPL_INT m, CPPL_INT n>
zrovector_small< n > operator* (const zrovector_small< m > &A, const zgematrix_small< m, n > &B)
 
template<CPPL_INT l>
zrovector_small< l > operator* (const zrovector_small< l > &A, const zhematrix_small< l > &B)
 
template<CPPL_INT l>
zrovector_small< l > operator* (const zrovector_small< l > &A, const double &v)
 
template<CPPL_INT l>
zrovector_small< l > operator* (const zrovector_small< l > &A, const comple &v)
 
template<CPPL_INT l>
zrovector_small< l > operator/ (const zrovector_small< l > &A, const double &v)
 
template<CPPL_INT l>
zrovector_small< l > operator/ (const zrovector_small< l > &A, const comple &v)
 
template<CPPL_INT l>
zrovector_small< l > hadamard (const zrovector_small< l > &A, const zrovector_small< l > &B)
 

Function Documentation

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

operator<<

Definition at line 63 of file zrovector_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>
zcovector_small<n> t ( const zrovector_small< n > &  A)
inline

return transposed zrovector_small

Definition at line 150 of file zrovector_small-functions.hpp.

References i().

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

return its 2-norm

Definition at line 162 of file zrovector_small-functions.hpp.

References i().

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

find index of the maximum component

Definition at line 174 of file zrovector_small-functions.hpp.

Referenced by damax().

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

return the maximum component

Definition at line 189 of file zrovector_small-functions.hpp.

References idamax().

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

zrovector_small+=zrovector_small operator

Definition at line 224 of file zrovector_small-functions.hpp.

References i().

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

zrovector_small-=zrovector_small operator

Definition at line 235 of file zrovector_small-functions.hpp.

References i().

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

zrovector_small*=double operator

Definition at line 246 of file zrovector_small-functions.hpp.

References i().

247 {CPPL_VERBOSE_REPORT;
248  for(CPPL_INT i=0; i<l; i++){
249  A(i) *=v;
250  }
251  return A;
252 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
zrovector_small<l>& operator*= ( zrovector_small< l > &  A,
const comple &  v 
)
inline

zrovector_small*=comple operator

Definition at line 257 of file zrovector_small-functions.hpp.

References i().

258 {CPPL_VERBOSE_REPORT;
259  for(CPPL_INT i=0; i<l; i++){
260  A(i) *=v;
261  }
262  return A;
263 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
zrovector_small<l>& operator/= ( zrovector_small< l > &  A,
const double &  v 
)
inline

zrovector_small/=double operator

Definition at line 268 of file zrovector_small-functions.hpp.

References i().

269 {CPPL_VERBOSE_REPORT;
270  for(CPPL_INT i=0; i<l; i++){
271  A(i) /=v;
272  }
273  return A;
274 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
zrovector_small<l>& operator/= ( zrovector_small< l > &  A,
const comple &  v 
)
inline

zrovector_small/=comple operator

Definition at line 279 of file zrovector_small-functions.hpp.

References i().

280 {CPPL_VERBOSE_REPORT;
281  for(CPPL_INT i=0; i<l; i++){
282  A(i) /=v;
283  }
284  return A;
285 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT l>
const zrovector_small<l>& operator+ ( const zrovector_small< l > &  A)
inline

unary + operator

Definition at line 294 of file zrovector_small-functions.hpp.

295 {CPPL_VERBOSE_REPORT;
296  return A;
297 }
template<CPPL_INT l>
zrovector_small<l> operator- ( const zrovector_small< l > &  A)
inline

unary - operator

Definition at line 302 of file zrovector_small-functions.hpp.

References i().

303 {CPPL_VERBOSE_REPORT;
305  for(CPPL_INT i=0; i<l; i++){
306  X(i) =-A(i);
307  }
308  return X;
309 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision Row Vector Class.
template<CPPL_INT l>
zrovector_small<l> operator+ ( const zrovector_small< l > &  A,
const zrovector_small< l > &  B 
)
inline

zrovector_small+zrovector_small operator

Definition at line 318 of file zrovector_small-functions.hpp.

References i().

319 {CPPL_VERBOSE_REPORT;
321  for(CPPL_INT i=0; i<l; i++){
322  X(i) =A(i)+B(i);
323  }
324  return X;
325 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision Row Vector Class.
template<CPPL_INT l>
zrovector_small<l> operator- ( const zrovector_small< l > &  A,
const zrovector_small< l > &  B 
)
inline

zrovector_small-zrovector_small operator

Definition at line 330 of file zrovector_small-functions.hpp.

References i().

331 {CPPL_VERBOSE_REPORT;
333  for(CPPL_INT i=0; i<l; i++){
334  X(i) =A(i)-B(i);
335  }
336  return X;
337 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision Row Vector Class.
template<CPPL_INT l>
comple operator* ( const zrovector_small< l > &  A,
const zcovector_small< l > &  B 
)
inline

zrovector_small*zcovector_small operator

Definition at line 346 of file zrovector_small-functions.hpp.

References i().

347 {CPPL_VERBOSE_REPORT;
348  comple x =0.;
349  for(CPPL_INT i=0; i<l; i++){
350  x +=A(i)*B(i);
351  }
352  return x;
353 }
_dgematrix i(const _dgbmatrix &mat)
template<CPPL_INT m, CPPL_INT n>
zrovector_small<n> operator* ( const zrovector_small< m > &  A,
const zgematrix_small< m, n > &  B 
)
inline

zrovector_small*zgematrix_small operator

Definition at line 358 of file zrovector_small-functions.hpp.

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

359 {CPPL_VERBOSE_REPORT;
361  C.zero();
362  for(CPPL_INT j=0; j<n; j++){
363  for(CPPL_INT i=0; i<m; i++){
364  C(j) +=A(i)*B(i,j);
365  }
366  }
367  return C;
368 }
zrovector_small< l > & zero()
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision Row Vector Class.
template<CPPL_INT l>
zrovector_small<l> operator* ( const zrovector_small< l > &  A,
const zhematrix_small< l > &  B 
)
inline

zrovector_small*zhematrix_small operator

Definition at line 373 of file zrovector_small-functions.hpp.

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

374 {CPPL_VERBOSE_REPORT;
376  C.zero();
377  for(CPPL_INT j=0; j<l; j++){
378  for(CPPL_INT i=0; i<j; i++){
379  C(j) +=A(i)*B(j,i);
380  }
381  for(CPPL_INT i=j; i<l; i++){
382  C(j) +=A(i)*B(i,j);
383  }
384  }
385  return C;
386 }
zrovector_small< l > & zero()
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision Row Vector Class.
template<CPPL_INT l>
zrovector_small<l> operator* ( const zrovector_small< l > &  A,
const double &  v 
)
inline

zrovector_small*double operator

Definition at line 391 of file zrovector_small-functions.hpp.

References i().

392 {CPPL_VERBOSE_REPORT;
394  for(CPPL_INT i=0; i<l; i++){
395  C(i) =A(i)*v;
396  }
397  return C;
398 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision Row Vector Class.
template<CPPL_INT l>
zrovector_small<l> operator* ( const zrovector_small< l > &  A,
const comple &  v 
)
inline

zrovector_small*comple operator

Definition at line 403 of file zrovector_small-functions.hpp.

References i().

404 {CPPL_VERBOSE_REPORT;
406  for(CPPL_INT i=0; i<l; i++){
407  C(i) =A(i)*v;
408  }
409  return C;
410 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision Row Vector Class.
template<CPPL_INT l>
zrovector_small<l> operator/ ( const zrovector_small< l > &  A,
const double &  v 
)
inline

zrovector_small/double operator

Definition at line 419 of file zrovector_small-functions.hpp.

References i().

420 {CPPL_VERBOSE_REPORT;
422  for(CPPL_INT i=0; i<l; i++){
423  C(i) =A(i)/v;
424  }
425  return C;
426 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision Row Vector Class.
template<CPPL_INT l>
zrovector_small<l> operator/ ( const zrovector_small< l > &  A,
const comple &  v 
)
inline

zrovector_small/comple operator

Definition at line 431 of file zrovector_small-functions.hpp.

References i().

432 {CPPL_VERBOSE_REPORT;
434  for(CPPL_INT i=0; i<l; i++){
435  C(i) =A(i)/v;
436  }
437  return C;
438 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision Row Vector Class.
template<CPPL_INT l>
zrovector_small<l> hadamard ( const zrovector_small< l > &  A,
const zrovector_small< l > &  B 
)
inline

Hadamard product

Definition at line 447 of file zrovector_small-functions.hpp.

References i().

448 {CPPL_VERBOSE_REPORT;
450  for(CPPL_INT i=0; i<l; i++){
451  C(i) =A(i)*B(i);
452  }
453  return C;
454 }
_dgematrix i(const _dgbmatrix &mat)
Samll Complex Double-precision Row Vector Class.