public void set(int i, int j, double r){
        if ((i>0)&&(i<=rows)&&(j>=0)&&(j<=columns)){
            this.elements[i-1][j-1]=r;
        }else{
            System.out.println("wrong indices, or matrix was not initialized");
        }
    }