Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Macros | Functions | Variables
Vmath.cpp File Reference
#include <LibUtilities/BasicUtils/Vmath.hpp>
#include <LibUtilities/BasicConst/NektarUnivTypeDefs.hpp>
#include <LibUtilities/LibUtilitiesDeclspec.h>
Include dependency graph for Vmath.cpp:

Go to the source code of this file.

Namespaces

 Vmath
 

Macros

#define IM1   2147483563
 
#define IM2   2147483399
 
#define AM   (1.0/IM1)
 
#define IMM1   (IM1-1)
 
#define IA1   40014
 
#define IA2   40692
 
#define IQ1   53668
 
#define IQ2   52774
 
#define IR1   12211
 
#define IR2   3791
 
#define NTAB   32
 
#define NDIV   (1+IMM1/NTAB)
 
#define EPS   1.2e-7
 
#define RNMX   (1.0-EPS)
 

Functions

template<class T >
void Vmath::Fill (int n, const T alpha, T *x, const int incx)
 Fill a vector with a constant value. More...
 
template void Vmath::Fill (int n, const Nektar::NekDouble alpha, Nektar::NekDouble *x, const int incx)
 
template<class T >
Vmath::ran2 (long *idum)
 Generates a number from ~Normal(0,1) More...
 
template<class T >
void Vmath::FillWhiteNoise (int n, const T eps, T *x, const int incx, int outseed)
 Fills a vector with white noise. More...
 
template void Vmath::FillWhiteNoise (int n, const Nektar::NekDouble eps, Nektar::NekDouble *x, const int incx, int outseed)
 
template<class T >
void Vmath::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 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::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 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::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 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::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 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::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 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 >
void Vmath::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 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::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 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 >
void Vmath::Zero (int n, T *x, const int incx)
 Zero vector. More...
 
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)
 
template<class T >
void Vmath::Neg (int n, T *x, const int incx)
 Negate x = -x. More...
 
template void Vmath::Neg (int n, Nektar::NekDouble *x, const int incx)
 
template<class T >
void Vmath::Vsqrt (int n, const T *x, const int incx, T *y, const int incy)
 sqrt y = sqrt(x) More...
 
template void Vmath::Vsqrt (int n, const Nektar::NekDouble *x, const int incx, Nektar::NekDouble *y, const int incy)
 
template<class T >
void Vmath::Vabs (int n, const T *x, const int incx, T *y, const int incy)
 vabs: y = |x| More...
 
template void Vmath::Vabs (int n, const Nektar::NekDouble *x, const int incx, Nektar::NekDouble *y, const int incy)
 
template<class T >
void Vmath::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 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::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 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::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 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::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 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::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 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::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 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::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 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::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 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::Gathr (int n, const T *x, const int *y, T *z)
 Gather vector z[i] = x[y[i]]. More...
 
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]]. More...
 
template void Vmath::Gathr (int n, const Nektar::NekDouble *sign, const Nektar::NekDouble *x, const int *y, Nektar::NekDouble *z)
 
template<class T >
void Vmath::Scatr (int n, const T *x, const int *y, T *z)
 Scatter vector z[y[i]] = x[i]. More...
 
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]. More...
 
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::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 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. More...
 
template void Vmath::Assmb (int n, const Nektar::NekDouble *sign, const Nektar::NekDouble *x, const int *y, Nektar::NekDouble *z)
 
template<class T >
Vmath::Vsum (int n, const T *x, const int incx)
 Subtract return sum(x) More...
 
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 >
int Vmath::Imax (int n, const T *x, const int incx)
 Return the index of the maximum element in x. More...
 
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 >
Vmath::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 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 >
int Vmath::Iamax (int n, const T *x, const int incx)
 Return the index of the maximum absolute element in x. More...
 
template int Vmath::Iamax (int n, const Nektar::NekDouble *x, const int incx)
 
template<class 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. More...
 
template Nektar::NekDouble Vmath::Vamax (int n, const Nektar::NekDouble *x, const int incx)
 
template<class T >
int Vmath::Imin (int n, const T *x, const int incx)
 Return the index of the minimum element in x. More...
 
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 >
Vmath::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 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 >
int Vmath::Nnan (int n, const T *x, const int incx)
 Return number of NaN elements of x. More...
 
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 >
Vmath::Dot (int n, const T *w, const T *x)
 vvtvp (vector times vector times vector): z = w*x*y More...
 
template Nektar::NekDouble Vmath::Dot (int n, const Nektar::NekDouble *w, const Nektar::NekDouble *x)
 
template<class 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 More...
 
template Nektar::NekDouble Vmath::Dot (int n, const Nektar::NekDouble *w, const int incw, const Nektar::NekDouble *x, const int incx)
 
template<class T >
Vmath::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 Vmath::Dot2 (int n, const Nektar::NekDouble *w, const Nektar::NekDouble *x, const int *y)
 
template<class 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 More...
 
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<typename T >
void Vmath::Vcopy (int n, const T *x, const int incx, T *y, const int incy)
 
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::Reverse (int n, const T *x, const int incx, T *y, const int incy)
 
template void Vmath::Reverse (int n, const Nektar::NekDouble *x, const int incx, Nektar::NekDouble *y, const int incy)
 

Variables

static boost::mutex Vmath::mutex
 

Macro Definition Documentation

#define AM   (1.0/IM1)

Definition at line 59 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define EPS   1.2e-7

Definition at line 69 of file Vmath.cpp.

#define IA1   40014

Definition at line 61 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define IA2   40692

Definition at line 62 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define IM1   2147483563

Definition at line 57 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define IM2   2147483399

Definition at line 58 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define IMM1   (IM1-1)

Definition at line 60 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define IQ1   53668

Definition at line 63 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define IQ2   52774

Definition at line 64 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define IR1   12211

Definition at line 65 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define IR2   3791

Definition at line 66 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define NDIV   (1+IMM1/NTAB)

Definition at line 68 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define NTAB   32

Definition at line 67 of file Vmath.cpp.

Referenced by Vmath::ran2().

#define RNMX   (1.0-EPS)

Definition at line 70 of file Vmath.cpp.

Referenced by Vmath::ran2().