package cmu.core;

public class Mat<T extends Number> {
	int dims; // number of dimensions
	
	int rows, cols; // the number of rows and columns
	
	T[] data; // matrix data
	
	/**
	 * Transpose a matrix.
	 * This method performs matrix transposition not in the original matrix but
	 * returns a temporary matrix transposition object. 
	 * @return
	 */
	public Mat<T> t() {
		
	}
	
	/**
	 * Performs an element-wise multiplication or division of the two matrices.
	 * @param InputMat
	 * @return
	 */
	public Mat<T> mul(Mat<T> m) {
		
	}
	
	/**
	 * Computes a dot-product of two vectors.
	 * @param m
	 * @return
	 */
	public Mat<T> dot(Mat<T> m) {
		
	}
	
	/**
	 * Returns true if the matrix has no elements
	 * @return
	 */
	public boolean empty() {
		
	}
	
	/**
	 * Returns a reference to the specified matrix element.
	 * @return
	 */
	public T at() {
		
	}
}

@@ -172,24 +172,390 @@
 ix data%0D%0A%09%0D%0A
+%09public Mat(int rows, int cols) %7B%0D%0A%09%09this.rows = rows;%0D%0A%09%09this.cols = cols;%0D%0A%09%7D%0D%0A%09%0D%0A%09/**%0D%0A%09 * Allocate memory for matrix%0D%0A%09 * @param dims%0D%0A%09 * @param rows%0D%0A%09 * @param cols%0D%0A%09 */%0D%0A%09public void create(int dims, int rows, int cols) %7B%0D%0A%09%09@SuppressWarnings(%22unchecked%22)%0D%0A%09%09final T%5B%5D data = (T%5B%5D) new Object%5Brows * cols%5D;%0D%0A%09%09this.data = data;%0D%0A%09%09this.dims = dims;%0D%0A%09%7D%0D%0A%09%0D%0A
 %09/**%0D%0A%09 * Tr

add memory allocation function