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_ABSTRACT_VECTOR_H
00043 #define NOX_ABSTRACT_VECTOR_H
00044
00045 #include "NOX_Common.H"
00046 #include "Teuchos_RCP.hpp"
00047
00048
00049 namespace NOX {
00050 namespace Abstract {
00051 class MultiVector;
00052 }
00053 }
00054
00056 namespace NOX {
00057
00059 enum CopyType {
00061 DeepCopy,
00063 ShapeCopy
00064 };
00065
00073 namespace Abstract {
00074
00087 class Vector {
00088
00089 public:
00090
00092 enum NormType {
00094 TwoNorm,
00096 OneNorm,
00098 MaxNorm
00099 };
00100
00102 Vector() {};
00103
00105 virtual ~Vector() {};
00106
00108
00110
00115 virtual NOX::Abstract::Vector& init(double gamma) = 0;
00116
00118
00128 virtual NOX::Abstract::Vector& random(bool useSeed = false, int seed = 1);
00129
00131
00137 virtual NOX::Abstract::Vector& abs(const NOX::Abstract::Vector& y) = 0;
00138
00140
00146 virtual NOX::Abstract::Vector& operator=(const NOX::Abstract::Vector& y) = 0;
00147
00149
00155 virtual NOX::Abstract::Vector& reciprocal(const NOX::Abstract::Vector& y) = 0;
00156
00158
00160
00162
00168 virtual NOX::Abstract::Vector& scale(double gamma) = 0;
00169
00171
00177 virtual NOX::Abstract::Vector& scale(const NOX::Abstract::Vector& a) = 0;
00178
00180
00186 virtual NOX::Abstract::Vector& update(double alpha, const NOX::Abstract::Vector& a, double gamma = 0.0) = 0;
00187
00189
00195 virtual NOX::Abstract::Vector& update(double alpha, const NOX::Abstract::Vector& a,
00196 double beta, const NOX::Abstract::Vector& b,
00197 double gamma = 0.0) = 0;
00198
00200
00202
00216 virtual Teuchos::RCP<NOX::Abstract::Vector>
00217 clone(NOX::CopyType type = NOX::DeepCopy) const = 0;
00218
00227 virtual Teuchos::RCP<NOX::Abstract::MultiVector>
00228 createMultiVector(const NOX::Abstract::Vector* const* vecs,
00229 int numVecs, NOX::CopyType type = NOX::DeepCopy) const;
00230
00237 virtual Teuchos::RCP<NOX::Abstract::MultiVector>
00238 createMultiVector(int numVecs, NOX::CopyType type = NOX::DeepCopy) const;
00239
00241
00243
00245
00256 virtual double norm(NOX::Abstract::Vector::NormType type = NOX::Abstract::Vector::TwoNorm) const = 0;
00257
00259
00264 virtual double norm(const NOX::Abstract::Vector& weights) const = 0;
00265
00267
00269
00271
00276 virtual double innerProduct(const NOX::Abstract::Vector& y) const = 0;
00277
00279
00281
00286 virtual int length() const = 0;
00287
00289 virtual void print(std::ostream& stream) const;
00290
00291 };
00292 }
00293 }
00294
00295 #endif