ConstrainedOptPack_QPSchurInitKKTSystemHessianFull.cpp

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00005 //                  Copyright (2003) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #include "ConstrainedOptPack_QPSchurInitKKTSystemHessianFull.hpp"
00030 #include "AbstractLinAlgPack_MatrixSymOpNonsing.hpp"
00031 #include "AbstractLinAlgPack_LinAlgOpPack.hpp"
00032 #include "AbstractLinAlgPack_VectorDenseEncap.hpp"
00033 #include "DenseLinAlgPack_LinAlgOpPack.hpp"
00034 #include "Teuchos_dyn_cast.hpp"
00035 
00036 namespace ConstrainedOptPack {
00037 
00038 void QPSchurInitKKTSystemHessianFull::initialize_kkt_system(
00039   const Vector    &g
00040   ,const MatrixOp   &G
00041   ,value_type           etaL
00042   ,const Vector   *dL
00043   ,const Vector   *dU
00044   ,const MatrixOp   *F
00045   ,BLAS_Cpp::Transp     trans_F
00046   ,const Vector   *f
00047   ,const Vector   *d
00048   ,const Vector   *nu
00049   ,size_type            *n_R
00050   ,i_x_free_t           *i_x_free
00051   ,i_x_fixed_t          *i_x_fixed
00052   ,bnd_fixed_t          *bnd_fixed
00053   ,j_f_decomp_t         *j_f_decomp
00054   ,DVector               *b_X
00055   ,Ko_ptr_t             *Ko
00056   ,DVector               *fo
00057   ) const
00058 {
00059   namespace mmp = MemMngPack;
00060   using Teuchos::dyn_cast;
00061   using LinAlgOpPack::V_mV;
00062 
00063   // Validate type of and convert G
00064   const MatrixSymOpNonsing&
00065     G_sym = dyn_cast<const MatrixSymOpNonsing>(G);
00066 
00067   const size_type nd = g.dim();
00068   
00069   // n_R
00070   *n_R = nd;
00071   // i_x_free[i-1] = i, i = 1...nd
00072   i_x_free->resize(0);
00073   // i_x_fixed[0] = nd+1
00074   i_x_fixed->resize(1);
00075   (*i_x_fixed)[0] = nd+1;
00076   // bnd_fixed[0] = LOWER
00077   bnd_fixed->resize(1);
00078   (*bnd_fixed)[0] = LOWER;
00079   // j_f_decomp[] = empty
00080   j_f_decomp->resize(0);
00081   // b_X = etaL
00082   b_X->resize(1);
00083   (*b_X)[0] = etaL;
00084   // Ko = G
00085   *Ko = Teuchos::rcp(&G_sym,false); // Not dynamically allocated so don't delete!
00086   // fo = -g
00087   V_mV(fo,VectorDenseEncap(g)());
00088 }
00089 
00090 } // end namesapce ConstrainedOptPack
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 10:10:58 2011 for MOOCHO (Single Doxygen Collection) by  doxygen 1.6.3