10#ifndef XPETRA_TPETRAVECTOR_DEF_HPP
11#define XPETRA_TPETRAVECTOR_DEF_HPP
16template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
23template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
27 :
TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, A, map->getLocalNumElements(), 1) {
30template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
35template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
38 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::replaceGlobalValue");
39 getTpetra_Vector()->replaceGlobalValue(globalRow, value);
42template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
45 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::sumIntoGlobalValue");
46 getTpetra_Vector()->sumIntoGlobalValue(globalRow, value);
49template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
52 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::replaceLocalValue");
53 getTpetra_Vector()->replaceLocalValue(myRow, value);
56template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
59 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::sumIntoLocalValue");
60 getTpetra_Vector()->sumIntoLocalValue(myRow, value);
63template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
67 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm1");
68 return getTpetra_Vector()->norm1();
71template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
75 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm2");
76 return getTpetra_Vector()->norm2();
79template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
83 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::normInf");
84 return getTpetra_Vector()->normInf();
87template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
91 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::meanValue");
92 return getTpetra_Vector()->meanValue();
95template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
99 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::description");
100 return getTpetra_Vector()->description();
103template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
106 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::describe");
107 getTpetra_Vector()->describe(out, verbLevel);
110template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
114 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::dot");
115 return getTpetra_Vector()->dot(*
toTpetra(a));
118template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
124template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class 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))))
136template <
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
150 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::dot;
151 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::norm1;
152 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::norm2;
153 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::normInf;
154 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::meanValue;
248 return Teuchos::null;
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))))
261template <
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
381 return Teuchos::null;
#define XPETRA_MONITOR(funcName)
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
static const EVerbosityLevel verbLevel_default
RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_MultiVector() const
Get the underlying Tpetra multivector.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
std::string description() const
Return a simple one-line description of this object.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
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.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
Scalar dot(const Vector &a) const
Computes dot product of this Vector against input Vector x.
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< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &vec)
TpetraMultiVector constructor to wrap a Tpetra::MultiVector object.
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)
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
TpetraVector(const Teuchos::RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &vec)
TpetraMultiVector constructor to wrap a Tpetra::MultiVector object.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
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.
std::string description() const
Return a simple one-line description of this object.
TpetraVector(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
Sets all vector entries to zero.
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 describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Vector() const
Get the underlying Tpetra multivector.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
virtual ~TpetraVector()
Destructor.
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.
Scalar dot(const Vector &a) const
Computes dot product of this Vector against input Vector x.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Scalar dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
Computes dot product of this Vector against input Vector x.
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
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.
std::string description() const
Return a simple one-line description of this 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.
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.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
virtual ~TpetraVector()
Destructor.
TpetraVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
static magnitudeType magnitude(T a)