MOOCHO (Single Doxygen Collection) Version of the Day
AbstractLinAlgPack_VectorSpace.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 ALAP_VECTOR_SPACE_HPP
00030 #define ALAP_VECTOR_SPACE_HPP
00031 
00032 #include "AbstractLinAlgPack_InnerProduct.hpp"
00033 #include "Teuchos_AbstractFactory.hpp"
00034 
00035 namespace AbstractLinAlgPack {
00036 
00120 class VectorSpace
00121   : public Teuchos::AbstractFactory<VectorMutable>
00122 {
00123 public:
00124 
00126   class IncompatibleVectorSpaces : public std::logic_error
00127   {public: IncompatibleVectorSpaces(const std::string& what_arg) : std::logic_error(what_arg) {}};
00129   typedef Teuchos::RCP<const InnerProduct>          inner_prod_ptr_t;
00131   typedef Teuchos::RCP<const VectorSpace>           space_ptr_t;
00133   typedef Teuchos::RCP<const VectorSpaceFactory>    space_fcty_ptr_t;
00135   typedef Teuchos::RCP<VectorMutable>               vec_mut_ptr_t;
00137   typedef Teuchos::RCP<MultiVectorMutable>          multi_vec_mut_ptr_t;
00138 
00139 
00142 
00144   VectorSpace( const inner_prod_ptr_t& inner_prod = Teuchos::null );
00145 
00157   virtual void inner_prod( const inner_prod_ptr_t& inner_prod );
00158 
00165   virtual const inner_prod_ptr_t inner_prod() const;
00166 
00168 
00171 
00184   virtual space_ptr_t clone() const = 0;
00185 
00200   virtual bool is_compatible(const VectorSpace& vec_spc ) const = 0;
00201 
00204   virtual index_type dim() const = 0;
00205 
00220   virtual vec_mut_ptr_t create_member() const = 0;
00221 
00223 
00226 
00242   virtual bool is_in_core() const;
00243 
00252   virtual space_fcty_ptr_t small_vec_spc_fcty() const;
00253 
00274   virtual vec_mut_ptr_t create_member(const value_type& alpha) const;
00275 
00298   virtual multi_vec_mut_ptr_t create_members(size_type num_vecs) const;
00299 
00301 
00339   virtual space_ptr_t sub_space(const Range1D& rng) const;
00340 
00342   space_ptr_t sub_space( const index_type il, const index_type iu ) const;
00343 
00365   virtual space_ptr_t space(
00366     const GenPermMatrixSlice  &P
00367     ,BLAS_Cpp::Transp         P_trans
00368     ) const;
00369 
00371   
00374 
00376   obj_ptr_t create() const;
00377 
00379 
00380 private:
00381 #ifdef DOXYGEN_COMPILE
00382   const InnerProduct   *inner_prod;
00383 #else
00384   inner_prod_ptr_t     inner_prod_;
00385 #endif
00386 
00387 }; // end class VectorSpace
00388 
00389 // ////////////////////////////////////////////////
00390 // Inline members
00391 
00392 inline
00393 VectorSpace::space_ptr_t
00394 VectorSpace::sub_space( const index_type il, const index_type iu ) const
00395 {
00396   return this->sub_space(Range1D(il,iu));
00397 }
00398 
00399 } // end namespace AbstractLinAlgPack
00400 
00401 #endif  // ALAP_VECTOR_SPACE_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines