Functions | |
ml_int_array::ml_int_array () | |
Default constructor. | |
ml_int_array::ml_int_array (int msize, const int *v=NULL) | |
Creates a ml_int_array of a given size and loads the values from array v. | |
ml_int_array::ml_int_array (const ml_int_array &a) | |
Copy constructor. | |
ml_int_array::ml_int_array (int start, int finish) | |
Creates a ml_int_array sequence ranging from start to finish. | |
ml_int_array::ml_int_array (char *s) | |
Constructs a ml_int_array from a string format as used in MATLAB. | |
ml_int_array::ml_int_array (void *bf) | |
Constructs a ml_int_array from a binary buffer. | |
int | ml_int_array::get (int index) const |
Accesses an element. Will not resize the ml_int_array. | |
int & | ml_int_array::operator() (int index) |
Accesses an element by its index. Resizes for out of bounds access. | |
void | ml_int_array::operator= (int *vals) |
Reassigns the values of the ml_int_array to those in the given array. | |
void | ml_int_array::operator= (int val) |
Sets the ml_int_array equal to an integer changes the size to 1. | |
ml_int_array & | ml_int_array::operator= (const ml_int_array &a) |
Sets the ml_int_array equal to the given ml_int_array. | |
int | ml_int_array::length () const |
Returns the length of the ml_int_array. | |
int | ml_int_array::is_empty () const |
Checks the size of the array, returns 1 unless the ml_int_array is empty. | |
ml_int_array | ml_int_array::find (ml_comparison op, int target) const |
Returns a ml_int_array of all indices in the ml_int_array for which the given operator and operand is true. | |
void | ml_int_array::display (char *s=NULL) const |
Display function. Formats the ml_int_array in a human readable fashion and prints to standard out. | |
char * | ml_int_array::to_string () |
Returns a string representations of the data structure. | |
void * | ml_int_array::to_binary (unsigned short *size=NULL) const |
Creates a binary form of the ml_int_array for interprocess communication. | |
int | ml_int_array::is_unique () const |
Determines whether the all the elements in the ml_int_array are unique. | |
int | ml_int_array::sum () const |
Returns the sum of all the values in the ml_int_array. | |
int * | ml_int_array::get_c_arr (int &s) const |
Converts the ml_int_array into a standard C array. | |
int | ml_int_array::operator== (const ml_int_array &a) |
Tests two int_arrays for equality. | |
int | ml_int_array::operator!= (const ml_int_array &a) |
Tests two int_arrays for in-equality. | |
ml_int_array | ml_int_array::subset (int start, int end) |
Returns an int array of the specified subset of the original array. | |
ml_int_array | ml_int_array::subset (const ml_int_array &indices) |
Returns an int array of the elements in the passed ml_int_array, in the specified order. | |
void | ml_int_array::sort (int direction=0) |
Sorts all the elements of the ml_int_array. Ascending order is the default, pass a non-zero value for descending sort. | |
void | ml_int_array::remove (const ml_int_array &indices) |
Removes the indices in the given ml_int_array and resizes the ml_int_array downwards. | |
void | ml_int_array::remove (int index) |
Removes the element at the specified index and resizes the ml_int_array downwards. | |
void | ml_int_array::append (ml_int_array b) |
Appends the given ml_int_array to the end of the "this" array. | |
void | ml_int_array::append (int val) |
Appends the given integer to the end of the ml_int_array. | |
void | ml_int_array::insert (int index, int val) |
Inserts a value at an arbitrary location in the ml_int_array. | |
void | ml_int_array::zero () |
Sets all elements of the ml_int_array to zero. | |
void | ml_int_array::ones () |
Sets all elements of the ml_int_array to one. | |
void | ml_int_array::fliplr () |
Flips the elements of the array. | |
void | ml_int_array::setdiff (const ml_int_array &b) |
Removes the elements in B from the array, then sorts the remainder. |
|
Default Constructor. Creates an int_array of size zero. |
|
Creates an integer array of a given size and loads the values from array v.
|
|
Copy constructor. |
|
Creates an integer array sequence. May be ascending or descending.
|
|
Constructs an integer array from a string format as used in MATLAB.
|
|
Accesses an element. Will not resize the int_array.
|
|
Accesses an element by its index. Resizes for out of bounds access.
|
|
Reassigns the values of the int_array to those in the given array. NOTE: Passing an array with fewer elements than the int_array can cause the program to crash.
|
|
Changes the length of the ml_int_array to 1 and sets the value of the element to the specified integer.
|
|
Sets the int_array equal to the given int_array.
|
|
Returns the length of the int_array.
|
|
Checks the size of the array, returns 1 unless the int_array is empty.
|
|
Returns an int_array of all indices in the int_array for which the given operator and operand is true.
|
|
Display function. Formats the int_array in a human readable fashion and prints to standard out.
|
|
Converts data structure to a string representation. THIS FUNCTION IS NOT THREAD SAFE. to_string() may be called without any action to release memory on the part of the user, i.e. the pointer that is returned does not point to a buffer that needs to be freed. This buffer is freed internally each time to_string is called as well as when the destructor is called, so the data should be copied to a new buffer if the user needs to store it for future use.
|
|
Determines whether the all the elements in the int_array are unique.
|
|
Returns the sum of all the values in the int_array.
|
|
Converts the int_array into a standard C array.
|
|
Tests two int_arrays for equality.
|
|
Tests two int_arrays for in-equality.
|
|
Returns an int array of the specified subset of the original array.
|
|
Returns an int array containing the specifed elements, in the given order, of the original array.
|
|
Sorts all the elements of the int_array. Ascending order is the default, pass a non-zero value for descending sort.
|
|
Removes the indices in the given int_array and resizes the int_array downwards.
|
|
Removes the element at the specified index and resizes the int_array downwards.
|
|
Appends the given int_array to the end of the "this" array.
|
|
Appends the given integer to the end of the int_array.
|
|
Inserts a new element into the array, at the specified index.
|
|
Sets all elements of the int_array to zero |
|
Sets all elements of the int_array to zero |
|
Flips the elements of the array (an array {1,2,3} would become {3,2,1}) |
|
Removes the elements that exist in B from the array, and then sorts the array.
|