This class creates an integer array.
More...
#include "../include/IntArray.h"
This class creates an integer array.
- Author
- Dan Vietor
◆ IntArray() [1/3]
Constructor. Initializes the values.
References init().
◆ IntArray() [2/3]
IntArray::IntArray |
( |
int |
size | ) |
|
Constructor. Size the arrays.
References init().
◆ ~IntArray()
◆ IntArray() [3/3]
IntArray::IntArray |
( |
const IntArray & |
data | ) |
|
Copy constructor.
- Parameters
-
References copy().
◆ add()
int IntArray::add |
( |
int |
rval | ) |
|
Adds a new point.
- Parameters
-
References expand().
◆ add1()
int WXP::IntArray::add1 |
( |
int |
rval | ) |
|
|
inline |
Adds a value (no bounds check)
◆ clear()
int WXP::IntArray::clear |
( |
| ) |
|
|
inline |
Clears the contents of the array
◆ copy()
int IntArray::copy |
( |
const IntArray & |
data | ) |
|
◆ expand()
int IntArray::expand |
( |
int |
size | ) |
|
Expands the size of the array
- Parameters
-
Referenced by add(), and set().
◆ get() [1/2]
int IntArray::get |
( |
int |
ind | ) |
|
Gets a specific point value from array.
- Parameters
-
- Returns
- Output value
◆ get() [2/2]
int IntArray::get |
( |
int |
ind, |
|
|
int & |
rval |
|
) |
| |
Gets a specific point value from array.
- Parameters
-
- Return values
-
◆ getNum()
int WXP::IntArray::getNum |
( |
| ) |
|
|
inline |
Return the number of points
◆ init() [1/2]
◆ init() [2/2]
int IntArray::init |
( |
int |
size | ) |
|
◆ offset()
int IntArray::offset |
( |
int |
ind, |
|
|
int |
rval |
|
) |
| |
Offsets a specific point value in array.
- Parameters
-
ind | Index of value to set |
rval | Offset value |
◆ operator=()
Assignment operator. Used to overload copying
- Parameters
-
References copy().
◆ print()
Prints the values to standard output.
◆ product()
int IntArray::product |
( |
| ) |
|
Returns the product of all values in array
◆ set()
int IntArray::set |
( |
int |
ind, |
|
|
int |
rval |
|
) |
| |
Sets a specific value in array.
- Parameters
-
ind | Index of value to set |
rval | New value |
References expand().
◆ sum()
Returns the sum of all values in array
The documentation for this class was generated from the following files: