|
| | int_matrix (int rows=0, int cols=0, int *data=NULL_POINTER) |
| |
| | int_matrix (const matrix< int > &to_copy) |
| |
| | matrix (int rows=0, int cols=0, int *data=NULL_POINTER) |
| | the "data" array must have at least "rows" * "cols" contents in it.
|
| |
| | matrix (const matrix &to_copy) |
| |
| | ~matrix () |
| |
| int | rows () const |
| |
| int | columns () const |
| |
| matrix & | operator= (const matrix &to_copy) |
| |
| int & | get (int row, int column) |
| |
| const int & | get (int row, int column) const |
| | retrieves the contents from the specified "row" and "column".
|
| |
| bool | put (int row, int column, const int &to_put) |
| | stores "to_put" into the matrix at "row" and "column".
|
| |
| int * | operator[] (int row) |
| | dangerous: indexes by "row" into the underlying contents.
|
| |
| const int * | operator[] (int row) const |
| | dangerous: constant peek into data for "row" in underlying contents.
|
| |
| matrix | submatrix (int row, int column, int rows, int columns) const |
| | returns a submatrix of this one starting at "row" and "column".
|
| |
| void | submatrix (matrix &sub, int row, int column, int rows, int cols) const |
| | like submatrix() above, but stores into the "sub" parameter.
|
| |
| matrix | transpose () const |
| | provides the transposed form of this matrix.
|
| |
| void | transpose (matrix &resultant) const |
| | stores the transpose of this matrix in "resultant".
|
| |
| basis::array< int > | get_row (int row) |
| | return the vector at the "row", or an empty array if "row" is invalid.
|
| |
| basis::array< int > | get_column (int column) |
| | return the vector at the "column", or an empty array if it's invalid.
|
| |
| bool | insert_row (int before_row) |
| | inserts a row before the "before_" parameter.
|
| |
| bool | insert_column (int before_column) |
| | inserts a column before the "before_" parameter.
|
| |
| void | reset (int rows=0, int columns=0) |
| | empties the matrix and changes its size.
|
| |
| void | redimension (int new_rows, int new_columns) |
| | changes the size to contain "new_rows" by "new_columns" elements.
|
| |
| bool | zap_row (int row_to_zap) |
| |
| bool | zap_column (int column_to_zap) |
| | removes a row or column from the matrix.
|
| |
|
| enum | specialc_flags {
NO_SPECIAL_MODES = 0x0
, SIMPLE_COPY = 0x1
, EXPONENTIAL_GROWTH = 0x2
, EXPONE = EXPONENTIAL_GROWTH
,
FLUSH_INVISIBLE = 0x4
} |
| | the flags specify how the array treats its contents and its length. More...
|
| |
| enum | how_to_copy { NEW_AT_END
, NEW_AT_BEGINNING
, DONT_COPY
} |
| |
| enum | shift_directions { TO_LEFT
, TO_RIGHT
} |
| |
| | DEFINE_CLASS_NAME ("array") |
| |
| | array (int number=0, const contents *init=NULL_POINTER, int flags=EXPONENTIAL_GROWTH|FLUSH_INVISIBLE) |
| | Constructs an array with room for "number" objects.
|
| |
| | array (const array< contents > ©_from) |
| | copies the contents & sizing information from "copy_from".
|
| |
| virtual | ~array () |
| | destroys the memory allocated for the objects.
|
| |
| void | reset (int number=0, const contents *initial_contents=NULL_POINTER) |
| | Resizes this array and sets the contents from an array of contents.
|
| |
| array & | operator= (const array< contents > ©_from) |
| | Copies the array in "copy_from" into this.
|
| |
| int | length () const |
| | Returns the current reported length of the allocated C array.
|
| |
| int | last () const |
| | Returns the last valid element in the array.
|
| |
| int | flags () const |
| | Provides the raw flags value, without interpreting what it means.
|
| |
| bool | exponential () const |
| | Returns true if this allocator will grow exponentially on resize.
|
| |
| bool | simple () const |
| | Reports whether the templated object is a simple type or not.
|
| |
| const contents & | get (int index) const |
| | Accesses individual objects stored in "this" at the "index" position.
|
| |
| contents & | use (int index) |
| | A non-constant version of get(); the returned object can be modified.
|
| |
| const contents & | operator[] (int index) const |
| | Synonym for get that provides the expected array indexing syntax.
|
| |
| contents & | operator[] (int index) |
| | Synonym for use that provides the expected array indexing syntax.
|
| |
| outcome | put (int index, const contents &to_put) |
| | Stores an object at the index "index" in the array.
|
| |
| array | concatenation (const array &to_concatenate) const |
| | Returns the concatenation of "this" and the array "to_concatenate".
|
| |
| array | concatenation (const contents &to_concatenate) const |
| | Returns the concatenation of "this" and the object "to_concatenate".
|
| |
| array & | concatenate (const array &to_concatenate) |
| | Appends the array "to_concatenate" onto "this" and returns "this".
|
| |
| array & | concatenate (const contents &to_concatenate) |
| | Appends the object "to_concatenate" onto "this" and returns "this".
|
| |
| array & | concatenate (const contents *to_concatenate, int length) |
| | Concatenates a C-array "to_concatenate" onto "this" and returns "this".
|
| |
| array | operator+ (const array &to_cat) const |
| | Synonym for concatenation.
|
| |
| array | operator+ (const contents &to_concatenate) const |
| | Synonym for concatenation.
|
| |
| array & | operator+= (const array &to_concatenate) |
| | Synonym for concatenate that modifies "this".
|
| |
| array & | operator+= (const contents &to_concatenate) |
| | Synonym for concatenate that modifies "this".
|
| |
| const contents * | observe () const |
| | Returns a pointer to the underlying C array of data.
|
| |
| contents * | access () |
| | A non-constant access of the underlying C-array. BE REALLY CAREFUL.
|
| |
| void | swap_contents (array< contents > &other) |
| | Exchanges the contents of "this" and "other".
|
| |
| void | snarf (array &new_contents) |
| | Drops "this" array's contents into the dustbin and uses "new_contents".
|
| |
| array | subarray (int start, int end) const |
| | Returns the array segment between the indices "start" and "end".
|
| |
| outcome | insert (int index, int new_indices) |
| | Adds "new_indices" new positions for objects into the array at "index".
|
| |
| outcome | overwrite (int index, const array &write_with, int count=-1) |
| | Stores the array "write_with" into the current array at the "index".
|
| |
| outcome | stuff (int length, contents *to_stuff) const |
| | Copies at most "length" elements from this into the array "to_stuff".
|
| |
| outcome | resize (int new_size, how_to_copy way=NEW_AT_END) |
| | Changes the size of the C array to "new_size".
|
| |
| outcome | zap (int start, int end) |
| | Deletes from "this" the objects inclusively between "start" and "end".
|
| |
| outcome | shrink () |
| | Cuts loose any allocated space that is beyond the real length.
|
| |
| outcome | retrain (int new_size, const contents *to_copy) |
| | Resizes the C array and stuffs it with the contents in "to_copy".
|
| |
| void | shift_data (shift_directions where) |
| | The valid portion of the array is moved to the left or right.
|
| |
| int | internal_real_length () const |
| | Gritty Internal: the real allocated length.
|
| |
| int | internal_offset () const |
| | Gritty Internal: the offset from real start to stored data.
|
| |
| const contents * | internal_block_start () const |
| | Gritty Internal: constant peek at the real allocated pointer.
|
| |
| contents * | internal_block_start () |
| | Gritty Internal: the real allocated pointer made accessible.
|
| |
| contents *const * | internal_offset_mem () const |
| | Gritty Internal: the start of the actual stored data.
|
| |
A matrix of integers.
Definition at line 111 of file matrix.h.