?? vector.hpp
字號:
// vector.hpp// A vector definition for real or complex vector // adds Linear Algebra operations to BasicArray// (c) Copyright 1995, Everett F. Carter Jr.// Permission is granted by the author to use// this software for any application provided this// copyright notice is preserved.// rcsid: $Id$ @(#)vector.hpp 1.12 10:24:33 5/11/95 EFC#ifndef VECTOR_HPP_#define VECTOR_HPP_ 1.12#include <math.h>#include <barray.hpp>#include <bool.h>class Vector : public BasicArray{ protected: static ostream* ostr; public: const int& rows; Vector() : BasicArray(1), rows(sze) {} Vector(const int r) : BasicArray(r), rows(sze) {} Vector(const Vector& v) : BasicArray(v), rows(sze) {} Vector(const BasicArray& v) : BasicArray(v), rows(sze) {} virtual ~Vector() {} Vector& operator=(const Vector& v); Vector& operator=(const BasicArray& v); Vector& operator+=(const Vector&); Vector& operator-=(const Vector&); friend Vector operator+(const Vector&, const Vector&); // Vector+Vector friend Vector operator-(const Vector&, const Vector&); // Vector-Vector friend scalar_type operator*(const Vector&,const Vector&); // Vector*Vector // Vector*scalar friend Vector operator*(const Vector& v, const double d);#ifdef COMPLEX friend Vector operator*(const Vector& v, const Complex d);#endif // scalar*Vector friend Vector operator*(const scalar_type d,const Vector& v) { return v * d; } // scalar assignment scalar_type operator=(const scalar_type d); friend bool operator==(const Vector&,const Vector&); // equality // attach the output stream for error messages, // (cerr is used if this is not ever used) static void attach(ostream& os) { ostr = &os; }};#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -