class UllmannState extends State {

    @Override
    boolean add(int n, int m) {

        if (!matrix.get(n, m)) return false;

        // fix the mapping
        matrix.markRow(n, -(n + 1));
        matrix.set(n, m);

        // attempt to refine the mapping
        if (refine(n)) {
            size = size + 1;
            m1[n] = m;
            m2[m] = n;
            return true;
        } else {
            // mapping became invalid - unfix mapping
            matrix.resetRows(n, -(n + 1));
            return false;
        }
    }

    public  UllmannState(IAtomContainer container1, IAtomContainer container2, int[][] g1, int[][] g2,
            EdgeToBondMap bonds1, EdgeToBondMap bonds2, AtomMatcher atomMatcher, BondMatcher bondMatcher);

}