util.h File Reference
Detailed Description
File that contains various utility functions.
#include <complex>
#include <valarray>
#include <vector>
#include <stdio.h>
#include "OFELI_Config.h"
#include "Point.h"
Go to the source code of this file.
Namespaces | |
| namespace | OFELI |
Functions | |
| double | Abs (const Point< double > &p) |
| Return Norm of vector a. | |
| double | Abs (complex_t a) |
| Return modulus of complex number a. | |
| double | Abs (double a) |
| Return absolute value of a. | |
| double | Abs2 (double a) |
| Return square of real number a. | |
| double | Abs2 (complex_t a) |
| Return square of modulus of complex number a. | |
| double | Arg (complex_t x) |
| Return argument of complex number x. | |
| template<class T_> | |
| void | Axpy (T_ a, const valarray< T_ > &x, valarray< T_ > &y) |
| Multiply vector x by a and add result to y. | |
| template<class T_> | |
| void | Axpy (T_ a, const vector< T_ > &x, vector< T_ > &y) |
| Multiply vector x by a and add result to y. | |
| template<class T_> | |
| void | Axpy (size_t n, T_ a, T_ *x, T_ *y) |
| Multiply array x by a and add result to y. | |
| complex_t | CDot (const valarray< complex_t > &x, valarray< complex_t > &y) |
| Return dot product of complex vectors x and y. | |
| complex_t | CDot (size_t n, const complex_t *x, const complex_t *y) |
| Return dot product of complex arrays x and y. | |
| template<class T_> | |
| void | Clear (vector< T_ > &v) |
| Clear (set entries to zero) vector v. | |
| template<class T_> | |
| void | Clear (valarray< T_ > &v) |
| Clear (set entries to zero) vector v. | |
| complex_t | Conjg (complex_t a) |
| Return complex conjugate of complex number a. | |
| double | Conjg (double a) |
| Return complex conjugate of real number a. | |
| template<class T_> | |
| void | Copy (const valarray< T_ > &x, valarray< T_ > &y) |
| Copy vector x to y. | |
| template<class T_> | |
| void | Copy (size_t n, T_ *x, T_ *y) |
| Copy array x to y. | |
| template<class T_> | |
| T_ | Dot (const Point< T_ > &x, const Point< T_ > &y) |
| Return dot product of x and y. | |
| complex_t | Dot (const valarray< complex_t > &x, const valarray< complex_t > &y) |
| Return dot product of vectors x and y. | |
| real_t | Dot (const valarray< real_t > &x, const valarray< real_t > &y) |
| Return dot product of vectors x and y. | |
| template<class T_> | |
| T_ | Dot (const vector< T_ > &x, const vector< T_ > &y) |
| Return dot product of vectors x and y. | |
| template<class T_> | |
| T_ | Dot (size_t n, T_ *x, T_ *y) |
| Return dot product of arrays x and y. | |
| std::string | dtos (double d) |
| Function to convert a double real to a string. | |
| std::string | ftos (float f) |
| Function to convert a float real to a string. | |
| char | itoc (int i) |
| Function to convert an integer to a character. | |
| std::string | itos (int i) |
| Function to convert an integer to a string. | |
| complex_t | Log (complex_t x) |
| Return principal determination of logarithm of complex number x. | |
| void | LTrim (char *s) |
| Function to remove blanks at the beginning of a string. | |
| int | Max (int a, int b, int c, int d) |
| Return maximum value of integer numbers a, b, c and d. | |
| double | Max (double a, double b, double c, double d) |
| Return maximum value of integer numbers a, b, c and d. | |
| int | Max (int a, int b, int c) |
| Return maximum value of integer numbers a, b and c. | |
| double | Max (double a, double b, double c) |
| Return maximum value of real numbers a, b and c. | |
| int | Min (int a, int b, int c, int d) |
| Return minimum value of integer numbers a, b, c and d. | |
| double | Min (double a, double b, double c, double d) |
| Return minimum value of real numbers a, b, c and d. | |
| int | Min (int a, int b, int c) |
| Return minimum value of integer numbers a, b and c. | |
| double | Min (double a, double b, double c) |
| Return minimum value of real numbers a, b and c. | |
| template<class T_> | |
| double | Nrm2 (const Point< T_ > &a) |
| Return 2-norm of a. | |
| double | Nrm2 (const valarray< double > &x) |
| Return 2-norm of vector x. | |
| double | Nrm2 (size_t n, double *x) |
| Return 2-norm of array x. | |
| void | RTrim (char *s) |
| Function to remove blanks at the end of a string. | |
| template<class T_> | |
| void | Scale (T_ a, valarray< T_ > &x) |
| Mutiply vector x by a. | |
| template<class T_> | |
| void | Scale (T_ a, vector< T_ > &x) |
| Mutiply vector x by a. | |
| template<class T_> | |
| void | Scale (T_ a, const valarray< T_ > &x, valarray< T_ > &y) |
| Mutiply vector x by a and save result in vector y. | |
| template<class T_> | |
| void | Scale (T_ a, const vector< T_ > &x, vector< T_ > &y) |
| Mutiply vector x by a and save result in vector y. | |
| int | Sgn (double a) |
| Return sign of a. | |
| template<class T_> | |
| T_ | Sqr (T_ &x) |
| Return square of value x. | |
| template<class T_> | |
| void | Swap (T_ &a, T_ &b) |
| Swap elements a and b. | |
| void | Trim (char *s) |
| Function to remove blanks at the beginning and end of a string. | |
| template<class T_> | |
| void | Xpy (const valarray< T_ > &x, valarray< T_ > &y) |
| Add vector x to y. | |
| template<class T_> | |
| void | Xpy (const vector< T_ > &x, vector< T_ > &y) |
| Add vector x to y. | |
| template<class T_> | |
| void | Xpy (size_t n, T_ *x, T_ *y) |
| Add array x to y. | |