summaryrefslogtreecommitdiffstats
path: root/src/libcola/conjugate_gradient.h
blob: 17e59c9af8679c131e43be25dca86cd4fe2aea17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef _CONJUGATE_GRADIENT_H
#define _CONJUGATE_GRADIENT_H

#include <valarray>

double
inner(std::valarray<double> const &x, 
      std::valarray<double> const &y);

void 
conjugate_gradient(double **A, 
		   double *x, 
		   double *b, 
		   unsigned n, 
		   double tol,
           unsigned max_iterations);
void 
conjugate_gradient(std::valarray<double> const &A, 
		   std::valarray<double> &x, 
		   std::valarray<double> const &b, 
		   unsigned n, double tol,
		   unsigned max_iterations);
#endif // _CONJUGATE_GRADIENT_H