X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=nucleus%2Flibrary%2Fstructures%2Fmatrix.h;h=5fd552503ed6a9918363776bc8eab27b3b1e60d7;hb=fa33ec7512eb5a32e25abeb266c24661cad9447b;hp=96ec3e0767917ee7b50a7987543522ba4a4b830f;hpb=457b128b77b5b4a0b7dd3094de543de2ce1477ad;p=feisty_meow.git diff --git a/nucleus/library/structures/matrix.h b/nucleus/library/structures/matrix.h index 96ec3e07..5fd55250 100644 --- a/nucleus/library/structures/matrix.h +++ b/nucleus/library/structures/matrix.h @@ -31,7 +31,7 @@ template class matrix : protected basis::array { public: - matrix(int rows = 0, int cols = 0, contents *data = NIL); + matrix(int rows = 0, int cols = 0, contents *data = NULL_POINTER); //!< the "data" array must have at least "rows" * "cols" contents in it. matrix(const matrix &to_copy); @@ -54,7 +54,7 @@ public: /*!< the result can be used as a pointer to the whole row of data, or it can be indexed into by column to find a row/column position. this is dangerous if one is not careful about ensuring that the column used is - within bounds. if the "row" parameter is out of bounds, then NIL is + within bounds. if the "row" parameter is out of bounds, then NULL_POINTER is returned. */ const contents *operator[] (int row) const; //!< dangerous: constant peek into data for "row" in underlying contents. @@ -111,7 +111,7 @@ private: class int_matrix : public matrix { public: - int_matrix(int rows = 0, int cols = 0, int *data = NIL) + int_matrix(int rows = 0, int cols = 0, int *data = NULL_POINTER) : matrix(rows, cols, data) {} int_matrix(const matrix &to_copy) : matrix(to_copy) {} }; @@ -120,7 +120,7 @@ public: class string_matrix : public matrix { public: - string_matrix(int rows = 0, int cols = 0, basis::astring *data = NIL) + string_matrix(int rows = 0, int cols = 0, basis::astring *data = NULL_POINTER) : matrix(rows, cols, data) {} string_matrix(const matrix &to_copy) : matrix(to_copy) {} }; @@ -129,7 +129,7 @@ public: class double_matrix : public matrix { public: - double_matrix(int rows = 0, int cols = 0, double *data = NIL) + double_matrix(int rows = 0, int cols = 0, double *data = NULL_POINTER) : matrix(rows, cols, data) {} double_matrix(const matrix &to_copy) : matrix(to_copy) {} }; @@ -208,8 +208,8 @@ void matrix::redimension(int new_rows, int new_columns) { if ( (_rows == new_rows) && (_cols == new_columns) ) return; matrix new_this(new_rows, new_columns); - for (int r = 0; r < minimum(new_rows, rows()); r++) - for (int c = 0; c < minimum(new_columns, columns()); c++) + for (int r = 0; r < basis::minimum(new_rows, rows()); r++) + for (int c = 0; c < basis::minimum(new_columns, columns()); c++) new_this[r][c] = (*this)[r][c]; *this = new_this; }