util.h File Reference

Go to the source code of this file.

Classes

struct  Sparse
 Sparse Matrix structure. More...

Typedefs

typedef double(* fx_t )(double x, void *data)
 Function-callback that is passed to gauss_kronrod15.

Functions

double ipow (double x, int p)
 Power function.
int gauss (double *A, double *b, double *x, int n)
 The Gauss method.
double trapezoid_integral (int k, int n, double k1, double b1, double k2, double b2, double x1, double x3)
 Take the integral of $x^k y^n$ over trapezoid.
double trapezoid_integral_cos (int k, int n, double k1, double b1, double k2, double b2, double x1, double x3)
 Take the integral of $x^k y^n cos(x)$ over trapezoid.
double trapezoid_integral_sin (int k, int n, double k1, double b1, double k2, double b2, double x1, double x3)
 Take the integral of $x^k y^n sin(x)$ over trapezoid.
double trapezoid_integral_1_cos (int k, int n, double k1, double b1, double k2, double b2, double x1, double x3)
 Take the integral of $x^k y^n / cos(x)$ over trapezoid.
void mat_print (const double *A, int n)
 Print NxN matrix to stdout.
void vec_print (const double *A, int n)
 Print vector to stdout.
void mat_mult_vector (double *r, const double *A, const double *x, int n)
 Product of NxN matrix and vector.
void sparse_mult_vector_l (double *r, const struct Sparse *A, const double *x, int n)
 If matrix is stored by columns then left multiply by vector: r = x A If matrix is stored by rows then right multiply by vector: r = A x.
void sparse_mult_vector_r (double *r, const struct Sparse *A, const double *x, int n)
 If matrix is stored by columns then right multiply by vector: r = A x If matrix is stored by rows then left multiply by vector: r = x A.
void sparse_print (const struct Sparse *A, int n, FILE *f)
 Print sparse matrix to file.
void vec_sum1 (double *r, const double *a, const double *b, double k1, double k2, int n)
 Linear combination of two vectors.
void vec_mult_scalar (double *a, const double *b, double k, int n)
 Product of vector by number.
void vec_sum (double *r, const double *a, const double *b, int n)
 Sum of two vectors.
double vec_norm2 (const double *v, int n)
 Vector norm.
double vec_scalar2 (const double *a, const double *b, int n)
 Inner product of two vectors.
void vec_mult (double *r, const double *a, const double *b, int n)
 Element by element vector multiplication.
void vec_diff (double *r, const double *a, const double *b, int n)
 Difference of two vectors.
double get_full_time ()
 Returns the number of seconds since epoch.
double gauss_kronrod15 (double a, double b, fx_t fm, void *data)
 Gauss Kronrod quadrature formula.
void set_fpe_except ()
 Sets FPU exceptions.


Detailed Description

Author:
Alexey Ozeritsky <aozeritsky@gmail.com>
Version:
Revision
cad6e724a001

DESCRIPTION

Misc functions.

Definition in file util.h.


Phelm Library
Copyright © 2009 Alexey Ozeritsky. All rights reserved.
http://resetius.ru