public boolean set(int row, int col, double value)
    {
        //check if the position is correct；
        if(row<0||row>this.r||col<0||col>this.r)
            return false;
        else
        {
            matrix[row][col]=value;
            return true;
        }

    }