00001 00005 class Vec(Type) : public VecSort(Type), public Vector(Type) 00006 00007 { 00008 private: 00009 00010 Type* startOfAlloc () const; 00011 Type* endOfAlloc () const; 00012 Type& entry (Type* ap) const; 00013 00014 public: 00015 00016 00017 00018 Vec(Type) (); 00019 Vec(Type) (int length); 00020 Vec(Type) (Type* a, int n, int base = 0); 00021 Vec(Type) (const Vec(Type)& X); 00022 Vec(Type) (const Vector(prm_Type)& pm); 00023 00024 virtual ~Vec(Type) (); 00025 00026 00027 00028 00029 virtual int getNoEntries () const { return length; } 00030 virtual real getStorage () const; 00031 00032 00033 00034 00035 virtual bool makeItSimilar (Handle(Vector(Type))& v) const; 00036 virtual bool redim (const Vector(prm_Type)& pm); 00037 bool redim (int n) { return VecSimplest(Type) :: redim (n); } 00038 bool redim (Type* a, int n, int base = 0) { 00039 return VecSimplest(Type) ::redim(a,n,base); 00040 } 00041 00042 00043 00044 00045 virtual void fill (const Vector(Type)& X); 00046 virtual void fill (const Type& a); 00047 00048 Vec(Type)& operator = (const Vec(Type)& X) { 00049 VecSimple(Type) ::operator = (X); return *this; 00050 } 00051 00052 Vec(Type)& operator = (const Type& a) { 00053 VecSimple(Type) ::fill(a); return *this; 00054 } 00055 00056 00057 void fill (Type start, Type stop); 00058 00059 virtual void assemble (const Vec(Type)& ev, 00060 const VecSimple(int)& idx_trans, 00061 int elm_no); 00062 00063 00064 00065 00066 virtual void add 00067 (const Vector(Type)& yb, const Vector(Type)& zb); 00068 virtual void add 00069 (const Vector(Type)& yb, char s, const Vector(Type)& zb); 00070 virtual void add 00071 (const Vector(Type)& yb, Type b, const Vector(Type)& zb); 00072 virtual void add 00073 (Type a, const Vector(Type)& yb, Type b, const Vector(Type)& zb); 00074 00075 virtual void add 00076 (const Vector(Type)& y, int power, Type front_factor); 00077 virtual void add (Type value); 00078 00079 virtual void mult (Type value); 00080 virtual void apply (Func(Type) f); 00081 00082 virtual real norm (Norm_type lp = l2) const; 00083 virtual real normDiff (const Vector(Type)& y, Norm_type lp = l2) const; 00084 00085 virtual Type inner (const Vector(Type)& yb) const; 00086 00087 virtual void randomize (real low = -1, real high = 1, real seed = 1); 00088 00089 00090 00091 00092 00093 virtual void print (Os os, const char* header = NULL, 00094 int nentries_per_line = 3) const; 00095 virtual void printAscii (Os os, const char* header = NULL) const; 00096 00097 virtual void scan (Is is); 00098 00099 00100 friend Os& operator << (Os& os, const Vec(Type)& x); 00101 friend Is& operator >> (Is& is , Vec(Type)& x); 00102 00103 virtual void save (const char* filename, const char* name = "X") const; 00104 virtual void load (const char* filename, const char* name = "X"); 00105 00106 CLASS_INFO 00107 00108 VIRTUAL_CAST(Vec(Type)) 00109 }; 00110 00111