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 LOCA_EXTENDED_VECTOR_H
00043 #define LOCA_EXTENDED_VECTOR_H
00044
00045 #include "NOX_Common.H"
00046 #include "NOX_Abstract_Vector.H"
00047 #include "NOX_Abstract_MultiVector.H"
00048
00049
00050 namespace LOCA {
00051 class GlobalData;
00052 namespace Extended {
00053 class MultiVector;
00054 }
00055 }
00056
00057 namespace LOCA {
00058
00059 namespace Extended {
00060
00090 class Vector : public NOX::Abstract::Vector {
00091
00093 friend class LOCA::Extended::MultiVector;
00094
00095 public:
00096
00098 Vector(const Vector& source, NOX::CopyType type = NOX::DeepCopy);
00099
00101 virtual ~Vector();
00102
00104 virtual NOX::Abstract::Vector&
00105 operator=(const NOX::Abstract::Vector& y);
00106
00108 virtual Vector&
00109 operator=(const Vector& y);
00110
00112 virtual Teuchos::RCP<NOX::Abstract::Vector>
00113 clone(NOX::CopyType type = NOX::DeepCopy) const;
00114
00120 virtual Teuchos::RCP<NOX::Abstract::MultiVector>
00121 createMultiVector(const NOX::Abstract::Vector* const* vecs,
00122 int numVecs, NOX::CopyType type = NOX::DeepCopy) const;
00123
00127 virtual Teuchos::RCP<NOX::Abstract::MultiVector>
00128 createMultiVector(int numVecs, NOX::CopyType type = NOX::DeepCopy) const;
00129
00134 virtual NOX::Abstract::Vector&
00135 init(double gamma);
00136
00138 virtual NOX::Abstract::Vector&
00139 random(bool useSeed = false, int seed = 1);
00140
00145 virtual NOX::Abstract::Vector&
00146 abs(const NOX::Abstract::Vector& y);
00147
00152 virtual NOX::Abstract::Vector&
00153 reciprocal(const NOX::Abstract::Vector& y);
00154
00159 virtual NOX::Abstract::Vector&
00160 scale(double gamma);
00161
00166 virtual NOX::Abstract::Vector&
00167 scale(const NOX::Abstract::Vector& a);
00168
00173 virtual NOX::Abstract::Vector&
00174 update(double alpha, const NOX::Abstract::Vector& a,
00175 double gamma = 0.0);
00176
00181 virtual NOX::Abstract::Vector&
00182 update(double alpha, const NOX::Abstract::Vector& a,
00183 double beta, const NOX::Abstract::Vector& b,
00184 double gamma = 0.0);
00185
00190 virtual double
00191 norm(NormType type = TwoNorm) const;
00192
00198 virtual double
00199 norm(const NOX::Abstract::Vector& weights) const;
00200
00206 virtual double
00207 innerProduct(const NOX::Abstract::Vector& y) const;
00208
00213 virtual int
00214 length() const;
00215
00219 virtual void
00220 print(std::ostream& stream) const;
00221
00223 virtual void
00224 setVector(int i, const NOX::Abstract::Vector& v);
00225
00227 virtual void
00228 setVectorView(int i,
00229 const Teuchos::RCP<NOX::Abstract::Vector>& v);
00230
00232 virtual void
00233 setScalar(int i, double s);
00234
00236 virtual void
00237 setScalarArray(double *sv);
00238
00240 virtual Teuchos::RCP<const NOX::Abstract::Vector>
00241 getVector(int i) const;
00242
00244 virtual Teuchos::RCP<NOX::Abstract::Vector>
00245 getVector(int i);
00246
00248 virtual double
00249 getScalar(int i) const;
00250
00252 virtual double&
00253 getScalar(int i);
00254
00256 virtual
00257 Teuchos::RCP<const NOX::Abstract::MultiVector::DenseMatrix>
00258 getScalars() const;
00259
00261 virtual Teuchos::RCP<NOX::Abstract::MultiVector::DenseMatrix>
00262 getScalars();
00263
00265 virtual int getNumScalars() const;
00266
00268 virtual int getNumVectors() const;
00269
00270 protected:
00271
00273 Vector(const Teuchos::RCP<LOCA::GlobalData>& global_data,
00274 int nvecs, int nscalars);
00275
00277
00283 virtual Teuchos::RCP<LOCA::Extended::MultiVector>
00284 generateMultiVector(int nColumns, int nVectorRows,
00285 int nScalarRows) const;
00286
00287 protected:
00288
00290 Teuchos::RCP<LOCA::GlobalData> globalData;
00291
00293 vector< Teuchos::RCP<NOX::Abstract::Vector> > vectorPtrs;
00294
00296 vector< bool > isView;
00297
00299 int numScalars;
00300
00302 Teuchos::RCP<NOX::Abstract::MultiVector::DenseMatrix> scalarsPtr;
00303
00304 };
00305 }
00306 }
00307
00308 #endif