10 #ifndef XPETRA_TPETRAVECTOR_DEF_HPP
11 #define XPETRA_TPETRAVECTOR_DEF_HPP
16 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
23 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
26 const Teuchos::ArrayView<const Scalar>& A)
27 :
TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, A, map->getLocalNumElements(), 1) {
30 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
35 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
38 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::replaceGlobalValue");
39 getTpetra_Vector()->replaceGlobalValue(globalRow, value);
42 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
45 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::sumIntoGlobalValue");
46 getTpetra_Vector()->sumIntoGlobalValue(globalRow, value);
49 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
52 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::replaceLocalValue");
53 getTpetra_Vector()->replaceLocalValue(myRow, value);
56 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
59 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::sumIntoLocalValue");
60 getTpetra_Vector()->sumIntoLocalValue(myRow, value);
63 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
64 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
67 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm1");
68 return getTpetra_Vector()->norm1();
71 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
72 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
75 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm2");
76 return getTpetra_Vector()->norm2();
79 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
80 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
83 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::normInf");
84 return getTpetra_Vector()->normInf();
87 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
91 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::meanValue");
92 return getTpetra_Vector()->meanValue();
95 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
99 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::description");
100 return getTpetra_Vector()->description();
103 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
105 describe(Teuchos::FancyOStream& out,
const Teuchos::EVerbosityLevel verbLevel)
const {
106 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::describe");
107 getTpetra_Vector()->describe(out, verbLevel);
110 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
114 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::dot");
115 return getTpetra_Vector()->dot(*
toTpetra(a));
118 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
120 TpetraVector(
const Teuchos::RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>& vec)
124 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
125 RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
131 #ifdef HAVE_XPETRA_EPETRA
133 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
136 template <
class Scalar>
138 :
public virtual Vector<Scalar, int, int, EpetraNode>,
public TpetraMultiVector<Scalar, int, int, EpetraNode> {
143 #undef XPETRA_TPETRAMULTIVECTOR_SHORT
144 #undef XPETRA_TPETRAVECTOR_SHORT
146 #define XPETRA_TPETRAMULTIVECTOR_SHORT
147 #define XPETRA_TPETRAVECTOR_SHORT
173 TpetraVector(
const Teuchos::RCP<const Map>& map,
const Teuchos::ArrayView<const Scalar>& A)
200 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
norm1()
const {
201 return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
205 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
norm2()
const {
206 return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
210 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
normInf()
const {
211 return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
215 Scalar
meanValue()
const {
return Teuchos::ScalarTraits<Scalar>::zero(); }
226 void describe(Teuchos::FancyOStream& out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
231 Scalar
dot(
const Vector& a)
const {
return Teuchos::ScalarTraits<Scalar>::zero(); }
237 TpetraVector(
const Teuchos::RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>& vec)
246 RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
248 return Teuchos::null;
255 #endif // #if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT)))
258 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
261 template <
class Scalar>
263 :
public virtual Vector<Scalar, int, long long, EpetraNode>,
public TpetraMultiVector<Scalar, int, long long, EpetraNode> {
268 #undef XPETRA_TPETRAMULTIVECTOR_SHORT
269 #undef XPETRA_TPETRAVECTOR_SHORT
271 #define XPETRA_TPETRAMULTIVECTOR_SHORT
272 #define XPETRA_TPETRAVECTOR_SHORT
275 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::dot;
276 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::norm1;
277 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::norm2;
278 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::normInf;
279 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::meanValue;
280 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::replaceGlobalValue;
281 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::sumIntoGlobalValue;
282 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::replaceLocalValue;
283 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::sumIntoLocalValue;
298 TpetraVector(
const Teuchos::RCP<const Map>& map,
const Teuchos::ArrayView<const Scalar>& A)
332 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
norm1()
const {
333 return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
337 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
norm2()
const {
338 return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
342 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
normInf()
const {
343 return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
347 Scalar
meanValue()
const {
return Teuchos::ScalarTraits<Scalar>::zero(); }
358 void describe(Teuchos::FancyOStream& out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
363 Scalar
dot(
const Vector& a)
const {
return Teuchos::ScalarTraits<Scalar>::zero(); }
371 TpetraVector(
const Teuchos::RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>& vec) {
379 RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
381 return Teuchos::null;
388 #endif // #if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))
391 #endif // HAVE_XPETRA_EPETRA
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
std::string description() const
Return a simple one-line description of this object.
virtual ~TpetraVector()
Destructor.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
Scalar meanValue() const
Compute mean (average) value of this Vector.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
Scalar dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
Computes dot product of this Vector against input Vector x.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
TpetraVector(const Teuchos::RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >> &vec)
TpetraMultiVector constructor to wrap a Tpetra::MultiVector object.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
TpetraVector(const Teuchos::RCP< const Map > &map, const Teuchos::ArrayView< const Scalar > &A)
Set multi-vector values from an array using Teuchos memory management classes. (copy) ...
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
std::string description() const
Return a simple one-line description of this object.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
Scalar meanValue() const
Compute mean (average) value of this Vector.
RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Vector() const
Get the underlying Tpetra multivector.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
TpetraVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &map, bool zeroOut=true)
Sets all vector entries to zero.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Vector() const
Get the underlying Tpetra multivector.
std::string description() const
Return a simple one-line description of this object.
RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_MultiVector() const
Get the underlying Tpetra multivector.
#define XPETRA_MONITOR(funcName)
TpetraVector(const Teuchos::RCP< const Map > &map, const Teuchos::ArrayView< const Scalar > &A)
Set multi-vector values from an array using Teuchos memory management classes. (copy) ...
Scalar dot(const Vector &a) const
Computes dot product of this Vector against input Vector x.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
Scalar dot(const Vector &a) const
Computes dot product of this Vector against input Vector x.
TpetraVector(const Teuchos::RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >> &vec)
TpetraMultiVector constructor to wrap a Tpetra::MultiVector object.
Scalar meanValue() const
Compute mean (average) value of this Vector.
RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Vector() const
Get the underlying Tpetra multivector.
TpetraVector(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
Sets all vector entries to zero.
virtual ~TpetraVector()
Destructor.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
TpetraVector(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
Sets all vector entries to zero.