Go to the documentation of this file.
19 #ifndef __PASO_UTIL_H__
20 #define __PASO_UTIL_H__
47 int comparIndex(
const void* index1,
const void* index2);
82 void update(
dim_t N,
double a,
double* x,
double b,
const double* y);
100 inline void AXPY(
dim_t N,
double* x,
double a,
const double* y)
108 return (a>=0 && b>=0) || (a<=0 && b<=0);
114 #endif // __PASO_UTIL_H__
index_t iMax(dim_t N, const index_t *array)
returns the maximum value in integer array
Definition: PasoUtil.cpp:65
index_t arg_max(dim_t n, dim_t *lambda)
returns the index to the largest entry in lambda
Definition: PasoUtil.cpp:269
static dim_t N
Definition: SparseMatrix_saveHB.cpp:37
double lsup(dim_t n, const double *x, escript::JMPI mpiinfo)
returns the global Lsup of x
Definition: PasoUtil.cpp:466
index_t index_t_min()
Returns the minimum finite value for the index_t type.
Definition: DataTypes.h:72
index_t cumsum(dim_t N, index_t *array)
calculates the cumulative sum in array and returns the total sum
Definition: PasoUtil.cpp:86
#define MPI_SUM
Definition: EsysMPI.h:54
bool samesign(double a, double b)
returns true if both arguments have the same sign, false otherwise
Definition: PasoUtil.h:106
void AXPY(dim_t N, double *x, double a, const double *y)
x = x+a*y
Definition: PasoUtil.h:100
dim_t numPositives(dim_t N, const double *x, escript::JMPI mpiInfo)
returns the number of positive values in x
Definition: PasoUtil.cpp:39
#define MPI_MAX
Definition: EsysMPI.h:56
void applyGivensRotations(dim_t n, double *v, const double *c, const double *s)
Definition: PasoUtil.cpp:536
index_t cumsum_maskedTrue(dim_t N, index_t *array, int *mask)
Definition: PasoUtil.cpp:139
void copy(dim_t N, double *out, const double *in)
out = in
Definition: PasoUtil.h:88
void update(dim_t n, double a, double *x, double b, const double *y)
Definition: PasoUtil.cpp:339
double l2(dim_t n, const double *x, escript::JMPI mpiinfo)
returns the global L2 norm of x
Definition: PasoUtil.cpp:501
int comparIndex(const void *index1, const void *index2)
this int-comparison function is used by qsort/bsearch in various places
Definition: PasoUtil.cpp:25
index_t dim_t
Definition: DataTypes.h:66
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:74
index_t cumsum_maskedFalse(dim_t N, index_t *array, int *mask)
Definition: PasoUtil.cpp:204
void linearCombination(dim_t n, double *z, double a, const double *x, double b, const double *y)
Definition: PasoUtil.cpp:388
#define MPI_DOUBLE
Definition: EsysMPI.h:49
void scale(dim_t N, double *x, double a)
x = a*x
Definition: PasoUtil.h:94
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:61
void zeroes(dim_t n, double *x)
fills array x with zeroes
Definition: PasoUtil.cpp:319
bool isAny(dim_t N, const index_t *array, index_t value)
returns true if array contains value
Definition: PasoUtil.cpp:30
Definition: BiCGStab.cpp:25
double innerProduct(dim_t n, const double *x, const double *y, escript::JMPI mpiinfo)
returns the inner product of global arrays x and y
Definition: PasoUtil.cpp:428