29 #ifndef __TSQR_Trilinos_Randomizer_hpp 30 #define __TSQR_Trilinos_Randomizer_hpp 33 #include "TsqrTypeAdaptor.hpp" 34 #include "TsqrCommFactory.hpp" 36 #include "Tsqr_ScalarTraits.hpp" 37 #include "Tsqr_Random_GlobalMatrix.hpp" 57 template<
class S,
class LO,
class GO,
class MV,
class Gen >
60 typedef S scalar_type;
61 typedef LO local_ordinal_type;
62 typedef GO global_ordinal_type;
63 typedef MV multivector_type;
64 typedef Gen normalgen_type;
65 typedef Teuchos::RCP< Gen > normalgen_ptr;
66 typedef TSQR::Random::MatrixGenerator< S, LO, Gen > matgen_type;
68 typedef typename TSQR::ScalarTraits< S >::magnitude_type magnitude_type;
70 typedef TsqrTypeAdaptor< S, LO, GO, MV > type_adaptor;
71 typedef typename type_adaptor::comm_type comm_type;
72 typedef typename type_adaptor::comm_ptr comm_ptr;
73 typedef Teuchos::RCP< MessengerBase< LO > > ordinal_messenger_ptr;
74 typedef Teuchos::RCP< MessengerBase< S > > scalar_messenger_ptr;
89 const magnitude_type singularValues[])
91 using TSQR::Random::randomGlobalMatrix;
92 using Teuchos::ArrayRCP;
93 typedef MatView< local_ordinal_type, scalar_type > matview_type;
95 local_ordinal_type nrowsLocal, ncols, LDA;
96 fetchDims (A, nrowsLocal, ncols, LDA);
97 ArrayRCP< scalar_type > A_ptr = fetchNonConstView (A);
98 matview_type A_view (nrowsLocal, ncols, A_ptr.get(), LDA);
100 randomGlobalMatrix (pGen_.get(), A_view, singularValues,
101 pOrdinalMessenger_.get(), pScalarMessenger_.get());
114 init (
const multivector_type& mv,
115 const normalgen_ptr& pGen)
119 fetchMessengers (mv, pScalarMessenger_, pOrdinalMessenger_);
139 fetchDims (
const multivector_type& A,
140 local_ordinal_type& nrowsLocal,
141 local_ordinal_type& ncols,
142 local_ordinal_type& LDA)
const = 0;
151 virtual Teuchos::ArrayRCP< scalar_type >
152 fetchNonConstView (multivector_type& A)
const = 0;
157 fetchMessengers (
const multivector_type& mv,
158 scalar_messenger_ptr& pScalarMessenger,
159 ordinal_messenger_ptr& pOrdinalMessenger)
const = 0;
162 ordinal_messenger_ptr pOrdinalMessenger_;
163 scalar_messenger_ptr pScalarMessenger_;
169 #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)