29 void Grow(
int new_size);
30 static int Compare(
int * a,
int * b);
35 IntArray(
int start_size = 0);
36 IntArray(
const IntArray & source);
39 IntArray & operator = (
const IntArray & rhs);
41 int & operator [](
int index)
45 int operator [](
int index)
const
52 int & operator [](
char index)
54 return items[int(index)];
56 int operator [](
char index)
const
58 return items[int(index)];
62 int & operator [](
double fraction)
64 return items[(int)(count * fraction)];
66 int operator [](
double fraction)
const
68 return items[(int)(count * fraction)];
71 int Append(
int value);
72 int Append(
const IntArray & rhs);
80 return items[--count];
84 return items[count - 1];
88 return items[count - 1];
91 void PushIfNew(
int value);
93 int Delete(
int index);
94 void InsertAt(
int index,
int value);
96 int Find(
int value)
const;
97 int FastFind(
int value)
const
99 return BinarySearch(value);
101 int BinarySearch(
int value)
const;
103 void Sort(IntArray & freeRider);
107 void SetSequence(
int start = 0,
int increment = 1);
113 void Dimension(
int new_count)
125 return Sum(0, count - 1);
127 int Sum(
int start)
const
129 return Sum(start, count - 1);
131 int Sum(
int start,
int end)
const;
135 return dSum(0, count - 1);
137 double dSum(
int start)
const
139 return dSum(start, count - 1);
141 double dSum(
int start,
int end)
const;
143 int SumProduct(
const IntArray & weight)
const;
144 double dSumProduct(
const IntArray & weight)
const;
148 return Max(0, count - 1);
150 int Max(
int start)
const
152 return Max(start, count - 1);
154 int Max(
int start,
int end)
const;
158 return Min(0, count - 1);
160 int Min(
int start)
const
162 return Min(start, count - 1);
164 int Min(
int start,
int end)
const;
170 int CountIfGreater(
int treshold)
const;
171 int CountIfGreaterOrEqual(
int treshold)
const;
173 void Swap(
int i,
int j)
188 void Subtract(
int term)
192 void Multiply(
int factor);
193 void Divide(
int denominator);
195 void Add(
const IntArray & rhs);
197 IntArray & operator += (
int rhs)
203 IntArray & operator += (
const IntArray & rhs)
209 IntArray & operator *= (
int rhs)
215 IntArray & operator -= (
int rhs)
221 IntArray & operator /= (
int rhs)
227 int InnerProduct(IntArray & v);
229 bool operator == (
const IntArray & rhs)
const;
230 bool operator != (
const IntArray & rhs)
const;
235 void Stack(
const IntArray & rhs);
237 void Swap(IntArray & rhs);
243 void Print(
const char * label)
245 Print(stdout, label);
247 void Print(FILE * output);
248 void Print(FILE * output,
const char * label);
251 double DoubleProduct();
253 int Hash(
int initval = 0);