proj home

Files   Classes   Functions   Hierarchy  

linepath_d1< FN, XI, X, T > Class Template Reference

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

#include <linepath_d1.h>

Collaboration diagram for linepath_d1< FN, XI, X, T >:

List of all members.

Public Member Functions

 linepath_d1 (uintc dim_, typename typeop< FN >::Tref fn_, XI xi_, X x0_, X di_)
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
 Evaluate the function.

Public Attributes

uintc dim
 Dimension.
typeop< FN >::Tref fn
 The function being minimized.
XI xi
 The function state.
x0
 Line constant.
di
 Direction.


Detailed Description

template<typename FN, typename XI, typename X, typename T>
class linepath_d1< FN, XI, X, T >

This is a 1D line in N dimensions.

The function has been templated as FN. The function state has been templated as XI. The initial position and direction templated with X type.

While XI and X are both N dimensional vectors with elements of the same type they are different types to support complex functions fn. For most applications this generality will not be needed.

Definition at line 23 of file linepath_d1.h.


Constructor & Destructor Documentation

template<typename FN , typename XI , typename X , typename T >
linepath_d1< FN, XI, X, T >::linepath_d1 ( uintc  dim_,
typename typeop< FN >::Tref  fn_,
XI  xi_,
x0_,
di_ 
) [inline]

Definition at line 86 of file linepath_d1.h.

00093   : dim(dim_), fn(fn_), xi(xi_), x0(x0_), di(di_)
00094 {
00095 }


Member Function Documentation

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

Evaluate the function on the line at t.

Definition at line 57 of file linepath_d1.h.

References linepath_d1< FN, XI, X, T >::eval(), and linepath_d1< FN, XI, X, T >::fn.

Referenced by linepath_d1< FN, XI, X, T >::eval().

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

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

Set xi by t.

Definition at line 49 of file linepath_d1.h.

References linepath_d1< FN, XI, X, T >::di, linepath_d1< FN, XI, X, T >::dim, linepath_d1< FN, XI, X, T >::x0, and linepath_d1< FN, XI, X, T >::xi.

00050   {
00051     for (uint i=0; i<dim; ++i)
00052       xi[i] = x0[i]+di[i]*t;
00053 //cout << "***";
00054 //cout << printvecfunc(xi,dim) << endl;
00055   }

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

Evaluate the function.

Look at the current state.

Definition at line 74 of file linepath_d1.h.

References linepath_d1< FN, XI, X, T >::di, linepath_d1< FN, XI, X, T >::dim, printvecfunc(), linepath_d1< FN, XI, X, T >::x0, and linepath_d1< FN, XI, X, T >::xi.

00075 {
00076   os << "dim=" << dim << endl;
00077   os << "xi[]=" << printvecfunc(xi,dim) << endl;
00078   os << "x0[]=" << printvecfunc(x0,dim) << endl;
00079   os << "di[]=" << printvecfunc(di,dim) << endl;
00080 
00081   return os;
00082 }


Member Data Documentation

template<typename FN , typename XI , typename X , typename T >
X linepath_d1< FN, XI, X, T >::di

Direction.

Definition at line 37 of file linepath_d1.h.

Referenced by linepath_d1< FN, XI, X, T >::eval(), and linepath_d1< FN, XI, X, T >::print().

template<typename FN , typename XI , typename X , typename T >
uintc linepath_d1< FN, XI, X, T >::dim

Dimension.

Definition at line 28 of file linepath_d1.h.

Referenced by linepath_d1< FN, XI, X, T >::eval(), and linepath_d1< FN, XI, X, T >::print().

template<typename FN , typename XI , typename X , typename T >
typeop<FN>::Tref linepath_d1< FN, XI, X, T >::fn

The function being minimized.

Definition at line 31 of file linepath_d1.h.

Referenced by linepath_d1< FN, XI, X, T >::eval().

template<typename FN , typename XI , typename X , typename T >
X linepath_d1< FN, XI, X, T >::x0

Line constant.

Definition at line 35 of file linepath_d1.h.

Referenced by linepath_d1< FN, XI, X, T >::eval(), and linepath_d1< FN, XI, X, T >::print().

template<typename FN , typename XI , typename X , typename T >
XI linepath_d1< FN, XI, X, T >::xi

The function state.

Definition at line 33 of file linepath_d1.h.

Referenced by linepath_d1< FN, XI, X, T >::eval(), and linepath_d1< FN, XI, X, 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