/* Matrix.h */

#ifndef MATRIX_H
#define MATRIX_H


class Matrix {
public:
  int nofRows;          // number of rows
  int nofCols;          // number of columns
  int *elements;        // pointer to int elements arranged in a
                        //  one-dim array

  /* Set the  i n i t i a l  size of the matrix.
   * Params:
   *   int nofRows               number of rows
   *   int nofColumns            number of columns
   * return:
   *   void
   */
 void setSize(int nofRows, int nofCols);


  /* Populate the array with int values passed in an array.
   * No checking of proper array length and matrix dimensions.
   * Params:
   *   int *ip                   pointer to int array
   * return:
   *   void
   */
  void populate(int *ip);


  /* Resize the matrix. New elements are set to 0.
   * For nofRows or/and nofCols equal zero the function
   * returns with no actions taken.
   * Params:
   *   int nofRows               number of rows
   *   int nofColumns            number of columns
   * return:
   *   void
   */
  void resize(int nofRows, int nofCols);


  /* Remove all elements from the matrix.
   * Params:
   *   none
   * return:
   *   void
   */
  void depopulate();


  /* Print all elements of the 2-dim matrix to cout..
   * Params:
   *   none
   * return:
   *   void
   */
  void print();
};


#endif
