proj home

Files   Classes   Functions   Hierarchy  

fixedpoint< F, N > Class Template Reference

Fixed Point Iteration. More...

#include <fixedpoint.h>

Collaboration diagram for fixedpoint< F, N >:

List of all members.

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


Detailed Description

template<typename F, unsigned int N>
class fixedpoint< F, N >

Fixed Point Iteration.

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.


Member Function Documentation

template<typename F , unsigned int N>
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 }

template<typename F , unsigned int N>
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 }


Member Data Documentation

template<typename F, unsigned int N>
F fixedpoint< F, N >::f

Definition at line 24 of file fixedpoint.h.

Referenced by fixedpointtest::test03().


The documentation for this class was generated from the following file:

Generated on Fri Mar 4 00:49:56 2011 for Chelton Evans Source by  doxygen 1.5.8