00001 00005 class ArrayGenSel(Type) : public ArrayGen(Type) 00006 00007 { 00008 00009 00010 private: 00011 00012 00013 00014 Handle(IndexSet) Ind; 00015 00016 protected: 00017 00018 void reset (); 00019 00020 public: 00021 00022 00023 00024 ArrayGenSel(Type) (); 00025 ArrayGenSel(Type) (int n1); 00026 ArrayGenSel(Type) (int n1, int n2); 00027 ArrayGenSel(Type) (int n1, int n2, int n3); 00028 ArrayGenSel(Type) (const Ptv(int)& n); 00029 ArrayGenSel(Type) (const IndexSet& I, int offset); 00030 ArrayGenSel(Type) (const IndexSet& I, const Ptv(int)& offset); 00031 ArrayGenSel(Type) (const ArrayGenSel(Type)& X); 00032 ArrayGenSel(Type) (const Vector(prm_Type)& pm); 00033 ~ArrayGenSel(Type) (); 00034 00035 00036 00037 00038 virtual int getNoEntries () const; 00039 00040 bool hasIndexSet () const; 00041 IndexSet& getIndexSet () const; 00042 00043 00044 00045 bool compatible(const IndexSet& I) const; 00046 00047 00048 00049 00050 bool compatible (const Vec(Type)& a) 00051 { return ArrayGen(Type) ::compatible(a); } 00052 bool compatible (const ArrayGen(Type)& a) 00053 { return ArrayGen(Type) ::compatible(a); } 00054 bool compatible (const ArrayGenSel(Type)& a) 00055 { return ArrayGen(Type) ::compatible((Vec(Type))&)a; } 00056 00057 00058 00059 00060 void attach (ArrayGen(Type)& values); 00061 void pureCopy(const ArrayGen(Type)& values); 00062 void activate (); 00063 void activate (const IndexSet& I); 00064 00065 00066 bool redim (int n1); 00067 bool redim (int n1, int n2); 00068 bool redim (int n1, int n2, int n3); 00069 bool redim (const Ptv(int)& n); 00070 bool redim (const IndexSet& I, int offset=0); 00071 bool redim (const IndexSet& I, const Ptv(int)& offset); 00072 virtual bool redim (const Vector(prm_Type)& pm); 00073 00074 virtual bool makeItSimilar (Handle(Vector(Type))& v) const; 00075 00076 00077 00078 00079 virtual void fill (const Vector(Type)& X) { Vec(Type) ::fill(X); } 00080 virtual void fill (const Type& a) { VecSimple(Type) ::fill(a); } 00081 void fill (Type start, Type stop) { Vec(Type) ::fill(start,stop); } 00082 00083 ArrayGenSel(Type)& operator = (const ArrayGenSel(Type)& X); 00084 ArrayGenSel(Type)& operator = (const ArrayGen(Type)& X); 00085 ArrayGenSel(Type)& operator = (const Type& a) 00086 { VecSimple(Type) ::fill(a); return *this; } 00087 00088 00089 void fillSel (const IndexSet& I, Type a); 00090 00091 00092 00093 00094 00095 virtual void add (const Vector(Type)& yb, const Vector(Type)& zb); 00096 virtual void add (const Vector(Type)& yb, char s, const Vector(Type)& zb); 00097 virtual void add (const Vector(Type)& yb, Type b, const Vector(Type)& zb); 00098 virtual void add 00099 (Type a, const Vector(Type)& yb, Type b, const Vector(Type)& zb); 00100 virtual void add (const Vector(Type)& y, int power, Type front_factor); 00101 virtual void add (Type value); 00102 00103 virtual void apply (Func(Type) f); 00104 virtual void mult (Type value); 00105 00106 virtual Type inner (const Vector(Type)& yb) const; 00107 00108 virtual real norm (Norm_type lp = l2) const; 00109 virtual real normDiff (const Vector(Type)& y, Norm_type lp = l2) const; 00110 00111 00112 00113 00114 virtual void printSel (Os os, const char* header = NULL, 00115 int nentries_per_line = 3) const; 00116 virtual void printSelAscii (Os os, const char* header = NULL) const; 00117 00118 void print(Os os, const char* header = NULL, 00119 int nentries_per_line = 3) const 00120 { ArrayGen(Type) ::print(os,header,nentries_per_line); } 00121 00122 00123 virtual void scan (Is is); 00124 00125 friend Os& operator << (Os& os, const Vec(Type)& x); 00126 friend Is& operator >> (Is& is , Vec(Type)& x); 00127 00128 CLASS_INFO 00129 00130 VIRTUAL_CAST(ArrayGenSel(Type)) 00131 00132 private: 00133 00134 00135 bool compatible (const VecSimplest(Type)& X) const 00136 { return ArrayGenSimplest(Type) ::compatible (X); } 00137 bool compatible (const ArrayGenSimplest(Type)& a, 00138 bool error_message = true) 00139 { return ArrayGenSimplest(Type) ::compatible(a,error_message); } 00140 00141 00142 bool redim (Type* a, int n, int base = 0) 00143 { return ArrayGenSimplest(Type) ::redim(a,n,base); } 00144 00145 00146 }; 00147 00148