public Object clone(){
            if(this==null){
    	        return null;
    	    }
    	    else{
    	        int nr = this.numberOfRows;
        	    int nc = this.numberOfColumns;
        	    Matrix b = new Matrix(nr,nc);
        	    double[][] barray = b.getArrayReference();
        	    b.numberOfRows = nr;
        	    b.numberOfColumns = nc;
        	    for(int i=0; i<nr; i++){
            		for(int j=0; j<nc; j++){
                		barray[i][j]=this.matrix[i][j];
            		}
        	    }
        	    for(int i=0; i<nr; i++)b.permutationIndex[i] = this.permutationIndex[i];
        	    return (Object) b;
        	}
    	}