10 #ifndef __TSQR_Trilinos_Randomizer_hpp
11 #define __TSQR_Trilinos_Randomizer_hpp
14 #include "TsqrTypeAdaptor.hpp"
15 #include "TsqrCommFactory.hpp"
17 #include "Tsqr_ScalarTraits.hpp"
18 #include "Tsqr_Random_GlobalMatrix.hpp"
38 template<
class S,
class LO,
class GO,
class MV,
class Gen >
41 typedef S scalar_type;
42 typedef LO local_ordinal_type;
43 typedef GO global_ordinal_type;
44 typedef MV multivector_type;
45 typedef Gen normalgen_type;
47 typedef TSQR::Random::MatrixGenerator< S, LO, Gen > matgen_type;
49 typedef typename TSQR::ScalarTraits< S >::magnitude_type magnitude_type;
51 typedef TsqrTypeAdaptor< S, LO, GO, MV > type_adaptor;
52 typedef typename type_adaptor::comm_type comm_type;
53 typedef typename type_adaptor::comm_ptr comm_ptr;
70 const magnitude_type singularValues[])
72 using TSQR::Random::randomGlobalMatrix;
74 typedef MatView< local_ordinal_type, scalar_type > matview_type;
76 local_ordinal_type nrowsLocal, ncols, LDA;
77 fetchDims (A, nrowsLocal, ncols, LDA);
78 ArrayRCP< scalar_type > A_ptr = fetchNonConstView (A);
79 matview_type A_view (nrowsLocal, ncols, A_ptr.get(), LDA);
81 randomGlobalMatrix (pGen_.
get(), A_view, singularValues,
82 pOrdinalMessenger_.
get(), pScalarMessenger_.
get());
95 init (
const multivector_type& mv,
100 fetchMessengers (mv, pScalarMessenger_, pOrdinalMessenger_);
120 fetchDims (
const multivector_type& A,
121 local_ordinal_type& nrowsLocal,
122 local_ordinal_type& ncols,
123 local_ordinal_type& LDA)
const = 0;
133 fetchNonConstView (multivector_type& A)
const = 0;
138 fetchMessengers (
const multivector_type& mv,
139 scalar_messenger_ptr& pScalarMessenger,
140 ordinal_messenger_ptr& pOrdinalMessenger)
const = 0;
143 ordinal_messenger_ptr pOrdinalMessenger_;
144 scalar_messenger_ptr pScalarMessenger_;
150 #endif // __TSQR_Trilinos_Randomizer_hpp
Generates random test problems for TSQR.
Anasazi header file which uses auto-configuration information to include necessary C++ headers...
virtual void randomMultiVector(multivector_type &A, const magnitude_type singularValues[])
Fill A with a (pseudo)random (distributed) matrix.
void init(const multivector_type &mv, const normalgen_ptr &pGen)