Belos Version of the Day
Loading...
Searching...
No Matches
BelosMultiVecTraits.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Belos: Block Linear Solvers Package
4//
5// Copyright 2004-2016 NTESS and the Belos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9//
10#ifndef BELOS_MULTI_VEC_TRAITS_HPP
11#define BELOS_MULTI_VEC_TRAITS_HPP
12
23
24#include "BelosTypes.hpp"
26#include "Teuchos_Range1D.hpp"
27#include "Teuchos_RCP.hpp"
28
29// This is included for backwards compatibility
30// for all codes using the default template parameter
31// DM = DefaultDenseMatrix<int,ScalarType>
33
34namespace Belos {
35
42 template<class ScalarType, class MV, class DM>
44 {
51 static inline ScalarType notDefined() {
52 return MV::this_type_is_missing_a_specialization();
53 }
54 };
55
101 template<class ScalarType, class MV, class DM = DefaultDenseMatrix<int, ScalarType>>
103 public:
105
106
111 static Teuchos::RCP<MV> Clone( const MV& mv, const int numvecs )
113
118 static Teuchos::RCP<MV> CloneCopy( const MV& mv )
120
126 static Teuchos::RCP<MV> CloneCopy( const MV& mv, const std::vector<int>& index )
128
138 static Teuchos::RCP<MV> CloneCopy( const MV& mv, const Teuchos::Range1D& index )
140
146 static Teuchos::RCP<MV> CloneViewNonConst( MV& mv, const std::vector<int>& index )
148
157 static Teuchos::RCP<MV> CloneViewNonConst( MV& mv, const Teuchos::Range1D& index )
159
165 static Teuchos::RCP<const MV> CloneView( const MV& mv, const std::vector<int>& index )
167
176 static Teuchos::RCP<MV> CloneView( MV& mv, const Teuchos::Range1D& index )
178
180
182
183
189
193
216 static bool HasConstantStride( const MV& mv )
218
220
222
223
229 static void MvTimesMatAddMv( const ScalarType alpha, const MV& A,
230 const DM& B,
231 const ScalarType beta, MV& mv )
233
236 static void MvAddMv( const ScalarType alpha, const MV& A, const ScalarType beta, const MV& B, MV& mv )
238
243
246 static void MvScale ( MV& mv, const std::vector<ScalarType>& alpha )
248
253 static void MvTransMv( const ScalarType alpha, const MV& A, const MV& mv, DM& B)
255
258 static void MvDot ( const MV& mv, const MV& A, std::vector<ScalarType> &b)
260
262
264
272 static void MvNorm( const MV& mv, std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType>& normvec, NormType type = TwoNorm )
274
276
278
279
284 static void SetBlock( const MV& A, const std::vector<int>& index, MV& mv )
286
299 static void SetBlock( const MV& A, const Teuchos::Range1D& index, MV& mv )
301
305 static void Assign( const MV& A, MV& mv )
307
312
315 static void MvInit( MV& mv, const ScalarType alpha = Teuchos::ScalarTraits<ScalarType>::zero() )
317
319
321
322
325 static void MvPrint( const MV& mv, std::ostream& os )
327
329
330#ifdef HAVE_BELOS_TSQR
343 typedef Belos::details::StubTsqrAdapter<MV, DM> tsqr_adaptor_type;
344#endif // HAVE_BELOS_TSQR
345 };
346
347} // namespace Belos
348
349#endif // BELOS_MULTI_VEC_TRAITS_HPP
"Stub" TSQR adapter for unsupported multivector types.
Collection of types and exceptions used within the Belos solvers.
Traits class which defines basic operations on multivectors.
static bool HasConstantStride(const MV &mv)
Whether the given multivector mv has constant stride.
static void MvInit(MV &mv, const ScalarType alpha=Teuchos::ScalarTraits< ScalarType >::zero())
Replace each element of the vectors in mv with alpha.
static void MvNorm(const MV &mv, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec, NormType type=TwoNorm)
Compute the norm of each individual vector of mv. Upon return, normvec[i] holds the value of ,...
static void MvScale(MV &mv, const std::vector< ScalarType > &alpha)
Scale each element of the i-th vector in mv with alpha[i].
static Teuchos::RCP< MV > CloneCopy(const MV &mv)
Creates a new MV and copies contents of mv into the new vector (deep copy).
static Teuchos::RCP< MV > Clone(const MV &mv, const int numvecs)
Creates a new empty MV containing numvecs columns.
static void MvPrint(const MV &mv, std::ostream &os)
Print the mv multi-vector to the os output stream.
static void MvRandom(MV &mv)
Replace the vectors in mv with random vectors.
static void SetBlock(const MV &A, const Teuchos::Range1D &index, MV &mv)
Deep copy of A into specified columns of mv.
static Teuchos::RCP< MV > CloneViewNonConst(MV &mv, const Teuchos::Range1D &index)
Non-const view of specified columns of mv.
static void MvAddMv(const ScalarType alpha, const MV &A, const ScalarType beta, const MV &B, MV &mv)
Replace mv with .
static void MvTimesMatAddMv(const ScalarType alpha, const MV &A, const DM &B, const ScalarType beta, MV &mv)
Update mv with .
static void Assign(const MV &A, MV &mv)
mv := A
static Teuchos::RCP< const MV > CloneView(const MV &mv, const std::vector< int > &index)
Creates a new const MV that shares the selected contents of mv (shallow copy).
static void MvTransMv(const ScalarType alpha, const MV &A, const MV &mv, DM &B)
Compute a dense matrix B through the matrix-matrix multiply .
static ptrdiff_t GetGlobalLength(const MV &mv)
Return the number of rows in the given multivector mv.
static void MvDot(const MV &mv, const MV &A, std::vector< ScalarType > &b)
Compute a vector b where the components are the individual dot-products of the i-th columns of A and ...
static void SetBlock(const MV &A, const std::vector< int > &index, MV &mv)
Copy the vectors in A to a set of vectors in mv indicated by the indices given in index.
static Teuchos::RCP< MV > CloneViewNonConst(MV &mv, const std::vector< int > &index)
Creates a new MV that shares the selected contents of mv (shallow copy).
static Teuchos::RCP< MV > CloneCopy(const MV &mv, const std::vector< int > &index)
Creates a new MV and copies the selected contents of mv into the new vector (deep copy).
static Teuchos::RCP< MV > CloneCopy(const MV &mv, const Teuchos::Range1D &index)
Deep copy of specified columns of mv.
static Teuchos::RCP< MV > CloneView(MV &mv, const Teuchos::Range1D &index)
Const view of specified columns of mv.
static void MvScale(MV &mv, const ScalarType alpha)
Scale each element of the vectors in mv with alpha.
static int GetNumberVecs(const MV &mv)
Obtain the number of vectors in mv.
Alternative run-time polymorphic interface for operators.
"Stub" TSQR adaptor for unsupported multivector types.
NormType
The type of vector norm to compute.
Used by MultiVecTraits to report lack of a specialization.
static ScalarType notDefined()
Any attempt to compile this method will result in a compile-time error.

Generated for Belos by doxygen 1.9.8