escript
Revision_
|
Functions | |
int | comparIndex (const void *index1, const void *index2) |
this int-comparison function is used by qsort/bsearch in various places | |
bool | isAny (dim_t N, index_t *array, index_t value) |
returns true if array contains value | |
dim_t | numPositives (dim_t N, const double *x) |
returns the number of positive values in x | |
index_t | iMax (dim_t N, const index_t *array) |
returns the maximum value in integer array | |
index_t | cumsum (dim_t N, index_t *array) |
calculates the cumulative sum in array and returns the total sum | |
index_t | cumsum_maskedTrue (dim_t N, index_t *array, int *mask) |
index_t | cumsum_maskedFalse (dim_t N, index_t *array, int *mask) |
index_t | arg_max (dim_t N, dim_t *lambda) |
returns the index to the largest entry in lambda | |
void | zeroes (dim_t N, double *x) |
fills array x with zeroes | |
void | update (dim_t n, double a, double *x, double b, const double *y) |
void | linearCombination (dim_t n, double *z, double a, const double *x, double b, const double *y) |
double | innerProduct (dim_t N, const double *x, const double *y, Esys_MPIInfo *mpiinfo) |
returns the inner product of global arrays x and y | |
double | lsup (dim_t N, const double *x, Esys_MPIInfo *mpiinfo) |
returns the global Lsup of x | |
double | l2 (dim_t N, const double *x, Esys_MPIInfo *mpiinfo) |
returns the global L2 norm of x | |
void | applyGivensRotations (dim_t n, double *v, const double *c, const double *s) |
void | copy (dim_t N, double *out, const double *in) |
out = in | |
void | scale (dim_t N, double *x, double a) |
x = a*x | |
void | AXPY (dim_t N, double *x, double a, const double *y) |
x = x+a*y | |
bool | samesign (double a, double b) |
returns true if both arguments have the same sign, false otherwise |
void paso::util::applyGivensRotations | ( | dim_t | N, |
double * | v, | ||
const double * | c, | ||
const double * | s | ||
) |
Applies a sequence of N-1 Givens rotations (c,s) to v of length N which is assumed to be small.
Referenced by paso::Solver_GMRES2().
index_t paso::util::arg_max | ( | dim_t | n, |
dim_t * | lambda | ||
) |
returns the index to the largest entry in lambda
References omp_get_max_threads.
Referenced by paso::Preconditioner_LocalAMG_RungeStuebenSearch().
void paso::util::AXPY | ( | dim_t | N, |
double * | x, | ||
double | a, | ||
const double * | y | ||
) | [inline] |
x = x+a*y
References update().
Referenced by paso::Preconditioner_LocalSmoother_solve(), paso::Preconditioner_Smoother_solve(), paso::Preconditioner_Smoother_solve_byTolerance(), and paso::Solver_MINRES().
int paso::util::comparIndex | ( | const void * | index1, |
const void * | index2 | ||
) |
this int-comparison function is used by qsort/bsearch in various places
Referenced by paso::Pattern::borrowMainDiagonalPointer(), paso::SystemMatrix::extendedRowsForST(), paso::SparseMatrix::getTranspose(), paso::Pattern::Pattern(), paso::Preconditioner_AMG_buildInterpolationOperator(), paso::Preconditioner_AMG_buildInterpolationOperatorBlock(), paso::Preconditioner_AMG_CIJPCoarsening(), paso::Preconditioner_AMG_getRestriction(), paso::Preconditioner_AMG_setClassicProlongation(), paso::Preconditioner_AMG_setClassicProlongation_Block(), paso::Preconditioner_AMG_setDirectProlongation(), paso::Preconditioner_AMG_setDirectProlongation_Block(), paso::Preconditioner_LocalAMG_enforceFFConnectivity(), paso::Preconditioner_LocalAMG_setClassicProlongation(), paso::Preconditioner_LocalAMG_setClassicProlongation_Block(), paso::Preconditioner_LocalAMG_setDirectProlongation(), paso::Preconditioner_LocalAMG_setDirectProlongation_Block(), paso::Solver_getRILU(), paso::Solver_updateIncompleteSchurComplement(), paso::SparseMatrix_MatrixMatrix_BB(), paso::SparseMatrix_MatrixMatrix_BD(), paso::SparseMatrix_MatrixMatrix_DB(), paso::SparseMatrix_MatrixMatrix_DD(), and paso::SparseMatrix::unroll().
void paso::util::copy | ( | dim_t | N, |
double * | out, | ||
const double * | in | ||
) | [inline] |
out = in
References linearCombination().
Referenced by paso::SparseMatrix::applyBlockMatrix(), weipa::FinleyElements::buildReducedElements(), paso::LinearSystem::call(), ripley::RipleyDomain::copyData(), ripley::RipleyDomain::createPasoPattern(), weipa::DataVar::DataVar(), ripley::Brick::dofToNodes(), ripley::Rectangle::dofToNodes(), weipa::FinleyNodes::FinleyNodes(), weipa::DataVar::getDataFlat(), weipa::FinleyNodes::initFromDudley(), weipa::FinleyElements::initFromDudley(), weipa::DataVar::initFromEscript(), weipa::FinleyNodes::initFromFinley(), weipa::FinleyElements::initFromFinley(), ripley::RipleyDomain::interpolateOnDomain(), ripley::Brick::nodesToDOF(), ripley::Rectangle::nodesToDOF(), paso::Preconditioner_AMG_solve(), paso::Preconditioner_LocalAMG_solve(), paso::Preconditioner_LocalSmoother_solve(), paso::Preconditioner_Smoother_solve(), paso::Preconditioner_Smoother_solve_byTolerance(), paso::Preconditioner_solve(), weipa::RipleyElements::reorderArray(), weipa::FinleyElements::reorderArray(), weipa::DataVar::reorderSamples(), weipa::RipleyNodes::RipleyNodes(), paso::TransportProblem::solve(), paso::Solver_MINRES(), paso::Solver_solveRILU(), paso::Solver_TFQMR(), and paso::FCT_Solver::updateNL().
index_t paso::util::cumsum | ( | dim_t | N, |
index_t * | array | ||
) |
calculates the cumulative sum in array and returns the total sum
References paso::N, omp_get_max_threads, and omp_get_thread_num.
Referenced by paso::Pattern::getSubpattern(), paso::Preconditioner_AMG_CopyRemoteData(), paso::Preconditioner_AMG_getProlongation(), paso::Preconditioner_LocalAMG_getProlongation(), and paso::Solver_getRILU().
index_t paso::util::cumsum_maskedFalse | ( | dim_t | N, |
index_t * | array, | ||
int * | mask | ||
) |
References paso::N, omp_get_max_threads, and omp_get_thread_num.
Referenced by paso::Preconditioner_AMG_alloc(), and paso::Preconditioner_LocalAMG_alloc().
index_t paso::util::cumsum_maskedTrue | ( | dim_t | N, |
index_t * | array, | ||
int * | mask | ||
) |
References paso::N, omp_get_max_threads, and omp_get_thread_num.
Referenced by paso::Preconditioner_AMG_alloc(), and paso::Preconditioner_LocalAMG_alloc().
index_t paso::util::iMax | ( | dim_t | N, |
const index_t * | array | ||
) |
returns the maximum value in integer array
References INDEX_T_MIN, and paso::N.
Referenced by paso::Preconditioner_LocalAMG_setClassicProlongation(), and paso::Preconditioner_LocalAMG_setClassicProlongation_Block().
double paso::util::innerProduct | ( | const dim_t | n, |
const double * | x, | ||
const double * | y, | ||
Esys_MPIInfo * | mpiinfo | ||
) |
returns the inner product of global arrays x and y
References Esys_MPIInfo::comm, MPI_DOUBLE, and omp_get_max_threads.
Referenced by paso::Solver_GMRES2(), paso::Solver_MINRES(), and paso::Solver_TFQMR().
bool paso::util::isAny | ( | dim_t | N, |
index_t * | array, | ||
index_t | value | ||
) |
returns true if array contains value
References paso::N.
Referenced by paso::Pattern::borrowColoringPointer(), and paso::Pattern::mis().
double paso::util::l2 | ( | dim_t | n, |
const double * | x, | ||
Esys_MPIInfo * | mpiinfo | ||
) |
returns the global L2 norm of x
References Esys_MPIInfo::comm, MPI_DOUBLE, and omp_get_max_threads.
Referenced by ripley::_brick(), ripley::Brick::Brick(), paso::Solver_GMRES2(), paso::Solver_MINRES(), paso::Solver_NewtonGMRES(), paso::Solver_TFQMR(), and paso::FCT_Solver::updateNL().
void paso::util::linearCombination | ( | dim_t | N, |
double * | z, | ||
double | a, | ||
const double * | x, | ||
double | b, | ||
const double * | y | ||
) |
Performs an update of the form z = a*x+b*y where y and x are long vectors. If a=0, x is not used; if b=0, y is not used.
References omp_get_max_threads.
Referenced by copy(), paso::Function::derivative(), and paso::Solver_TFQMR().
double paso::util::lsup | ( | dim_t | n, |
const double * | x, | ||
Esys_MPIInfo * | mpiinfo | ||
) |
returns the global Lsup of x
References Esys_MPIInfo::comm, MPI_DOUBLE, and omp_get_max_threads.
Referenced by paso::Function::derivative(), paso::Preconditioner_Smoother_solve_byTolerance(), paso::Solver_NewtonGMRES(), paso::FCT_Solver::updateLCN(), and paso::FCT_Solver::updateNL().
dim_t paso::util::numPositives | ( | dim_t | N, |
const double * | x | ||
) |
returns the number of positive values in x
References paso::N.
bool paso::util::samesign | ( | double | a, |
double | b | ||
) | [inline] |
returns true if both arguments have the same sign, false otherwise
Referenced by paso::Preconditioner_AMG_setClassicProlongation(), paso::Preconditioner_AMG_setClassicProlongation_Block(), paso::Preconditioner_LocalAMG_setClassicProlongation(), and paso::Preconditioner_LocalAMG_setClassicProlongation_Block().
void paso::util::scale | ( | dim_t | N, |
double * | x, | ||
double | a | ||
) | [inline] |
x = a*x
References update().
Referenced by escript::eigenvalues_and_eigenvectors2(), paso::Solver_MINRES(), and paso::FCT_Solver::updateLCN().
void paso::util::update | ( | dim_t | N, |
double | a, | ||
double * | x, | ||
double | b, | ||
const double * | y | ||
) |
Performs an update of the form x = a*x+b*y where y and x are long vectors. If b=0, y is not used.
References omp_get_max_threads.
Referenced by AXPY(), paso::Function::derivative(), scale(), paso::Solver_GMRES2(), paso::Solver_NewtonGMRES(), and paso::Solver_TFQMR().
void paso::util::zeroes | ( | dim_t | n, |
double * | x | ||
) |
fills array x with zeroes
References omp_get_max_threads.
Referenced by paso::Function::derivative(), paso::TransportProblem::reset(), paso::Solver_GMRES2(), paso::Solver_TFQMR(), and paso::FCT_Solver::updateNL().