|
Anasazi
Version of the Day
|
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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 00203 static int GetVecLength( const MV& mv ) 00204 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return 0; } 00205 00207 static int GetNumberVecs( const MV& mv ) 00208 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return 0; } 00209 00211 00213 00214 00217 static void MvTimesMatAddMv( const ScalarType alpha, const MV& A, 00218 const Teuchos::SerialDenseMatrix<int,ScalarType>& B, 00219 const ScalarType beta, MV& mv ) 00220 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00221 00224 static void MvAddMv( const ScalarType alpha, const MV& A, const ScalarType beta, const MV& B, MV& mv ) 00225 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00226 00229 static void MvScale ( MV& mv, const ScalarType alpha ) 00230 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00231 00234 static void MvScale ( MV& mv, const std::vector<ScalarType>& alpha ) 00235 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00236 00239 static void MvTransMv( const ScalarType alpha, const MV& A, const MV& mv, Teuchos::SerialDenseMatrix<int,ScalarType>& B) 00240 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00241 00244 static void MvDot ( const MV& mv, const MV& A, std::vector<ScalarType> &b) 00245 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00246 00248 00249 00250 00254 static void MvNorm( const MV& mv, std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType> &normvec ) 00255 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00256 00258 00260 00261 00266 static void SetBlock( const MV& A, const std::vector<int>& index, MV& mv ) 00267 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00268 00281 static void SetBlock( const MV& A, const Teuchos::Range1D& index, MV& mv ) 00282 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00283 00287 static void Assign( const MV& A, MV& mv ) 00288 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00289 00292 static void MvRandom( MV& mv ) 00293 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00294 00297 static void MvInit( MV& mv, const ScalarType alpha = Teuchos::ScalarTraits<ScalarType>::zero() ) 00298 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00299 00301 00303 00304 00307 static void MvPrint( const MV& mv, std::ostream& os ) 00308 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00309 00311 00312 #ifdef HAVE_ANASAZI_TSQR 00313 00314 00315 00316 00317 00318 00319 00320 00321 00322 00323 00324 00325 typedef Anasazi::details::StubTsqrAdapter<MV> tsqr_adaptor_type; 00326 #endif // HAVE_ANASAZI_TSQR 00327 }; 00328 00329 00355 template<class ScalarType, class MV> 00356 class MultiVecTraitsExt { 00357 public: 00359 00360 00363 static ptrdiff_t GetGlobalLength( const MV& mv ) 00364 { return static_cast<ptrdiff_t>( MultiVecTraits<ScalarType, MV>::GetVecLength( mv ) ); } 00365 00367 }; 00368 } // namespace Anasazi 00369 00370 #endif // ANASAZI_MULTI_VEC_TRAITS_HPP
1.7.6.1