package Mat; import java.util.*; class Matrix { Vector matrix; int row;//----> int column;//|||||| public Matrix(int row,int column) { this.row = row; this.column = column; this.matrix = new Vector(); this.matrix.add(null); this.matrix.add(null); this.matrix.add(null); this.matrix.add(null); } public int getRow() { return row; } public int getColumn() { return column; } public void setCell(Double atai,int col,int row) { matrix.set(col*getRow() + row,atai); } public Double getCell(int col,int row) { return matrix.get(col*getRow() + row); } public boolean checkRowColumn(Matrix mat) { if(mat != null &&mat.getRow() == getRow() && mat.getColumn() == getColumn()) { return true; } return false; } public Matrix doAddition(Matrix mat) { if(false == checkRowColumn(mat)){return null;} Matrix ret = new Matrix(getRow(),getColumn()); int max = getRow()*getColumn(); for(int i = 0;i