Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef XPETRA_EPETRAVECTOR_HPP
00047 #define XPETRA_EPETRAVECTOR_HPP
00048
00049
00050
00051 #include "Xpetra_EpetraConfigDefs.hpp"
00052
00053 #include "Xpetra_Vector.hpp"
00054 #include "Xpetra_EpetraMultiVector.hpp"
00055 #include "Xpetra_EpetraMap.hpp"
00056 #include "Xpetra_Utils.hpp"
00057 #include "Xpetra_EpetraImport.hpp"
00058 #include "Xpetra_EpetraExport.hpp"
00059 #include "Xpetra_Exceptions.hpp"
00060
00061 #include <Epetra_Vector.h>
00062
00063 namespace Xpetra {
00064
00065
00066 Epetra_Vector & toEpetra(Vector<double, int, int> &);
00067
00068 const Epetra_Vector & toEpetra(const Vector<double, int, int> &);
00069
00070
00071 class EpetraVector
00072 : public virtual Vector<double,int,int>, public EpetraMultiVector
00073 {
00074
00075 typedef double Scalar;
00076 typedef int LocalOrdinal;
00077 typedef int GlobalOrdinal;
00078 typedef Kokkos::DefaultNode::DefaultNodeType Node;
00079
00080 public:
00081
00082 using EpetraMultiVector::dot;
00083 using EpetraMultiVector::norm1;
00084 using EpetraMultiVector::norm2;
00085 using EpetraMultiVector::normInf;
00086 using EpetraMultiVector::normWeighted;
00087 using EpetraMultiVector::meanValue;
00088 using EpetraMultiVector::replaceGlobalValue;
00089 using EpetraMultiVector::sumIntoGlobalValue;
00090 using EpetraMultiVector::replaceLocalValue;
00091 using EpetraMultiVector::sumIntoLocalValue;
00092
00094
00095
00097 explicit EpetraVector(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true);
00098
00100 EpetraVector(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
00101
00103 virtual ~EpetraVector() { }
00104
00106
00108
00109
00111 void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value);
00112
00114 void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value);
00115
00117 void replaceLocalValue(LocalOrdinal myRow, const Scalar &value);
00118
00120 void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value);
00121
00123
00125
00126
00128 Scalar dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const;
00129
00131 Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const;
00132
00134 Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const;
00135
00137 Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const;
00138
00140 Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
00141
00143 Scalar meanValue() const;
00144
00146
00148
00149
00151 std::string description() const;
00152
00154 void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const;
00155
00157
00159
00160
00162 EpetraVector(const Teuchos::RCP<Epetra_Vector> &vec) : EpetraMultiVector(vec) { }
00163
00165 Epetra_Vector * getEpetra_Vector() const { return (*this->EpetraMultiVector::getEpetra_MultiVector())(0); }
00166
00167
00169
00170 };
00171
00172 }
00173
00174 #endif // XPETRA_EPETRAVECTOR_HPP