MoochoPack_MeritFunc_PenaltyParamUpdateWithMult_AddedStep.cpp

00001 #if 0
00002 
00003 // @HEADER
00004 // ***********************************************************************
00005 // 
00006 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00007 //                  Copyright (2003) Sandia Corporation
00008 // 
00009 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 // license for use of this work by or on behalf of the U.S. Government.
00011 // 
00012 // This library is free software; you can redistribute it and/or modify
00013 // it under the terms of the GNU Lesser General Public License as
00014 // published by the Free Software Foundation; either version 2.1 of the
00015 // License, or (at your option) any later version.
00016 //  
00017 // This library is distributed in the hope that it will be useful, but
00018 // WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 // Lesser General Public License for more details.
00021 //  
00022 // You should have received a copy of the GNU Lesser General Public
00023 // License along with this library; if not, write to the Free Software
00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 // USA
00026 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00027 // 
00028 // ***********************************************************************
00029 // @HEADER
00030 
00031 #include <ostream>
00032 #include <typeinfo>
00033 
00034 #include "MoochoPack_MeritFunc_PenaltyParamUpdateWithMult_AddedStep.hpp"
00035 #include "MoochoPack_NLPAlgoState.hpp"
00036 #include "ConstrainedOptPack/src/VectorWithNorms.h"
00037 
00038 namespace MoochoPack {
00039 
00040 MeritFunc_PenaltyParamUpdateWithMult_AddedStep::MeritFunc_PenaltyParamUpdateWithMult_AddedStep(
00041       const merit_func_ptr_t& merit_func, value_type small_mu
00042     , value_type mult_factor, value_type kkt_near_sol )
00043   : MeritFunc_PenaltyParamUpdateGuts_AddedStep(merit_func,small_mu,mult_factor,kkt_near_sol)
00044 {}
00045 
00046 // Overridden from MeritFunc_PenaltyParamUpdateGuts_AddedStep
00047 
00048 bool MeritFunc_PenaltyParamUpdateWithMult_AddedStep::min_mu(
00049   NLPAlgoState& s, value_type* min_mu ) const
00050 {
00051   if ( s.lambda().updated_k(0) ) {
00052     *min_mu = s.lambda().get_k(0).norm_inf();
00053     return true;
00054   }
00055   return false;
00056 }
00057 
00058 void MeritFunc_PenaltyParamUpdateWithMult_AddedStep::print_min_mu_step(
00059   std::ostream& out, const std::string& L ) const
00060 {
00061   out
00062     << L << "if lambda_k is updated then\n"
00063     << L << "    min_mu = norm( lambda_k, inf )\n"
00064     << L << "    update_mu = true\n"
00065     << L << "else\n"
00066     << L << "    update_mu = false\n"
00067     << L << "endif\n"
00068     ;
00069 }
00070 
00071 } // end namespace MoochoPack
00072 
00073 #endif // 0

Generated on Wed May 12 21:32:13 2010 for MoochoPack : Framework for Large-Scale Optimization Algorithms by  doxygen 1.4.7