00001 /* 00002 ------------------------------------------------------------------- 00003 00004 Copyright (C) 2006, 2007, 2008, 2009, 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_MROOT_HYBRIDS_B_H 00025 #define O2SCL_GSL_MROOT_HYBRIDS_B_H 00026 00027 #include <cmath> 00028 00029 #include <gsl/gsl_vector.h> 00030 #include <gsl/gsl_matrix.h> 00031 #include <gsl/gsl_linalg.h> 00032 00033 #ifndef DOXYGENP 00034 namespace o2scl { 00035 #endif 00036 00037 /** 00038 \brief Base functions for gsl_mroot_hybrids 00039 00040 This is a trivial recasting of the functions that were in file 00041 scope in the GSL version of the hybrids solver. 00042 00043 \todoc Document the individual functions for this class, 00044 and possibly rename it. 00045 */ 00046 class hybrids_base { 00047 protected: 00048 00049 /// Compute the norm of \c f 00050 double enorm(const gsl_vector *f); 00051 00052 /// Compute the norm of \f$ \vec{f} \cdot \vec{d} \f$ 00053 double scaled_enorm(const gsl_vector *d, const gsl_vector *f); 00054 00055 /// Compute the norm of \f$ \vec{a} + \vec{b} \f$. 00056 double enorm_sum(const gsl_vector *a, const gsl_vector *b); 00057 00058 /// Desc. 00059 double compute_actual_reduction(double fnorm, double fnorm1); 00060 00061 /// Desc. 00062 double compute_predicted_reduction(double fnorm, double fnorm1); 00063 00064 /// Compute \f$ Q^{T} f \f$ 00065 void compute_qtf(const gsl_matrix *q, const gsl_vector *f, 00066 gsl_vector *qtf); 00067 00068 /// Desc. 00069 int newton_direction(const gsl_matrix *r, const gsl_vector *qtf, 00070 gsl_vector *p); 00071 00072 /// Desc. 00073 void gradient_direction(const gsl_matrix *r, const gsl_vector *qtf, 00074 const gsl_vector *diag, gsl_vector *g); 00075 00076 /// Desc. 00077 void minimum_step(double gnorm, const gsl_vector *diag, gsl_vector *g); 00078 00079 00080 }; 00081 00082 #ifndef DOXYGENP 00083 } 00084 #endif 00085 00086 #endif
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page