ConstrainedOptPack_MatrixHessianSuperBasicInitDiagonal.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_MatrixHessianSuperBasicInitDiagonal.hpp"
00030 #include "DenseLinAlgPack_DVectorClass.hpp"
00031 #include "Midynamic_cast_verbose.h"
00032 
00033 namespace ConstrainedOptPack {
00034 
00035 MatrixHessianSuperBasicInitDiagonal::MatrixHessianSuperBasicInitDiagonal()
00036   : B_RR_init_(NULL)
00037 {}
00038 
00039 void MatrixHessianSuperBasicInitDiagonal::initialize(
00040   size_type            n
00041   ,size_type           n_R
00042   ,const size_type     i_x_free[]
00043   ,const size_type     i_x_fixed[]
00044   ,const EBounds       bnd_fixed[]
00045   ,const B_RR_ptr_t&   B_RR_ptr
00046   ,const B_RX_ptr_t&   B_RX_ptr
00047   ,BLAS_Cpp::Transp    B_RX_trans
00048   ,const B_XX_ptr_t&   B_XX_ptr
00049   )
00050 {
00051   using Teuchos::dyn_cast;
00052 
00053   // Validate the B_RR supports this interface
00054 #ifdef _WINDOWS
00055   B_RR_init_ = &dynamic_cast<MatrixSymInitDiag&>(
00056     const_cast<MatrixSymWithOpFactorized&>(*B_RR_ptr)
00057     );
00058 #else
00059   B_RR_init_ = &dyn_cast<MatrixSymInitDiag>(
00060     const_cast<MatrixSymWithOpFactorized&>(*B_RR_ptr)
00061     );
00062 #endif
00063 
00064   MatrixHessianSuperBasic::initialize(
00065     n,n_R,i_x_free,i_x_fixed,bnd_fixed
00066     ,B_RR_ptr,B_RX_ptr,B_RX_trans,B_XX_ptr 
00067     );
00068 }
00069 
00070 // Overridden from MatrixSymInitDiag
00071 
00072 void MatrixHessianSuperBasicInitDiagonal::init_identity(
00073   size_type n, value_type alpha )
00074 {
00075   assert_initialized();
00076   B_RR_init_->init_identity(n,alpha);
00077   MatrixHessianSuperBasic::initialize(
00078     n,n,NULL,NULL,NULL
00079     ,this->B_RR_ptr()
00080     ,this->B_RX_ptr(),this->B_RX_trans()
00081     ,this->B_XX_ptr()
00082     );
00083 }
00084 
00085 void MatrixHessianSuperBasicInitDiagonal::init_diagonal(
00086   const DVectorSlice& diag )
00087 {
00088   assert_initialized();
00089   B_RR_init_->init_diagonal(diag);
00090   MatrixHessianSuperBasic::initialize(
00091     diag.size(),diag.size(),NULL,NULL,NULL
00092     ,this->B_RR_ptr()
00093     ,this->B_RX_ptr(),this->B_RX_trans()
00094     ,this->B_XX_ptr()
00095     );
00096 }
00097 
00098 } // end namespace ConstrainedOptPack

Generated on Tue Oct 20 12:51:44 2009 for MOOCHO (Single Doxygen Collection) by doxygen 1.4.7