public int count(G g, int count) {
        if (count < 1)
            throw new IllegalArgumentException("Count must be positive");
        sum += count;
        Pair<Integer> orderAndSize = new Pair<Integer>(g.order(), g.size());
        Map<G,Integer> graphs = orderAndSizeToGraphs.get(orderAndSize);
        if (graphs == null) {
            // If there wasn't a mapping for this graph's configuration and
            // we're not allowing new motif instances, return 0.
            if (!allowNewMotifs)
                return 0;
            graphs = new HashMap<G,Integer>();
            orderAndSizeToGraphs.put(orderAndSize, graphs);
            graphs.put(g, count);
            return count;
        }
        else {
            for (Map.Entry<G,Integer> e : graphs.entrySet()) {
                if (isoTest.areIsomorphic(g, e.getKey())) {
                    int newCount = e.getValue() + count;
                    e.setValue(newCount);
                    return newCount;
                }
            }
            // If the graph was not found and we can add new motifs, then do so.
            if (allowNewMotifs) {
                graphs.put(g, count);
                return count;
            }
            else 
                return 0;
        }
    }
public int count ( G g , int count ) { if ( count < 1 ) throw new IllegalArgumentException ( "Count must be positive" ) ; sum += count ; Pair < Integer > orderAndSize = new Pair < Integer > ( g . order ( ) , g . size ( ) ) ; Map < G , Integer > graphs = orderAndSizeToGraphs . get ( orderAndSize ) ; if ( graphs == null ) { if ( ! allowNewMotifs ) return 0 ; graphs = new HashMap < G , Integer > ( ) ; orderAndSizeToGraphs . put ( orderAndSize , graphs ) ; graphs . put ( g , count ) ; return count ; } else { for ( Map . Entry < G , Integer > e : graphs . entrySet ( ) ) { if ( isoTest . areIsomorphic ( g , e . getKey ( ) ) ) { int newCount = e . getValue ( ) + count ; e . setValue ( newCount ) ; return newCount ; } } if ( allowNewMotifs ) { graphs . put ( g , count ) ; return count ; } else return 0 ; } }
Counts the isomorphic version of this graph, increasing its total count
by the specified positive amount.

@param count a positive value for the number of times the object occurred

@throws IllegalArgumentException if {@code count} is not a positive value.