public void setMatrix(int rows, int columns){
        if ((rows<1)||(columns<1)) {
            System.out.println("number of rows and columns must be positive integer");
        }
        this.rows=rows;
        this.columns=columns;
        elements=new double[rows][columns];
        if (columns==rows){
            determinant=1;
        }
    }