-
Notifications
You must be signed in to change notification settings - Fork 4
/
Solve.h
33 lines (29 loc) · 988 Bytes
/
Solve.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef SOLVE_H
#define SOLVE_H
#include "BandedMatrix.h"
#include <stddef.h>
/*!
* \brief Gauss-Seidel relaxation.
*
* Sequential Gauss-Seidel on a single host CPU for \f$ Ax=b \f$.
*
* \param x Input and output vector
* \param A Input matrix
* \param b Input right-hand side
* \param iterations How many smoothing iterations to perform
*/
void gaussSeidel_host( float* x, BandedMatrix const& A, float const* b, size_t iterations=1 );
/*!
* \brief Damped Jacobi relaxation.
*
* Damped Jacobi iterations on a single host CPU for \f$ Ax=b \f$.
*
* \param x Input and output vector
* \param A Input matrix
* \param b Input right-hand side
* \param iterations How many smoothing iterations to perform
* \param omega Damping ratio (in [0,1]). Default is 2/3 (typical choice).
* 1 means no damping, 0 means infinite.
*/
void jacobi_host( float* x, BandedMatrix const& A, float const* b, size_t iterations, int xpad, float omega=2.f/3.f );
#endif /*SOLVE_H*/