proj home

Files   Classes   Functions   Hierarchy  

powell03< LNM, T > Class Template Reference

#include <powell03.h>

Collaboration diagram for powell03< LNM, T >:

List of all members.

Public Member Functions

 powell03 (LNM opt_)
 ~powell03 ()
void dirUnitVectors ()
 Reset the direction vectors to be perpendicular unit vectors.

Public Attributes

LNM opt
uint optiterations
 The number of iterations for one minimization.
uintc dim
Tmemoryblock
Tpos
 Positions.
Tdir
 Direction vectors.
Txi
 function state
uintc dir_current
 The start of the direction stack.
T ** linepathx0
T ** linepathdi

Protected Member Functions

void minimize (uintc k)
 The k'th line is minimized with the new state in xi.


Detailed Description

template<typename LNM, typename T>
class powell03< LNM, T >

Definition at line 10 of file powell03.h.


Constructor & Destructor Documentation

template<typename LNM , typename T >
powell03< LNM, T >::powell03 ( LNM  opt_  )  [inline]

Definition at line 38 of file powell03.h.

References powell03< LNM, T >::dim, powell03< LNM, T >::dir, powell03< LNM, T >::linepathdi, powell03< LNM, T >::linepathx0, powell03< LNM, T >::memoryblock, powell03< LNM, T >::opt, powell03< LNM, T >::pos, and powell03< LNM, T >::xi.

00039     : opt(opt_), optiterations(10), dim(opt.linepath.dim)
00040   {
00041     memoryblock = new T[dim*dim*2 + dim*2];
00042     uint memi=0;
00043     pos = & memoryblock[memi];
00044     memi += dim*dim;
00045     dir = & memoryblock[memi];
00046     memi += dim*dim;
00047     xi = & memoryblock[memi];
00048     memi += dim;
00049     u0 = & memoryblock[memi];
00050     memi += dim;
00051   
00052     opt.linepath.xi = xi;
00053     linepathx0 = & opt.linepath.xo;
00054     linepathdi = & opt.linepath.di;
00055   }

template<typename LNM , typename T >
powell03< LNM, T >::~powell03 (  )  [inline]

Definition at line 57 of file powell03.h.

References powell03< LNM, T >::memoryblock.

00058     { delete[] memoryblock; }


Member Function Documentation

template<typename LNM , typename T >
void powell03< LNM, T >::dirUnitVectors (  )  [inline]

Reset the direction vectors to be perpendicular unit vectors.

Definition at line 81 of file powell03.h.

References powell03< LNM, T >::dim, and powell03< LNM, T >::dir.

00082 {
00083   for (uint i=0; i<dim*dim; ++i)
00084     dir[i]=0;
00085   for (uint i=0; i<dim; ++i)
00086     dir[i*N+i]=(T)1;
00087 }

template<typename LNM , typename T >
void powell03< LNM, T >::minimize ( uintc  k  )  [inline, protected]

The k'th line is minimized with the new state in xi.

Definition at line 66 of file powell03.h.

References powell03< LNM, T >::dim, powell03< LNM, T >::dir, powell03< LNM, T >::dir_current, powell03< LNM, T >::linepathx0, powell03< LNM, T >::opt, powell03< LNM, T >::optiterations, and powell03< LNM, T >::pos.

00067   {
00068     *linepathx0 = pos+dim*k; 
00069     uintc k2 = (dir_current + k ) % dim;
00070     *linepathd1 = dir+dim*k2;
00071 
00072     opt.reset(0.0,5.0);
00073     for (uint i=0; i<optiterations; ++i)
00074       ++opt;
00075   }


Member Data Documentation

template<typename LNM , typename T >
uintc powell03< LNM, T >::dim

template<typename LNM , typename T >
T* powell03< LNM, T >::dir

Direction vectors.

Definition at line 25 of file powell03.h.

Referenced by powell03< LNM, T >::dirUnitVectors(), powell03< LNM, T >::minimize(), and powell03< LNM, T >::powell03().

template<typename LNM , typename T >
uintc powell03< LNM, T >::dir_current

The start of the direction stack.

Definition at line 30 of file powell03.h.

Referenced by powell03< LNM, T >::minimize().

template<typename LNM , typename T >
T** powell03< LNM, T >::linepathdi

Definition at line 33 of file powell03.h.

Referenced by powell03< LNM, T >::powell03().

template<typename LNM , typename T >
T** powell03< LNM, T >::linepathx0

Definition at line 32 of file powell03.h.

Referenced by powell03< LNM, T >::minimize(), and powell03< LNM, T >::powell03().

template<typename LNM , typename T >
T* powell03< LNM, T >::memoryblock

Definition at line 20 of file powell03.h.

Referenced by powell03< LNM, T >::powell03(), and powell03< LNM, T >::~powell03().

template<typename LNM , typename T >
LNM powell03< LNM, T >::opt

Definition at line 14 of file powell03.h.

Referenced by powell03< LNM, T >::minimize(), and powell03< LNM, T >::powell03().

template<typename LNM , typename T >
uint powell03< LNM, T >::optiterations

The number of iterations for one minimization.

O(fn) multiplier.

Definition at line 16 of file powell03.h.

Referenced by powell03< LNM, T >::minimize().

template<typename LNM , typename T >
T* powell03< LNM, T >::pos

Positions.

Definition at line 23 of file powell03.h.

Referenced by powell03< LNM, T >::minimize(), and powell03< LNM, T >::powell03().

template<typename LNM , typename T >
T* powell03< LNM, T >::xi

function state

Definition at line 27 of file powell03.h.

Referenced by powell03< LNM, T >::powell03().


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

Generated on Fri Mar 4 00:50:10 2011 for Chelton Evans Source by  doxygen 1.5.8