dlinmin.cpp File Reference

Minimizing functions of "N"-dimensional variables by using derivative information. More...

#include <cmath>
#include <LinAlg/arrayoptimize.h>
#include <SharkDefs.h>

Go to the source code of this file.

Defines

#define SIGN(a, b)   ((b) >= 0.0 ? fabs(a) : -fabs(a))

Functions

void dlinmin (Array< double > &p, const Array< double > &xi, double &fret, double(*func)(const Array< double > &), void(*dfunc)(const Array< double > &, Array< double > &))
 Minimizes a function of "N" variables by using derivative information.


Detailed Description

Minimizing functions of "N"-dimensional variables by using derivative information.

Author:
M. Kreutz
Date:
1998
Copyright (c) 1998-2000:
Institut für Neuroinformatik
Ruhr-Universität Bochum
D-44780 Bochum, Germany
Phone: +49-234-32-25558
Fax: +49-234-32-14209
eMail: Shark-admin@neuroinformatik.ruhr-uni-bochum.de
www: http://www.neuroinformatik.ruhr-uni-bochum.de

Project:
LinAlg



This file is part of LinAlg. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Definition in file dlinmin.cpp.


Define Documentation

#define SIGN ( a,
 )     ((b) >= 0.0 ? fabs(a) : -fabs(a))

Definition at line 79 of file dlinmin.cpp.

Referenced by dlinmin(), linmin(), and svd().


Function Documentation

void dlinmin ( Array< double > &  p,
const Array< double > &  xi,
double &  fret,
double(*)(const Array< double > &)  func,
void(*)(const Array< double > &, Array< double > &)  dfunc 
)

Minimizes a function of "N" variables by using derivative information.

Minimizes a function of "N" variables by using derivative information.

Performs a minimization of a function of $ N $ variables, i.e. given as input the vectors $ P $ and $ n $ and the function $ f $, the function finds the scalar $ \lambda $ that minimizes $ f(P + \lambda n) $. $ P $ is replaced by $ P + \lambda n $ and $ n $ by $ \lambda n $.

Parameters:
p N-dimensional initial starting point for the search, is set to the point where the function takes on a minimum.
xi N-dimensional search direction, is replaced by the actual vector displacement that p was moved.
fret The function value at the new point p.
func The function that will be minimized.
dfunc The derivation of function func.
Returns:
none.
Exceptions:
SharkException the type of the exception will be "size mismatch" and indicates that p is not one-dimensional or that p and xi don't have the same length
Please follow the link to view the source code of the example. The example can be executed in the example directory of package LinAlg.

Author:
M. Kreutz
Date:
1998
Changes
none
Status
stable
See also:
linmin.cpp
Examples:
dlinmin_test.cpp.

Definition at line 125 of file dlinmin.cpp.

References SIGN.