public Complex getElem(int ri, int ci) {
        try {
            return matrix[ri][ci];
        } catch (Exception e) {
            System.out.println("Invalid indices in getElem(int ri, int ci)");
            e.printStackTrace();
        }
        return null;
    }