info.mrupp.isoak1
Class MolecularGraph

java.lang.Object
  extended by info.mrupp.isoak1.MolecularGraph

public class MolecularGraph
extends java.lang.Object

Query-only data structure for molecular graphs. Contains all information about one molecule. Designed as a constant data structure, i.e. once created no modifications are possible. Optimized for fast access.

The maximum allowed vertex degree tau is used to compute tau! in other parts of the program. Since optimal neighbour assignments are computed where tau! possible assignments are tested, increasing tau beyond 6 is not recommended.


Nested Class Summary
static class MolecularGraph.FileFormat
          The supported chemical file formats (currently only SDF).
 
Field Summary
static int MAX_DEGREE
          Maximum degree of any vertex.
 
Constructor Summary
MolecularGraph(java.io.LineNumberReader reader, MolecularGraph.FileFormat format)
          Creates a new molecular graph from a given source.
 
Method Summary
 float atomDescriptor(int atom, int descriptor)
          Returns the value of the given descriptor for the given atom.
 float bondDescriptor(int bond, int descriptor)
          Returns the value of the given descriptor for the given bond.
 int bondIndex(int a, int b)
          Returns the index of the bond between two atoms.
 java.lang.String name()
          Returns an identifier for the molecular graph.
 int neighbour(int atom, int n)
          Returns the n-th neighbour (index) of given atom.
 int numAtoms()
          Returns the total number of atoms in the molecular graph.
 int numBonds()
          Returns the total number of bonds in the molecular graph.
 int numNeighbours(int atom)
          Returns the degree of given atom.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DEGREE

public static final int MAX_DEGREE
Maximum degree of any vertex. Factorial runtime dependency on this constant.

See Also:
Constant Field Values
Constructor Detail

MolecularGraph

public MolecularGraph(java.io.LineNumberReader reader,
                      MolecularGraph.FileFormat format)
               throws java.io.IOException,
                      java.text.ParseException
Creates a new molecular graph from a given source.

Parameters:
reader - the source from which a textual representation of the molecule is read.
format - the file format of the textual source.
Throws:
java.io.IOException
java.text.ParseException
Method Detail

atomDescriptor

public float atomDescriptor(int atom,
                            int descriptor)
Returns the value of the given descriptor for the given atom. First descriptor is atomic number.


bondDescriptor

public float bondDescriptor(int bond,
                            int descriptor)
Returns the value of the given descriptor for the given bond. First descriptor is bond order.


bondIndex

public int bondIndex(int a,
                     int b)
Returns the index of the bond between two atoms.


name

public java.lang.String name()
Returns an identifier for the molecular graph.


neighbour

public int neighbour(int atom,
                     int n)
Returns the n-th neighbour (index) of given atom. The order of neighbours is arbitrary but does not change once the graph has been created.


numAtoms

public int numAtoms()
Returns the total number of atoms in the molecular graph.


numBonds

public int numBonds()
Returns the total number of bonds in the molecular graph.


numNeighbours

public int numNeighbours(int atom)
Returns the degree of given atom.