Belos Version of the Day
BelosMultiVecTraits.hpp
Go to the documentation of this file.
00001 //@HEADER
00002 // ************************************************************************
00003 //
00004 //                 Belos: Block Linear Solvers Package
00005 //                  Copyright 2004 Sandia Corporation
00006 //
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00008 // the U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00038 //
00039 // ************************************************************************
00040 //@HEADER
00041 //
00042 #ifndef BELOS_MULTI_VEC_TRAITS_HPP
00043 #define BELOS_MULTI_VEC_TRAITS_HPP
00044 
00055 
00056 #include "BelosTypes.hpp"
00057 #include "Teuchos_Range1D.hpp"
00058 #include "Teuchos_RCP.hpp"
00059 #include "Teuchos_SerialDenseMatrix.hpp"
00060 
00061 namespace Belos {
00062 
00066   template<class ScalarType, class MV>
00067   struct UndefinedMultiVecTraits
00068   {
00070 
00074     static inline ScalarType notDefined() { 
00075       return MV::this_type_is_missing_a_specialization(); 
00076     }
00077   };
00078 
00086   template<class ScalarType, class MV>
00087   class MultiVecTraits 
00088   {
00089   public:
00091 
00092 
00097     static Teuchos::RCP<MV> Clone( const MV& mv, const int numvecs )
00098     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00099 
00104     static Teuchos::RCP<MV> CloneCopy( const MV& mv )
00105     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00106 
00112     static Teuchos::RCP<MV> CloneCopy( const MV& mv, const std::vector<int>& index )
00113     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00114 
00124     static Teuchos::RCP<MV> CloneCopy( const MV& mv, const Teuchos::Range1D& index )
00125     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00126 
00132     static Teuchos::RCP<MV> CloneViewNonConst( MV& mv, const std::vector<int>& index )
00133     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00134 
00143     static Teuchos::RCP<MV> CloneViewNonConst( MV& mv, const Teuchos::Range1D& index )
00144     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00145 
00151     static Teuchos::RCP<const MV> CloneView( const MV& mv, const std::vector<int>& index )
00152     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00153 
00162     static Teuchos::RCP<MV> CloneView( MV& mv, const Teuchos::Range1D& index )
00163     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; }     
00164 
00166 
00168 
00169 
00171     static int GetVecLength( const MV& mv )
00172     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return 0; }     
00173 
00175     static int GetNumberVecs( const MV& mv )
00176     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return 0; }     
00177 
00200     static bool HasConstantStride( const MV& mv )
00201     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return false; }
00202 
00204 
00206 
00207 
00210     static void MvTimesMatAddMv( const ScalarType alpha, const MV& A, 
00211                                  const Teuchos::SerialDenseMatrix<int,ScalarType>& B, 
00212                                  const ScalarType beta, MV& mv )
00213     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00214 
00217     static void MvAddMv( const ScalarType alpha, const MV& A, const ScalarType beta, const MV& B, MV& mv )
00218     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00219 
00222     static void MvScale ( MV& mv, const ScalarType alpha )
00223     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }
00224     
00227     static void MvScale ( MV& mv, const std::vector<ScalarType>& alpha )
00228     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }
00229 
00232     static void MvTransMv( const ScalarType alpha, const MV& A, const MV& mv, Teuchos::SerialDenseMatrix<int,ScalarType>& B)
00233     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00234 
00237     static void MvDot ( const MV& mv, const MV& A, std::vector<ScalarType> &b) 
00238     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00239 
00241 
00242 
00243 
00247     static void MvNorm( const MV& mv, std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType>& normvec, NormType type = TwoNorm )
00248     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00249 
00251 
00253 
00254 
00259     static void SetBlock( const MV& A, const std::vector<int>& index, MV& mv )
00260     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00261 
00274     static void SetBlock( const MV& A, const Teuchos::Range1D& index, MV& mv )
00275     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00276 
00280     static void Assign( const MV& A, MV& mv )
00281     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00282 
00285     static void MvRandom( MV& mv )
00286     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00287 
00290     static void MvInit( MV& mv, const ScalarType alpha = Teuchos::ScalarTraits<ScalarType>::zero() )
00291     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00292 
00294 
00296 
00297 
00300     static void MvPrint( const MV& mv, std::ostream& os )
00301     { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); }     
00302 
00304   };
00305   
00306 } // namespace Belos
00307 
00308 #endif // BELOS_MULTI_VEC_TRAITS_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines