Thyra Version of the Day
Loading...
Searching...
No Matches
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
18namespace Thyra {
19
20
29template<class Scalar>
31public:
32
35
37 bool isCompatible( const VectorSpaceBase<Scalar> &space ) const;
38
40
41private:
42
45
47 void randomizeImpl(const Ptr<MultiVectorBase<Scalar> > &mv);
48
50
51};
52
53
58template<class Scalar>
64
65
66// //////////////////////////////
67// Definitions
68
69
70template<class Scalar>
72{
73 return true;
74}
75
76
77// Overridded private functions
78
79
80template<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
Interface for a collection of column vectors called a multi-vector.
Base interface for a strategy object for randomizing a multi-vector.
Univeral MultiVectorRandomizerBase subclass that is compatible with all MultiVectorBase objects.
bool isCompatible(const VectorSpaceBase< Scalar > &space) const
RCP< UniversalMultiVectorRandomizer< Scalar > > universalMultiVectorRandomizer()
Nonmember constructor.
Abstract interface for objects that represent a space for vectors.
TypeTo as(const TypeFrom &t)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)