46#ifndef XPETRA_TPETRAVECTOR_DEF_HPP
47#define XPETRA_TPETRAVECTOR_DEF_HPP
54template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
63template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
67 :
TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, A, map->getLocalNumElements(), 1)
72template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
79template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
84 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::replaceGlobalValue");
85 getTpetra_Vector()->replaceGlobalValue(globalRow, value);
89template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
94 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::sumIntoGlobalValue");
95 getTpetra_Vector()->sumIntoGlobalValue(globalRow, value);
99template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
104 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::replaceLocalValue");
105 getTpetra_Vector()->replaceLocalValue(myRow, value);
109template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
114 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::sumIntoLocalValue");
115 getTpetra_Vector()->sumIntoLocalValue(myRow, value);
119template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
124 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm1");
125 return getTpetra_Vector()->norm1();
129template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
134 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm2");
135 return getTpetra_Vector()->norm2();
139template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
144 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::normInf");
145 return getTpetra_Vector()->normInf();
149template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
154 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::meanValue");
155 return getTpetra_Vector()->meanValue();
159template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
164 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::description");
165 return getTpetra_Vector()->description();
169template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
174 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::describe");
175 getTpetra_Vector()->describe(out, verbLevel);
179template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
184 XPETRA_MONITOR(
"TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::dot");
185 return getTpetra_Vector()->dot(*
toTpetra(a));
189template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
197template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
206#ifdef HAVE_XPETRA_EPETRA
208#if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) \
209 || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
212template<
class Scalar>
214 :
public virtual Vector<Scalar, int, int, EpetraNode>
221#undef XPETRA_TPETRAMULTIVECTOR_SHORT
222#undef XPETRA_TPETRAVECTOR_SHORT
224#define XPETRA_TPETRAMULTIVECTOR_SHORT
225#define XPETRA_TPETRAVECTOR_SHORT
352 return Teuchos::null;
365#if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) \
366 || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
369template<
class Scalar>
371 :
public virtual Vector<Scalar, int, long long, EpetraNode>
378#undef XPETRA_TPETRAMULTIVECTOR_SHORT
379#undef XPETRA_TPETRAVECTOR_SHORT
381#define XPETRA_TPETRAMULTIVECTOR_SHORT
382#define XPETRA_TPETRAVECTOR_SHORT
385 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::dot;
386 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::norm1;
387 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::norm2;
388 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::normInf;
389 using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
::meanValue;
500 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.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
static magnitudeType magnitude(T a)