public ComplexMatrix add(ComplexMatrix b) throws Exception {
        checkConsistenceAndThrowException(b);

        int rowSize = getRowSize();
        int colSize = getColSize();
        ComplexMatrix mx = emptyMatrix(rowSize, colSize);

        for (int ri = 0; ri < rowSize; ri++) {
            for (int ci = 0; ci < colSize; ci++) {
                mx.setElem(ri, ci, getElem(ri, ci).add(b.getElem(ri, ci)));
            }
        }
        return mx;
    }