Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_UniversalMultiVectorRandomizer.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
4 //
5 // Copyright 2004 NTESS and the Thyra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef THYRA_UNIVERSAL_MULTI_VECTOR_RANDOMIZER_HPP
11 #define THYRA_UNIVERSAL_MULTI_VECTOR_RANDOMIZER_HPP
12 
13 
14 #include "Thyra_MultiVectorRandomizerBase.hpp"
15 #include "Thyra_MultiVectorStdOps.hpp"
16 
17 
18 namespace Thyra {
19 
20 
29 template<class Scalar>
31 public:
32 
35 
37  bool isCompatible( const VectorSpaceBase<Scalar> &space ) const;
38 
40 
41 private:
42 
45 
47  void randomizeImpl(const Ptr<MultiVectorBase<Scalar> > &mv);
48 
50 
51 };
52 
53 
58 template<class Scalar>
61 {
63 }
64 
65 
66 // //////////////////////////////
67 // Definitions
68 
69 
70 template<class Scalar>
72 {
73  return true;
74 }
75 
76 
77 // Overridded private functions
78 
79 
80 template<class Scalar>
82  const Ptr<MultiVectorBase<Scalar> > &mv )
83 {
84  using Teuchos::as;
86  Thyra::randomize(as<Scalar>(-ST::one()), as<Scalar>(+ST::one()), mv);
87 }
88 
89 
90 } // namespace Thyra
91 
92 
93 #endif // THYRA_UNIVERSAL_MULTI_VECTOR_RANDOMIZER_HPP
Univeral MultiVectorRandomizerBase subclass that is compatible with all MultiVectorBase objects...
Abstract interface for objects that represent a space for vectors.
RCP< UniversalMultiVectorRandomizer< Scalar > > universalMultiVectorRandomizer()
Nonmember constructor.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Interface for a collection of column vectors called a multi-vector.
TypeTo as(const TypeFrom &t)
bool isCompatible(const VectorSpaceBase< Scalar > &space) const
Base interface for a strategy object for randomizing a multi-vector.