gsl_mmin_simp_b.h

00001 /*
00002   -------------------------------------------------------------------
00003   
00004   Copyright (C) 2006, 2007, 2008, Andrew W. Steiner
00005   
00006   This file is part of O2scl.
00007   
00008   O2scl is free software; you can redistribute it and/or modify
00009   it under the terms of the GNU General Public License as published by
00010   the Free Software Foundation; either version 3 of the License, or
00011   (at your option) any later version.
00012   
00013   O2scl is distributed in the hope that it will be useful,
00014   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016   GNU General Public License for more details.
00017   
00018   You should have received a copy of the GNU General Public License
00019   along with O2scl. If not, see <http://www.gnu.org/licenses/>.
00020 
00021   -------------------------------------------------------------------
00022 */
00023 
00024 #ifndef O2SCL_GSL_MMIN_SIMP_B_H
00025 #define O2SCL_GSL_MMIN_SIMP_B_H
00026 
00027 #include <iostream>
00028 #include <gsl/gsl_vector.h>
00029 #include <gsl/gsl_multimin.h>
00030 #include <gsl/gsl_blas.h>
00031 
00032 #ifndef DOXYGENP
00033 namespace o2scl {
00034 #endif
00035 
00036   /** 
00037       \brief Base routines for the GSL simplex minimizer
00038    */
00039   class gsl_mmin_simp_b {
00040   public:
00041     
00042     /// State type for GSL simplex minimizer
00043     typedef struct
00044     {
00045       /// The (n+1,n) matrix containing the simplex
00046       gsl_matrix *x1;
00047       /// The (n+1) function values at the simplex points
00048       gsl_vector *y1;
00049       /// Desc
00050       gsl_vector *ws1;
00051       /// Desc
00052       gsl_vector *ws2;
00053     }
00054     simp_state_t;
00055     
00056     /// Compute the center of the simplex and store in \c mp
00057     int nmsimplex_calc_center(const simp_state_t *state, gsl_vector *mp);
00058     
00059     /** 
00060         \brief Compute the size of the simplex
00061         
00062         Calculates simplex size as average sum of length of vectors
00063         from simplex center to corner points:
00064         
00065         \f$ (1/n) \sum || y - y_{\mathrm{middlepoint}} || \f$
00066     */
00067     double nmsimplex_size(simp_state_t *state);
00068     
00069   };
00070 
00071 
00072 #ifndef DOXYGENP
00073 }
00074 #endif
00075 
00076 #endif

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page