public final class ComponentGrouping extends Object implements com.google.common.base.Predicate<int[]>
int[]
array of length (|V(query)| + 1). The final
index indicates the maximum component group (in the query). A specification
of '0' indicates there are no grouping restrictions.
// grouping is actually set by SMARTS parser but this shows how it's stored query.setProperty(ComponentGrouping.KEY, grouping); IAtomContainer query, target; Pattern pattern = ...; // create pattern for query // filter for mappings which respect component grouping in the query Iterables.filter(pattern.matchAll(target), new ComponentGrouping(query, target));
Pattern
Modifier and Type | Field and Description |
---|---|
static String |
KEY
Key indicates where the grouping should be store in the query
properties.
|
Constructor and Description |
---|
ComponentGrouping(IAtomContainer query,
IAtomContainer target)
Create a predicate to match components for the provided query and target.
|
ComponentGrouping(int[] grouping,
int[] targetComponents)
Create a predicate to match components for the provided query (grouping)
and target (connected components).
|
Modifier and Type | Method and Description |
---|---|
boolean |
apply(int[] mapping)
Does the mapping respected the component grouping specified by the
query.
|
public static final String KEY
public ComponentGrouping(IAtomContainer query, IAtomContainer target)
GraphUtil.toAdjList(IAtomContainer)
) and the query components extracted
from the property KEY
in the query.query
- query structuretarget
- target structurepublic ComponentGrouping(int[] grouping, int[] targetComponents)
grouping
- query groupingtargetComponents
- connected component of the targetpublic boolean apply(int[] mapping)
apply
in interface com.google.common.base.Predicate<int[]>
mapping
- a permutation of the query verticesCopyright © 2017. All Rights Reserved.