/* define an NVector as an Array with arithmatic H. Schellman */ #ifndef NVector_H #define NVector_H #include "Array.h" class NVector : public Array{ public: // converter from Array to NVector NVector(); NVector(const int i, const double value); NVector(const int i); // converter from Array to NVector NVector(const Array& rhs); // unary operators void operator += (const NVector& v); void operator -= (const NVector& v); void operator *= (const double d); void operator /= (const double d); //binary operators NVector operator + (const NVector& v)const; friend NVector operator - (const NVector& lhs, const NVector& rhs); NVector operator * (const double d) const; double operator * (const NVector& a) const; // dot product friend NVector operator *(const double lhs, const NVector& rhs); NVector operator / (const double d) const; // don't allow double/NVector as an operation. private: }; #endif