Nektar++
Vmath Namespace Reference

Functions

template<class T >
void Fill (int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value. More...

template void Fill (int n, const Nektar::NekDouble alpha, Nektar::NekDouble *x, const int incx)

template<class T >
ran2 (long *idum)
Generates a number from ~Normal(0,1) More...

template<class T >
void FillWhiteNoise (int n, const T eps, T *x, const int incx, int outseed)
Fills a vector with white noise. More...

template void FillWhiteNoise (int n, const Nektar::NekDouble eps, Nektar::NekDouble *x, const int incx, int outseed)

template<class T >
void Vmul (int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y. More...

template void Vmul (int n, const Nektar::NekDouble *x, const int incx, const Nektar::NekDouble *y, const int incy, Nektar::NekDouble *z, const int incz)

template<class T >
void Smul (int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y. More...

template void Smul (int n, const Nektar::NekDouble alpha, const Nektar::NekDouble *x, const int incx, Nektar::NekDouble *y, const int incy)

template<class T >
void Vdiv (int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y. More...

template void Vdiv (int n, const Nektar::NekDouble *x, const int incx, const Nektar::NekDouble *y, const int incy, Nektar::NekDouble *z, const int incz)

template<class T >
void Sdiv (int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/y. More...

template void Sdiv (int n, const Nektar::NekDouble alpha, const Nektar::NekDouble *x, const int incx, Nektar::NekDouble *y, const int incy)

template<class T >
void Vadd (int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y. More...

template void Vadd (int n, const Nektar::NekDouble *x, const int incx, const Nektar::NekDouble *y, const int incy, Nektar::NekDouble *z, const int incz)

template<class T >
void Sadd (int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x. More...

template void Sadd (int n, const Nektar::NekDouble alpha, const Nektar::NekDouble *x, const int incx, Nektar::NekDouble *y, const int incy)

template<class T >
void Vsub (int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y. More...

template void Vsub (int n, const Nektar::NekDouble *x, const int incx, const Nektar::NekDouble *y, const int incy, Nektar::NekDouble *z, const int incz)

template<class T >
void Zero (int n, T *x, const int incx)
Zero vector. More...

template void Zero (int n, Nektar::NekDouble *x, const int incx)

template void Zero (int n, int *x, const int incx)

template void Zero (int n, long *x, const int incx)

template<class T >
void Neg (int n, T *x, const int incx)
Negate x = -x. More...

template void Neg (int n, Nektar::NekDouble *x, const int incx)

template<class T >
void Vsqrt (int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x) More...

template void Vsqrt (int n, const Nektar::NekDouble *x, const int incx, Nektar::NekDouble *y, const int incy)

template<class T >
void Vabs (int n, const T *x, const int incx, T *y, const int incy)
vabs: y = |x| More...

template void Vabs (int n, const Nektar::NekDouble *x, const int incx, Nektar::NekDouble *y, const int incy)

template<class T >
void Vvtvp (int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y More...

template void Vvtvp (int n, const Nektar::NekDouble *w, const int incw, const Nektar::NekDouble *x, const int incx, const Nektar::NekDouble *y, const int incy, Nektar::NekDouble *z, const int incz)

template<class T >
void Vvtvm (int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvm (vector times vector plus vector): z = w*x - y More...

template void Vvtvm (int n, const Nektar::NekDouble *w, const int incw, const Nektar::NekDouble *x, const int incx, const Nektar::NekDouble *y, const int incy, Nektar::NekDouble *z, const int incz)

template<class T >
void Svtvp (int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y More...

template void Svtvp (int n, const Nektar::NekDouble alpha, const Nektar::NekDouble *x, const int incx, const Nektar::NekDouble *y, const int incy, Nektar::NekDouble *z, const int incz)

template<class T >
void Svtvm (int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x - y More...

template void Svtvm (int n, const Nektar::NekDouble alpha, const Nektar::NekDouble *x, const int incx, const Nektar::NekDouble *y, const int incy, Nektar::NekDouble *z, const int incz)

template<class T >
void Vvtvvtp (int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector): More...

template void Vvtvvtp (int n, const Nektar::NekDouble *v, int incv, const Nektar::NekDouble *w, int incw, const Nektar::NekDouble *x, int incx, const Nektar::NekDouble *y, int incy, Nektar::NekDouble *z, int incz)

template<class T >
void Vvtvvtm (int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtm (vector times vector minus vector times vector): More...

template void Vvtvvtm (int n, const Nektar::NekDouble *v, int incv, const Nektar::NekDouble *w, int incw, const Nektar::NekDouble *x, int incx, const Nektar::NekDouble *y, int incy, Nektar::NekDouble *z, int incz)

template<class T >
void Svtsvtp (int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
vvtvvtp (scalar times vector plus scalar times vector): More...

template void Svtsvtp (int n, const Nektar::NekDouble alpha, const Nektar::NekDouble *x, int incx, const Nektar::NekDouble beta, const Nektar::NekDouble *y, int incy, Nektar::NekDouble *z, int incz)

template<class T >
void Vstvpp (int n, const T alpha, const T *v, int incv, const T *w, int incw, const T *x, int incx, T *z, int incz)
Vstvpp (scalar times vector plus vector plus vector): More...

template void Vstvpp (int n, const Nektar::NekDouble alpha, const Nektar::NekDouble *v, int incv, const Nektar::NekDouble *w, int incw, const Nektar::NekDouble *x, int incx, Nektar::NekDouble *z, int incz)

template<class T >
void Gathr (int n, const T *x, const int *y, T *z)
Gather vector z[i] = x[y[i]]. More...

template void Gathr (int n, const Nektar::NekDouble *x, const int *y, Nektar::NekDouble *z)

template<class T >
void Gathr (int n, const T *sign, const T *x, const int *y, T *z)
Gather vector z[i] = sign[i]*x[y[i]]. More...

template void Gathr (int n, const Nektar::NekDouble *sign, const Nektar::NekDouble *x, const int *y, Nektar::NekDouble *z)

template<class T >
void Scatr (int n, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = x[i]. More...

template void Scatr (int n, const Nektar::NekDouble *x, const int *y, Nektar::NekDouble *z)

template<class T >
void Scatr (int n, const T *sign, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = sign[i]*x[i]. More...

template void Scatr (int n, const Nektar::NekDouble *sign, const Nektar::NekDouble *x, const int *y, Nektar::NekDouble *z)

template<class T >
void Assmb (int n, const T *x, const int *y, T *z)
Assemble z[y[i]] += x[i]; z should be zero'd first. More...

template void Assmb (int n, const Nektar::NekDouble *x, const int *y, Nektar::NekDouble *z)

template<class T >
void Assmb (int n, const T *sign, const T *x, const int *y, T *z)
Assemble z[y[i]] += sign[i]*x[i]; z should be zero'd first. More...

template void Assmb (int n, const Nektar::NekDouble *sign, const Nektar::NekDouble *x, const int *y, Nektar::NekDouble *z)

template<class T >
Vsum (int n, const T *x, const int incx)
Subtract return sum(x) More...

template Nektar::NekDouble Vsum (int n, const Nektar::NekDouble *x, const int incx)

template int Vsum (int n, const int *x, const int incx)

template<class T >
int Imax (int n, const T *x, const int incx)
Return the index of the maximum element in x. More...

template int Imax (int n, const Nektar::NekDouble *x, const int incx)

template int Imax (int n, const int *x, const int incx)

template<class T >
Vmax (int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max. More...

template Nektar::NekDouble Vmax (int n, const Nektar::NekDouble *x, const int incx)

template int Vmax (int n, const int *x, const int incx)

template<class T >
int Iamax (int n, const T *x, const int incx)
Return the index of the maximum absolute element in x. More...

template int Iamax (int n, const Nektar::NekDouble *x, const int incx)

template<class T >
Vamax (int n, const T *x, const int incx)
Return the maximum absolute element in x called vamax to avoid conflict with max. More...

template Nektar::NekDouble Vamax (int n, const Nektar::NekDouble *x, const int incx)

template<class T >
int Imin (int n, const T *x, const int incx)
Return the index of the minimum element in x. More...

template int Imin (int n, const Nektar::NekDouble *x, const int incx)

template int Imin (int n, const int *x, const int incx)

template<class T >
Vmin (int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min. More...

template Nektar::NekDouble Vmin (int n, const Nektar::NekDouble *x, const int incx)

template int Vmin (int n, const int *x, const int incx)

template<class T >
int Nnan (int n, const T *x, const int incx)
Return number of NaN elements of x. More...

template int Nnan (int n, const Nektar::NekDouble *x, const int incx)

template int Nnan (int n, const float *x, const int incx)

template int Nnan (int n, const int *x, const int incx)

template<class T >
Dot (int n, const T *w, const T *x)
vvtvp (vector times vector times vector): z = w*x*y More...

template Nektar::NekDouble Dot (int n, const Nektar::NekDouble *w, const Nektar::NekDouble *x)

template<class T >
Dot (int n, const T *w, const int incw, const T *x, const int incx)
vvtvp (vector times vector times vector): z = w*x*y More...

template Nektar::NekDouble Dot (int n, const Nektar::NekDouble *w, const int incw, const Nektar::NekDouble *x, const int incx)

template<class T >
Dot2 (int n, const T *w, const T *x, const int *y)
vvtvp (vector times vector times vector): z = w*x*y More...

template Nektar::NekDouble Dot2 (int n, const Nektar::NekDouble *w, const Nektar::NekDouble *x, const int *y)

template<class T >
Dot2 (int n, const T *w, const int incw, const T *x, const int incx, const int *y, const int incy)
vvtvp (vector times vector times vector): z = w*x*y More...

template Nektar::NekDouble Dot2 (int n, const Nektar::NekDouble *w, const int incw, const Nektar::NekDouble *x, const int incx, const int *y, const int incy)

template<typename T >
void Vcopy (int n, const T *x, const int incx, T *y, const int incy)

template void Vcopy (int n, const int *x, const int incx, int *y, const int incy)

template void Vcopy (int n, const unsigned int *x, const int incx, unsigned int *y, const int incy)

template void Vcopy (int n, const Nektar::NekDouble *x, const int incx, Nektar::NekDouble *y, const int incy)

template<class T >
void Reverse (int n, const T *x, const int incx, T *y, const int incy)

template void Reverse (int n, const Nektar::NekDouble *x, const int incx, Nektar::NekDouble *y, const int incy)

template<class T >
void Vlog (int n, const T *x, const int incx, T *y, const int incy)

template<class T >
void Vexp (int n, const T *x, const int incx, T *y, const int incy)

template<class T >
void Vpow (int n, const T *x, const int incx, const T f, T *y, const int incy)

template<class T >
void Fill (int n, const T alpha, Array< OneD, T > &x, const int incx)
Fill a vector with a constant value. More...

template<class T >
void FillWhiteNoise (int n, const T eps, Array< OneD, T > &x, const int incx, int outseed)

template<class T >
void Vmul (int n, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
Multiply vector z = x*y. More...

template<class T >
void Vmul (int n, const Array< TwoD, NekDouble >::const_reference &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)

template<class T >
void Smul (int n, const T alpha, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
Scalar multiply y = alpha*y. More...

template<class T >
void Vdiv (int n, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
Multiply vector z = x/y. More...

template<class T >
void Sdiv (int n, const T alpha, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
Scalar multiply y = alpha/y. More...

template<class T >
void Vadd (int n, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
Add vector z = x+y. More...

template<class T >
void Sadd (int n, const T alpha, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
Add vector y = alpha + x. More...

template<class T >
void Vsub (int n, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
Subtract vector z = x-y. More...

template<class T >
void Zero (int n, Array< OneD, T > &x, const int incx)
Zero vector. More...

template<class T >
void Neg (int n, Array< OneD, T > &x, const int incx)
Negate x = -x. More...

template<class T >
void Vlog (int n, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)

template<class T >
void Vexp (int n, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)

template<class T >
void Vpow (int n, const Array< OneD, const T > &x, const int incx, const T f, Array< OneD, T > &y, const int incy)

template<class T >
void Vsqrt (int n, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
sqrt y = sqrt(x) More...

template<class T >
void Vabs (int n, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
vabs: y = |x| More...

template<class T >
void Vvtvp (int n, const Array< OneD, const T > &w, const int incw, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y More...

template<class T >
void Vvtvp (int n, const Array< TwoD, NekDouble >::const_reference &w, const int incw, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)

template<class T >
void Svtvp (int n, const T alpha, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y More...

template<class T >
void Svtvm (int n, const T alpha, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y More...

template<class T >
void Vvtvm (int n, const Array< OneD, const T > &w, const int incw, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
vvtvm (vector times vector minus vector): z = w*x - y More...

template<class T >
void Vvtvvtp (int n, const Array< OneD, const T > &v, int incv, const Array< OneD, const T > &w, int incw, const Array< OneD, const T > &x, int incx, const Array< OneD, const T > &y, int incy, Array< OneD, T > &z, int incz)
vvtvvtp (vector times vector plus vector times vector): z = v*w + y*z More...

template<class T >
void Svtsvtp (int n, const T alpha, const Array< OneD, const T > &x, const int incx, const T beta, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
svtsvtp (scalar times vector plus scalar times vector): z = alpha*x + beta*y More...

template<class T >
void Gathr (int n, const Array< OneD, const T > &x, const Array< OneD, const int > &y, Array< OneD, T > &z)
Gather vector z[i] = x[y[i]]. More...

template<class T >
void Scatr (int n, const Array< OneD, const T > &x, const Array< OneD, const int > &y, Array< OneD, T > &z)
Scatter vector z[y[i]] = x[i]. More...

template<class T >
void Assmb (int n, const Array< OneD, T > &x, const Array< OneD, int > &y, Array< OneD, T > &z)
Assemble z[y[i]] += x[i]; z should be zero'd first. More...

template<class T >
Vsum (int n, const Array< OneD, const T > &x, const int incx)
Subtract return sum(x) More...

template<class T >
int Imax (int n, const Array< OneD, const T > &x, const int incx)
Return the index of the maximum element in x. More...

template<class T >
Vmax (int n, const Array< OneD, const T > &x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max. More...

template<class T >
int Iamax (int n, const Array< OneD, const T > &x, const int incx)
Return the index of the maximum absolute element in x. More...

template<class T >
Vamax (int n, const Array< OneD, const T > &x, const int incx)
Return the maximum absolute element in x called vamax to avoid conflict with max. More...

template<class T >
int Imin (int n, const Array< OneD, const T > &x, const int incx)
Return the index of the minimum element in x. More...

template<class T >
Vmin (int n, const Array< OneD, const T > &x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min. More...

template<class T >
int Nnan (int n, const Array< OneD, const T > &x, const int incx)
Return number of NaN elements of x. More...

template<class T >
Dot (int n, const Array< OneD, const T > &w, const Array< OneD, const T > &x)

template<class T >
Dot (int n, const Array< OneD, const T > &w, const int incw, const Array< OneD, const T > &x, const int incx)

template<class T >
Dot2 (int n, const Array< OneD, const T > &w, const Array< OneD, const T > &x, const Array< OneD, const int > &y)

template<class T >
Ddot (int n, const Array< OneD, const T > &w, const int incw, const Array< OneD, const T > &x, const int incx, const Array< OneD, const int > &y, const int incy)

template<class T >
void Vcopy (int n, const Array< OneD, const T > &x, int incx, Array< OneD, T > &y, int const incy)

template<class T >
void Reverse (int n, const Array< OneD, const T > &x, int incx, Array< OneD, T > &y, int const incy)

Variables

static boost::mutex mutex

Function Documentation

template<class T >
 void Vmath::Assmb ( int n, const Array< OneD, T > & x, const Array< OneD, int > & y, Array< OneD, T > & z )

Assemble z[y[i]] += x[i]; z should be zero'd first.

Definition at line 317 of file VmathArray.hpp.

References ASSERTL1, and Assmb().

318  {
319  ASSERTL1(n <= x.num_elements()+x.GetOffset(),"Array out of bounds");
320  ASSERTL1(n <= y.num_elements()+y.GetOffset(),"Array out of bounds");
321
322  Assmb(n,&x[0],&y[0],&z[0]);
323  }
void Assmb(int n, const Array< OneD, T > &x, const Array< OneD, int > &y, Array< OneD, T > &z)
Assemble z[y[i]] += x[i]; z should be zero'd first.
Definition: VmathArray.hpp:317
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Assmb ( int n, const T * x, const int * y, T * z )

Assemble z[y[i]] += x[i]; z should be zero'd first.

Definition at line 695 of file Vmath.cpp.

697  {
698  while (n--)
699  {
700  *(z + *(y++)) += *(x++);
701  }
702  }
 template void Vmath::Assmb ( int n, const Nektar::NekDouble * x, const int * y, Nektar::NekDouble * z )
template<class T >
 void Vmath::Assmb ( int n, const T * sign, const T * x, const int * y, T * z )

Assemble z[y[i]] += sign[i]*x[i]; z should be zero'd first.

Definition at line 708 of file Vmath.cpp.

710  {
711  while (n--)
712  {
713  *(z + *(y++)) += *(sign++) * (*(x++));
714  }
715  }
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:22
 template void Vmath::Assmb ( int n, const Nektar::NekDouble * sign, const Nektar::NekDouble * x, const int * y, Nektar::NekDouble * z )
template<class T >
 T Vmath::Ddot ( int n, const Array< OneD, const T > & w, const int incw, const Array< OneD, const T > & x, const int incx, const Array< OneD, const int > & y, const int incy )

Definition at line 434 of file VmathArray.hpp.

References ASSERTL1, and Dot2().

438  {
439  ASSERTL1(n*incw <= w.num_elements()+w.GetOffset(),"Array out of bounds");
440  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
441  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
442
443  return Dot2(n,&w[0],incw,&x[0],incx,&y[0],incy);
444  }
T Dot2(int n, const Array< OneD, const T > &w, const Array< OneD, const T > &x, const Array< OneD, const int > &y)
Definition: VmathArray.hpp:421
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 T Vmath::Dot ( int n, const Array< OneD, const T > & w, const Array< OneD, const T > & x )

Definition at line 399 of file VmathArray.hpp.

References ASSERTL1, and Dot().

402  {
403  ASSERTL1(n <= w.num_elements()+w.GetOffset(),"Array out of bounds");
404  ASSERTL1(n <= x.num_elements()+x.GetOffset(),"Array out of bounds");
405
406  return Dot(n,&w[0],&x[0]);
407  }
T Dot(int n, const Array< OneD, const T > &w, const int incw, const Array< OneD, const T > &x, const int incx)
Definition: VmathArray.hpp:410
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 T Vmath::Dot ( int n, const Array< OneD, const T > & w, const int incw, const Array< OneD, const T > & x, const int incx )

Definition at line 410 of file VmathArray.hpp.

References ASSERTL1, and Dot().

413  {
414  ASSERTL1(n*incw <= w.num_elements()+w.GetOffset(),"Array out of bounds");
415  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
416
417  return Dot(n,&w[0],incw,&x[0],incx);
418  }
T Dot(int n, const Array< OneD, const T > &w, const int incw, const Array< OneD, const T > &x, const int incx)
Definition: VmathArray.hpp:410
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 T Vmath::Dot ( int n, const T * w, const T * x )

vvtvp (vector times vector times vector): z = w*x*y

Definition at line 900 of file Vmath.cpp.

903  {
904  T sum = 0;
905
906  while( n-- )
907  {
908  sum += (*w) * (*x);
909  ++w;
910  ++x;
911  }
912  return sum;
913  }
 template Nektar::NekDouble Vmath::Dot ( int n, const Nektar::NekDouble * w, const Nektar::NekDouble * x )
template<class T >
 T Vmath::Dot ( int n, const T * w, const int incw, const T * x, const int incx )

vvtvp (vector times vector times vector): z = w*x*y

Definition at line 920 of file Vmath.cpp.

923  {
924  T sum = 0;
925
926  while( n-- )
927  {
928  sum += (*w) * (*x);
929  w += incw;
930  x += incx;
931  }
932  return sum;
933  }
 template Nektar::NekDouble Vmath::Dot ( int n, const Nektar::NekDouble * w, const int incw, const Nektar::NekDouble * x, const int incx )
template<class T >
 T Vmath::Dot2 ( int n, const Array< OneD, const T > & w, const Array< OneD, const T > & x, const Array< OneD, const int > & y )

Definition at line 421 of file VmathArray.hpp.

References ASSERTL1, and Dot2().

425  {
426  ASSERTL1(n <= w.num_elements()+w.GetOffset(),"Array out of bounds");
427  ASSERTL1(n <= x.num_elements()+x.GetOffset(),"Array out of bounds");
428  ASSERTL1(n <= y.num_elements()+y.GetOffset(),"Array out of bounds");
429
430  return Dot2(n,&w[0],&x[0],&y[0]);
431  }
T Dot2(int n, const Array< OneD, const T > &w, const Array< OneD, const T > &x, const Array< OneD, const int > &y)
Definition: VmathArray.hpp:421
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 T Vmath::Dot2 ( int n, const T * w, const T * x, const int * y )

vvtvp (vector times vector times vector): z = w*x*y

Definition at line 940 of file Vmath.cpp.

944  {
945  T sum = 0;
946
947  while( n-- )
948  {
949  sum += (*y == 1 ? (*w) * (*x) : 0 );
950  ++w;
951  ++x;
952  ++y;
953  }
954  return sum;
955  }
 template Nektar::NekDouble Vmath::Dot2 ( int n, const Nektar::NekDouble * w, const Nektar::NekDouble * x, const int * y )
template<class T >
 T Vmath::Dot2 ( int n, const T * w, const int incw, const T * x, const int incx, const int * y, const int incy )

vvtvp (vector times vector times vector): z = w*x*y

Definition at line 964 of file Vmath.cpp.

968  {
969  T sum = 0;
970
971  while( n-- )
972  {
973  sum += (*y == 1 ? (*w) * (*x) : 0.0 );
974  w += incw;
975  x += incx;
976  y += incy;
977  }
978  return sum;
979  }
 template Nektar::NekDouble Vmath::Dot2 ( int n, const Nektar::NekDouble * w, const int incw, const Nektar::NekDouble * x, const int incx, const int * y, const int incy )
template<class T >
 void Vmath::Fill ( int n, const T alpha, Array< OneD, T > & x, const int incx )

Fill a vector with a constant value.

Definition at line 48 of file VmathArray.hpp.

References ASSERTL1, and Fill().

49  {
50
51  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Out of bounds");
52
53  Fill(n,alpha,&x[0],incx);
54  }
void Fill(int n, const T alpha, Array< OneD, T > &x, const int incx)
Fill a vector with a constant value.
Definition: VmathArray.hpp:48
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
 template void Vmath::Fill ( int n, const Nektar::NekDouble alpha, Nektar::NekDouble * x, const int incx )
template<class T >
 void Vmath::FillWhiteNoise ( int n, const T eps, Array< OneD, T > & x, const int incx, int outseed )

Definition at line 56 of file VmathArray.hpp.

References ASSERTL1, and FillWhiteNoise().

57  {
58  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Out of bounds");
59
60  FillWhiteNoise(n,eps,&x[0],incx,outseed);
61  }
void FillWhiteNoise(int n, const T eps, Array< OneD, T > &x, const int incx, int outseed)
Definition: VmathArray.hpp:56
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::FillWhiteNoise ( int n, const T eps, T * x, const int incx, int outseed )

Fills a vector with white noise.

Definition at line 138 of file Vmath.cpp.

139  {
140  // Protect the static vars here and in ran2
141  boost::mutex::scoped_lock l(mutex);
142  while( n-- )
143  {
144  static int iset = 0;
145  static T gset;
146  long seed = long(outseed);
147  T fac, rsq, v1, v2;
148
149  if (iset == 0) {
150  do {
151  v1 = 2.0 * ran2<T> (&seed) - 1.0;
152  v2 = 2.0 * ran2<T> (&seed) - 1.0;
153  rsq = v1*v1 + v2*v2;
154  } while (rsq >= 1.0 || rsq == 0.0);
155  fac = sqrt(-2.0 * log (rsq) / rsq);
156  gset = v1 * fac;
157  iset = 1;
158  *x = eps * v2 * fac;
159  } else {
160  iset = 0;
161  *x = eps * gset;
162  }
163  x += incx;
164  }
165  }
static boost::mutex mutex
Definition: Vmath.cpp:134
 template void Vmath::FillWhiteNoise ( int n, const Nektar::NekDouble eps, Nektar::NekDouble * x, const int incx, int outseed )
template<class T >
 void Vmath::Gathr ( int n, const Array< OneD, const T > & x, const Array< OneD, const int > & y, Array< OneD, T > & z )

Gather vector z[i] = x[y[i]].

Definition at line 296 of file VmathArray.hpp.

References ASSERTL1, and Gathr().

297  {
298
299  ASSERTL1(n <= y.num_elements()+y.GetOffset(),"Array out of bounds");
300  ASSERTL1(n <= z.num_elements()+z.GetOffset(),"Array out of bounds");
301
302  Gathr(n,&x[0],&y[0],&z[0]);
303
304  }
void Gathr(int n, const Array< OneD, const T > &x, const Array< OneD, const int > &y, Array< OneD, T > &z)
Gather vector z[i] = x[y[i]].
Definition: VmathArray.hpp:296
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Gathr ( int n, const T * x, const int * y, T * z )

Gather vector z[i] = x[y[i]].

Definition at line 630 of file Vmath.cpp.

632  {
633  while (n--)
634  {
635  *z++ = *(x + *y++);
636  }
637  return;
638  }
 template void Vmath::Gathr ( int n, const Nektar::NekDouble * x, const int * y, Nektar::NekDouble * z )
template<class T >
 void Vmath::Gathr ( int n, const T * sign, const T * x, const int * y, T * z )

Gather vector z[i] = sign[i]*x[y[i]].

Definition at line 645 of file Vmath.cpp.

647  {
648  while (n--)
649  {
650  *z++ = *(sign++) * (*(x + *y++));
651  }
652  return;
653  }
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:22
 template void Vmath::Gathr ( int n, const Nektar::NekDouble * sign, const Nektar::NekDouble * x, const int * y, Nektar::NekDouble * z )
template<class T >
 int Vmath::Iamax ( int n, const Array< OneD, const T > & x, const int incx )

Return the index of the maximum absolute element in x.

Definition at line 355 of file VmathArray.hpp.

References ASSERTL1, and Iamax().

356  {
357  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
358
359  return Iamax(n,&x[0],incx);
360
361  }
int Iamax(int n, const Array< OneD, const T > &x, const int incx)
Return the index of the maximum absolute element in x.
Definition: VmathArray.hpp:355
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 int Vmath::Iamax ( int n, const T * x, const int incx )

Return the index of the maximum absolute element in x.

Definition at line 786 of file Vmath.cpp.

Referenced by Iamax().

787  {
788
789  int i, indx = ( n > 0 ) ? 0 : -1;
790  T xmax = *x;
791  T xm;
792
793  for (i = 0; i < n; i++)
794  {
795  xm = (*x > 0)? *x: -*x;
796  if (xm > xmax)
797  {
798  xmax = xm;
799  indx = i;
800  }
801  x += incx;
802  }
803
804  return indx;
805  }
 template int Vmath::Iamax ( int n, const Nektar::NekDouble * x, const int incx )
template<class T >
 int Vmath::Imax ( int n, const Array< OneD, const T > & x, const int incx )

Return the index of the maximum element in x.

Definition at line 338 of file VmathArray.hpp.

References ASSERTL1, and Imax().

339  {
340  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
341
342  return Imax(n,&x[0],incx);
343  }
int Imax(int n, const Array< OneD, const T > &x, const int incx)
Return the index of the maximum element in x.
Definition: VmathArray.hpp:338
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 int Vmath::Imax ( int n, const T * x, const int incx )

Return the index of the maximum element in x.

Definition at line 741 of file Vmath.cpp.

742  {
743
744  int i, indx = ( n > 0 ) ? 0 : -1;
745  T xmax = *x;
746
747  for (i = 0; i < n; i++)
748  {
749  if (*x > xmax)
750  {
751  xmax = *x;
752  indx = i;
753  }
754  x += incx;
755  }
756
757  return indx;
758  }
 template int Vmath::Imax ( int n, const Nektar::NekDouble * x, const int incx )
 template int Vmath::Imax ( int n, const int * x, const int incx )
template<class T >
 int Vmath::Imin ( int n, const Array< OneD, const T > & x, const int incx )

Return the index of the minimum element in x.

Definition at line 374 of file VmathArray.hpp.

References ASSERTL1, and Imin().

375  {
376  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
377
378  return Imin(n,&x[0],incx);
379  }
int Imin(int n, const Array< OneD, const T > &x, const int incx)
Return the index of the minimum element in x.
Definition: VmathArray.hpp:374
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 int Vmath::Imin ( int n, const T * x, const int incx )

Return the index of the minimum element in x.

Definition at line 833 of file Vmath.cpp.

834  {
835
836  int i, indx = ( n > 0 ) ? 0 : -1;
837  T xmin = *x;
838
839  for(i = 0;i < n;i++)
840  {
841  if( *x < xmin )
842  {
843  xmin = *x;
844  indx = i;
845  }
846  x += incx;
847  }
848
849  return indx;
850  }
 template int Vmath::Imin ( int n, const Nektar::NekDouble * x, const int incx )
 template int Vmath::Imin ( int n, const int * x, const int incx )
template<class T >
 void Vmath::Neg ( int n, Array< OneD, T > & x, const int incx )

Negate x = -x.

Definition at line 154 of file VmathArray.hpp.

References ASSERTL1, and Neg().

155  {
156  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
157
158  Neg(n,&x[0],incx);
159
160  }
void Neg(int n, Array< OneD, T > &x, const int incx)
Negate x = -x.
Definition: VmathArray.hpp:154
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
 template void Vmath::Neg ( int n, Nektar::NekDouble * x, const int incx )
template<class T >
 int Vmath::Nnan ( int n, const Array< OneD, const T > & x, const int incx )

Return number of NaN elements of x.

Definition at line 391 of file VmathArray.hpp.

References ASSERTL1, and Nnan().

392  {
393  ASSERTL1(n * incx <= x.num_elements() + x.GetOffset(), "Array out of bounds");
394
395  return Nnan(n, &x[0], incx);
396  }
int Nnan(int n, const Array< OneD, const T > &x, const int incx)
Return number of NaN elements of x.
Definition: VmathArray.hpp:391
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 int Vmath::Nnan ( int n, const T * x, const int incx )

Return number of NaN elements of x.

Definition at line 878 of file Vmath.cpp.

879  {
880
881  int nNan = 0;
882
883  while (n--)
884  {
885  if (*x != *x)
886  {
887  nNan++;
888  }
889  x += incx;
890  }
891
892  return nNan;
893  }
 template int Vmath::Nnan ( int n, const Nektar::NekDouble * x, const int incx )
 template int Vmath::Nnan ( int n, const float * x, const int incx )
 template int Vmath::Nnan ( int n, const int * x, const int incx )
template<class T >
 T Vmath::ran2 ( long * idum )

Generates a number from ~Normal(0,1)

Definition at line 73 of file Vmath.cpp.

References AM, IA1, IA2, IM1, IM2, IMM1, IQ1, IQ2, IR1, IR2, NDIV, NTAB, and RNMX.

81  {
82  int j;
83  long k;
84  static long idum2=123456789;
85  static long iy=0;
86  static long iv[NTAB];
87  T temp;
88
89  if (*idum <= 0) {
90  if (-(*idum) < 1) *idum = 1;
91  else *idum = -(*idum);
92  idum2 = (*idum);
93  for (j=NTAB+7; j>=0; j--) {
94  k = (*idum) / IQ1;
95  *idum = IA1 * (*idum - k*IQ1) - k*IR1;
96  if (*idum < 0) *idum += IM1;
97  if (j < NTAB) iv[j] = *idum;
98  }
99  iy = iv[0];
100  }
101
102  k = (*idum) / IQ1;
103  *idum = IA1*(*idum - k*IQ1) - k*IR1;
104  if (*idum < 0) *idum += IM1;
105
106  k = idum2 / IQ2;
107  idum2 = IA2*(idum2 - k*IQ2) - k*IR2;
108  if (idum2 < 0) idum2 += IM2;
109
110  j = iy / NDIV;
111  iy = iv[j] - idum2;
112  iv[j] = *idum;
113  if (iy < 1) iy += IMM1;
114
115  if ((temp=AM*iy) > RNMX) return RNMX;
116  else return temp;
117  }
#define IMM1
Definition: Vmath.cpp:60
#define IM1
Definition: Vmath.cpp:57
#define IM2
Definition: Vmath.cpp:58
#define AM
Definition: Vmath.cpp:59
#define IQ1
Definition: Vmath.cpp:63
#define IR1
Definition: Vmath.cpp:65
#define IQ2
Definition: Vmath.cpp:64
#define NTAB
Definition: Vmath.cpp:67
#define IR2
Definition: Vmath.cpp:66
#define IA2
Definition: Vmath.cpp:62
#define IA1
Definition: Vmath.cpp:61
#define RNMX
Definition: Vmath.cpp:70
#define NDIV
Definition: Vmath.cpp:68
template<class T >
 void Vmath::Reverse ( int n, const Array< OneD, const T > & x, int incx, Array< OneD, T > & y, int const incy )

Definition at line 456 of file VmathArray.hpp.

References ASSERTL1, and Reverse().

457  {
458  ASSERTL1(static_cast<unsigned int>(std::abs(n*incx)) <= x.num_elements()+x.GetOffset(),"Array out of bounds");
459  ASSERTL1(static_cast<unsigned int>(std::abs(n*incy)) <= y.num_elements()+y.GetOffset(),"Array out of bounds");
460
461  Reverse(n,&x[0],incx,&y[0],incy);
462  }
void Reverse(int n, const Array< OneD, const T > &x, int incx, Array< OneD, T > &y, int const incy)
Definition: VmathArray.hpp:456
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Reverse ( int n, const T * x, const int incx, T * y, const int incy )

Definition at line 1071 of file Vmath.cpp.

1072  {
1073  int i;
1074  T store;
1075  int nloop = n/2;
1076
1077  // copy value in case of n is odd number
1078  y[nloop] = x[nloop];
1079
1080  for(i = 0; i < nloop; ++i)
1081  {
1082  store = x[n-1-i];
1083  y[n-1-i] = x[i];
1084  y[i] = store;
1085  }
1086  }
 template void Vmath::Reverse ( int n, const Nektar::NekDouble * x, const int incx, Nektar::NekDouble * y, const int incy )
template<class T >
 void Vmath::Sadd ( int n, const T alpha, const Array< OneD, const T > & x, const int incx, Array< OneD, T > & y, const int incy )

Add vector y = alpha + x.

Definition at line 124 of file VmathArray.hpp.

125  {
126
127  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
128  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
129
131  }
void Sadd(int n, const T alpha, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
Add vector y = alpha + x.
Definition: VmathArray.hpp:124
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Sadd ( int n, const T alpha, const T * x, const int incx, T * y, const int incy )

Add vector y = alpha + x.

Definition at line 301 of file Vmath.cpp.

303  {
304  ++n;
305  if (incx == 1 && incy == 1)
306  {
307  while( --n )
308  {
309  *y = alpha + (*x);
310  ++x;
311  ++y;
312  }
313  }
314  else
315  {
316  while( --n )
317  {
318  *y = alpha + (*x);
319  x += incx;
320  y += incy;
321  }
322  }
323  }
 template void Vmath::Sadd ( int n, const Nektar::NekDouble alpha, const Nektar::NekDouble * x, const int incx, Nektar::NekDouble * y, const int incy )
template<class T >
 void Vmath::Scatr ( int n, const Array< OneD, const T > & x, const Array< OneD, const int > & y, Array< OneD, T > & z )

Scatter vector z[y[i]] = x[i].

Definition at line 307 of file VmathArray.hpp.

References ASSERTL1, and Scatr().

308  {
309  ASSERTL1(n <= x.num_elements()+x.GetOffset(),"Array out of bounds");
310  ASSERTL1(n <= y.num_elements()+y.GetOffset(),"Array out of bounds");
311
312  Scatr(n,&x[0],&y[0],&z[0]);
313  }
void Scatr(int n, const Array< OneD, const T > &x, const Array< OneD, const int > &y, Array< OneD, T > &z)
Scatter vector z[y[i]] = x[i].
Definition: VmathArray.hpp:307
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Scatr ( int n, const T * x, const int * y, T * z )

Scatter vector z[y[i]] = x[i].

Definition at line 659 of file Vmath.cpp.

661  {
662  while (n--)
663  {
664  *(z + *(y++)) = *(x++);
665  }
666  }
 template void Vmath::Scatr ( int n, const Nektar::NekDouble * x, const int * y, Nektar::NekDouble * z )
template<class T >
 void Vmath::Scatr ( int n, const T * sign, const T * x, const int * y, T * z )

Scatter vector z[y[i]] = sign[i]*x[i].

Definition at line 672 of file Vmath.cpp.

674  {
675  while (n--)
676  {
677  if(*sign)
678  {
679  *(z + *(y++)) = *(sign++) * (*(x++));
680  }
681  else
682  {
683  x++;
684  y++;
685  sign++;
686  }
687  }
688  }
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:22
 template void Vmath::Scatr ( int n, const Nektar::NekDouble * sign, const Nektar::NekDouble * x, const int * y, Nektar::NekDouble * z )
template<class T >
 void Vmath::Sdiv ( int n, const T alpha, const Array< OneD, const T > & x, const int incx, Array< OneD, T > & y, const int incy )

Scalar multiply y = alpha/y.

Definition at line 104 of file VmathArray.hpp.

References ASSERTL1, and Sdiv().

105  {
106  ASSERTL1(static_cast<unsigned int>(n*incx) <= x.num_elements()+x.GetOffset(),"Array out of bounds");
107  ASSERTL1(static_cast<unsigned int>(n*incy) <= y.num_elements()+y.GetOffset(),"Array out of bounds");
108
109  Sdiv(n,alpha,&x[0],incx,&y[0],incy);
110  }
void Sdiv(int n, const T alpha, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
Scalar multiply y = alpha/y.
Definition: VmathArray.hpp:104
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Sdiv ( int n, const T alpha, const T * x, const int incx, T * y, const int incy )

Scalar multiply y = alpha/y.

Definition at line 257 of file Vmath.cpp.

259  {
260  ++n;
261  if (incx == 1 && incy == 1)
262  {
263  while( --n )
264  {
265  *y = alpha / (*x);
266  ++x;
267  ++y;
268  }
269  }
270  else
271  {
272  while( --n )
273  {
274  *y = alpha / (*x);
275  x += incx;
276  y += incy;
277  }
278  }
279  }
 template void Vmath::Sdiv ( int n, const Nektar::NekDouble alpha, const Nektar::NekDouble * x, const int incx, Nektar::NekDouble * y, const int incy )
template<class T >
 void Vmath::Smul ( int n, const T alpha, const Array< OneD, const T > & x, const int incx, Array< OneD, T > & y, const int incy )

Scalar multiply y = alpha*y.

Definition at line 84 of file VmathArray.hpp.

References ASSERTL1, and Smul().

85  {
86  ASSERTL1(static_cast<unsigned int>(n*incx) <= x.num_elements()+x.GetOffset(),"Array out of bounds");
87  ASSERTL1(static_cast<unsigned int>(n*incy) <= y.num_elements()+y.GetOffset(),"Array out of bounds");
88
89  Smul(n,alpha, &x[0],incx,&y[0],incy);
90  }
void Smul(int n, const T alpha, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
Scalar multiply y = alpha*y.
Definition: VmathArray.hpp:84
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
 template void Vmath::Smul ( int n, const Nektar::NekDouble alpha, const Nektar::NekDouble * x, const int incx, Nektar::NekDouble * y, const int incy )
template<class T >
 void Vmath::Svtsvtp ( int n, const T alpha, const Array< OneD, const T > & x, const int incx, const T beta, const Array< OneD, const T > & y, const int incy, Array< OneD, T > & z, const int incz )

svtsvtp (scalar times vector plus scalar times vector): z = alpha*x + beta*y

Definition at line 281 of file VmathArray.hpp.

References ASSERTL1, and Svtsvtp().

282  {
283  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
284  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
285  ASSERTL1(n*incz <= z.num_elements()+z.GetOffset(),"Array out of bounds");
286
287  Svtsvtp(n,alpha,&x[0],incx,beta,&y[0],incy,&z[0],incz);
288  }
void Svtsvtp(int n, const T alpha, const Array< OneD, const T > &x, const int incx, const T beta, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
svtsvtp (scalar times vector plus scalar times vector): z = alpha*x + beta*y
Definition: VmathArray.hpp:281
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Svtsvtp ( int n, const T alpha, const T * x, int incx, const T beta, const T * y, int incy, T * z, int incz )

vvtvvtp (scalar times vector plus scalar times vector):

Svtsvtp (scalar times vector plus scalar times vector):

Definition at line 577 of file Vmath.cpp.

583  {
584  while( n-- )
585  {
586  *z = alpha * (*x) + beta * (*y);
587  x += incx;
588  y += incy;
589  z += incz;
590  }
591  }
 template void Vmath::Svtsvtp ( int n, const Nektar::NekDouble alpha, const Nektar::NekDouble * x, int incx, const Nektar::NekDouble beta, const Nektar::NekDouble * y, int incy, Nektar::NekDouble * z, int incz )
template<class T >
 void Vmath::Svtvm ( int n, const T alpha, const Array< OneD, const T > & x, const int incx, const Array< OneD, const T > & y, const int incy, Array< OneD, T > & z, const int incz )

svtvp (scalar times vector plus vector): z = alpha*x + y

Definition at line 240 of file VmathArray.hpp.

References ASSERTL1, and Svtvm().

241  {
242  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
243  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
244  ASSERTL1(n*incz <= z.num_elements()+z.GetOffset(),"Array out of bounds");
245
246  Svtvm(n,alpha,&x[0],incx,&y[0],incy,&z[0],incz);
247
248  }
void Svtvm(int n, const T alpha, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: VmathArray.hpp:240
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Svtvm ( int n, const T alpha, const T * x, const int incx, const T * y, const int incy, T * z, const int incz )

svtvp (scalar times vector plus vector): z = alpha*x - y

Definition at line 504 of file Vmath.cpp.

507  {
508  while( n-- )
509  {
510  *z = alpha * (*x) - (*y);
511  x += incx;
512  y += incy;
513  z += incz;
514  }
515  }
 template void Vmath::Svtvm ( int n, const Nektar::NekDouble alpha, const Nektar::NekDouble * x, const int incx, const Nektar::NekDouble * y, const int incy, Nektar::NekDouble * z, const int incz )
template<class T >
 void Vmath::Svtvp ( int n, const T alpha, const Array< OneD, const T > & x, const int incx, const Array< OneD, const T > & y, const int incy, Array< OneD, T > & z, const int incz )

svtvp (scalar times vector plus vector): z = alpha*x + y

Definition at line 229 of file VmathArray.hpp.

References ASSERTL1, and Svtvp().

230  {
231  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
232  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
233  ASSERTL1(n*incz <= z.num_elements()+z.GetOffset(),"Array out of bounds");
234
235  Svtvp(n,alpha,&x[0],incx,&y[0],incy,&z[0],incz);
236
237  }
void Svtvp(int n, const T alpha, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: VmathArray.hpp:229
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Svtvp ( int n, const T alpha, const T * x, const int incx, const T * y, const int incy, T * z, const int incz )

svtvp (scalar times vector plus vector): z = alpha*x + y

Definition at line 471 of file Vmath.cpp.

474  {
475  ++n;
476  if (incx == 1 && incy == 1 && incz == 1)
477  {
478  while( --n )
479  {
480  *z = alpha * (*x) + (*y);
481  ++x;
482  ++y;
483  ++z;
484  }
485  }
486  else
487  {
488  while( --n )
489  {
490  *z = alpha * (*x) + (*y);
491  x += incx;
492  y += incy;
493  z += incz;
494  }
495  }
496  }
 template void Vmath::Svtvp ( int n, const Nektar::NekDouble alpha, const Nektar::NekDouble * x, const int incx, const Nektar::NekDouble * y, const int incy, Nektar::NekDouble * z, const int incz )
template<class T >
 void Vmath::Vabs ( int n, const Array< OneD, const T > & x, const int incx, Array< OneD, T > & y, const int incy )

vabs: y = |x|

Definition at line 197 of file VmathArray.hpp.

References ASSERTL1, and Vabs().

198  {
199  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
200  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
201
202  Vabs(n,&x[0],incx,&y[0],incy);
203  }
void Vabs(int n, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
vabs: y = |x|
Definition: VmathArray.hpp:197
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Vabs ( int n, const T * x, const int incx, T * y, const int incy )

vabs: y = |x|

Definition at line 410 of file Vmath.cpp.

412  {
413  while( n-- )
414  {
415  *y = ( *x >0)? *x:-(*x);
416  x += incx;
417  y += incy;
418  }
419  }
 template void Vmath::Vabs ( int n, const Nektar::NekDouble * x, const int incx, Nektar::NekDouble * y, const int incy )
template<class T >
 void Vmath::Vadd ( int n, const Array< OneD, const T > & x, const int incx, const Array< OneD, const T > & y, const int incy, Array< OneD, T > & z, const int incz )

Definition at line 113 of file VmathArray.hpp.

114  {
115
116  ASSERTL1(static_cast<unsigned int>(n*incx) <= x.num_elements()+x.GetOffset(),"Array out of bounds");
117  ASSERTL1(static_cast<unsigned int>(n*incy) <= y.num_elements()+y.GetOffset(),"Array out of bounds");
118  ASSERTL1(static_cast<unsigned int>(n*incz) <= z.num_elements()+z.GetOffset(),"Array out of bounds");
119
121  }
void Vadd(int n, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
Definition: VmathArray.hpp:113
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
 template void Vmath::Vadd ( int n, const Nektar::NekDouble * x, const int incx, const Nektar::NekDouble * y, const int incy, Nektar::NekDouble * z, const int incz )
template<class T >
 T Vmath::Vamax ( int n, const Array< OneD, const T > & x, const int incx )

Return the maximum absolute element in x called vamax to avoid conflict with max.

Definition at line 365 of file VmathArray.hpp.

References ASSERTL1, and Vamax().

366  {
367  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
368
369  return Vamax(n,&x[0],incx);
370  }
T Vamax(int n, const Array< OneD, const T > &x, const int incx)
Return the maximum absolute element in x called vamax to avoid conflict with max. ...
Definition: VmathArray.hpp:365
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 T Vmath::Vamax ( int n, const T * x, const int incx )

Return the maximum absolute element in x called vamax to avoid conflict with max.

Definition at line 811 of file Vmath.cpp.

Referenced by Nektar::StdRegions::StdExpansion::Linf(), and Vamax().

812  {
813
814  T xmax = *x;
815  T xm;
816
817  while( n-- )
818  {
819  xm = (*x > 0)? *x: -*x;
820  if (xm > xmax)
821  {
822  xmax = xm;
823  }
824  x += incx;
825  }
826  return xmax;
827  }
 template Nektar::NekDouble Vmath::Vamax ( int n, const Nektar::NekDouble * x, const int incx )
template<class T >
 void Vmath::Vcopy ( int n, const Array< OneD, const T > & x, int incx, Array< OneD, T > & y, int const incy )

Definition at line 448 of file VmathArray.hpp.

References ASSERTL1, and Vcopy().

449  {
450  ASSERTL1(static_cast<unsigned int>(std::abs(n*incx)) <= x.num_elements()+x.GetOffset(),"Array out of bounds");
451  ASSERTL1(static_cast<unsigned int>(std::abs(n*incy)) <= y.num_elements()+y.GetOffset(),"Array out of bounds");
452
453  Vcopy(n,&x[0],incx,&y[0],incy);
454  }
void Vcopy(int n, const Array< OneD, const T > &x, int incx, Array< OneD, T > &y, int const incy)
Definition: VmathArray.hpp:448
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
 template void Vmath::Vcopy ( int n, const int * x, const int incx, int * y, const int incy )
 template void Vmath::Vcopy ( int n, const unsigned int * x, const int incx, unsigned int * y, const int incy )
 template void Vmath::Vcopy ( int n, const Nektar::NekDouble * x, const int incx, Nektar::NekDouble * y, const int incy )
template<class T >
 void Vmath::Vdiv ( int n, const Array< OneD, const T > & x, const int incx, const Array< OneD, const T > & y, const int incy, Array< OneD, T > & z, const int incz )

Multiply vector z = x/y.

Definition at line 93 of file VmathArray.hpp.

References ASSERTL1, and Vdiv().

94  {
95  ASSERTL1(static_cast<unsigned int>(n*incx) <= x.num_elements()+x.GetOffset(),"Array out of bounds");
96  ASSERTL1(static_cast<unsigned int>(n*incy) <= y.num_elements()+y.GetOffset(),"Array out of bounds");
97  ASSERTL1(static_cast<unsigned int>(n*incz) <= z.num_elements()+z.GetOffset(),"Array out of bounds");
98
99  Vdiv(n,&x[0],incx,&y[0],incy,&z[0],incz);
100
101  }
void Vdiv(int n, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
Multiply vector z = x/y.
Definition: VmathArray.hpp:93
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Vdiv ( int n, const T * x, const int incx, const T * y, const int incy, T * z, const int incz )

Multiply vector z = x/y.

Definition at line 227 of file Vmath.cpp.

229  {
230  ++n;
231  if (incx == 1 && incy == 1)
232  {
233  while( --n )
234  {
235  *z = (*x) / (*y);
236  ++x;
237  ++y;
238  ++z;
239  }
240  }
241  else
242  {
243  while( --n )
244  {
245  *z = (*x) / (*y);
246  x += incx;
247  y += incy;
248  z += incz;
249  }
250  }
251  }
 template void Vmath::Vdiv ( int n, const Nektar::NekDouble * x, const int incx, const Nektar::NekDouble * y, const int incy, Nektar::NekDouble * z, const int incz )
template<class T >
 void Vmath::Vexp ( int n, const T * x, const int incx, T * y, const int incy )

Definition at line 107 of file Vmath.hpp.

109  {
110  while (n--)
111  {
112  *y = exp( *x );
113  x += incx;
114  y += incy;
115  }
116  }
template<class T >
 void Vmath::Vexp ( int n, const Array< OneD, const T > & x, const int incx, Array< OneD, T > & y, const int incy )

Definition at line 171 of file VmathArray.hpp.

References ASSERTL1, and Vexp().

172  {
173  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
174  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
175
176  Vexp(n, &x[0], incx, &y[0], incy);
177  }
void Vexp(int n, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
Definition: VmathArray.hpp:171
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Vlog ( int n, const T * x, const int incx, T * y, const int incy )

Definition at line 95 of file Vmath.hpp.

Referenced by Nektar::CourtemancheRamirezNattel98::v_Update(), and Vlog().

97  {
98  while (n--)
99  {
100  *y = log( *x );
101  x += incx;
102  y += incy;
103  }
104  }
template<class T >
 void Vmath::Vlog ( int n, const Array< OneD, const T > & x, const int incx, Array< OneD, T > & y, const int incy )

Definition at line 162 of file VmathArray.hpp.

References ASSERTL1, and Vlog().

163  {
164  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
165  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
166
167  Vlog(n, &x[0], incx, &y[0], incy);
168  }
void Vlog(int n, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
Definition: VmathArray.hpp:162
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 T Vmath::Vmax ( int n, const Array< OneD, const T > & x, const int incx )

Return the maximum element in x – called vmax to avoid conflict with max.

Definition at line 347 of file VmathArray.hpp.

References ASSERTL1, and Vmax().

348  {
349  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
350
351  return Vmax(n,&x[0],incx);
352  }
T Vmax(int n, const Array< OneD, const T > &x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
Definition: VmathArray.hpp:347
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 T Vmath::Vmax ( int n, const T * x, const int incx )

Return the maximum element in x – called vmax to avoid conflict with max.

Definition at line 765 of file Vmath.cpp.

766  {
767
768  T xmax = *x;
769
770  while( n-- )
771  {
772  if (*x > xmax)
773  {
774  xmax = *x;
775  }
776  x += incx;
777  }
778
779  return xmax;
780  }
 template Nektar::NekDouble Vmath::Vmax ( int n, const Nektar::NekDouble * x, const int incx )
 template int Vmath::Vmax ( int n, const int * x, const int incx )
template<class T >
 T Vmath::Vmin ( int n, const Array< OneD, const T > & x, const int incx )

Return the minimum element in x - called vmin to avoid conflict with min.

Definition at line 383 of file VmathArray.hpp.

References ASSERTL1, and Vmin().

384  {
385  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
386
387  return Vmin(n,&x[0],incx);
388  }
T Vmin(int n, const Array< OneD, const T > &x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
Definition: VmathArray.hpp:383
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 T Vmath::Vmin ( int n, const T * x, const int incx )

Return the minimum element in x - called vmin to avoid conflict with min.

Definition at line 857 of file Vmath.cpp.

858  {
859
860  T xmin = *x;
861
862  while( n-- )
863  {
864  if (*x < xmin)
865  {
866  xmin = *x;
867  }
868  x += incx;
869  }
870
871  return xmin;
872  }
 template Nektar::NekDouble Vmath::Vmin ( int n, const Nektar::NekDouble * x, const int incx )
 template int Vmath::Vmin ( int n, const int * x, const int incx )
template<class T >
 void Vmath::Vmul ( int n, const Array< OneD, const T > & x, const int incx, const Array< OneD, const T > & y, const int incy, Array< OneD, T > & z, const int incz )

Multiply vector z = x*y.

Definition at line 64 of file VmathArray.hpp.

References ASSERTL1, and Vmul().

65  {
66  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
67  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
68  ASSERTL1(n*incz <= z.num_elements()+z.GetOffset(),"Array out of bounds");
69
70  Vmul(n,&x[0],incx,&y[0],incy,&z[0],incz);
71  }
void Vmul(int n, const Array< TwoD, NekDouble >::const_reference &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
Definition: VmathArray.hpp:73
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Vmul ( int n, const Array< TwoD, NekDouble >::const_reference & x, const int incx, const Array< OneD, const T > & y, const int incy, Array< OneD, T > & z, const int incz )

Definition at line 73 of file VmathArray.hpp.

References ASSERTL1, and Vmul().

74  {
75  ASSERTL1(n*incx <= x.num_elements(),"Array out of bounds");
76  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
77  ASSERTL1(n*incz <= z.num_elements()+z.GetOffset(),"Array out of bounds");
78
79  Vmul(n,x.origin(),incx,&y[0],incy,&z[0],incz);
80  }
void Vmul(int n, const Array< TwoD, NekDouble >::const_reference &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
Definition: VmathArray.hpp:73
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
 template void Vmath::Vmul ( int n, const Nektar::NekDouble * x, const int incx, const Nektar::NekDouble * y, const int incy, Nektar::NekDouble * z, const int incz )
template<class T >
 void Vmath::Vpow ( int n, const T * x, const int incx, const T f, T * y, const int incy )

Definition at line 118 of file Vmath.hpp.

Referenced by Nektar::CourtemancheRamirezNattel98::v_Update(), and Vpow().

120  {
121  while (n--)
122  {
123  *y = pow( *x, f );
124  x += incx;
125  y += incy;
126  }
127  }
template<class T >
 void Vmath::Vpow ( int n, const Array< OneD, const T > & x, const int incx, const T f, Array< OneD, T > & y, const int incy )

Definition at line 179 of file VmathArray.hpp.

References ASSERTL1, and Vpow().

180  {
181  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
182  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
183
184  Vpow(n, &x[0], incx, f, &y[0], incy);
185  }
void Vpow(int n, const Array< OneD, const T > &x, const int incx, const T f, Array< OneD, T > &y, const int incy)
Definition: VmathArray.hpp:179
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Vsqrt ( int n, const Array< OneD, const T > & x, const int incx, Array< OneD, T > & y, const int incy )

sqrt y = sqrt(x)

Definition at line 188 of file VmathArray.hpp.

References ASSERTL1, and Vsqrt().

189  {
190  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
191  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
192
193  Vsqrt(n,&x[0],incx,&y[0],incy);
194  }
void Vsqrt(int n, const Array< OneD, const T > &x, const int incx, Array< OneD, T > &y, const int incy)
sqrt y = sqrt(x)
Definition: VmathArray.hpp:188
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Vsqrt ( int n, const T * x, const int incx, T * y, const int incy )
 template void Vmath::Vsqrt ( int n, const Nektar::NekDouble * x, const int incx, Nektar::NekDouble * y, const int incy )
template<class T >
 void Vmath::Vstvpp ( int n, const T alpha, const T * v, int incv, const T * w, int incw, const T * x, int incx, T * z, int incz )

Vstvpp (scalar times vector plus vector plus vector):

Definition at line 603 of file Vmath.cpp.

609  {
610  while( n-- )
611  {
612  *z = alpha * (*v) + (*w) + (*x);
613  v += incv;
614  w += incw;
615  x += incx;
616  z += incz;
617  }
618  }
 template void Vmath::Vstvpp ( int n, const Nektar::NekDouble alpha, const Nektar::NekDouble * v, int incv, const Nektar::NekDouble * w, int incw, const Nektar::NekDouble * x, int incx, Nektar::NekDouble * z, int incz )
template<class T >
 void Vmath::Vsub ( int n, const Array< OneD, const T > & x, const int incx, const Array< OneD, const T > & y, const int incy, Array< OneD, T > & z, const int incz )

Subtract vector z = x-y.

Definition at line 134 of file VmathArray.hpp.

References ASSERTL1, and Vsub().

135  {
136  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
137  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
138  ASSERTL1(n*incz <= z.num_elements()+z.GetOffset(),"Array out of bounds");
139
140  Vsub(n,&x[0],incx,&y[0],incy,&z[0],incz);
141
142  }
void Vsub(int n, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
Subtract vector z = x-y.
Definition: VmathArray.hpp:134
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Vsub ( int n, const T * x, const int incx, const T * y, const int incy, T * z, const int incz )
 template void Vmath::Vsub ( int n, const Nektar::NekDouble * x, const int incx, const Nektar::NekDouble * y, const int incy, Nektar::NekDouble * z, const int incz )
template<class T >
 T Vmath::Vsum ( int n, const Array< OneD, const T > & x, const int incx )

Subtract return sum(x)

Definition at line 329 of file VmathArray.hpp.

References ASSERTL1, and Vsum().

330  {
331  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
332
333  return Vsum(n,&x[0],incx);
334  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
T Vsum(int n, const Array< OneD, const T > &x, const int incx)
Subtract return sum(x)
Definition: VmathArray.hpp:329
template<class T >
 T Vmath::Vsum ( int n, const T * x, const int incx )

Subtract return sum(x)

Definition at line 723 of file Vmath.cpp.

724  {
725
726  T sum = 0;
727
728  while( n-- )
729  {
730  sum += (*x);
731  x += incx;
732  }
733
734  return sum;
735  }
 template Nektar::NekDouble Vmath::Vsum ( int n, const Nektar::NekDouble * x, const int incx )
 template int Vmath::Vsum ( int n, const int * x, const int incx )
template<class T >
 void Vmath::Vvtvm ( int n, const Array< OneD, const T > & w, const int incw, const Array< OneD, const T > & x, const int incx, const Array< OneD, const T > & y, const int incy, Array< OneD, T > & z, const int incz )

vvtvm (vector times vector minus vector): z = w*x - y

Definition at line 251 of file VmathArray.hpp.

References ASSERTL1, and Vvtvm().

252  {
253  ASSERTL1(n*incw <= w.num_elements()+w.GetOffset(),"Array out of bounds");
254  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
255  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
256  ASSERTL1(n*incz <= z.num_elements()+z.GetOffset(),"Array out of bounds");
257
258  Vvtvm(n,&w[0],incw,&x[0],incx,&y[0],incy,&z[0],incz);
259
260  }
void Vvtvm(int n, const Array< OneD, const T > &w, const int incw, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
vvtvm (vector times vector minus vector): z = w*x - y
Definition: VmathArray.hpp:251
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Vvtvm ( int n, const T * w, const int incw, const T * x, const int incx, const T * y, const int incy, T * z, const int incz )

vvtvm (vector times vector plus vector): z = w*x - y

Definition at line 451 of file Vmath.cpp.

454  {
455  while( n-- )
456  {
457  *z = (*w) * (*x) - (*y);
458  w += incw;
459  x += incx;
460  y += incy;
461  z += incz;
462  }
463  }
 template void Vmath::Vvtvm ( int n, const Nektar::NekDouble * w, const int incw, const Nektar::NekDouble * x, const int incx, const Nektar::NekDouble * y, const int incy, Nektar::NekDouble * z, const int incz )
template<class T >
 void Vmath::Vvtvp ( int n, const Array< OneD, const T > & w, const int incw, const Array< OneD, const T > & x, const int incx, const Array< OneD, const T > & y, const int incy, Array< OneD, T > & z, const int incz )

vvtvp (vector times vector plus vector): z = w*x + y

Definition at line 208 of file VmathArray.hpp.

References ASSERTL1, and Vvtvp().

209  {
210  ASSERTL1(n*incw <= w.num_elements()+w.GetOffset(),"Array out of bounds");
211  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
212  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
213  ASSERTL1(n*incz <= z.num_elements()+z.GetOffset(),"Array out of bounds");
214
215  Vvtvp(n,&w[0],incw,&x[0],incx,&y[0],incy,&z[0],incz);
216  }
void Vvtvp(int n, const Array< TwoD, NekDouble >::const_reference &w, const int incw, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
Definition: VmathArray.hpp:218
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Vvtvp ( int n, const Array< TwoD, NekDouble >::const_reference & w, const int incw, const Array< OneD, const T > & x, const int incx, const Array< OneD, const T > & y, const int incy, Array< OneD, T > & z, const int incz )

Definition at line 218 of file VmathArray.hpp.

References ASSERTL1, and Vvtvp().

219  {
220  ASSERTL1(n*incw <= w.num_elements(),"Array out of bounds");
221  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
222  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
223  ASSERTL1(n*incz <= z.num_elements()+z.GetOffset(),"Array out of bounds");
224
225  Vvtvp(n,w.origin(),incw,&x[0],incx,&y[0],incy,&z[0],incz);
226  }
void Vvtvp(int n, const Array< TwoD, NekDouble >::const_reference &w, const int incw, const Array< OneD, const T > &x, const int incx, const Array< OneD, const T > &y, const int incy, Array< OneD, T > &z, const int incz)
Definition: VmathArray.hpp:218
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
 template void Vmath::Vvtvp ( int n, const Nektar::NekDouble * w, const int incw, const Nektar::NekDouble * x, const int incx, const Nektar::NekDouble * y, const int incy, Nektar::NekDouble * z, const int incz )
template<class T >
 void Vmath::Vvtvvtm ( int n, const T * v, int incv, const T * w, int incw, const T * x, int incx, const T * y, int incy, T * z, int incz )

vvtvvtm (vector times vector minus vector times vector):

Definition at line 550 of file Vmath.cpp.

556  {
557  while( n-- )
558  {
559  *z = (*v) * (*w) - (*x) * (*y);
560  v += incv;
561  w += incw;
562  x += incx;
563  y += incy;
564  z += incz;
565  }
566  }
 template void Vmath::Vvtvvtm ( int n, const Nektar::NekDouble * v, int incv, const Nektar::NekDouble * w, int incw, const Nektar::NekDouble * x, int incx, const Nektar::NekDouble * y, int incy, Nektar::NekDouble * z, int incz )
template<class T >
 void Vmath::Vvtvvtp ( int n, const Array< OneD, const T > & v, int incv, const Array< OneD, const T > & w, int incw, const Array< OneD, const T > & x, int incx, const Array< OneD, const T > & y, int incy, Array< OneD, T > & z, int incz )

vvtvvtp (vector times vector plus vector times vector): z = v*w + y*z

Definition at line 263 of file VmathArray.hpp.

References ASSERTL1, and Vvtvvtp().

270  {
271  ASSERTL1(n*incv <= v.num_elements()+v.GetOffset(),"Array out of bounds");
272  ASSERTL1(n*incw <= w.num_elements()+w.GetOffset(),"Array out of bounds");
273  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
274  ASSERTL1(n*incy <= y.num_elements()+y.GetOffset(),"Array out of bounds");
275  ASSERTL1(n*incz <= z.num_elements()+z.GetOffset(),"Array out of bounds");
276
277  Vvtvvtp(n,&v[0],incv,&w[0],incw,&x[0],incx,&y[0],incy,&z[0],incz);
278  }
void Vvtvvtp(int n, const Array< OneD, const T > &v, int incv, const Array< OneD, const T > &w, int incw, const Array< OneD, const T > &x, int incx, const Array< OneD, const T > &y, int incy, Array< OneD, T > &z, int incz)
vvtvvtp (vector times vector plus vector times vector): z = v*w + y*z
Definition: VmathArray.hpp:263
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<class T >
 void Vmath::Vvtvvtp ( int n, const T * v, int incv, const T * w, int incw, const T * x, int incx, const T * y, int incy, T * z, int incz )

vvtvvtp (vector times vector plus vector times vector):

Definition at line 523 of file Vmath.cpp.

529  {
530  while( n-- )
531  {
532  *z = (*v) * (*w) + (*x) * (*y);
533  v += incv;
534  w += incw;
535  x += incx;
536  y += incy;
537  z += incz;
538  }
539  }
 template void Vmath::Vvtvvtp ( int n, const Nektar::NekDouble * v, int incv, const Nektar::NekDouble * w, int incw, const Nektar::NekDouble * x, int incx, const Nektar::NekDouble * y, int incy, Nektar::NekDouble * z, int incz )
template<class T >
 void Vmath::Zero ( int n, Array< OneD, T > & x, const int incx )

Zero vector.

Definition at line 145 of file VmathArray.hpp.

References ASSERTL1, and Zero().

146  {
147  ASSERTL1(n*incx <= x.num_elements()+x.GetOffset(),"Array out of bounds");
148
149  Zero(n,&x[0],incx);
150
151  }
void Zero(int n, Array< OneD, T > &x, const int incx)
Zero vector.
Definition: VmathArray.hpp:145
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
 template void Vmath::Zero ( int n, Nektar::NekDouble * x, const int incx )
 template void Vmath::Zero ( int n, int * x, const int incx )
 template void Vmath::Zero ( int n, long * x, const int incx )

Variable Documentation

 boost::mutex Vmath::mutex
static

Definition at line 134 of file Vmath.cpp.