Skip to content

Commit

Permalink
a) Default constructor supported as per changes in the CDK b) VFMCS i…
Browse files Browse the repository at this point in the history
…ndex error should point to -1 not null Signed-off-by: Syed Asad Rahman <s9asad@gmail.com>
  • Loading branch information
asad authored and egonw committed Aug 30, 2010
1 parent 1dae4f2 commit 9c6c830
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 8 deletions.
Expand Up @@ -59,6 +59,13 @@ public final class GenerateCompatibilityGraph {
private IAtomContainer target = null;
private boolean shouldMatchBonds = false;

/**
* Default constructor added
*/
public GenerateCompatibilityGraph(){

}

/**
* Generates a compatibility graph between two molecules
* @param source
Expand Down
Expand Up @@ -45,6 +45,13 @@
@TestClass("org.openscience.cdk.smsd.SMSDBondSensitiveTest")
public class MCSPlus {

/**
* Default constructor added
*/
public MCSPlus(){

}

private static TimeManager timeManager = null;

/**
Expand Down
Expand Up @@ -52,6 +52,10 @@
@TestClass("org.openscience.cdk.smsd.algorithm.cdk.CDKRMapHandlerTest")
public class CDKRMapHandler {


public CDKRMapHandler(){

}
/**
* Returns source molecule
* @return the source
Expand Down
Expand Up @@ -58,6 +58,12 @@ public class SingleMapping {
private List<Map<IAtom, IAtom>> mappings = null;
private Map<Integer, Double> connectedBondOrder = null;

/**
* Default
*/
public SingleMapping() {
}

/**
* Returns single mapping solutions.
* @param source
Expand Down Expand Up @@ -119,7 +125,7 @@ private void setSourceSingleAtomMap(IQueryAtomContainer source, boolean removeHy
int counter = 0;
BondEnergies be = BondEnergies.getInstance();
for (IAtom sourceAtom : source.atoms()) {
IQueryAtom smartAtom=(IQueryAtom)sourceAtom;
IQueryAtom smartAtom = (IQueryAtom) sourceAtom;
if ((removeHydrogen && !smartAtom.getSymbol().equals("H")) || (!removeHydrogen)) {
for (IAtom targetAtom : target.atoms()) {
Map<IAtom, IAtom> mapAtoms = new HashMap<IAtom, IAtom>();
Expand Down
Expand Up @@ -312,6 +312,7 @@ private void setVFMappings(boolean RONP, IQuery query) {
IAtom tAtom = null;
Integer qIndex = 0;
Integer tIndex = 0;

if (RONP) {
qAtom = query.getAtom(mapping.getKey());
tAtom = mapping.getValue();
Expand All @@ -323,13 +324,13 @@ private void setVFMappings(boolean RONP, IQuery query) {
qIndex = getReactantMol().getAtomNumber(qAtom);
tIndex = getProductMol().getAtomNumber(tAtom);
}

if (qIndex != null && tIndex != null) {
if (qIndex != -1 && tIndex != -1) {
atomatomMapping.put(qAtom, tAtom);
indexindexMapping.put(qIndex, tIndex);
} else {
try {
throw new CDKException("Atom index pointing to NULL");
throw new CDKException("Atom index pointing to -1");
} catch (CDKException ex) {
Logger.error(Level.SEVERE, null, ex);
}
Expand Down
Expand Up @@ -95,8 +95,6 @@ public TargetProperties(IAtomContainer container) {
map = new IBond[container.getAtomCount()][container.getAtomCount()];
for (IAtom atom : container.atoms()) {
int count = container.getConnectedAtomsCount(atom);
// int virtualHydrogenCount = atom.getImplicitHydrogenCount() == null ? 0 : atom.getImplicitHydrogenCount().intValue();
// count += virtualHydrogenCount;
connectedTargetAtomCountMap.put(atom, count);
List<IAtom> list = container.getConnectedAtomsList(atom);
if (list != null) {
Expand Down
Expand Up @@ -75,8 +75,8 @@
@TestClass("org.openscience.cdk.smsd.algorithm.vflib.VFLibTest")
public class VFMCSMapper implements IMapper {

private IQuery query;
private List<Map<INode, IAtom>> maps;
private IQuery query = null;
private List<Map<INode, IAtom>> maps = null;
private int currentMCSSize = -1;
private static TimeManager timeManager = null;

Expand Down

0 comments on commit 9c6c830

Please sign in to comment.