AbstractLinAlgPack_BasisSystemPermDirectSparse.hpp

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 #ifndef ABSTRACT_LIN_ALG_PACK_BASIS_PERM_DIRECT_SPARSE_SYSTEM_H
00030 #define ABSTRACT_LIN_ALG_PACK_BASIS_PERM_DIRECT_SPARSE_SYSTEM_H
00031 
00032 #include "AbstractLinAlgPack_DirectSparseSolver.hpp"
00033 #include "AbstractLinAlgPack_BasisSystemPerm.hpp"
00034 #include "DenseLinAlgPack_IVector.hpp"
00035 
00036 namespace AbstractLinAlgPack {
00037 
00045 class BasisSystemPermDirectSparse
00046   : public AbstractLinAlgPack::BasisSystemPerm
00047 {
00048 public:
00049 
00052 
00054   typedef Teuchos::RCP<DirectSparseSolver>   direct_solver_ptr_t;
00055 
00057 
00060 
00062   BasisSystemPermDirectSparse(
00063     const direct_solver_ptr_t&   direct_solver = Teuchos::null
00064     );
00065   
00067   void initialize(
00068     const direct_solver_ptr_t&   direct_solver
00069     );
00070 
00072 
00075 
00077   const mat_nonsing_fcty_ptr_t factory_C() const;
00079   const mat_fcty_ptr_t factory_D() const;
00081   const mat_fcty_ptr_t factory_GcUP() const;
00083   Range1D var_dep() const;
00085   Range1D var_indep() const;
00087   Range1D equ_decomp() const;
00089   Range1D equ_undecomp() const;
00091   void update_basis(
00092     const MatrixOp          &Gc
00093     ,MatrixOpNonsing        *C
00094     ,MatrixOp               *D
00095     ,MatrixOp               *GcUP
00096     ,EMatRelations          mat_rel
00097     ,std::ostream           *out
00098     ) const;
00099 
00101 
00104 
00106   const perm_fcty_ptr_t   factory_P_var() const;
00108   const perm_fcty_ptr_t   factory_P_equ() const;
00110   const perm_fcty_ptr_t   factory_P_inequ() const;
00112   void set_basis(
00113     const Permutation          &P_var
00114     ,const Range1D             &var_dep
00115     ,const Permutation         *P_equ
00116     ,const Range1D             *equ_decomp
00117     ,const MatrixOp            &Gc
00118     ,MatrixOpNonsing           *C
00119     ,MatrixOp                  *D
00120     ,MatrixOp                  *GcUP
00121     ,EMatRelations             mat_rel
00122     ,std::ostream              *out
00123     );
00125   void select_basis(
00126     const Vector               *nu
00127     ,MatrixOp                  *Gc
00128     ,Permutation               *P_var
00129     ,Range1D                   *var_dep
00130     ,Permutation               *P_equ
00131     ,Range1D                   *equ_decomp
00132     ,MatrixOpNonsing           *C
00133     ,MatrixOp                  *D
00134     ,MatrixOp                  *GcUP
00135     ,EMatRelations             mat_rel
00136     ,std::ostream              *out
00137     );
00138   
00140 
00141 private:
00142 
00143   // ///////////////////////////////
00144   // Private data members
00145 
00146   direct_solver_ptr_t   direct_solver_;
00147   size_type             n_;
00148   size_type           m_;
00149   size_type             r_;
00150   size_type             Gc_nz_;
00151   Range1D               init_var_rng_;
00152   IVector               init_var_inv_perm_;  // If init_var_rng is full range then this is ignored
00153     Range1D               init_equ_rng_;
00154   IVector               init_equ_inv_perm_;  // If init_equ_rng is full range then this is ignored
00155   Range1D               var_dep_;       // used by factor()
00156   Range1D               var_indep_;     // used by factor()
00157     Range1D               equ_decomp_;    // used by factor()
00158     Range1D               equ_undecomp_;  // used by factor()
00159 
00160   // ///////////////////////////////
00161   // Private member functions
00162 
00164   Teuchos::RCP<DirectSparseSolver::BasisMatrix>
00165   get_basis_matrix( MatrixOpNonsingAggr &C_aggr ) const;
00166 
00168   void set_A_mctse(
00169     size_type                    n
00170     ,size_type                   m
00171     ,const MatrixPermAggr        &Gc_pa
00172     ,MatrixConvertToSparseEncap  *A_mctse
00173     ) const;
00174 
00176   void update_basis_and_auxiliary_matrices(
00177     const MatrixOp& Gc
00178     ,const Teuchos::RCP<DirectSparseSolver::BasisMatrix>& C_bm
00179     ,MatrixOpNonsingAggr *C_aggr
00180     ,MatrixOp* D, MatrixOp* GcUP
00181     ) const;
00182 
00184   void do_some_basis_stuff(
00185     const MatrixOp& Gc
00186     ,const Range1D& var_dep, const Range1D& equ_decomp
00187     ,const Teuchos::RCP<DirectSparseSolver::BasisMatrix>& C_bm
00188     ,MatrixOpNonsingAggr *C_aggr
00189     ,MatrixOp* D, MatrixOp* GcUP
00190     );
00191 
00192 
00193 }; // end class BasisSystemPermDirectSparse
00194 
00195 }  // end namespace AbstractLinAlgPack
00196 
00197 #endif // ABSTRACT_LIN_ALG_PACK_BASIS_PERM_DIRECT_SPARSE_SYSTEM_H

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