|
Belos Version of the Day
|
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 00049 #include "Teuchos_RCP.hpp" 00050 #include "Teuchos_SerialDenseMatrix.hpp" 00051 #include "BelosTypes.hpp" 00052 00053 namespace Belos { 00054 00058 template< class ScalarType, class MV > 00059 struct UndefinedMultiVecTraits 00060 { 00062 00066 static inline ScalarType notDefined() { return MV::this_type_is_missing_a_specialization(); }; 00067 }; 00068 00076 template<class ScalarType, class MV> 00077 class MultiVecTraits 00078 { 00079 public: 00080 00082 00083 00088 static Teuchos::RCP<MV> Clone( const MV& mv, const int numvecs ) 00089 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; } 00090 00095 static Teuchos::RCP<MV> CloneCopy( const MV& mv ) 00096 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; } 00097 00103 static Teuchos::RCP<MV> CloneCopy( const MV& mv, const std::vector<int>& index ) 00104 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; } 00105 00111 static Teuchos::RCP<MV> CloneViewNonConst( MV& mv, const std::vector<int>& index ) 00112 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; } 00113 00119 static Teuchos::RCP<const MV> CloneView( const MV& mv, const std::vector<int>& index ) 00120 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return Teuchos::null; } 00121 00123 00125 00126 00128 static int GetVecLength( const MV& mv ) 00129 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return 0; } 00130 00132 static int GetNumberVecs( const MV& mv ) 00133 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); return 0; } 00134 00136 00138 00139 00142 static void MvTimesMatAddMv( const ScalarType alpha, const MV& A, 00143 const Teuchos::SerialDenseMatrix<int,ScalarType>& B, 00144 const ScalarType beta, MV& mv ) 00145 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00146 00149 static void MvAddMv( const ScalarType alpha, const MV& A, const ScalarType beta, const MV& B, MV& mv ) 00150 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00151 00154 static void MvScale ( MV& mv, const ScalarType alpha ) 00155 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00156 00159 static void MvScale ( MV& mv, const std::vector<ScalarType>& alpha ) 00160 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00161 00164 static void MvTransMv( const ScalarType alpha, const MV& A, const MV& mv, Teuchos::SerialDenseMatrix<int,ScalarType>& B) 00165 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00166 00169 static void MvDot ( const MV& mv, const MV& A, std::vector<ScalarType> &b) 00170 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00171 00173 00174 00175 00179 static void MvNorm( const MV& mv, std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType>& normvec, NormType type = TwoNorm ) 00180 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00181 00183 00185 00186 00191 static void SetBlock( const MV& A, const std::vector<int>& index, MV& mv ) 00192 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00193 00196 static void MvRandom( MV& mv ) 00197 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00198 00201 static void MvInit( MV& mv, const ScalarType alpha = Teuchos::ScalarTraits<ScalarType>::zero() ) 00202 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00203 00205 00207 00208 00211 static void MvPrint( const MV& mv, std::ostream& os ) 00212 { UndefinedMultiVecTraits<ScalarType, MV>::notDefined(); } 00213 00215 }; 00216 00217 } // namespace Belos 00218 00219 #endif // BELOS_MULTI_VEC_TRAITS_HPP
1.7.4