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
00044 #ifndef NOX_THYRA_VECTOR_H
00045 #define NOX_THYRA_VECTOR_H
00046
00047 #include "NOX_Abstract_Vector.H"
00048 #include "Thyra_VectorBase.hpp"
00049 #include "Teuchos_RCP.hpp"
00050
00051 #ifndef TEUCHOS_DISABLE_ALL_TIMERS
00052
00053 #define ENABLE_NOX_THYRA_TIMERS
00054 #endif
00055
00056 #ifdef ENABLE_NOX_THYRA_TIMERS
00057 #include "Teuchos_TimeMonitor.hpp"
00058 #endif
00059
00060 namespace NOX {
00061
00063 namespace Thyra {
00064
00066 class Vector : public NOX::Abstract::Vector {
00067
00068 public:
00069
00071
00072 Vector(const Teuchos::RCP< ::Thyra::VectorBase<double> >& src);
00073
00075
00076 Vector(const ::Thyra::VectorBase<double>& source);
00077
00079 Vector(const NOX::Thyra::Vector& source,
00080 NOX::CopyType type = NOX::DeepCopy);
00081
00083 ~Vector();
00084
00086
00088 virtual ::Thyra::VectorBase<double>& getThyraVector();
00089
00091 virtual const ::Thyra::VectorBase<double>& getThyraVector() const;
00092
00094 virtual Teuchos::RCP< ::Thyra::VectorBase<double> > getThyraRCPVector();
00095
00097 virtual Teuchos::RCP<const ::Thyra::VectorBase<double> > getThyraRCPVector() const;
00098
00100
00102
00104 NOX::Abstract::Vector& init(double gamma);
00105
00107 NOX::Abstract::Vector& random(bool useSeed=false, int seed=1);
00108
00110 NOX::Abstract::Vector& operator=(const NOX::Abstract::Vector& y);
00111 NOX::Abstract::Vector& operator=(const NOX::Thyra::Vector& y);
00112
00117 NOX::Abstract::Vector& abs(const NOX::Abstract::Vector& y);
00118
00120 NOX::Abstract::Vector& reciprocal(const NOX::Abstract::Vector& y);
00121
00123
00125
00127 NOX::Abstract::Vector& scale(double gamma);
00128
00130 NOX::Abstract::Vector& scale(const NOX::Abstract::Vector& a);
00131
00133 NOX::Abstract::Vector& update(double alpha,
00134 const NOX::Abstract::Vector& a,
00135 double gamma = 0.0);
00136
00141 NOX::Abstract::Vector& update(double alpha,
00142 const NOX::Abstract::Vector& a,
00143 double beta,
00144 const NOX::Abstract::Vector& b,
00145 double gamma = 0.0);
00146
00148
00150
00155 Teuchos::RCP<NOX::Abstract::Vector>
00156 clone(NOX::CopyType type = NOX::DeepCopy) const;
00157
00163 virtual Teuchos::RCP<NOX::Abstract::MultiVector>
00164 createMultiVector(const NOX::Abstract::Vector* const* vecs,
00165 int numVecs, NOX::CopyType type = NOX::DeepCopy) const;
00166
00170 virtual Teuchos::RCP<NOX::Abstract::MultiVector>
00171 createMultiVector(int numVecs, NOX::CopyType type = NOX::DeepCopy) const;
00172
00174
00176
00178 double norm(NOX::Abstract::Vector::NormType type = NOX::Abstract::Vector::TwoNorm) const;
00179
00181 double norm(const NOX::Abstract::Vector& weights) const;
00182
00184
00186
00188 double innerProduct(const NOX::Abstract::Vector& y) const;
00189
00191
00193 int length() const;
00194
00196 void print(std::ostream& stream) const;
00197
00198 protected:
00199
00201 Teuchos::RCP< ::Thyra::VectorBase<double> > thyraVec;
00202
00203 };
00204
00205 }
00206 }
00207
00208 #endif