#include <int.Vec.h>
Inheritance diagram for intVec:


Public Member Functions | |
| intVec () | |
| intVec (int l) | |
| intVec (int l, int fill_value) | |
| intVec (const intVec &) | |
| ~intVec () | |
| intVec & | operator= (const intVec &a) |
| intVec | at (int from=0, int n=-1) |
| int | capacity () const |
| void | resize (int newlen) |
| int & | operator[] (int n) |
| int & | elem (int n) |
| void | reverse () |
| void | sort (intComparator f) |
| void | fill (int val, int from=0, int n=-1) |
| void | apply (intProcedure f) |
| int | reduce (intCombiner f, int base) |
| int | index (int targ) |
| void | error (const char *msg) |
| void | range_error () |
Protected Member Functions | |
| intVec (int l, int *d) | |
Protected Attributes | |
| int | len |
| int * | s |
Friends | |
| intVec | concat (intVec &a, intVec &b) |
| intVec | map (intMapper f, intVec &a) |
| intVec | merge (intVec &a, intVec &b, intComparator f) |
| intVec | combine (intCombiner f, intVec &a, intVec &b) |
| intVec | reverse (intVec &a) |
| int | operator== (intVec &a, intVec &b) |
| int | operator!= (intVec &a, intVec &b) |
|
||||||||||||
|
Definition at line 101 of file int.Vec.h. References len.
|
|
|
Definition at line 90 of file int.Vec.h. Referenced by at().
|
|
|
Definition at line 95 of file int.Vec.h.
|
|
||||||||||||
|
Definition at line 69 of file int.Vec.cc.
|
|
|
Definition at line 60 of file int.Vec.cc.
|
|
|
Definition at line 104 of file int.Vec.h. References s.
00105 {
00106 delete [] s;
00107 }
|
|
|
Definition at line 92 of file int.Vec.cc.
|
|
||||||||||||
|
Definition at line 222 of file int.Vec.cc. References intVec(), len, range_error(), and s.
00223 {
00224 int to;
00225 if (n < 0)
00226 {
00227 n = len - from;
00228 to = len - 1;
00229 }
00230 else
00231 to = from + n - 1;
00232 if ((unsigned)from > (unsigned)to)
00233 range_error();
00234 int* news = new int [n];
00235 int* p = news;
00236 int* t = &(s[from]);
00237 int* top = &(s[to]);
00238 while (t <= top) *p++ = *t++;
00239 return intVec(n, news);
00240 }
|
Here is the call graph for this function:

|
|
Definition at line 123 of file int.Vec.h. References len.
00124 {
00125 return len;
00126 }
|
|
|
Definition at line 117 of file int.Vec.h. References s.
00118 {
00119 return s[n];
00120 }
|
|
|
Definition at line 50 of file int.Vec.cc.
00051 {
00052 (*intVec_error_handler)(msg);
00053 }
|
|
||||||||||||||||
|
Definition at line 208 of file int.Vec.cc. References len, range_error(), and s.
00209 {
00210 int to;
00211 if (n < 0)
00212 to = len - 1;
00213 else
00214 to = from + n - 1;
00215 if ((unsigned)from > (unsigned)to)
00216 range_error();
00217 int* t = &(s[from]);
00218 int* top = &(s[to]);
00219 while (t <= top) *t++ = val;
00220 }
|
Here is the call graph for this function:

|
|
Definition at line 181 of file int.Vec.cc.
|
|
|
Definition at line 78 of file int.Vec.cc.
|
|
|
Reimplemented in intRVec. Definition at line 110 of file int.Vec.h. References len, range_error(), and s.
00111 {
00112 if ((unsigned)n >= (unsigned)len)
00113 range_error();
00114 return s[n];
00115 }
|
Here is the call graph for this function:

|
|
Definition at line 55 of file int.Vec.cc. Referenced by at(), fill(), operator[](), and intRVec::operator[]().
00056 {
00057 (*intVec_error_handler)("Index out of range.");
00058 }
|
|
||||||||||||
|
Definition at line 140 of file int.Vec.cc.
|
|
|
Definition at line 100 of file int.Vec.cc. Referenced by intRVec::grow().
|
|
|
Definition at line 166 of file int.Vec.cc.
|
|
|
Definition at line 274 of file int.Vec.cc. References gsort(), len, and s.
00275 {
00276 gsort(s, len, compar);
00277 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 128 of file int.Vec.cc.
|
|
||||||||||||
|
Definition at line 113 of file int.Vec.cc.
|
|
||||||||||||
|
Definition at line 187 of file int.Vec.cc.
|
|
||||||||||||||||
|
Definition at line 242 of file int.Vec.cc.
00243 {
00244 int newl = a.len + b.len;
00245 int* news = new int [newl];
00246 int* p = news;
00247 int* topa = &(a.s[a.len]);
00248 int* as = a.s;
00249 int* topb = &(b.s[b.len]);
00250 int* bs = b.s;
00251
00252 for (;;)
00253 {
00254 if (as >= topa)
00255 {
00256 while (bs < topb) *p++ = *bs++;
00257 break;
00258 }
00259 else if (bs >= topb)
00260 {
00261 while (as < topa) *p++ = *as++;
00262 break;
00263 }
00264 else if ((*f)(*as, *bs) <= 0)
00265 *p++ = *as++;
00266 else
00267 *p++ = *bs++;
00268 }
00269 return intVec(newl, news);
00270 }
|
|
||||||||||||
|
Definition at line 130 of file int.Vec.h.
00131 {
00132 return !(a == b);
00133 }
|
|
||||||||||||
|
Definition at line 197 of file int.Vec.cc.
|
|
|
Definition at line 149 of file int.Vec.cc.
|
|
|
Definition at line 42 of file int.Vec.h. Referenced by apply(), at(), capacity(), combine(), concat(), fill(), intRVec::grow(), index(), intVec(), map(), merge(), operator=(), operator==(), operator[](), intRVec::operator[](), reduce(), resize(), reverse(), reverse(), sort(), and intRVec::viable_range(). |
|
|
Definition at line 43 of file int.Vec.h. Referenced by apply(), at(), combine(), concat(), elem(), fill(), intRVec::grow(), index(), intVec(), map(), merge(), operator=(), operator==(), operator[](), intRVec::operator[](), reduce(), resize(), reverse(), sort(), and ~intVec(). |
1.3.3