| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 2010

# FuncMinimum.cpp File Reference

Implementation file for class : FuncMinimum. More...

`#include <stdlib.h>`
`#include <stdio.h>`
`#include "GaudiKernel/ToolFactory.h"`
`#include "GaudiKernel/MsgStream.h"`
`#include "gsl/gsl_vector.h"`
`#include "gsl/gsl_multimin.h"`
`#include "gsl/gsl_math.h"`
`#include "gsl/gsl_matrix.h"`
`#include "gsl/gsl_linalg.h"`
`#include "gsl/gsl_blas.h"`
`#include "gsl/gsl_errno.h"`
`#include "FuncMinimum.h"`

Include dependency graph for FuncMinimum.cpp:

Go to the source code of this file.

## Functions
double | fun_gsl (const gsl_vector *v, void *params)
| The function which we minimize.
void | dfun_gsl (const gsl_vector *v, void *params, gsl_vector *df)
| The gradient of the function "fun_gsl".
void | fdfun_gsl (const gsl_vector *v, void *params, double *f, gsl_vector *df)
| Compute both the function "fun_gsl" and gradient of this function "dfun_gsl" together.

## Detailed Description

Implementation file for class : FuncMinimum.

See also:
  FuncMinimum.h

Author:
  Kirill Miklyaev kirillm@iris1.itep.ru

Date:
  2002-09-14

Definition in file FuncMinimum.cpp.

## Function Documentation

void @122::dfun_gsl | ( | const gsl_vector * | v,
|  | void * | params,
|  | gsl_vector * | df |
| ) |  |  | `[static]`

The gradient of the function "fun_gsl".

Definition at line 106 of file FuncMinimum.cpp.

    00108   {
    00109     FuncMinimum::FuncMinimumMisc * local =
    00110       static_cast <FuncMinimum::FuncMinimumMisc*> (params);
    00111     const FuncMinimum::Gradient& grad  = local->gradient();
    00112     Argument&                    arg   = local->argument()  ;
    00113
    00114     {for ( unsigned int i = 0; i < v->size; ++i)
    00115       {
    00116         arg[i] = gsl_vector_get (v, i);
    00117       }
    00118     }
    00119
    00120     {for( unsigned int i = 0 ; i < df->size ; ++i )
    00121
    00122       {
    00123         Genfun::GENFUNCTION f = *(grad[i]);
    00124         gsl_vector_set ( df, i, f(arg) );
    00125       }
    00126     }
    00127
    00128   }

void @122::fdfun_gsl | ( | const gsl_vector * | v,
|  | void * | params,
|  | double * | f,
|  | gsl_vector * | df |
| ) |  |  | `[static]`

Compute both the function "fun_gsl" and gradient of this function "dfun_gsl" together.

Definition at line 132 of file FuncMinimum.cpp.

    00136   {
    00137     *f = fun_gsl( v , params );
    00138     dfun_gsl ( v , params, df);
    00139   }

double @122::fun_gsl | ( | const gsl_vector * | v,
|  | void * | params |
| ) |  |  | `[static]`

The function which we minimize.

Definition at line 88 of file FuncMinimum.cpp.

    00090   {
    00091     FuncMinimum::FuncMinimumMisc * local =
    00092       static_cast <FuncMinimum::FuncMinimumMisc*> (params);
    00093     const FuncMinimum::GenFunc& eq  = *(local->equation());
    00094     Argument&                   arg = local->argument()   ;
    00095
    00096     {for (unsigned int i = 0; i < v->size; ++i)
    00097       {
    00098         arg[i] = gsl_vector_get (v, i);
    00099       }
    00100     }
    00101
    00102     return eq(arg);
    00103   }