10 #ifndef XPETRA_MULTIVECTOR_DEF_HPP
11 #define XPETRA_MULTIVECTOR_DEF_HPP
17 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
22 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
30 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
33 typedef Teuchos::ScalarTraits<Scalar> SCT;
35 const size_t numVectors = getNumVectors();
36 for (
size_t i = 0; i < numVectors; i++) {
37 Teuchos::ArrayRCP<Scalar> datai = getDataNonConst(i);
39 const size_t myLength = getLocalLength();
40 for (
size_t j = 0; j < myLength; j++) {
41 datai[j] = SCT::random();
46 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
49 typedef Teuchos::ScalarTraits<Scalar> SCT;
50 Scalar point5 = SCT::one() / (SCT::one() + SCT::one());
52 const size_t numVectors = getNumVectors();
53 for (
size_t i = 0; i < numVectors; i++) {
54 Teuchos::ArrayRCP<Scalar> datai = getDataNonConst(i);
56 const size_t myLength = getLocalLength();
57 for (
size_t j = 0; j < myLength; j++) {
58 datai[j] = point5 * (maxVal - minVal) * SCT::random() + point5 * (maxVal + minVal);
65 #endif // XPETRA_MULTIVECTOR_DEF_HPP
virtual void Xpetra_randomize()
Set multi-vector values to random numbers. XPetra implementation.
MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > & operator=(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Assignment operator: Does a deep copy.
virtual ~MultiVector()
Destructor.