Files Classes Functions Hierarchy
#include <fixedpoint.h>
Public Member Functions | |
| void | inc (double x[N], double const x0[N]) const |
| One iteration. | |
| double const | norm (double const x[N], double const x0[N]) const |
| sum( abs(x[i]-x0[i]) ) | |
Public Attributes | |
| F | f |
Solves a system of N equations, as a vector function f(X) = 0. The client supplies template class F with F.f(double[N],double*const) and F.IDf( double[N][N], double const[N][N] ) the inverse of grad f.
Definition at line 20 of file fixedpoint.h.
| void fixedpoint< F, N >::inc | ( | double | x[N], | |
| double const | x0[N] | |||
| ) | const [inline] |
One iteration.
Definition at line 92 of file fixedpoint.h.
Referenced by fixedpointtest::test02(), and fixedpointtest::test03().
00096 { 00097 double fx[N]; 00098 f.f(fx,x0); 00099 00100 for (unsigned int i=0; i<N; ++i) 00101 x[i] = x0[i]; 00102 00103 double IDF[N][N]; 00104 f.IDf(IDF,x0); 00105 00106 for (unsigned int i=0; i<N; ++i) 00107 { 00108 for (unsigned int k=0; k<N; ++k) 00109 { 00110 x[i] -= IDF[i][k]*fx[k]; 00111 } 00112 } 00113 }
| double const fixedpoint< F, N >::norm | ( | double const | x[N], | |
| double const | x0[N] | |||
| ) | const [inline] |
sum( abs(x[i]-x0[i]) )
Definition at line 117 of file fixedpoint.h.
00121 { 00122 double s = 0.0; 00123 for ( unsigned int i=0; i<N; ++i ) 00124 s += abs(x[i]-x0[i]); 00125 00126 return s; 00127 }
| F fixedpoint< F, N >::f |
1.5.8