Anasazi Version of the Day
AnasaziMultiVecTraits.hpp
Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 //
00004 //                 Anasazi: Block Eigensolvers Package
00005 //                 Copyright (2004) 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 Michael A. Heroux (maherou@sandia.gov)
00025 //
00026 // ***********************************************************************
00027 // @HEADER
00028 //
00029 #ifndef ANASAZI_MULTI_VEC_TRAITS_HPP
00030 #define ANASAZI_MULTI_VEC_TRAITS_HPP
00031 
00042 
00043 #include "AnasaziTypes.hpp"
00044 #include "AnasaziStubTsqrAdapter.hpp"
00045 #include "Teuchos_Range1D.hpp"
00046 #include "Teuchos_RCP.hpp"
00047 #include "Teuchos_SerialDenseMatrix.hpp"
00048 
00049 namespace Anasazi {
00050 
00057   template< class ScalarType, class MV >
00058   struct UndefinedMultiVecTraits
00059   {
00066     static inline ScalarType notDefined() { return MV::this_type_is_missing_a_specialization(); };
00067   };
00068 
00069 
00113   template<class ScalarType, class MV>
00114   class MultiVecTraits {
00115   public:
00117 
00118 
00123     static Teuchos::RCP<MV> Clone( const MV& mv, const int numvecs )
00124     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00125 
00130     static Teuchos::RCP<MV> CloneCopy( const MV& mv )
00131     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00132 
00138     static Teuchos::RCP<MV> CloneCopy( const MV& mv, const std::vector<int>& index )
00139     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00140 
00150     static Teuchos::RCP<MV> CloneCopy( const MV& mv, const Teuchos::Range1D& index )
00151     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00152 
00158     static Teuchos::RCP<MV> CloneViewNonConst( MV& mv, const std::vector<int>& index )
00159     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00160 
00169     static Teuchos::RCP<MV> CloneViewNonConst( MV& mv, const Teuchos::Range1D& index )
00170     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00171 
00177     static Teuchos::RCP<const MV> CloneView( const MV& mv, const std::vector<int>& index )
00178     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00179 
00188     static Teuchos::RCP<MV> CloneView( MV& mv, const Teuchos::Range1D& index )
00189     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00190 
00192 
00194 
00195 
00197     static int GetVecLength( const MV& mv )
00198     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return 0; }     
00199 
00201     static int GetNumberVecs( const MV& mv )
00202     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return 0; }     
00203 
00205 
00207 
00208 
00211     static void MvTimesMatAddMv( const ScalarType alpha, const MV& A, 
00212                                  const Teuchos::SerialDenseMatrix<int,ScalarType>& B, 
00213                                  const ScalarType beta, MV& mv )
00214     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00215 
00218     static void MvAddMv( const ScalarType alpha, const MV& A, const ScalarType beta, const MV& B, MV& mv )
00219     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00220 
00223     static void MvScale ( MV& mv, const ScalarType alpha )
00224     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }
00225     
00228     static void MvScale ( MV& mv, const std::vector<ScalarType>& alpha )
00229     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }
00230 
00233     static void MvTransMv( const ScalarType alpha, const MV& A, const MV& mv, Teuchos::SerialDenseMatrix<int,ScalarType>& B)
00234     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00235 
00238     static void MvDot ( const MV& mv, const MV& A, std::vector<ScalarType> &b) 
00239     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00240 
00242 
00243 
00244 
00248     static void MvNorm( const MV& mv, std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> &normvec )
00249     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00250 
00252 
00254 
00255 
00260     static void SetBlock( const MV& A, const std::vector<int>& index, MV& mv )
00261     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00262 
00275     static void SetBlock( const MV& A, const Teuchos::Range1D& index, MV& mv )
00276     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00277 
00281     static void Assign( const MV& A, MV& mv )
00282     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00283 
00286     static void MvRandom( MV& mv )
00287     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00288 
00291     static void MvInit( MV& mv, const ScalarType alpha = Teuchos::ScalarTraits<ScalarType>::zero() )
00292     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00293 
00295 
00297 
00298 
00301     static void MvPrint( const MV& mv, std::ostream& os )
00302     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00303 
00305 
00306 #ifdef HAVE_ANASAZI_TSQR
00307 
00308 
00309 
00310 
00311 
00312 
00313 
00314 
00315 
00316 
00317 
00318 
00319     typedef Anasazi::details::StubTsqrAdapter<MV> tsqr_adaptor_type;
00320 #endif // HAVE_ANASAZI_TSQR
00321   };
00322   
00323 } // namespace Anasazi
00324 
00325 #endif // ANASAZI_MULTI_VEC_TRAITS_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends