00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef NOX_Playa_VECTOR_H
00011 #define NOX_Playa_VECTOR_H
00012
00013 #include "NOX_Abstract_Vector.H"
00014 #include "NOX_Common.H"
00015 #include "PlayaVectorDecl.hpp"
00016 #include "PlayaVectorSpaceDecl.hpp"
00017
00018 namespace NOX
00019 {
00020
00021
00022 namespace NOXPlaya
00023 {
00024 using Teuchos::RCP;
00025
00026
00027
00028
00029
00030
00031 class Vector : public NOX::Abstract::Vector
00032 {
00033
00034 public:
00035
00036
00037 Vector(const NOX::NOXPlaya::Vector& source,
00038 NOX::CopyType type = DeepCopy);
00039
00040
00041 Vector(const Playa::Vector<double>& source,
00042 NOX::CopyType type = DeepCopy);
00043
00044
00045 Vector(const NOX::NOXPlaya::Vector& source,
00046 int numdigits,
00047 NOX::CopyType type = DeepCopy);
00048
00049
00050 Vector(const Playa::Vector<double>& source,
00051 int numdigits,
00052 NOX::CopyType type = DeepCopy);
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 Playa::Vector<double>& getPlayaVector();
00063
00064
00065 const Playa::Vector<double>& getPlayaVector() const;
00066
00067
00068 int getPrecision() const;
00069
00070
00071
00072
00073 NOX::Abstract::Vector& init(double value);
00074
00075
00076 NOX::Abstract::Vector& operator=(const NOX::NOXPlaya::Vector& y);
00077
00078 NOX::Abstract::Vector& operator=(const NOX::Abstract::Vector& y);
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 NOX::Abstract::Vector& abs(const NOX::NOXPlaya::Vector& y);
00092
00093 NOX::Abstract::Vector& abs(const NOX::Abstract::Vector& y);
00094
00095
00096 NOX::Abstract::Vector& reciprocal(const NOX::NOXPlaya::Vector& y);
00097
00098 NOX::Abstract::Vector& reciprocal(const NOX::Abstract::Vector& y);
00099
00100
00101
00102
00103
00104
00105 NOX::Abstract::Vector& scale(double gamma);
00106
00107
00108 NOX::Abstract::Vector& scale(const NOX::NOXPlaya::Vector& a);
00109 NOX::Abstract::Vector& scale(const NOX::Abstract::Vector& a);
00110
00111
00112 NOX::Abstract::Vector& update(double alpha, const NOX::NOXPlaya::Vector& a, double gamma = 0.0);
00113 NOX::Abstract::Vector& update(double alpha, const NOX::Abstract::Vector& a, double gamma = 0.0);
00114
00115
00116 NOX::Abstract::Vector& update(double alpha, const NOX::NOXPlaya::Vector& a,
00117 double beta, const NOX::NOXPlaya::Vector& b,
00118 double gamma = 0.0);
00119 NOX::Abstract::Vector& update(double alpha, const NOX::Abstract::Vector& a,
00120 double beta, const NOX::Abstract::Vector& b,
00121 double gamma = 0.0);
00122
00123
00124
00125
00126
00127
00128 #ifdef TRILINOS_6
00129 NOX::Abstract::Vector* clone(NOX::CopyType type = NOX::DeepCopy) const;
00130 #else
00131 RCP<NOX::Abstract::Vector> clone(NOX::CopyType type = NOX::DeepCopy) const ;
00132 #endif
00133
00134
00135
00136
00137
00138
00139 double norm(NOX::Abstract::Vector::NormType type = NOX::Abstract::Vector::TwoNorm) const;
00140
00141
00142 double norm(const NOX::NOXPlaya::Vector& weights) const;
00143 double norm(const NOX::Abstract::Vector& weights) const;
00144
00145
00146
00147
00148
00149
00150 double dot(const NOX::NOXPlaya::Vector& y) const;
00151 double dot(const NOX::Abstract::Vector& y) const;
00152 double innerProduct(const NOX::Abstract::Vector& y) const;
00153
00154
00155
00156
00157
00158
00159 int length() const;
00160
00161
00162
00163
00164
00165
00166
00167 ostream& leftshift(std::ostream& stream) const;
00168
00169
00170 void print() const;
00171
00172 private:
00173
00174
00175 int precision;
00176
00177
00178 Playa::Vector<double> x;
00179 };
00180
00181 }
00182 }
00183
00184
00185 namespace std{
00186
00187 ostream& operator<<(std::ostream& stream, const NOX::NOXPlaya::Vector& v);
00188 }
00189
00190 #endif