| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- File List
- File Members

# FuncMinimum.cpp File Reference

## 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.

`#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.

## 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 110 of file FuncMinimum.cpp.

References FuncMinimum::FuncMinimumMisc::argument(), and FuncMinimum::FuncMinimumMisc::gradient().

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

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 136 of file FuncMinimum.cpp.

References dfun_gsl(), and fun_gsl().

    00140   {
    00141     *f = fun_gsl( v , params );
    00142     dfun_gsl ( v , params, df);
    00143   }

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

The function which we minimize.

Definition at line 92 of file FuncMinimum.cpp.

References FuncMinimum::FuncMinimumMisc::argument(), and FuncMinimum::FuncMinimumMisc::equation().

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