00001
00008 #ifndef MORPHEUS_VECTOR_H_
00009 #define MORPHEUS_VECTOR_H_
00010
00016 namespace Morpheus {
00017
00030 class Vector {
00031 public:
00032
00035
00044 Vector(const int numElements);
00045
00050 ~Vector();
00052
00055
00068 double& operator[](const int subscript);
00069
00082 const double& operator[](const int subscript) const;
00083
00085 int getNumElements() const;
00087
00090
00095 void setValue(const double alpha=0);
00096
00102 void scale(const double alpha);
00103
00114 void add(const Vector& b, Vector& sum) const;
00115
00122 double dot(const Vector& b) const;
00124
00127
00129 double norm1() const;
00130
00132 double normInf() const;
00133
00135 double norm2() const;
00137
00140
00150 void print() const;
00152
00153 private:
00158 int numElements_;
00163 double* data_;
00164 };
00165
00166 }
00167 #endif
00168