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 #include "Xpetra_EpetraVector.hpp"
00047
00048
00049
00050 namespace Xpetra {
00051
00052 EpetraVector::EpetraVector(const Teuchos::RCP<const Map<int,int> > &map, bool zeroOut) : EpetraMultiVector(map,1,zeroOut) { }
00053
00054 void EpetraVector::replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraVector::replaceGlobalValue"); getEpetra_MultiVector()->ReplaceGlobalValue(globalRow, 0, value); }
00055
00056 void EpetraVector::sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraVector::sumIntoGlobalValue");getEpetra_MultiVector()->SumIntoGlobalValue(globalRow, 0, value); }
00057
00058 void EpetraVector::replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraVector::replaceLocalValue");getEpetra_MultiVector()->ReplaceMyValue(myRow, 0, value); }
00059
00060 void EpetraVector::sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraVector::sumIntoLocalValue");getEpetra_MultiVector()->SumIntoMyValue(myRow, 0, value); }
00061
00062 double EpetraVector::dot(const Vector<double,int,int,Kokkos::DefaultNode::DefaultNodeType> &a) const {
00063 XPETRA_MONITOR("EpetraVector::dot");
00064
00065 XPETRA_DYNAMIC_CAST(const EpetraVector, a, tA, "This Xpetra::EpetraVector method only accept Xpetra::EpetraVector as input arguments.");
00066
00067
00068
00069 double r;
00070 getEpetra_MultiVector()->Epetra_MultiVector::Dot(*tA.getEpetra_MultiVector(), &r);
00071 return r;
00072 }
00073
00074 Teuchos::ScalarTraits<double>::magnitudeType EpetraVector::norm1() const { XPETRA_MONITOR("EpetraVector::norm1"); double r; getEpetra_MultiVector()->Norm1(&r); return r; }
00075
00076 Teuchos::ScalarTraits<double>::magnitudeType EpetraVector::norm2() const { XPETRA_MONITOR("EpetraVector::norm2"); double r; getEpetra_MultiVector()->Norm2(&r); return r; }
00077
00078 Teuchos::ScalarTraits<double>::magnitudeType EpetraVector::normInf() const { XPETRA_MONITOR("EpetraVector::normInf"); double r; getEpetra_MultiVector()->NormInf(&r); return r; }
00079
00080 Teuchos::ScalarTraits<double>::magnitudeType EpetraVector::normWeighted(const Vector<double,int,int,Kokkos::DefaultNode::DefaultNodeType> &weights) const {
00081 XPETRA_MONITOR("EpetraVector::normWeighted");
00082 XPETRA_DYNAMIC_CAST(const EpetraVector, weights, tWeights, "This Xpetra::EpetraVector method only accept Xpetra::EpetraVector as input arguments.");
00083 double r;
00084 getEpetra_MultiVector()->NormWeighted(*tWeights.getEpetra_MultiVector(), &r); return r;
00085 }
00086
00087 double EpetraVector::meanValue() const { XPETRA_MONITOR("EpetraVector::meanValue"); double r; getEpetra_MultiVector()->MeanValue(&r); return r; }
00088
00089 std::string EpetraVector::description() const {
00090 XPETRA_MONITOR("EpetraVector::description");
00091
00092 std::ostringstream oss;
00093 oss << Teuchos::Describable::description();
00094 oss << "{length="<<this->getGlobalLength()
00095 << "}";
00096 return oss.str();
00097 }
00098
00099 void EpetraVector::describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const {
00100 XPETRA_MONITOR("EpetraVector::describe");
00101
00102 if (verbLevel > Teuchos::VERB_NONE)
00103 getEpetra_Vector()->Print(out);
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 }
00163
00164
00165 Epetra_Vector & toEpetra(Vector<double, int, int> &x) {
00166 XPETRA_DYNAMIC_CAST( EpetraVector, x, tX, "toEpetra");
00167 return *tX.getEpetra_Vector();
00168 }
00169
00170 const Epetra_Vector & toEpetra(const Vector<double, int, int> &x) {
00171 XPETRA_DYNAMIC_CAST(const EpetraVector, x, tX, "toEpetra");
00172 return *tX.getEpetra_Vector();
00173 }
00174
00175
00176 }