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 #ifndef NOX_EPETRA_VECTOR_H
00043 #define NOX_EPETRA_VECTOR_H
00044
00045 #include "NOX_Abstract_Vector.H"
00046 #include "Teuchos_RCP.hpp"
00047 #include "NOX_Epetra_VectorSpace.H"
00048
00049
00050 class Epetra_Vector;
00051 namespace NOX {
00052 namespace Epetra {
00053 class VectorSpace;
00054 }
00055 }
00056
00057 namespace NOX {
00058
00060 namespace Epetra {
00061
00063 class Vector : public virtual NOX::Abstract::Vector {
00064
00065 public:
00066
00068 enum MemoryType {
00070 CreateView,
00072 CreateCopy
00073 };
00074
00087 Vector(const Teuchos::RCP<Epetra_Vector>& source,
00088 NOX::Epetra::Vector::MemoryType memoryType =
00089 NOX::Epetra::Vector::CreateCopy,
00090 NOX::CopyType type = NOX::DeepCopy,
00091 Teuchos::RCP<NOX::Epetra::VectorSpace> vs =
00092 Teuchos::null);
00093
00095
00096 Vector(const Epetra_Vector& source,
00097 NOX::CopyType type = NOX::DeepCopy,
00098 Teuchos::RCP<NOX::Epetra::VectorSpace> vs =
00099 Teuchos::null);
00100
00102 Vector(const NOX::Epetra::Vector& source,
00103 NOX::CopyType type = NOX::DeepCopy);
00104
00106 ~Vector();
00107
00109
00111 virtual Epetra_Vector& getEpetraVector();
00112
00114 virtual const Epetra_Vector& getEpetraVector() const;
00115
00117
00119
00120
00121 virtual NOX::Abstract::Vector& init(double gamma);
00122
00123
00124 virtual NOX::Abstract::Vector& random(bool useSeed = false, int seed = 1);
00125
00127
00129 virtual NOX::Abstract::Vector& operator=(const Epetra_Vector& y);
00130
00131
00132 virtual NOX::Abstract::Vector& operator=(const NOX::Epetra::Vector& y);
00133 virtual NOX::Abstract::Vector& operator=(const NOX::Abstract::Vector& y);
00134
00135
00136 virtual NOX::Abstract::Vector& abs(const NOX::Epetra::Vector& y);
00137 virtual NOX::Abstract::Vector& abs(const NOX::Abstract::Vector& y);
00138
00139
00140 virtual NOX::Abstract::Vector& reciprocal(const NOX::Epetra::Vector& y);
00141 virtual NOX::Abstract::Vector& reciprocal(const NOX::Abstract::Vector& y);
00142
00144
00146
00147
00148 virtual NOX::Abstract::Vector& scale(double gamma);
00149
00150
00151 virtual NOX::Abstract::Vector& scale(const NOX::Epetra::Vector& a);
00152 virtual NOX::Abstract::Vector& scale(const NOX::Abstract::Vector& a);
00153
00154
00155 virtual NOX::Abstract::Vector& update(double alpha, const NOX::Epetra::Vector& a,
00156 double gamma = 0.0);
00157 virtual NOX::Abstract::Vector& update(double alpha, const NOX::Abstract::Vector& a,
00158 double gamma = 0.0);
00159
00160
00161 virtual NOX::Abstract::Vector& update(double alpha, const NOX::Epetra::Vector& a,
00162 double beta, const NOX::Epetra::Vector& b,
00163 double gamma = 0.0);
00164 virtual NOX::Abstract::Vector& update(double alpha, const NOX::Abstract::Vector& a,
00165 double beta, const NOX::Abstract::Vector& b,
00166 double gamma = 0.0);
00167
00168
00170
00172
00173
00174 virtual Teuchos::RCP<NOX::Abstract::Vector>
00175 clone(CopyType type = DeepCopy) const;
00176
00185 virtual Teuchos::RCP<NOX::Abstract::MultiVector>
00186 createMultiVector(const NOX::Abstract::Vector* const* vecs,
00187 int numVecs, NOX::CopyType type = NOX::DeepCopy) const;
00188
00195 virtual Teuchos::RCP<NOX::Abstract::MultiVector>
00196 createMultiVector(int numVecs, NOX::CopyType type = NOX::DeepCopy) const;
00197
00199
00201
00202
00203 virtual double norm(NOX::Abstract::Vector::NormType type = TwoNorm) const;
00204
00205
00206 virtual double norm(const NOX::Epetra::Vector& weights) const;
00207 virtual double norm(const NOX::Abstract::Vector& weights) const;
00208
00210
00212
00213
00214 virtual double innerProduct(const NOX::Epetra::Vector& y) const;
00215 virtual double innerProduct(const NOX::Abstract::Vector& y) const;
00216
00218
00219
00220 virtual int length() const;
00221
00222
00223 virtual void print(std::ostream& stream) const;
00224
00226 virtual Teuchos::RCP<NOX::Epetra::VectorSpace>
00227 getVectorSpace() const;
00228
00229 protected:
00230
00232 Teuchos::RCP<Epetra_Vector> epetraVec;
00233
00235 Teuchos::RCP<NOX::Epetra::VectorSpace> vectorSpace;
00236
00237 };
00238 }
00239 }
00240
00241 #endif