proj home

Files   Classes   Functions   Hierarchy  

linepathD1< FN, T > Class Template Reference

This is a 1D line in N dimensions. More...

#include <linepathD1.h>

Collaboration diagram for linepathD1< FN, T >:

List of all members.

Public Member Functions

 linepathD1 (uintc dim_, FN fn_)
 Configure the line later.
 linepathD1 (uintc dim_, FN fn_, X xi_, X x0_, X di_)
 linepathD1 (uintc dim_, X xi_, X x0_, X di_)
 Have the function fn owned by the line path.
void eval (T const t)
 Set xi by t.
void eval (T &fval, T const t)
 Evaluate the function on the line at t.
ostreamprint (ostream &os) const
 Print the current state.

Public Attributes

uintc dim
 Dimension.
FN fn
 The function being minimized.
Txi
 The function state.
Tx0
 Line constant.
Tdi
 Direction.


Detailed Description

template<typename FN, typename T>
class linepathD1< FN, T >

This is a 1D line in N dimensions.

The function has been templated as FN.

Definition at line 17 of file linepathD1.h.


Constructor & Destructor Documentation

template<typename FN , typename T >
linepathD1< FN, T >::linepathD1 ( uintc  dim_,
FN  fn_ 
) [inline]

Configure the line later.

Definition at line 35 of file linepathD1.h.

00039     : dim(dim_), fn(fn_), xi(0), x0(0), di(0)
00040     {}

template<typename FN , typename T >
linepathD1< FN, T >::linepathD1 ( uintc  dim_,
FN  fn_,
xi_,
x0_,
di_ 
) [inline]

Definition at line 43 of file linepathD1.h.

00050     : dim(dim_), fn(fn_), xi(xi_), x0(x0_), di(di_) 
00051     {}

template<typename FN , typename T >
linepathD1< FN, T >::linepathD1 ( uintc  dim_,
xi_,
x0_,
di_ 
) [inline]

Have the function fn owned by the line path.

Definition at line 55 of file linepathD1.h.

00061     : dim(dim_), xi(xi_), x0(x0_), di(di_) 
00062     {}


Member Function Documentation

template<typename FN , typename T >
void linepathD1< FN, T >::eval ( T fval,
T const   t 
) [inline]

Evaluate the function on the line at t.

Definition at line 73 of file linepathD1.h.

References linepathD1< FN, T >::eval(), and linepathD1< FN, T >::fn.

Referenced by linepathD1< FN, T >::eval().

00074     { eval(t); fn(fval); }

template<typename FN , typename T >
void linepathD1< FN, T >::eval ( T const   t  )  [inline]

Set xi by t.

Definition at line 65 of file linepathD1.h.

References linepathD1< FN, T >::di, linepathD1< FN, T >::dim, linepathD1< FN, T >::x0, and linepathD1< FN, T >::xi.

00066   {
00067     for (uint i=0; i<dim; ++i)
00068       xi[i] = x0[i]+di[i]*t;
00069 //cout << "***";
00070 //cout << printvecfunc(xi,dim) << endl;
00071   }

template<typename FN , typename T >
ostream & linepathD1< FN, T >::print ( ostream os  )  const [inline]

Print the current state.

Definition at line 87 of file linepathD1.h.

References linepathD1< FN, T >::di, linepathD1< FN, T >::dim, linepathD1< FN, T >::x0, and linepathD1< FN, T >::xi.

00088 {
00089   os << "dim=" << dim << endl;
00090   //os << "xi[]=" << printvecfunc(xi,dim) << endl;
00091   os << "xi[]=" << print(xi,xi+dim) << endl;
00092   //os << "x0[]=" << printvecfunc(x0,dim) << endl;
00093   os << "x0[]=" << print(x0,x0+dim) << endl;
00094   //os << "di[]=" << printvecfunc(di,dim) << endl;
00095   os << "di[]=" << print(di,di+dim) << endl;
00096 
00097   return os;
00098 }


Member Data Documentation

template<typename FN , typename T >
T* linepathD1< FN, T >::di

Direction.

Definition at line 31 of file linepathD1.h.

Referenced by linepathD1< FN, T >::eval(), and linepathD1< FN, T >::print().

template<typename FN , typename T >
uintc linepathD1< FN, T >::dim

Dimension.

Definition at line 22 of file linepathD1.h.

Referenced by linepathD1< FN, T >::eval(), and linepathD1< FN, T >::print().

template<typename FN , typename T >
FN linepathD1< FN, T >::fn

The function being minimized.

Definition at line 25 of file linepathD1.h.

Referenced by linepathD1< FN, T >::eval().

template<typename FN , typename T >
T* linepathD1< FN, T >::x0

Line constant.

Definition at line 29 of file linepathD1.h.

Referenced by linepathD1< FN, T >::eval(), and linepathD1< FN, T >::print().

template<typename FN , typename T >
T* linepathD1< FN, T >::xi

The function state.

Definition at line 27 of file linepathD1.h.

Referenced by linepathD1< FN, T >::eval(), and linepathD1< FN, T >::print().


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

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