id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
114,400
cdk/cdk
legacy/src/main/java/org/openscience/cdk/tools/SwissArmyKnife.java
SwissArmyKnife.printInt2D
public static String printInt2D(int[][] contab) { String line = ""; for (int f = 0; f < contab.length; f++) { for (int g = 0; g < contab.length; g++) { line += contab[f][g] + " "; } line += "\n"; } return line; }
java
public static String printInt2D(int[][] contab) { String line = ""; for (int f = 0; f < contab.length; f++) { for (int g = 0; g < contab.length; g++) { line += contab[f][g] + " "; } line += "\n"; } return line; }
[ "public", "static", "String", "printInt2D", "(", "int", "[", "]", "[", "]", "contab", ")", "{", "String", "line", "=", "\"\"", ";", "for", "(", "int", "f", "=", "0", ";", "f", "<", "contab", ".", "length", ";", "f", "++", ")", "{", "for", "(", ...
Returns a string representation of a 2D int matrix for printing or listing to the console. @param contab The 2D int matrix for which a string representation is to be generatred
[ "Returns", "a", "string", "representation", "of", "a", "2D", "int", "matrix", "for", "printing", "or", "listing", "to", "the", "console", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/tools/SwissArmyKnife.java#L83-L92
114,401
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.newUnitVector
static Vector2d newUnitVector(final Tuple2d from, final Tuple2d to) { final Vector2d vector = new Vector2d(to.x - from.x, to.y - from.y); vector.normalize(); return vector; }
java
static Vector2d newUnitVector(final Tuple2d from, final Tuple2d to) { final Vector2d vector = new Vector2d(to.x - from.x, to.y - from.y); vector.normalize(); return vector; }
[ "static", "Vector2d", "newUnitVector", "(", "final", "Tuple2d", "from", ",", "final", "Tuple2d", "to", ")", "{", "final", "Vector2d", "vector", "=", "new", "Vector2d", "(", "to", ".", "x", "-", "from", ".", "x", ",", "to", ".", "y", "-", "from", ".",...
Create a unit vector between two points. @param from start of vector @param to end of vector @return unit vector
[ "Create", "a", "unit", "vector", "between", "two", "points", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L80-L84
114,402
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.newUnitVector
static Vector2d newUnitVector(final IAtom atom, final IBond bond) { return newUnitVector(atom.getPoint2d(), bond.getOther(atom).getPoint2d()); }
java
static Vector2d newUnitVector(final IAtom atom, final IBond bond) { return newUnitVector(atom.getPoint2d(), bond.getOther(atom).getPoint2d()); }
[ "static", "Vector2d", "newUnitVector", "(", "final", "IAtom", "atom", ",", "final", "IBond", "bond", ")", "{", "return", "newUnitVector", "(", "atom", ".", "getPoint2d", "(", ")", ",", "bond", ".", "getOther", "(", "atom", ")", ".", "getPoint2d", "(", ")...
Create a unit vector for a bond with the start point being the specified atom. @param atom start of vector @param bond the bond used to create the vector @return unit vector
[ "Create", "a", "unit", "vector", "for", "a", "bond", "with", "the", "start", "point", "being", "the", "specified", "atom", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L93-L95
114,403
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.newUnitVectors
static List<Vector2d> newUnitVectors(final IAtom fromAtom, final List<IAtom> toAtoms) { final List<Vector2d> unitVectors = new ArrayList<Vector2d>(toAtoms.size()); for (final IAtom toAtom : toAtoms) { unitVectors.add(newUnitVector(fromAtom.getPoint2d(), toAtom.getPoint2d())); } ...
java
static List<Vector2d> newUnitVectors(final IAtom fromAtom, final List<IAtom> toAtoms) { final List<Vector2d> unitVectors = new ArrayList<Vector2d>(toAtoms.size()); for (final IAtom toAtom : toAtoms) { unitVectors.add(newUnitVector(fromAtom.getPoint2d(), toAtom.getPoint2d())); } ...
[ "static", "List", "<", "Vector2d", ">", "newUnitVectors", "(", "final", "IAtom", "fromAtom", ",", "final", "List", "<", "IAtom", ">", "toAtoms", ")", "{", "final", "List", "<", "Vector2d", ">", "unitVectors", "=", "new", "ArrayList", "<", "Vector2d", ">", ...
Create unit vectors from one atom to all other provided atoms. @param fromAtom reference atom (will become 0,0) @param toAtoms list of to atoms @return unit vectors
[ "Create", "unit", "vectors", "from", "one", "atom", "to", "all", "other", "provided", "atoms", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L104-L110
114,404
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.midpoint
static Point2d midpoint(Point2d a, Point2d b) { return new Point2d((a.x + b.x) / 2, (a.y + b.y) / 2); }
java
static Point2d midpoint(Point2d a, Point2d b) { return new Point2d((a.x + b.x) / 2, (a.y + b.y) / 2); }
[ "static", "Point2d", "midpoint", "(", "Point2d", "a", ",", "Point2d", "b", ")", "{", "return", "new", "Point2d", "(", "(", "a", ".", "x", "+", "b", ".", "x", ")", "/", "2", ",", "(", "a", ".", "y", "+", "b", ".", "y", ")", "/", "2", ")", ...
Midpoint of a line described by two points, a and b. @param a first point @param b second point @return the midpoint
[ "Midpoint", "of", "a", "line", "described", "by", "two", "points", "a", "and", "b", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L131-L133
114,405
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.scale
static Vector2d scale(final Tuple2d vector, final double factor) { final Vector2d cpy = new Vector2d(vector); cpy.scale(factor); return cpy; }
java
static Vector2d scale(final Tuple2d vector, final double factor) { final Vector2d cpy = new Vector2d(vector); cpy.scale(factor); return cpy; }
[ "static", "Vector2d", "scale", "(", "final", "Tuple2d", "vector", ",", "final", "double", "factor", ")", "{", "final", "Vector2d", "cpy", "=", "new", "Vector2d", "(", "vector", ")", ";", "cpy", ".", "scale", "(", "factor", ")", ";", "return", "cpy", ";...
Scale a vector by a given factor, the input vector is not modified. @param vector a vector to scale @param factor how much the input vector should be scaled @return scaled vector
[ "Scale", "a", "vector", "by", "a", "given", "factor", "the", "input", "vector", "is", "not", "modified", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L142-L146
114,406
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.sum
static Vector2d sum(final Tuple2d a, final Tuple2d b) { return new Vector2d(a.x + b.x, a.y + b.y); }
java
static Vector2d sum(final Tuple2d a, final Tuple2d b) { return new Vector2d(a.x + b.x, a.y + b.y); }
[ "static", "Vector2d", "sum", "(", "final", "Tuple2d", "a", ",", "final", "Tuple2d", "b", ")", "{", "return", "new", "Vector2d", "(", "a", ".", "x", "+", "b", ".", "x", ",", "a", ".", "y", "+", "b", ".", "y", ")", ";", "}" ]
Sum the components of two vectors, the input is not modified. @param a first vector @param b second vector @return scaled vector
[ "Sum", "the", "components", "of", "two", "vectors", "the", "input", "is", "not", "modified", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L155-L157
114,407
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.intersection
static Point2d intersection(final Tuple2d p1, final Tuple2d d1, final Tuple2d p2, final Tuple2d d2) { final Vector2d p1End = sum(p1, d1); final Vector2d p2End = sum(p2, d2); return intersection(p1.x, p1.y, p1End.x, p1End.y, p2.x, p2.y, p2End.x, p2End.y); }
java
static Point2d intersection(final Tuple2d p1, final Tuple2d d1, final Tuple2d p2, final Tuple2d d2) { final Vector2d p1End = sum(p1, d1); final Vector2d p2End = sum(p2, d2); return intersection(p1.x, p1.y, p1End.x, p1End.y, p2.x, p2.y, p2End.x, p2End.y); }
[ "static", "Point2d", "intersection", "(", "final", "Tuple2d", "p1", ",", "final", "Tuple2d", "d1", ",", "final", "Tuple2d", "p2", ",", "final", "Tuple2d", "d2", ")", "{", "final", "Vector2d", "p1End", "=", "sum", "(", "p1", ",", "d1", ")", ";", "final"...
Calculate the intersection of two vectors given their starting positions. @param p1 position vector 1 @param d1 direction vector 1 @param p2 position vector 2 @param d2 direction vector 2 @return the intersection
[ "Calculate", "the", "intersection", "of", "two", "vectors", "given", "their", "starting", "positions", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L179-L183
114,408
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.adjacentLength
static double adjacentLength(Vector2d hypotenuse, Vector2d adjacent, double oppositeLength) { return Math.tan(hypotenuse.angle(adjacent)) * oppositeLength; }
java
static double adjacentLength(Vector2d hypotenuse, Vector2d adjacent, double oppositeLength) { return Math.tan(hypotenuse.angle(adjacent)) * oppositeLength; }
[ "static", "double", "adjacentLength", "(", "Vector2d", "hypotenuse", ",", "Vector2d", "adjacent", ",", "double", "oppositeLength", ")", "{", "return", "Math", ".", "tan", "(", "hypotenuse", ".", "angle", "(", "adjacent", ")", ")", "*", "oppositeLength", ";", ...
Given vectors for the hypotenuse and adjacent side of a right angled triangle and the length of the opposite side, determine how long the adjacent side size. @param hypotenuse vector for the hypotenuse @param adjacent vector for the adjacent side @param oppositeLength length of the opposite side of a triangle @return ...
[ "Given", "vectors", "for", "the", "hypotenuse", "and", "adjacent", "side", "of", "a", "right", "angled", "triangle", "and", "the", "length", "of", "the", "opposite", "side", "determine", "how", "long", "the", "adjacent", "side", "size", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L220-L222
114,409
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.average
static Vector2d average(final Collection<Vector2d> vectors) { final Vector2d average = new Vector2d(0, 0); for (final Vector2d vector : vectors) { average.add(vector); } average.scale(1d / vectors.size()); return average; }
java
static Vector2d average(final Collection<Vector2d> vectors) { final Vector2d average = new Vector2d(0, 0); for (final Vector2d vector : vectors) { average.add(vector); } average.scale(1d / vectors.size()); return average; }
[ "static", "Vector2d", "average", "(", "final", "Collection", "<", "Vector2d", ">", "vectors", ")", "{", "final", "Vector2d", "average", "=", "new", "Vector2d", "(", "0", ",", "0", ")", ";", "for", "(", "final", "Vector2d", "vector", ":", "vectors", ")", ...
Average a collection of vectors. @param vectors one or more vectors @return average vector
[ "Average", "a", "collection", "of", "vectors", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L230-L237
114,410
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.getNearestVector
static Vector2d getNearestVector(final Vector2d reference, final List<Vector2d> vectors) { if (vectors.isEmpty()) throw new IllegalArgumentException("No vectors provided"); // to find the closest vector we find use the dot product, // for the general case (non-unit vectors) one can use the ...
java
static Vector2d getNearestVector(final Vector2d reference, final List<Vector2d> vectors) { if (vectors.isEmpty()) throw new IllegalArgumentException("No vectors provided"); // to find the closest vector we find use the dot product, // for the general case (non-unit vectors) one can use the ...
[ "static", "Vector2d", "getNearestVector", "(", "final", "Vector2d", "reference", ",", "final", "List", "<", "Vector2d", ">", "vectors", ")", "{", "if", "(", "vectors", ".", "isEmpty", "(", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"No vector...
Given a list of unit vectors, find the vector which is nearest to a provided reference. @param reference a target vector @param vectors list of vectors @return the nearest vector @throws java.lang.IllegalArgumentException no vectors provided
[ "Given", "a", "list", "of", "unit", "vectors", "find", "the", "vector", "which", "is", "nearest", "to", "a", "provided", "reference", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L248-L267
114,411
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.getNearestVector
static Vector2d getNearestVector(Vector2d reference, IAtom fromAtom, List<IBond> bonds) { final List<IAtom> toAtoms = new ArrayList<IAtom>(); for (IBond bond : bonds) { toAtoms.add(bond.getOther(fromAtom)); } return getNearestVector(reference, newUnitVectors(fromAtom, toAto...
java
static Vector2d getNearestVector(Vector2d reference, IAtom fromAtom, List<IBond> bonds) { final List<IAtom> toAtoms = new ArrayList<IAtom>(); for (IBond bond : bonds) { toAtoms.add(bond.getOther(fromAtom)); } return getNearestVector(reference, newUnitVectors(fromAtom, toAto...
[ "static", "Vector2d", "getNearestVector", "(", "Vector2d", "reference", ",", "IAtom", "fromAtom", ",", "List", "<", "IBond", ">", "bonds", ")", "{", "final", "List", "<", "IAtom", ">", "toAtoms", "=", "new", "ArrayList", "<", "IAtom", ">", "(", ")", ";",...
Given a list of bonds, find the bond which is nearest to a provided reference and return the vector for this bond. @param reference a target vector @param fromAtom an atom (will be 0,0) @param bonds list of bonds containing 'fromAtom' @return the nearest vector
[ "Given", "a", "list", "of", "bonds", "find", "the", "bond", "which", "is", "nearest", "to", "a", "provided", "reference", "and", "return", "the", "vector", "for", "this", "bond", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L278-L286
114,412
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java
VecmathUtil.extents
static double[] extents(final List<Vector2d> vectors) { final int n = vectors.size(); final double[] extents = new double[n]; for (int i = 0; i < n; i++) extents[i] = VecmathUtil.extent(vectors.get(i)); return extents; }
java
static double[] extents(final List<Vector2d> vectors) { final int n = vectors.size(); final double[] extents = new double[n]; for (int i = 0; i < n; i++) extents[i] = VecmathUtil.extent(vectors.get(i)); return extents; }
[ "static", "double", "[", "]", "extents", "(", "final", "List", "<", "Vector2d", ">", "vectors", ")", "{", "final", "int", "n", "=", "vectors", ".", "size", "(", ")", ";", "final", "double", "[", "]", "extents", "=", "new", "double", "[", "n", "]", ...
Obtain the extents for a list of vectors. @param vectors list of vectors @return array of extents (not sorted) @see #extent(javax.vecmath.Vector2d)
[ "Obtain", "the", "extents", "for", "a", "list", "of", "vectors", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L312-L318
114,413
cdk/cdk
base/silent/src/main/java/org/openscience/cdk/silent/AtomType.java
AtomType.compare
@Override public boolean compare(Object object) { if (!(object instanceof IAtomType)) { return false; } if (!super.compare(object)) { return false; } AtomType type = (AtomType) object; return Objects.equal(getAtomTypeName(), type.getAtomTypeNam...
java
@Override public boolean compare(Object object) { if (!(object instanceof IAtomType)) { return false; } if (!super.compare(object)) { return false; } AtomType type = (AtomType) object; return Objects.equal(getAtomTypeName(), type.getAtomTypeNam...
[ "@", "Override", "public", "boolean", "compare", "(", "Object", "object", ")", "{", "if", "(", "!", "(", "object", "instanceof", "IAtomType", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "super", ".", "compare", "(", "object", ")", ")"...
Compares a atom type with this atom type. @param object Object of type AtomType @return true if the atom types are equal
[ "Compares", "a", "atom", "type", "with", "this", "atom", "type", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/AtomType.java#L303-L314
114,414
cdk/cdk
base/data/src/main/java/org/openscience/cdk/formula/MolecularFormula.java
MolecularFormula.add
@Override public IMolecularFormula add(IMolecularFormula formula) { for (IIsotope newIsotope : formula.isotopes()) { addIsotope(newIsotope, formula.getIsotopeCount(newIsotope)); } if (formula.getCharge() != null) { if (charge != null) charge += formula...
java
@Override public IMolecularFormula add(IMolecularFormula formula) { for (IIsotope newIsotope : formula.isotopes()) { addIsotope(newIsotope, formula.getIsotopeCount(newIsotope)); } if (formula.getCharge() != null) { if (charge != null) charge += formula...
[ "@", "Override", "public", "IMolecularFormula", "add", "(", "IMolecularFormula", "formula", ")", "{", "for", "(", "IIsotope", "newIsotope", ":", "formula", ".", "isotopes", "(", ")", ")", "{", "addIsotope", "(", "newIsotope", ",", "formula", ".", "getIsotopeCo...
Adds an molecularFormula to this MolecularFormula. @param formula The molecularFormula to be added to this chemObject @return The IMolecularFormula
[ "Adds", "an", "molecularFormula", "to", "this", "MolecularFormula", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/data/src/main/java/org/openscience/cdk/formula/MolecularFormula.java#L82-L94
114,415
cdk/cdk
base/core/src/main/java/org/openscience/cdk/graph/GreedyBasis.java
GreedyBasis.add
final void add(final Cycle cycle) { basis.add(cycle); edgesOfBasis.or(cycle.edgeVector()); }
java
final void add(final Cycle cycle) { basis.add(cycle); edgesOfBasis.or(cycle.edgeVector()); }
[ "final", "void", "add", "(", "final", "Cycle", "cycle", ")", "{", "basis", ".", "add", "(", "cycle", ")", ";", "edgesOfBasis", ".", "or", "(", "cycle", ".", "edgeVector", "(", ")", ")", ";", "}" ]
Add a cycle to the basis. @param cycle new basis member
[ "Add", "a", "cycle", "to", "the", "basis", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/GreedyBasis.java#L92-L95
114,416
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/MorganNumbersTools.java
MorganNumbersTools.getMorganNumbers
public static long[] getMorganNumbers(IAtomContainer molecule) { int order = molecule.getAtomCount(); long[] currentInvariants = new long[order]; long[] previousInvariants = new long[order]; int[][] graph = new int[order][INITIAL_DEGREE]; int[] degree = new int[order]; ...
java
public static long[] getMorganNumbers(IAtomContainer molecule) { int order = molecule.getAtomCount(); long[] currentInvariants = new long[order]; long[] previousInvariants = new long[order]; int[][] graph = new int[order][INITIAL_DEGREE]; int[] degree = new int[order]; ...
[ "public", "static", "long", "[", "]", "getMorganNumbers", "(", "IAtomContainer", "molecule", ")", "{", "int", "order", "=", "molecule", ".", "getAtomCount", "(", ")", ";", "long", "[", "]", "currentInvariants", "=", "new", "long", "[", "order", "]", ";", ...
Makes an array containing the morgan numbers of the atoms of atomContainer. These number are the extended connectivity values and not the lexicographic smallest labelling on the graph. @param molecule the molecule to analyse. @return The morgan numbers value.
[ "Makes", "an", "array", "containing", "the", "morgan", "numbers", "of", "the", "atoms", "of", "atomContainer", ".", "These", "number", "are", "the", "extended", "connectivity", "values", "and", "not", "the", "lexicographic", "smallest", "labelling", "on", "the",...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/MorganNumbersTools.java#L57-L102
114,417
cdk/cdk
legacy/src/main/java/org/openscience/cdk/smsd/Isomorphism.java
Isomorphism.makeBondMapsOfAtomMaps
public static List<Map<IBond, IBond>> makeBondMapsOfAtomMaps(IAtomContainer ac1, IAtomContainer ac2, List<Map<IAtom, IAtom>> mappings) { List<Map<IBond, IBond>> bondMaps = new ArrayList<Map<IBond, IBond>>(); for (Map<IAtom, IAtom> mapping : mappings) { bondMaps.add(makeBondMapOfA...
java
public static List<Map<IBond, IBond>> makeBondMapsOfAtomMaps(IAtomContainer ac1, IAtomContainer ac2, List<Map<IAtom, IAtom>> mappings) { List<Map<IBond, IBond>> bondMaps = new ArrayList<Map<IBond, IBond>>(); for (Map<IAtom, IAtom> mapping : mappings) { bondMaps.add(makeBondMapOfA...
[ "public", "static", "List", "<", "Map", "<", "IBond", ",", "IBond", ">", ">", "makeBondMapsOfAtomMaps", "(", "IAtomContainer", "ac1", ",", "IAtomContainer", "ac2", ",", "List", "<", "Map", "<", "IAtom", ",", "IAtom", ">", ">", "mappings", ")", "{", "List...
Returns bond maps between source and target molecules based on the atoms @param ac1 source molecule @param ac2 target molecule @param mappings mappings between source and target molecule atoms @return bond maps between source and target molecules based on the atoms
[ "Returns", "bond", "maps", "between", "source", "and", "target", "molecules", "based", "on", "the", "atoms" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/Isomorphism.java#L256-L263
114,418
cdk/cdk
legacy/src/main/java/org/openscience/cdk/smsd/Isomorphism.java
Isomorphism.init
public void init(String sourceMolFileName, String targetMolFileName, boolean removeHydrogen, boolean cleanAndConfigureMolecule) throws CDKException { this.removeHydrogen = removeHydrogen; init(new MolHandler(sourceMolFileName, cleanAndConfigureMolecule, removeHydrogen), new MolHandler( ...
java
public void init(String sourceMolFileName, String targetMolFileName, boolean removeHydrogen, boolean cleanAndConfigureMolecule) throws CDKException { this.removeHydrogen = removeHydrogen; init(new MolHandler(sourceMolFileName, cleanAndConfigureMolecule, removeHydrogen), new MolHandler( ...
[ "public", "void", "init", "(", "String", "sourceMolFileName", ",", "String", "targetMolFileName", ",", "boolean", "removeHydrogen", ",", "boolean", "cleanAndConfigureMolecule", ")", "throws", "CDKException", "{", "this", ".", "removeHydrogen", "=", "removeHydrogen", "...
Initialize the query and targetAtomCount mol via mol files @param sourceMolFileName source mol file name @param targetMolFileName target mol file name @param removeHydrogen set true to make hydrogens implicit before search @param cleanAndConfigureMolecule eg: percieveAtomTypesAndConfigureAtoms, detect aromaticity et...
[ "Initialize", "the", "query", "and", "targetAtomCount", "mol", "via", "mol", "files" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/Isomorphism.java#L620-L625
114,419
cdk/cdk
legacy/src/main/java/org/openscience/cdk/isomorphism/matchers/smarts/SMARTSAtom.java
SMARTSAtom.invariants
final SMARTSAtomInvariants invariants(final IAtom atom) { final SMARTSAtomInvariants inv = atom.getProperty(SMARTSAtomInvariants.KEY); if (inv == null) throw new NullPointerException( "Missing SMARTSAtomInvariants - please compute these values before matching."); ...
java
final SMARTSAtomInvariants invariants(final IAtom atom) { final SMARTSAtomInvariants inv = atom.getProperty(SMARTSAtomInvariants.KEY); if (inv == null) throw new NullPointerException( "Missing SMARTSAtomInvariants - please compute these values before matching."); ...
[ "final", "SMARTSAtomInvariants", "invariants", "(", "final", "IAtom", "atom", ")", "{", "final", "SMARTSAtomInvariants", "inv", "=", "atom", ".", "getProperty", "(", "SMARTSAtomInvariants", ".", "KEY", ")", ";", "if", "(", "inv", "==", "null", ")", "throw", ...
Access the atom invariants for this atom. If the invariants have not been set an exception is thrown. @param atom the atom to obtain the invariants of @return the atom invariants for the atom @throws NullPointerException thrown if the invariants were not set
[ "Access", "the", "atom", "invariants", "for", "this", "atom", ".", "If", "the", "invariants", "have", "not", "been", "set", "an", "exception", "is", "thrown", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/isomorphism/matchers/smarts/SMARTSAtom.java#L48-L54
114,420
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/io/CrystClustWriter.java
CrystClustWriter.write
@Override public void write(IChemObject object) throws UnsupportedChemObjectException { if (object instanceof ICrystal) { writeCrystal((ICrystal) object); } else if (object instanceof IChemSequence) { writeChemSequence((IChemSequence) object); } else { thr...
java
@Override public void write(IChemObject object) throws UnsupportedChemObjectException { if (object instanceof ICrystal) { writeCrystal((ICrystal) object); } else if (object instanceof IChemSequence) { writeChemSequence((IChemSequence) object); } else { thr...
[ "@", "Override", "public", "void", "write", "(", "IChemObject", "object", ")", "throws", "UnsupportedChemObjectException", "{", "if", "(", "object", "instanceof", "ICrystal", ")", "{", "writeCrystal", "(", "(", "ICrystal", ")", "object", ")", ";", "}", "else",...
Serializes the IChemObject to CrystClust format and redirects it to the output Writer. @param object A Molecule of MoleculeSet object
[ "Serializes", "the", "IChemObject", "to", "CrystClust", "format", "and", "redirects", "it", "to", "the", "output", "Writer", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/io/CrystClustWriter.java#L116-L125
114,421
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/io/CrystClustWriter.java
CrystClustWriter.writeCrystal
private void writeCrystal(ICrystal crystal) { String sg = crystal.getSpaceGroup(); if ("P 2_1 2_1 2_1".equals(sg)) { writeln("P 21 21 21 (1)"); } else { writeln("P 1 (1)"); } // output unit cell axes writeVector3d(crystal.getA()); writeVe...
java
private void writeCrystal(ICrystal crystal) { String sg = crystal.getSpaceGroup(); if ("P 2_1 2_1 2_1".equals(sg)) { writeln("P 21 21 21 (1)"); } else { writeln("P 1 (1)"); } // output unit cell axes writeVector3d(crystal.getA()); writeVe...
[ "private", "void", "writeCrystal", "(", "ICrystal", "crystal", ")", "{", "String", "sg", "=", "crystal", ".", "getSpaceGroup", "(", ")", ";", "if", "(", "\"P 2_1 2_1 2_1\"", ".", "equals", "(", "sg", ")", ")", "{", "writeln", "(", "\"P 21 21 21 (1)\"", ")"...
Writes a single frame to the Writer. <p>Format: <pre> line data ------- -------------------------- 1 spacegroup 2,3,4 cell parameter: a 5,6,7 b 8,9,10 c 11 number of atoms 12 number of asym. units 13-16 atomtype: charge, atomcoord x, y, z 17-20 ...
[ "Writes", "a", "single", "frame", "to", "the", "Writer", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/io/CrystClustWriter.java#L165-L206
114,422
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/GeneralPath.java
GeneralPath.recolor
public GeneralPath recolor(Color newColor) { return new GeneralPath(elements, newColor, winding, stroke, fill); }
java
public GeneralPath recolor(Color newColor) { return new GeneralPath(elements, newColor, winding, stroke, fill); }
[ "public", "GeneralPath", "recolor", "(", "Color", "newColor", ")", "{", "return", "new", "GeneralPath", "(", "elements", ",", "newColor", ",", "winding", ",", "stroke", ",", "fill", ")", ";", "}" ]
Recolor the path with the specified color. @param newColor new path color @return the recolored path
[ "Recolor", "the", "path", "with", "the", "specified", "color", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/GeneralPath.java#L105-L107
114,423
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/GeneralPath.java
GeneralPath.shapeOf
public static GeneralPath shapeOf(Shape shape, Color color) { List<PathElement> elements = new ArrayList<PathElement>(); PathIterator pathIt = shape.getPathIterator(new AffineTransform()); double[] data = new double[6]; while (!pathIt.isDone()) { switch (pathIt.currentSegment...
java
public static GeneralPath shapeOf(Shape shape, Color color) { List<PathElement> elements = new ArrayList<PathElement>(); PathIterator pathIt = shape.getPathIterator(new AffineTransform()); double[] data = new double[6]; while (!pathIt.isDone()) { switch (pathIt.currentSegment...
[ "public", "static", "GeneralPath", "shapeOf", "(", "Shape", "shape", ",", "Color", "color", ")", "{", "List", "<", "PathElement", ">", "elements", "=", "new", "ArrayList", "<", "PathElement", ">", "(", ")", ";", "PathIterator", "pathIt", "=", "shape", ".",...
Create a filled path of the specified Java 2D Shape and color. @param shape Java 2D shape @param color the color to fill the shape with @return a new general path
[ "Create", "a", "filled", "path", "of", "the", "specified", "Java", "2D", "Shape", "and", "color", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/GeneralPath.java#L132-L157
114,424
cdk/cdk
tool/hash/src/main/java/org/openscience/cdk/hash/PerturbedAtomHashGenerator.java
PerturbedAtomHashGenerator.combine
long[] combine(long[][] perturbed) { int n = perturbed.length; int m = perturbed[0].length; long[] combined = new long[n]; long[] rotated = new long[m]; for (int i = 0; i < n; i++) { Arrays.sort(perturbed[i]); for (int j = 0; j < m; j++) { ...
java
long[] combine(long[][] perturbed) { int n = perturbed.length; int m = perturbed[0].length; long[] combined = new long[n]; long[] rotated = new long[m]; for (int i = 0; i < n; i++) { Arrays.sort(perturbed[i]); for (int j = 0; j < m; j++) { ...
[ "long", "[", "]", "combine", "(", "long", "[", "]", "[", "]", "perturbed", ")", "{", "int", "n", "=", "perturbed", ".", "length", ";", "int", "m", "=", "perturbed", "[", "0", "]", ".", "length", ";", "long", "[", "]", "combined", "=", "new", "l...
Combines the values in an n x m matrix into a single array of size n. This process scans the rows and xors all unique values in the row together. If a duplicate value is found it is rotated using a pseudorandom number generator. @param perturbed n x m, matrix @return the combined values of each row
[ "Combines", "the", "values", "in", "an", "n", "x", "m", "matrix", "into", "a", "single", "array", "of", "size", "n", ".", "This", "process", "scans", "the", "rows", "and", "xors", "all", "unique", "values", "in", "the", "row", "together", ".", "If", ...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/hash/src/main/java/org/openscience/cdk/hash/PerturbedAtomHashGenerator.java#L176-L200
114,425
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java
BasicBondGenerator.getRingSet
protected IRingSet getRingSet(IAtomContainer atomContainer) { IRingSet ringSet = atomContainer.getBuilder().newInstance(IRingSet.class); try { IAtomContainerSet molecules = ConnectivityChecker.partitionIntoMolecules(atomContainer); for (IAtomContainer mol : molecules.atomContain...
java
protected IRingSet getRingSet(IAtomContainer atomContainer) { IRingSet ringSet = atomContainer.getBuilder().newInstance(IRingSet.class); try { IAtomContainerSet molecules = ConnectivityChecker.partitionIntoMolecules(atomContainer); for (IAtomContainer mol : molecules.atomContain...
[ "protected", "IRingSet", "getRingSet", "(", "IAtomContainer", "atomContainer", ")", "{", "IRingSet", "ringSet", "=", "atomContainer", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IRingSet", ".", "class", ")", ";", "try", "{", "IAtomContainerSet", "mole...
Determine the ring set for this atom container. @param atomContainer the atom container to find rings in. @return the rings of the molecule
[ "Determine", "the", "ring", "set", "for", "this", "atom", "container", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L198-L213
114,426
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java
BasicBondGenerator.getColorForBond
public Color getColorForBond(IBond bond, RendererModel model) { if (this.overrideColor != null) { return overrideColor; } Color color = model.getParameter(ColorHash.class).getValue().get(bond); if (color == null) { return model.getParameter(DefaultBondColor.class...
java
public Color getColorForBond(IBond bond, RendererModel model) { if (this.overrideColor != null) { return overrideColor; } Color color = model.getParameter(ColorHash.class).getValue().get(bond); if (color == null) { return model.getParameter(DefaultBondColor.class...
[ "public", "Color", "getColorForBond", "(", "IBond", "bond", ",", "RendererModel", "model", ")", "{", "if", "(", "this", ".", "overrideColor", "!=", "null", ")", "{", "return", "overrideColor", ";", "}", "Color", "color", "=", "model", ".", "getParameter", ...
Determine the color of a bond, returning either the default color, the override color or whatever is in the color hash for that bond. @param bond the bond we are generating an element for @param model the rendering model @return the color to paint the bond
[ "Determine", "the", "color", "of", "a", "bond", "returning", "either", "the", "default", "color", "the", "override", "color", "or", "whatever", "is", "in", "the", "color", "hash", "for", "that", "bond", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L223-L234
114,427
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java
BasicBondGenerator.getWidthForBond
public double getWidthForBond(IBond bond, RendererModel model) { double scale = model.getParameter(Scale.class).getValue(); if (this.overrideBondWidth != -1) { return this.overrideBondWidth / scale; } else { return model.getParameter(BondWidth.class).getValue() / scale; ...
java
public double getWidthForBond(IBond bond, RendererModel model) { double scale = model.getParameter(Scale.class).getValue(); if (this.overrideBondWidth != -1) { return this.overrideBondWidth / scale; } else { return model.getParameter(BondWidth.class).getValue() / scale; ...
[ "public", "double", "getWidthForBond", "(", "IBond", "bond", ",", "RendererModel", "model", ")", "{", "double", "scale", "=", "model", ".", "getParameter", "(", "Scale", ".", "class", ")", ".", "getValue", "(", ")", ";", "if", "(", "this", ".", "override...
Determine the width of a bond, returning either the width defined in the model, or the override width. Note that this will be scaled to the space of the model. @param bond the bond to determine the width for @param model the renderer model @return a double in chem-model space
[ "Determine", "the", "width", "of", "a", "bond", "returning", "either", "the", "width", "defined", "in", "the", "model", "or", "the", "override", "width", ".", "Note", "that", "this", "will", "be", "scaled", "to", "the", "space", "of", "the", "model", "."...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L245-L252
114,428
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java
BasicBondGenerator.generateBondElement
public IRenderingElement generateBondElement(IBond bond, IBond.Order type, RendererModel model) { // More than 2 atoms per bond not supported by this module if (bond.getAtomCount() > 2) return null; // is object right? if not replace with a good one Point2d point1 = bond.getBegin().getP...
java
public IRenderingElement generateBondElement(IBond bond, IBond.Order type, RendererModel model) { // More than 2 atoms per bond not supported by this module if (bond.getAtomCount() > 2) return null; // is object right? if not replace with a good one Point2d point1 = bond.getBegin().getP...
[ "public", "IRenderingElement", "generateBondElement", "(", "IBond", "bond", ",", "IBond", ".", "Order", "type", ",", "RendererModel", "model", ")", "{", "// More than 2 atoms per bond not supported by this module", "if", "(", "bond", ".", "getAtomCount", "(", ")", ">"...
Generate a LineElement or an ElementGroup of LineElements for this bond. This version should be used if you want to override the type - for example, for ring double bonds. @param bond the bond to generate for @param type the type of the bond - single, double, etc @param model the renderer model @return one or more ren...
[ "Generate", "a", "LineElement", "or", "an", "ElementGroup", "of", "LineElements", "for", "this", "bond", ".", "This", "version", "should", "be", "used", "if", "you", "want", "to", "override", "the", "type", "-", "for", "example", "for", "ring", "double", "...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L309-L339
114,429
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java
BasicBondGenerator.generateRingElements
public IRenderingElement generateRingElements(IBond bond, IRing ring, RendererModel model) { if (isSingle(bond) && isStereoBond(bond)) { return generateStereoElement(bond, model); } else if (isDouble(bond)) { ElementGroup pair = new ElementGroup(); pair.add(generateBo...
java
public IRenderingElement generateRingElements(IBond bond, IRing ring, RendererModel model) { if (isSingle(bond) && isStereoBond(bond)) { return generateStereoElement(bond, model); } else if (isDouble(bond)) { ElementGroup pair = new ElementGroup(); pair.add(generateBo...
[ "public", "IRenderingElement", "generateRingElements", "(", "IBond", "bond", ",", "IRing", "ring", ",", "RendererModel", "model", ")", "{", "if", "(", "isSingle", "(", "bond", ")", "&&", "isStereoBond", "(", "bond", ")", ")", "{", "return", "generateStereoElem...
Generate ring elements, such as inner-ring bonds or ring stereo elements. @param bond the ring bond to use when generating elements @param ring the ring that the bond is in @param model the renderer model @return one or more rendering elements
[ "Generate", "ring", "elements", "such", "as", "inner", "-", "ring", "bonds", "or", "ring", "stereo", "elements", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L378-L389
114,430
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java
BasicBondGenerator.generateInnerElement
public LineElement generateInnerElement(IBond bond, IRing ring, RendererModel model) { Point2d center = GeometryUtil.get2DCenter(ring); Point2d a = bond.getBegin().getPoint2d(); Point2d b = bond.getEnd().getPoint2d(); // the proportion to move in towards the ring center double d...
java
public LineElement generateInnerElement(IBond bond, IRing ring, RendererModel model) { Point2d center = GeometryUtil.get2DCenter(ring); Point2d a = bond.getBegin().getPoint2d(); Point2d b = bond.getEnd().getPoint2d(); // the proportion to move in towards the ring center double d...
[ "public", "LineElement", "generateInnerElement", "(", "IBond", "bond", ",", "IRing", "ring", ",", "RendererModel", "model", ")", "{", "Point2d", "center", "=", "GeometryUtil", ".", "get2DCenter", "(", "ring", ")", ";", "Point2d", "a", "=", "bond", ".", "getB...
Make the inner ring bond, which is slightly shorter than the outer bond. @param bond the ring bond @param ring the ring that the bond is in @param model the renderer model @return the line element
[ "Make", "the", "inner", "ring", "bond", "which", "is", "slightly", "shorter", "than", "the", "outer", "bond", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L399-L424
114,431
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java
BasicBondGenerator.isStereoBond
private boolean isStereoBond(IBond bond) { return bond.getStereo() != IBond.Stereo.NONE && bond.getStereo() != (IBond.Stereo) CDKConstants.UNSET && bond.getStereo() != IBond.Stereo.E_Z_BY_COORDINATES; }
java
private boolean isStereoBond(IBond bond) { return bond.getStereo() != IBond.Stereo.NONE && bond.getStereo() != (IBond.Stereo) CDKConstants.UNSET && bond.getStereo() != IBond.Stereo.E_Z_BY_COORDINATES; }
[ "private", "boolean", "isStereoBond", "(", "IBond", "bond", ")", "{", "return", "bond", ".", "getStereo", "(", ")", "!=", "IBond", ".", "Stereo", ".", "NONE", "&&", "bond", ".", "getStereo", "(", ")", "!=", "(", "IBond", ".", "Stereo", ")", "CDKConstan...
Check to see if a bond is a stereo bond. @param bond the bond to check @return true if the bond has stero information
[ "Check", "to", "see", "if", "a", "bond", "is", "a", "stereo", "bond", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L467-L470
114,432
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java
BasicBondGenerator.bindsHydrogen
protected boolean bindsHydrogen(IBond bond) { for (int i = 0; i < bond.getAtomCount(); i++) { IAtom atom = bond.getAtom(i); if ("H".equals(atom.getSymbol())) return true; } return false; }
java
protected boolean bindsHydrogen(IBond bond) { for (int i = 0; i < bond.getAtomCount(); i++) { IAtom atom = bond.getAtom(i); if ("H".equals(atom.getSymbol())) return true; } return false; }
[ "protected", "boolean", "bindsHydrogen", "(", "IBond", "bond", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "bond", ".", "getAtomCount", "(", ")", ";", "i", "++", ")", "{", "IAtom", "atom", "=", "bond", ".", "getAtom", "(", "i", ")"...
Check to see if any of the atoms in this bond are hydrogen atoms. @param bond the bond to check @return true if any atom has an element symbol of "H"
[ "Check", "to", "see", "if", "any", "of", "the", "atoms", "in", "this", "bond", "are", "hydrogen", "atoms", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L478-L484
114,433
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java
BasicBondGenerator.generateBond
public IRenderingElement generateBond(IBond bond, RendererModel model) { boolean showExplicitHydrogens = true; if (model.hasParameter(BasicAtomGenerator.ShowExplicitHydrogens.class)) { showExplicitHydrogens = model.getParameter(BasicAtomGenerator.ShowExplicitHydrogens.class).getValue(); ...
java
public IRenderingElement generateBond(IBond bond, RendererModel model) { boolean showExplicitHydrogens = true; if (model.hasParameter(BasicAtomGenerator.ShowExplicitHydrogens.class)) { showExplicitHydrogens = model.getParameter(BasicAtomGenerator.ShowExplicitHydrogens.class).getValue(); ...
[ "public", "IRenderingElement", "generateBond", "(", "IBond", "bond", ",", "RendererModel", "model", ")", "{", "boolean", "showExplicitHydrogens", "=", "true", ";", "if", "(", "model", ".", "hasParameter", "(", "BasicAtomGenerator", ".", "ShowExplicitHydrogens", ".",...
Generate stereo or bond elements for this bond. @param bond the bond to use when generating elements @param model the renderer model @return one or more rendering elements
[ "Generate", "stereo", "or", "bond", "elements", "for", "this", "bond", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L493-L508
114,434
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaSetManipulator.java
MolecularFormulaSetManipulator.getMaxOccurrenceElements
public static IMolecularFormula getMaxOccurrenceElements(IMolecularFormulaSet mfSet) { IMolecularFormula molecularFormula = mfSet.getBuilder().newInstance(IMolecularFormula.class); for (IMolecularFormula mf : mfSet.molecularFormulas()) { for (IIsotope isotope : mf.isotopes()) { ...
java
public static IMolecularFormula getMaxOccurrenceElements(IMolecularFormulaSet mfSet) { IMolecularFormula molecularFormula = mfSet.getBuilder().newInstance(IMolecularFormula.class); for (IMolecularFormula mf : mfSet.molecularFormulas()) { for (IIsotope isotope : mf.isotopes()) { ...
[ "public", "static", "IMolecularFormula", "getMaxOccurrenceElements", "(", "IMolecularFormulaSet", "mfSet", ")", "{", "IMolecularFormula", "molecularFormula", "=", "mfSet", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IMolecularFormula", ".", "class", ")", ";...
Extract from a set of MolecularFormula the maximum occurrence of each element found and put the element and occurrence in a new IMolecularFormula. @param mfSet The set of molecularFormules to inspect @return A IMolecularFormula containing the maximum occurrence of the elements @see #getMinOccurre...
[ "Extract", "from", "a", "set", "of", "MolecularFormula", "the", "maximum", "occurrence", "of", "each", "element", "found", "and", "put", "the", "element", "and", "occurrence", "in", "a", "new", "IMolecularFormula", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaSetManipulator.java#L56-L75
114,435
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaSetManipulator.java
MolecularFormulaSetManipulator.validCorrelation
private static boolean validCorrelation(IMolecularFormula formulaMin, IMolecularFormula formulamax) { for (IElement element : MolecularFormulaManipulator.elements(formulaMin)) { if (!MolecularFormulaManipulator.containsElement(formulamax, element)) return false; } return true; }
java
private static boolean validCorrelation(IMolecularFormula formulaMin, IMolecularFormula formulamax) { for (IElement element : MolecularFormulaManipulator.elements(formulaMin)) { if (!MolecularFormulaManipulator.containsElement(formulamax, element)) return false; } return true; }
[ "private", "static", "boolean", "validCorrelation", "(", "IMolecularFormula", "formulaMin", ",", "IMolecularFormula", "formulamax", ")", "{", "for", "(", "IElement", "element", ":", "MolecularFormulaManipulator", ".", "elements", "(", "formulaMin", ")", ")", "{", "i...
In the minimal IMolecularFormula must contain all those IElement found in the minimal IMolecularFormula. @param formulaMax A IMolecularFormula which contains the maximal representation of the Elements @param formulaMin A IMolecularFormula which contains the minimal representation of the Elements @return T...
[ "In", "the", "minimal", "IMolecularFormula", "must", "contain", "all", "those", "IElement", "found", "in", "the", "minimal", "IMolecularFormula", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaSetManipulator.java#L158-L164
114,436
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaSetManipulator.java
MolecularFormulaSetManipulator.contains
public static boolean contains(IMolecularFormulaSet formulaSet, IMolecularFormula formula) { for (IMolecularFormula fm : formulaSet.molecularFormulas()) { if (MolecularFormulaManipulator.compare(fm, formula)) { return true; } } return false; }
java
public static boolean contains(IMolecularFormulaSet formulaSet, IMolecularFormula formula) { for (IMolecularFormula fm : formulaSet.molecularFormulas()) { if (MolecularFormulaManipulator.compare(fm, formula)) { return true; } } return false; }
[ "public", "static", "boolean", "contains", "(", "IMolecularFormulaSet", "formulaSet", ",", "IMolecularFormula", "formula", ")", "{", "for", "(", "IMolecularFormula", "fm", ":", "formulaSet", ".", "molecularFormulas", "(", ")", ")", "{", "if", "(", "MolecularFormul...
True, if the IMolecularFormulaSet contains the given IMolecularFormula but not as object. It compare according contains the same number and type of Isotopes. It is not based on compare objects. @param formulaSet The IMolecularFormulaSet @param formula The IMolecularFormula this IMolecularFormulaSet is searched ...
[ "True", "if", "the", "IMolecularFormulaSet", "contains", "the", "given", "IMolecularFormula", "but", "not", "as", "object", ".", "It", "compare", "according", "contains", "the", "same", "number", "and", "type", "of", "Isotopes", ".", "It", "is", "not", "based"...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaSetManipulator.java#L177-L184
114,437
cdk/cdk
legacy/src/main/java/org/openscience/cdk/math/qm/OneElectronJob.java
OneElectronJob.sort
private void sort(Matrix C, Vector E) { int i, j; double value; boolean changed; do { changed = false; for (i = 1; i < E.size; i++) if (E.vector[i - 1] > E.vector[i]) { value = E.vector[i]; E.vector[i] = E.ve...
java
private void sort(Matrix C, Vector E) { int i, j; double value; boolean changed; do { changed = false; for (i = 1; i < E.size; i++) if (E.vector[i - 1] > E.vector[i]) { value = E.vector[i]; E.vector[i] = E.ve...
[ "private", "void", "sort", "(", "Matrix", "C", ",", "Vector", "E", ")", "{", "int", "i", ",", "j", ";", "double", "value", ";", "boolean", "changed", ";", "do", "{", "changed", "=", "false", ";", "for", "(", "i", "=", "1", ";", "i", "<", "E", ...
Sorts the orbitals by their energies
[ "Sorts", "the", "orbitals", "by", "their", "energies" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/math/qm/OneElectronJob.java#L64-L84
114,438
cdk/cdk
legacy/src/main/java/org/openscience/cdk/math/qm/OneElectronJob.java
OneElectronJob.calculateT
private Matrix calculateT(IBasis basis) { int size = basis.getSize(); Matrix J = new Matrix(size, size); int i, j; for (i = 0; i < size; i++) for (j = 0; j < size; j++) // (1/2) * -<d^2/dx^2 chi_i | chi_j> J.matrix[i][j] = basis.calcJ(j, i) / 2...
java
private Matrix calculateT(IBasis basis) { int size = basis.getSize(); Matrix J = new Matrix(size, size); int i, j; for (i = 0; i < size; i++) for (j = 0; j < size; j++) // (1/2) * -<d^2/dx^2 chi_i | chi_j> J.matrix[i][j] = basis.calcJ(j, i) / 2...
[ "private", "Matrix", "calculateT", "(", "IBasis", "basis", ")", "{", "int", "size", "=", "basis", ".", "getSize", "(", ")", ";", "Matrix", "J", "=", "new", "Matrix", "(", "size", ",", "size", ")", ";", "int", "i", ",", "j", ";", "for", "(", "i", ...
Calculates the matrix for the kinetic energy T_i,j = (1/2) * -<d^2/dx^2 chi_i | chi_j>
[ "Calculates", "the", "matrix", "for", "the", "kinetic", "energy" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/math/qm/OneElectronJob.java#L102-L112
114,439
cdk/cdk
legacy/src/main/java/org/openscience/cdk/math/qm/OneElectronJob.java
OneElectronJob.calculateV
private Matrix calculateV(IBasis basis) { int size = basis.getSize(); Matrix V = new Matrix(size, size); int i, j; for (i = 0; i < size; i++) for (j = 0; j < size; j++) V.matrix[i][j] = basis.calcV(i, j); return V; }
java
private Matrix calculateV(IBasis basis) { int size = basis.getSize(); Matrix V = new Matrix(size, size); int i, j; for (i = 0; i < size; i++) for (j = 0; j < size; j++) V.matrix[i][j] = basis.calcV(i, j); return V; }
[ "private", "Matrix", "calculateV", "(", "IBasis", "basis", ")", "{", "int", "size", "=", "basis", ".", "getSize", "(", ")", ";", "Matrix", "V", "=", "new", "Matrix", "(", "size", ",", "size", ")", ";", "int", "i", ",", "j", ";", "for", "(", "i", ...
Calculates the matrix for the potential matrix V_i,j = <chi_i | 1/r | chi_j>
[ "Calculates", "the", "matrix", "for", "the", "potential", "matrix" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/math/qm/OneElectronJob.java#L119-L128
114,440
cdk/cdk
base/silent/src/main/java/org/openscience/cdk/silent/ChemFile.java
ChemFile.addChemSequence
@Override public void addChemSequence(IChemSequence chemSequence) { if (chemSequenceCount + 1 >= chemSequences.length) { growChemSequenceArray(); } chemSequences[chemSequenceCount] = chemSequence; chemSequenceCount++; }
java
@Override public void addChemSequence(IChemSequence chemSequence) { if (chemSequenceCount + 1 >= chemSequences.length) { growChemSequenceArray(); } chemSequences[chemSequenceCount] = chemSequence; chemSequenceCount++; }
[ "@", "Override", "public", "void", "addChemSequence", "(", "IChemSequence", "chemSequence", ")", "{", "if", "(", "chemSequenceCount", "+", "1", ">=", "chemSequences", ".", "length", ")", "{", "growChemSequenceArray", "(", ")", ";", "}", "chemSequences", "[", "...
Adds a ChemSequence to this container. @param chemSequence The chemSequence to be added to this container @see #chemSequences
[ "Adds", "a", "ChemSequence", "to", "this", "container", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/ChemFile.java#L80-L87
114,441
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/AtomContainerAtomPermutor.java
AtomContainerAtomPermutor.containerFromPermutation
@Override public IAtomContainer containerFromPermutation(int[] permutation) { try { IAtomContainer permutedContainer = (IAtomContainer) atomContainer.clone(); IAtom[] atoms = new IAtom[atomContainer.getAtomCount()]; for (int i = 0; i < atomContainer.getAtomCount(); i++) {...
java
@Override public IAtomContainer containerFromPermutation(int[] permutation) { try { IAtomContainer permutedContainer = (IAtomContainer) atomContainer.clone(); IAtom[] atoms = new IAtom[atomContainer.getAtomCount()]; for (int i = 0; i < atomContainer.getAtomCount(); i++) {...
[ "@", "Override", "public", "IAtomContainer", "containerFromPermutation", "(", "int", "[", "]", "permutation", ")", "{", "try", "{", "IAtomContainer", "permutedContainer", "=", "(", "IAtomContainer", ")", "atomContainer", ".", "clone", "(", ")", ";", "IAtom", "["...
Generate the atom container with this permutation of the atoms. @param permutation the permutation to use @return the
[ "Generate", "the", "atom", "container", "with", "this", "permutation", "of", "the", "atoms", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/AtomContainerAtomPermutor.java#L64-L77
114,442
cdk/cdk
storage/ctab/src/main/java/org/openscience/cdk/io/MDLV3000Reader.java
MDLV3000Reader.readSGroup
public void readSGroup(IAtomContainer readData) throws CDKException { boolean foundEND = false; while (isReady() && !foundEND) { String command = readCommand(readLine()); if ("END SGROUP".equals(command)) { foundEND = true; } else { log...
java
public void readSGroup(IAtomContainer readData) throws CDKException { boolean foundEND = false; while (isReady() && !foundEND) { String command = readCommand(readLine()); if ("END SGROUP".equals(command)) { foundEND = true; } else { log...
[ "public", "void", "readSGroup", "(", "IAtomContainer", "readData", ")", "throws", "CDKException", "{", "boolean", "foundEND", "=", "false", ";", "while", "(", "isReady", "(", ")", "&&", "!", "foundEND", ")", "{", "String", "command", "=", "readCommand", "(",...
Reads labels.
[ "Reads", "labels", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLV3000Reader.java#L527-L593
114,443
cdk/cdk
storage/ctab/src/main/java/org/openscience/cdk/io/MDLV3000Reader.java
MDLV3000Reader.readCommand
private String readCommand(String line) throws CDKException { if (line.startsWith("M V30 ")) { String command = line.substring(7); if (command.endsWith("-")) { command = command.substring(0, command.length() - 1); command += readCommand(readLine()); ...
java
private String readCommand(String line) throws CDKException { if (line.startsWith("M V30 ")) { String command = line.substring(7); if (command.endsWith("-")) { command = command.substring(0, command.length() - 1); command += readCommand(readLine()); ...
[ "private", "String", "readCommand", "(", "String", "line", ")", "throws", "CDKException", "{", "if", "(", "line", ".", "startsWith", "(", "\"M V30 \"", ")", ")", "{", "String", "command", "=", "line", ".", "substring", "(", "7", ")", ";", "if", "(", "...
Reads the command on this line. If the line is continued on the next, that part is added. @return Returns the command on this line.
[ "Reads", "the", "command", "on", "this", "line", ".", "If", "the", "line", "is", "continued", "on", "the", "next", "that", "part", "is", "added", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLV3000Reader.java#L601-L612
114,444
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java
EquivalentClassPartitioner.getTopoEquivClassbyHuXu
public int[] getTopoEquivClassbyHuXu(IAtomContainer atomContainer) throws NoSuchAtomException { double nodeSequence[] = prepareNode(atomContainer); nodeMatrix = buildNodeMatrix(nodeSequence); bondMatrix = buildBondMatrix(); weight = buildWeightMatrix(nodeMatrix, bondMatrix); retu...
java
public int[] getTopoEquivClassbyHuXu(IAtomContainer atomContainer) throws NoSuchAtomException { double nodeSequence[] = prepareNode(atomContainer); nodeMatrix = buildNodeMatrix(nodeSequence); bondMatrix = buildBondMatrix(); weight = buildWeightMatrix(nodeMatrix, bondMatrix); retu...
[ "public", "int", "[", "]", "getTopoEquivClassbyHuXu", "(", "IAtomContainer", "atomContainer", ")", "throws", "NoSuchAtomException", "{", "double", "nodeSequence", "[", "]", "=", "prepareNode", "(", "atomContainer", ")", ";", "nodeMatrix", "=", "buildNodeMatrix", "("...
Get the topological equivalent class of the molecule. @param atomContainer atoms and bonds of the molecule @return an array contains the automorphism partition of the molecule
[ "Get", "the", "topological", "equivalent", "class", "of", "the", "molecule", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java#L101-L107
114,445
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java
EquivalentClassPartitioner.buildNodeMatrix
public double[][] buildNodeMatrix(double[] nodeSequence) { int i, j, k; for (i = 0; i < nodeNumber; i++) { nodeMatrix[i][0] = nodeSequence[i]; for (j = 1; j <= layerNumber; j++) { nodeMatrix[i][j] = 0.0; for (k = 0; k < nodeNumber; k++) { ...
java
public double[][] buildNodeMatrix(double[] nodeSequence) { int i, j, k; for (i = 0; i < nodeNumber; i++) { nodeMatrix[i][0] = nodeSequence[i]; for (j = 1; j <= layerNumber; j++) { nodeMatrix[i][j] = 0.0; for (k = 0; k < nodeNumber; k++) { ...
[ "public", "double", "[", "]", "[", "]", "buildNodeMatrix", "(", "double", "[", "]", "nodeSequence", ")", "{", "int", "i", ",", "j", ",", "k", ";", "for", "(", "i", "=", "0", ";", "i", "<", "nodeNumber", ";", "i", "++", ")", "{", "nodeMatrix", "...
Build node Matrix. @param nodeSequence an array contains node number for each atom @return node Matrix
[ "Build", "node", "Matrix", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java#L282-L296
114,446
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java
EquivalentClassPartitioner.buildTrialNodeMatrix
public double[][] buildTrialNodeMatrix(double[] weight) { int i, j, k; for (i = 0; i < nodeNumber; i++) { nodeMatrix[i][0] = weight[i + 1]; for (j = 1; j <= layerNumber; j++) { nodeMatrix[i][j] = 0.0; for (k = 0; k < nodeNumber; k++) { ...
java
public double[][] buildTrialNodeMatrix(double[] weight) { int i, j, k; for (i = 0; i < nodeNumber; i++) { nodeMatrix[i][0] = weight[i + 1]; for (j = 1; j <= layerNumber; j++) { nodeMatrix[i][j] = 0.0; for (k = 0; k < nodeNumber; k++) { ...
[ "public", "double", "[", "]", "[", "]", "buildTrialNodeMatrix", "(", "double", "[", "]", "weight", ")", "{", "int", "i", ",", "j", ",", "k", ";", "for", "(", "i", "=", "0", ";", "i", "<", "nodeNumber", ";", "i", "++", ")", "{", "nodeMatrix", "[...
Build trial node Matrix. @param weight an array contains the weight of atom @return trial node matrix.
[ "Build", "trial", "node", "Matrix", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java#L304-L318
114,447
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java
EquivalentClassPartitioner.buildBondMatrix
public double[][] buildBondMatrix() { int i, j, k, m; for (i = 0; i < nodeNumber; i++) { for (j = 1; j <= layerNumber; j++) { bondMatrix[i][j - 1] = 0.0; for (k = 0; k < nodeNumber; k++) { if (j == 1) { if (apspMatri...
java
public double[][] buildBondMatrix() { int i, j, k, m; for (i = 0; i < nodeNumber; i++) { for (j = 1; j <= layerNumber; j++) { bondMatrix[i][j - 1] = 0.0; for (k = 0; k < nodeNumber; k++) { if (j == 1) { if (apspMatri...
[ "public", "double", "[", "]", "[", "]", "buildBondMatrix", "(", ")", "{", "int", "i", ",", "j", ",", "k", ",", "m", ";", "for", "(", "i", "=", "0", ";", "i", "<", "nodeNumber", ";", "i", "++", ")", "{", "for", "(", "j", "=", "1", ";", "j"...
Build bond matrix. @return bond matrix.
[ "Build", "bond", "matrix", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java#L325-L348
114,448
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java
EquivalentClassPartitioner.buildWeightMatrix
public double[] buildWeightMatrix(double[][] nodeMatrix, double[][] bondMatrix) { for (int i = 0; i < nodeNumber; i++) { weight[i + 1] = nodeMatrix[i][0]; for (int j = 0; j < layerNumber; j++) { weight[i + 1] += nodeMatrix[i][j + 1] * bondMatrix[i][j] * Math.pow(10.0, (do...
java
public double[] buildWeightMatrix(double[][] nodeMatrix, double[][] bondMatrix) { for (int i = 0; i < nodeNumber; i++) { weight[i + 1] = nodeMatrix[i][0]; for (int j = 0; j < layerNumber; j++) { weight[i + 1] += nodeMatrix[i][j + 1] * bondMatrix[i][j] * Math.pow(10.0, (do...
[ "public", "double", "[", "]", "buildWeightMatrix", "(", "double", "[", "]", "[", "]", "nodeMatrix", ",", "double", "[", "]", "[", "]", "bondMatrix", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nodeNumber", ";", "i", "++", ")", "{"...
Build weight array for the given node matrix and bond matrix. @param nodeMatrix array contains node information @param bondMatrix array contains bond information @return weight array for the node
[ "Build", "weight", "array", "for", "the", "given", "node", "matrix", "and", "bond", "matrix", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java#L357-L366
114,449
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java
EquivalentClassPartitioner.checkDiffNumber
public int checkDiffNumber(double[] weight) { // Count the number of different weight double category[] = new double[weight.length]; int i, j; int count = 1; double t; category[1] = weight[1]; for (i = 2; i < weight.length; i++) { for (j = 1; j <= coun...
java
public int checkDiffNumber(double[] weight) { // Count the number of different weight double category[] = new double[weight.length]; int i, j; int count = 1; double t; category[1] = weight[1]; for (i = 2; i < weight.length; i++) { for (j = 1; j <= coun...
[ "public", "int", "checkDiffNumber", "(", "double", "[", "]", "weight", ")", "{", "// Count the number of different weight", "double", "category", "[", "]", "=", "new", "double", "[", "weight", ".", "length", "]", ";", "int", "i", ",", "j", ";", "int", "cou...
Get different number of the given number. @param weight array contains weight of the nodes @return number of different weight
[ "Get", "different", "number", "of", "the", "given", "number", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java#L374-L393
114,450
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java
EquivalentClassPartitioner.getEquivalentClass
public int[] getEquivalentClass(double[] weight) { double category[] = new double[weight.length]; int equivalentClass[] = new int[weight.length]; int i, j; int count = 1; double t; category[1] = weight[1]; for (i = 2; i < weight.length; i++) { for (j =...
java
public int[] getEquivalentClass(double[] weight) { double category[] = new double[weight.length]; int equivalentClass[] = new int[weight.length]; int i, j; int count = 1; double t; category[1] = weight[1]; for (i = 2; i < weight.length; i++) { for (j =...
[ "public", "int", "[", "]", "getEquivalentClass", "(", "double", "[", "]", "weight", ")", "{", "double", "category", "[", "]", "=", "new", "double", "[", "weight", ".", "length", "]", ";", "int", "equivalentClass", "[", "]", "=", "new", "int", "[", "w...
Get the final equivalent class. @param weight array contains weight of the nodes @return an array contains the automorphism partition
[ "Get", "the", "final", "equivalent", "class", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java#L401-L437
114,451
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java
EquivalentClassPartitioner.findTopoEquivClass
public int[] findTopoEquivClass(double[] weight) { int trialCount, i; int equivalentClass[] = new int[weight.length]; int count = checkDiffNumber(weight); trialCount = count; if (count == nodeNumber) { for (i = 1; i <= nodeNumber; i++) { equivalentClas...
java
public int[] findTopoEquivClass(double[] weight) { int trialCount, i; int equivalentClass[] = new int[weight.length]; int count = checkDiffNumber(weight); trialCount = count; if (count == nodeNumber) { for (i = 1; i <= nodeNumber; i++) { equivalentClas...
[ "public", "int", "[", "]", "findTopoEquivClass", "(", "double", "[", "]", "weight", ")", "{", "int", "trialCount", ",", "i", ";", "int", "equivalentClass", "[", "]", "=", "new", "int", "[", "weight", ".", "length", "]", ";", "int", "count", "=", "che...
Find the topological equivalent class for the given weight. @param weight array contains weight of the nodes @return an array contains the automorphism partition
[ "Find", "the", "topological", "equivalent", "class", "for", "the", "given", "weight", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/graph/invariant/EquivalentClassPartitioner.java#L445-L475
114,452
cdk/cdk
legacy/src/main/java/org/openscience/cdk/isomorphism/matchers/smarts/SmartsMatchers.java
SmartsMatchers.prepare
public static void prepare(IAtomContainer container, boolean ringQuery) { if (ringQuery) { SMARTSAtomInvariants.configureDaylightWithRingInfo(container); } else { SMARTSAtomInvariants.configureDaylightWithoutRingInfo(container); } }
java
public static void prepare(IAtomContainer container, boolean ringQuery) { if (ringQuery) { SMARTSAtomInvariants.configureDaylightWithRingInfo(container); } else { SMARTSAtomInvariants.configureDaylightWithoutRingInfo(container); } }
[ "public", "static", "void", "prepare", "(", "IAtomContainer", "container", ",", "boolean", "ringQuery", ")", "{", "if", "(", "ringQuery", ")", "{", "SMARTSAtomInvariants", ".", "configureDaylightWithRingInfo", "(", "container", ")", ";", "}", "else", "{", "SMART...
Do not use - temporary method until the SMARTS packages are cleaned up. Prepares a target molecule for matching with SMARTS. @param container the container to initialise @param ringQuery whether the smarts will check ring size queries
[ "Do", "not", "use", "-", "temporary", "method", "until", "the", "SMARTS", "packages", "are", "cleaned", "up", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/isomorphism/matchers/smarts/SmartsMatchers.java#L51-L57
114,453
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/validate/BasicValidator.java
BasicValidator.validateCharge
private ValidationReport validateCharge(IAtom atom) { ValidationReport report = new ValidationReport(); ValidationTest tooCharged = new ValidationTest(atom, "Atom has an unlikely large positive or negative charge"); if (atom.getSymbol().equals("O") || atom.getSymbol().equals("N") || atom.getSymb...
java
private ValidationReport validateCharge(IAtom atom) { ValidationReport report = new ValidationReport(); ValidationTest tooCharged = new ValidationTest(atom, "Atom has an unlikely large positive or negative charge"); if (atom.getSymbol().equals("O") || atom.getSymbol().equals("N") || atom.getSymb...
[ "private", "ValidationReport", "validateCharge", "(", "IAtom", "atom", ")", "{", "ValidationReport", "report", "=", "new", "ValidationReport", "(", ")", ";", "ValidationTest", "tooCharged", "=", "new", "ValidationTest", "(", "atom", ",", "\"Atom has an unlikely large ...
the Atom tests
[ "the", "Atom", "tests" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/validate/BasicValidator.java#L124-L160
114,454
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/validate/BasicValidator.java
BasicValidator.validateStereoChemistry
private ValidationReport validateStereoChemistry(IBond bond) { ValidationReport report = new ValidationReport(); ValidationTest bondStereo = new ValidationTest(bond, "Defining stereochemistry on bonds is not safe.", "Use atom based stereochemistry."); if (bond.getStereo() != IBon...
java
private ValidationReport validateStereoChemistry(IBond bond) { ValidationReport report = new ValidationReport(); ValidationTest bondStereo = new ValidationTest(bond, "Defining stereochemistry on bonds is not safe.", "Use atom based stereochemistry."); if (bond.getStereo() != IBon...
[ "private", "ValidationReport", "validateStereoChemistry", "(", "IBond", "bond", ")", "{", "ValidationReport", "report", "=", "new", "ValidationReport", "(", ")", ";", "ValidationTest", "bondStereo", "=", "new", "ValidationTest", "(", "bond", ",", "\"Defining stereoche...
the Bond tests
[ "the", "Bond", "tests" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/validate/BasicValidator.java#L205-L215
114,455
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/validate/BasicValidator.java
BasicValidator.validateIsotopeExistence
public ValidationReport validateIsotopeExistence(IIsotope isotope) { ValidationReport report = new ValidationReport(); ValidationTest isotopeExists = new ValidationTest(isotope, "Isotope with this mass number is not known for this element."); try { IsotopeFactory isot...
java
public ValidationReport validateIsotopeExistence(IIsotope isotope) { ValidationReport report = new ValidationReport(); ValidationTest isotopeExists = new ValidationTest(isotope, "Isotope with this mass number is not known for this element."); try { IsotopeFactory isot...
[ "public", "ValidationReport", "validateIsotopeExistence", "(", "IIsotope", "isotope", ")", "{", "ValidationReport", "report", "=", "new", "ValidationReport", "(", ")", ";", "ValidationTest", "isotopeExists", "=", "new", "ValidationTest", "(", "isotope", ",", "\"Isotop...
the Isotope tests
[ "the", "Isotope", "tests" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/validate/BasicValidator.java#L260-L288
114,456
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/validate/BasicValidator.java
BasicValidator.validateBondOrderSum
private ValidationReport validateBondOrderSum(IAtom atom, IAtomContainer molecule) { ValidationReport report = new ValidationReport(); ValidationTest checkBondSum = new ValidationTest(atom, "The atom's total bond order is too high."); try { AtomTypeFactory structgenATF = AtomTypeFact...
java
private ValidationReport validateBondOrderSum(IAtom atom, IAtomContainer molecule) { ValidationReport report = new ValidationReport(); ValidationTest checkBondSum = new ValidationTest(atom, "The atom's total bond order is too high."); try { AtomTypeFactory structgenATF = AtomTypeFact...
[ "private", "ValidationReport", "validateBondOrderSum", "(", "IAtom", "atom", ",", "IAtomContainer", "molecule", ")", "{", "ValidationReport", "report", "=", "new", "ValidationReport", "(", ")", ";", "ValidationTest", "checkBondSum", "=", "new", "ValidationTest", "(", ...
the Molecule tests
[ "the", "Molecule", "tests" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/validate/BasicValidator.java#L292-L333
114,457
cdk/cdk
base/reaction/src/main/java/org/openscience/cdk/graph/invariant/ConjugatedPiSystemsDetector.java
ConjugatedPiSystemsDetector.detect
public static IAtomContainerSet detect(IAtomContainer ac) { IAtomContainerSet piSystemSet = ac.getBuilder().newInstance(IAtomContainerSet.class); for (int i = 0; i < ac.getAtomCount(); i++) { IAtom atom = ac.getAtom(i); atom.setFlag(CDKConstants.VISITED, false); } ...
java
public static IAtomContainerSet detect(IAtomContainer ac) { IAtomContainerSet piSystemSet = ac.getBuilder().newInstance(IAtomContainerSet.class); for (int i = 0; i < ac.getAtomCount(); i++) { IAtom atom = ac.getAtom(i); atom.setFlag(CDKConstants.VISITED, false); } ...
[ "public", "static", "IAtomContainerSet", "detect", "(", "IAtomContainer", "ac", ")", "{", "IAtomContainerSet", "piSystemSet", "=", "ac", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IAtomContainerSet", ".", "class", ")", ";", "for", "(", "int", "i", ...
Detect all conjugated pi systems in an AtomContainer. This method returns a AtomContainerSet with Atom and Bond objects from the original AtomContainer. The aromaticity has to be known before calling this method. <p>An example for detection of Radical Allyl: <pre> Atom a0 = new Atom("C"); mol.addAtom(a0); Atom a1 = ne...
[ "Detect", "all", "conjugated", "pi", "systems", "in", "an", "AtomContainer", ".", "This", "method", "returns", "a", "AtomContainerSet", "with", "Atom", "and", "Bond", "objects", "from", "the", "original", "AtomContainer", ".", "The", "aromaticity", "has", "to", ...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/reaction/src/main/java/org/openscience/cdk/graph/invariant/ConjugatedPiSystemsDetector.java#L69-L126
114,458
cdk/cdk
base/reaction/src/main/java/org/openscience/cdk/graph/invariant/ConjugatedPiSystemsDetector.java
ConjugatedPiSystemsDetector.checkAtom
private static int checkAtom(IAtomContainer ac, IAtom currentAtom) { int check = -1; List<IAtom> atoms = ac.getConnectedAtomsList(currentAtom); List<IBond> bonds = ac.getConnectedBondsList(currentAtom); if (currentAtom.getFlag(CDKConstants.ISAROMATIC)) { check = 0; } ...
java
private static int checkAtom(IAtomContainer ac, IAtom currentAtom) { int check = -1; List<IAtom> atoms = ac.getConnectedAtomsList(currentAtom); List<IBond> bonds = ac.getConnectedBondsList(currentAtom); if (currentAtom.getFlag(CDKConstants.ISAROMATIC)) { check = 0; } ...
[ "private", "static", "int", "checkAtom", "(", "IAtomContainer", "ac", ",", "IAtom", "currentAtom", ")", "{", "int", "check", "=", "-", "1", ";", "List", "<", "IAtom", ">", "atoms", "=", "ac", ".", "getConnectedAtomsList", "(", "currentAtom", ")", ";", "L...
Check an Atom whether it may be conjugated or not. @param ac The AtomContainer containing currentAtom @param currentAtom The Atom to check @return -1 if isolated, 0 if conjugated, 1 if cumulative db
[ "Check", "an", "Atom", "whether", "it", "may", "be", "conjugated", "or", "not", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/reaction/src/main/java/org/openscience/cdk/graph/invariant/ConjugatedPiSystemsDetector.java#L135-L180
114,459
cdk/cdk
storage/smiles/src/main/java/org/openscience/cdk/io/iterator/IteratingSMILESReader.java
IteratingSMILESReader.hasNext
@Override public boolean hasNext() { if (!nextAvailableIsKnown) { hasNext = false; // now try to parse the next Molecule try { final String line = input.readLine(); if (line == null) { nextAvailableIsKnown = true; ...
java
@Override public boolean hasNext() { if (!nextAvailableIsKnown) { hasNext = false; // now try to parse the next Molecule try { final String line = input.readLine(); if (line == null) { nextAvailableIsKnown = true; ...
[ "@", "Override", "public", "boolean", "hasNext", "(", ")", "{", "if", "(", "!", "nextAvailableIsKnown", ")", "{", "hasNext", "=", "false", ";", "// now try to parse the next Molecule", "try", "{", "final", "String", "line", "=", "input", ".", "readLine", "(", ...
Checks whether there is another molecule to read. @return true if there are molecules to read, false otherwise
[ "Checks", "whether", "there", "is", "another", "molecule", "to", "read", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/io/iterator/IteratingSMILESReader.java#L117-L147
114,460
cdk/cdk
storage/smiles/src/main/java/org/openscience/cdk/io/iterator/IteratingSMILESReader.java
IteratingSMILESReader.suffix
private String suffix(final String line) { for (int i = 0; i < line.length(); i++) { char c = line.charAt(i); if (c == ' ' || c == '\t') return line.substring(i + 1); } return ""; }
java
private String suffix(final String line) { for (int i = 0; i < line.length(); i++) { char c = line.charAt(i); if (c == ' ' || c == '\t') return line.substring(i + 1); } return ""; }
[ "private", "String", "suffix", "(", "final", "String", "line", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "line", ".", "length", "(", ")", ";", "i", "++", ")", "{", "char", "c", "=", "line", ".", "charAt", "(", "i", ")", ";", ...
Obtain the suffix after a line containing SMILES. The suffix follows any ' ' or '\t' termination characters. @param line input line @return the suffix - or an empty line
[ "Obtain", "the", "suffix", "after", "a", "line", "containing", "SMILES", ".", "The", "suffix", "follows", "any", "or", "\\", "t", "termination", "characters", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/io/iterator/IteratingSMILESReader.java#L156-L162
114,461
cdk/cdk
storage/smiles/src/main/java/org/openscience/cdk/io/iterator/IteratingSMILESReader.java
IteratingSMILESReader.readSmiles
private IAtomContainer readSmiles(final String line) { try { return sp.parseSmiles(line); } catch (CDKException e) { logger.error("Error while reading the SMILES from: " + line + ", ", e); final IAtomContainer empty = builder.newInstance(IAtomContainer.class, 0, 0, 0,...
java
private IAtomContainer readSmiles(final String line) { try { return sp.parseSmiles(line); } catch (CDKException e) { logger.error("Error while reading the SMILES from: " + line + ", ", e); final IAtomContainer empty = builder.newInstance(IAtomContainer.class, 0, 0, 0,...
[ "private", "IAtomContainer", "readSmiles", "(", "final", "String", "line", ")", "{", "try", "{", "return", "sp", ".", "parseSmiles", "(", "line", ")", ";", "}", "catch", "(", "CDKException", "e", ")", "{", "logger", ".", "error", "(", "\"Error while readin...
Read the SMILES given in the input line - or return an empty container. @param line input line @return the read container (or an empty one)
[ "Read", "the", "SMILES", "given", "in", "the", "input", "line", "-", "or", "return", "an", "empty", "container", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/io/iterator/IteratingSMILESReader.java#L170-L179
114,462
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java
LayoutRefiner.traverseRing
private void traverseRing(int[] ringSystem, int v, int rnum) { ringSystem[v] = rnum; for (int w : adjList[v]) { if (ringSystem[w] == 0 && bondMap.get(v, w).isInRing()) traverseRing(ringSystem, w, rnum); } }
java
private void traverseRing(int[] ringSystem, int v, int rnum) { ringSystem[v] = rnum; for (int w : adjList[v]) { if (ringSystem[w] == 0 && bondMap.get(v, w).isInRing()) traverseRing(ringSystem, w, rnum); } }
[ "private", "void", "traverseRing", "(", "int", "[", "]", "ringSystem", ",", "int", "v", ",", "int", "rnum", ")", "{", "ringSystem", "[", "v", "]", "=", "rnum", ";", "for", "(", "int", "w", ":", "adjList", "[", "v", "]", ")", "{", "if", "(", "ri...
Simple method for marking ring systems with a flood-fill. @param ringSystem ring system vector @param v start atom @param rnum the number to mark atoms of this ring
[ "Simple", "method", "for", "marking", "ring", "systems", "with", "a", "flood", "-", "fill", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java#L180-L186
114,463
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java
LayoutRefiner.isCrossed
private boolean isCrossed(Point2d beg1, Point2d end1, Point2d beg2, Point2d end2) { return Line2D.linesIntersect(beg1.x, beg1.y, end1.x, end1.y, beg2.x, beg2.y, end2.x, end2.y); }
java
private boolean isCrossed(Point2d beg1, Point2d end1, Point2d beg2, Point2d end2) { return Line2D.linesIntersect(beg1.x, beg1.y, end1.x, end1.y, beg2.x, beg2.y, end2.x, end2.y); }
[ "private", "boolean", "isCrossed", "(", "Point2d", "beg1", ",", "Point2d", "end1", ",", "Point2d", "beg2", ",", "Point2d", "end2", ")", "{", "return", "Line2D", ".", "linesIntersect", "(", "beg1", ".", "x", ",", "beg1", ".", "y", ",", "end1", ".", "x",...
Check if two bonds are crossing. @param beg1 first atom of first bond @param end1 second atom of first bond @param beg2 first atom of second bond @param end2 first atom of second bond @return bond is crossing
[ "Check", "if", "two", "bonds", "are", "crossing", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java#L293-L295
114,464
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java
LayoutRefiner.invert
void invert(Collection<AtomPair> pairs) { for (AtomPair pair : pairs) { if (congestion.contribution(pair.fst, pair.snd) < MIN_SCORE) continue; if (fusionPointInversion(pair)) continue; if (macroCycleInversion(pair)) continue; ...
java
void invert(Collection<AtomPair> pairs) { for (AtomPair pair : pairs) { if (congestion.contribution(pair.fst, pair.snd) < MIN_SCORE) continue; if (fusionPointInversion(pair)) continue; if (macroCycleInversion(pair)) continue; ...
[ "void", "invert", "(", "Collection", "<", "AtomPair", ">", "pairs", ")", "{", "for", "(", "AtomPair", "pair", ":", "pairs", ")", "{", "if", "(", "congestion", ".", "contribution", "(", "pair", ".", "fst", ",", "pair", ".", "snd", ")", "<", "MIN_SCORE...
Special case congestion minimisation, rotate terminals bonds around ring systems so they are inside the ring. @param pairs congested atom pairs
[ "Special", "case", "congestion", "minimisation", "rotate", "terminals", "bonds", "around", "ring", "systems", "so", "they", "are", "inside", "the", "ring", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java#L443-L452
114,465
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java
LayoutRefiner.macroCycleInversion
private boolean macroCycleInversion(AtomPair pair) { for (int v : pair.seqAt) { IAtom atom = mol.getAtom(v); if (!atom.isInRing() || adjList[v].length == 2) continue; if (atom.getProperty(MacroCycleLayout.MACROCYCLE_ATOM_HINT) == null) continu...
java
private boolean macroCycleInversion(AtomPair pair) { for (int v : pair.seqAt) { IAtom atom = mol.getAtom(v); if (!atom.isInRing() || adjList[v].length == 2) continue; if (atom.getProperty(MacroCycleLayout.MACROCYCLE_ATOM_HINT) == null) continu...
[ "private", "boolean", "macroCycleInversion", "(", "AtomPair", "pair", ")", "{", "for", "(", "int", "v", ":", "pair", ".", "seqAt", ")", "{", "IAtom", "atom", "=", "mol", ".", "getAtom", "(", "v", ")", ";", "if", "(", "!", "atom", ".", "isInRing", "...
of the ring
[ "of", "the", "ring" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java#L456-L502
114,466
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java
LayoutRefiner.stretch
private double stretch(AtomPair pair, IntStack stack, Point2d[] coords, Map<IBond,AtomPair> firstVisit) { stackBackup.clear(); final double score = congestion.score(); double min = score; for (IBond bond : pair.bndAt) { // don't stretch ring bonds if (bond.isI...
java
private double stretch(AtomPair pair, IntStack stack, Point2d[] coords, Map<IBond,AtomPair> firstVisit) { stackBackup.clear(); final double score = congestion.score(); double min = score; for (IBond bond : pair.bndAt) { // don't stretch ring bonds if (bond.isI...
[ "private", "double", "stretch", "(", "AtomPair", "pair", ",", "IntStack", "stack", ",", "Point2d", "[", "]", "coords", ",", "Map", "<", "IBond", ",", "AtomPair", ">", "firstVisit", ")", "{", "stackBackup", ".", "clear", "(", ")", ";", "final", "double", ...
Stretch all bonds in the shortest path between a pair of atoms in an attempt to resolve the overlap. The stretch that produces the minimum congestion is stored in the provided stack and coords with the congestion score returned. @param pair congested atom pair @param stack best result vertices @param coords best re...
[ "Stretch", "all", "bonds", "in", "the", "shortest", "path", "between", "a", "pair", "of", "atoms", "in", "an", "attempt", "to", "resolve", "the", "overlap", ".", "The", "stretch", "that", "produces", "the", "minimum", "congestion", "is", "stored", "in", "t...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java#L682-L738
114,467
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java
LayoutRefiner.bendOrStretch
private void bendOrStretch(Collection<AtomPair> pairs) { // without checking which bonds have been bent/stretch already we // could end up repeating a lot of repeated work to no avail Map<IBond,AtomPair> bendVisit = new HashMap<>(); Map<IBond,AtomPair> stretchVisit = new HashMap<>();...
java
private void bendOrStretch(Collection<AtomPair> pairs) { // without checking which bonds have been bent/stretch already we // could end up repeating a lot of repeated work to no avail Map<IBond,AtomPair> bendVisit = new HashMap<>(); Map<IBond,AtomPair> stretchVisit = new HashMap<>();...
[ "private", "void", "bendOrStretch", "(", "Collection", "<", "AtomPair", ">", "pairs", ")", "{", "// without checking which bonds have been bent/stretch already we", "// could end up repeating a lot of repeated work to no avail", "Map", "<", "IBond", ",", "AtomPair", ">", "bendV...
Resolves conflicts either by bending bonds or stretching bonds in the shortest path between an overlapping pair. Bending and stretch are tried for each pair and the best resolution is used. @param pairs pairs
[ "Resolves", "conflicts", "either", "by", "bending", "bonds", "or", "stretching", "bonds", "in", "the", "shortest", "path", "between", "an", "overlapping", "pair", ".", "Bending", "and", "stretch", "are", "tried", "for", "each", "pair", "and", "the", "best", ...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java#L747-L788
114,468
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java
LayoutRefiner.refine
public void refine() { for (int i = 1; i <= MAX_ITERATIONS; i++) { final List<AtomPair> pairs = findCongestedPairs(); if (pairs.isEmpty()) break; final double min = congestion.score(); // rotation: flipping around sigma bonds rotate(...
java
public void refine() { for (int i = 1; i <= MAX_ITERATIONS; i++) { final List<AtomPair> pairs = findCongestedPairs(); if (pairs.isEmpty()) break; final double min = congestion.score(); // rotation: flipping around sigma bonds rotate(...
[ "public", "void", "refine", "(", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "MAX_ITERATIONS", ";", "i", "++", ")", "{", "final", "List", "<", "AtomPair", ">", "pairs", "=", "findCongestedPairs", "(", ")", ";", "if", "(", "pairs", ...
Refine the 2D coordinates of a layout to reduce overlap and congestion.
[ "Refine", "the", "2D", "coordinates", "of", "a", "layout", "to", "reduce", "overlap", "and", "congestion", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java#L793-L826
114,469
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java
LayoutRefiner.stretch
private void stretch(IntStack stack, IAtom beg, IAtom end, double amount) { Point2d begPoint = beg.getPoint2d(); Point2d endPoint = end.getPoint2d(); if (begPoint.distance(endPoint) + amount > MAX_BOND_LENGTH) return; Vector2d vector = new Vector2d(endPoint.x - begPoint.x, ...
java
private void stretch(IntStack stack, IAtom beg, IAtom end, double amount) { Point2d begPoint = beg.getPoint2d(); Point2d endPoint = end.getPoint2d(); if (begPoint.distance(endPoint) + amount > MAX_BOND_LENGTH) return; Vector2d vector = new Vector2d(endPoint.x - begPoint.x, ...
[ "private", "void", "stretch", "(", "IntStack", "stack", ",", "IAtom", "beg", ",", "IAtom", "end", ",", "double", "amount", ")", "{", "Point2d", "begPoint", "=", "beg", ".", "getPoint2d", "(", ")", ";", "Point2d", "endPoint", "=", "end", ".", "getPoint2d"...
Stretch the distance between beg and end, moving all atoms provided in the stack. @param stack atoms to be moved @param beg begin atom of a bond @param end end atom of a bond @param amount amount to try stretching by (absolute)
[ "Stretch", "the", "distance", "between", "beg", "and", "end", "moving", "all", "atoms", "provided", "in", "the", "stack", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java#L933-L946
114,470
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java
LayoutRefiner.getCommon
private static IAtom getCommon(IBond bndA, IBond bndB) { IAtom beg = bndA.getBegin(); IAtom end = bndA.getEnd(); if (bndB.contains(beg)) return beg; else if (bndB.contains(end)) return end; else return null; }
java
private static IAtom getCommon(IBond bndA, IBond bndB) { IAtom beg = bndA.getBegin(); IAtom end = bndA.getEnd(); if (bndB.contains(beg)) return beg; else if (bndB.contains(end)) return end; else return null; }
[ "private", "static", "IAtom", "getCommon", "(", "IBond", "bndA", ",", "IBond", "bndB", ")", "{", "IAtom", "beg", "=", "bndA", ".", "getBegin", "(", ")", ";", "IAtom", "end", "=", "bndA", ".", "getEnd", "(", ")", ";", "if", "(", "bndB", ".", "contai...
Access the common atom shared by two bonds. @param bndA first bond @param bndB second bond @return common atom or null if non exists
[ "Access", "the", "common", "atom", "shared", "by", "two", "bonds", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java#L1041-L1050
114,471
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/formula/IsotopeContainer.java
IsotopeContainer.getFormulasString
String getFormulasString() { StringBuilder sb = new StringBuilder(); for (IMolecularFormula mf : getFormulas()) { if (sb.length() != 0) sb.append(", "); sb.append(MolecularFormulaManipulator.getString(mf, false, true)); } return sb.toString(); ...
java
String getFormulasString() { StringBuilder sb = new StringBuilder(); for (IMolecularFormula mf : getFormulas()) { if (sb.length() != 0) sb.append(", "); sb.append(MolecularFormulaManipulator.getString(mf, false, true)); } return sb.toString(); ...
[ "String", "getFormulasString", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "IMolecularFormula", "mf", ":", "getFormulas", "(", ")", ")", "{", "if", "(", "sb", ".", "length", "(", ")", "!=", "0", ")", ...
Pretty-print the MFs of this isotope container. @return the MFs
[ "Pretty", "-", "print", "the", "MFs", "of", "this", "isotope", "container", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/IsotopeContainer.java#L152-L160
114,472
cdk/cdk
descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/CarbonTypesDescriptor.java
CarbonTypesDescriptor.calculate
@Override public DescriptorValue calculate(IAtomContainer container) { int c1sp1 = 0; int c2sp1 = 0; int c1sp2 = 0; int c2sp2 = 0; int c3sp2 = 0; int c1sp3 = 0; int c2sp3 = 0; int c3sp3 = 0; int c4sp3 = 0; for (IAtom atom : container.a...
java
@Override public DescriptorValue calculate(IAtomContainer container) { int c1sp1 = 0; int c2sp1 = 0; int c1sp2 = 0; int c2sp2 = 0; int c3sp2 = 0; int c1sp3 = 0; int c2sp3 = 0; int c3sp3 = 0; int c4sp3 = 0; for (IAtom atom : container.a...
[ "@", "Override", "public", "DescriptorValue", "calculate", "(", "IAtomContainer", "container", ")", "{", "int", "c1sp1", "=", "0", ";", "int", "c2sp1", "=", "0", ";", "int", "c1sp2", "=", "0", ";", "int", "c2sp2", "=", "0", ";", "int", "c3sp2", "=", ...
Calculates the 9 carbon types descriptors @param container Parameter is the atom container. @return An ArrayList containing 9 elements in the order described above
[ "Calculates", "the", "9", "carbon", "types", "descriptors" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/CarbonTypesDescriptor.java#L144-L199
114,473
cdk/cdk
tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java
GasteigerPEPEPartialCharges.removingFlagsAromaticity
private IAtomContainer removingFlagsAromaticity(IAtomContainer ac) { Iterator<IAtom> atoms = ac.atoms().iterator(); while (atoms.hasNext()) atoms.next().setFlag(CDKConstants.ISAROMATIC, false); Iterator<IBond> bonds = ac.bonds().iterator(); while (bonds.hasNext()) ...
java
private IAtomContainer removingFlagsAromaticity(IAtomContainer ac) { Iterator<IAtom> atoms = ac.atoms().iterator(); while (atoms.hasNext()) atoms.next().setFlag(CDKConstants.ISAROMATIC, false); Iterator<IBond> bonds = ac.bonds().iterator(); while (bonds.hasNext()) ...
[ "private", "IAtomContainer", "removingFlagsAromaticity", "(", "IAtomContainer", "ac", ")", "{", "Iterator", "<", "IAtom", ">", "atoms", "=", "ac", ".", "atoms", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "atoms", ".", "hasNext", "(", ")", ")...
remove the aromaticity flags. @param ac The IAtomContainer to remove flags @return The IAtomContainer with the flags removed
[ "remove", "the", "aromaticity", "flags", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java#L457-L465
114,474
cdk/cdk
tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java
GasteigerPEPEPartialCharges.setFlags
private IAtomContainer setFlags(IAtomContainer container, IAtomContainer ac, boolean b) { for (Iterator<IAtom> it = container.atoms().iterator(); it.hasNext();) { int positionA = ac.indexOf(it.next()); ac.getAtom(positionA).setFlag(CDKConstants.REACTIVE_CENTER, b); } for ...
java
private IAtomContainer setFlags(IAtomContainer container, IAtomContainer ac, boolean b) { for (Iterator<IAtom> it = container.atoms().iterator(); it.hasNext();) { int positionA = ac.indexOf(it.next()); ac.getAtom(positionA).setFlag(CDKConstants.REACTIVE_CENTER, b); } for ...
[ "private", "IAtomContainer", "setFlags", "(", "IAtomContainer", "container", ",", "IAtomContainer", "ac", ",", "boolean", "b", ")", "{", "for", "(", "Iterator", "<", "IAtom", ">", "it", "=", "container", ".", "atoms", "(", ")", ".", "iterator", "(", ")", ...
Set the Flags to atoms and bonds from an atomContainer. @param container Container with the flags @param ac Container to put the flags @param b True, if the the flag is true @return Container with added flags
[ "Set", "the", "Flags", "to", "atoms", "and", "bonds", "from", "an", "atomContainer", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java#L475-L486
114,475
cdk/cdk
tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java
GasteigerPEPEPartialCharges.setAntiFlags
private IAtomContainer setAntiFlags(IAtomContainer container, IAtomContainer ac, int number, boolean b) { IBond bond = ac.getBond(number); if (!container.contains(bond)) { bond.setFlag(CDKConstants.REACTIVE_CENTER, b); bond.getBegin().setFlag(CDKConstants.REACTIVE_CENTER, b); ...
java
private IAtomContainer setAntiFlags(IAtomContainer container, IAtomContainer ac, int number, boolean b) { IBond bond = ac.getBond(number); if (!container.contains(bond)) { bond.setFlag(CDKConstants.REACTIVE_CENTER, b); bond.getBegin().setFlag(CDKConstants.REACTIVE_CENTER, b); ...
[ "private", "IAtomContainer", "setAntiFlags", "(", "IAtomContainer", "container", ",", "IAtomContainer", "ac", ",", "int", "number", ",", "boolean", "b", ")", "{", "IBond", "bond", "=", "ac", ".", "getBond", "(", "number", ")", ";", "if", "(", "!", "contain...
Set the Flags to atoms and bonds which are not contained in an atomContainer. @param container Container with the flags @param ac Container to put the flags @param b True, if the the flag is true @return Container with added flags
[ "Set", "the", "Flags", "to", "atoms", "and", "bonds", "which", "are", "not", "contained", "in", "an", "atomContainer", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java#L497-L506
114,476
cdk/cdk
tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java
GasteigerPEPEPartialCharges.getElectrostaticPotentialN
private double getElectrostaticPotentialN(IAtomContainer ac, int atom1, double[] ds) { // double CoulombForceConstant = 1/(4*Math.PI*8.81/*Math.pow(10, -12)*/); double CoulombForceConstant = 0.048; double sum = 0.0; try { if (factory == null) factory = AtomT...
java
private double getElectrostaticPotentialN(IAtomContainer ac, int atom1, double[] ds) { // double CoulombForceConstant = 1/(4*Math.PI*8.81/*Math.pow(10, -12)*/); double CoulombForceConstant = 0.048; double sum = 0.0; try { if (factory == null) factory = AtomT...
[ "private", "double", "getElectrostaticPotentialN", "(", "IAtomContainer", "ac", ",", "int", "atom1", ",", "double", "[", "]", "ds", ")", "{", "//\t\tdouble CoulombForceConstant = 1/(4*Math.PI*8.81/*Math.pow(10, -12)*/);", "double", "CoulombForceConstant", "=", "0.048", ";",...
get the electrostatic potential of the neighbours of a atom. @param ac The IAtomContainer to study @param ds @param atom1 The position of the IAtom to study @return The sum of electrostatic potential of the neighbours
[ "get", "the", "electrostatic", "potential", "of", "the", "neighbours", "of", "a", "atom", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java#L594-L621
114,477
cdk/cdk
tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java
GasteigerPEPEPartialCharges.getTopologicalFactors
private double getTopologicalFactors(IAtomContainer atomContainer, IAtomContainer ac) { /* factor for separation of charge */ int totalNCharge1 = AtomContainerManipulator.getTotalNegativeFormalCharge(atomContainer); int totalPCharge1 = AtomContainerManipulator.getTotalPositiveFormalCharge(atomCo...
java
private double getTopologicalFactors(IAtomContainer atomContainer, IAtomContainer ac) { /* factor for separation of charge */ int totalNCharge1 = AtomContainerManipulator.getTotalNegativeFormalCharge(atomContainer); int totalPCharge1 = AtomContainerManipulator.getTotalPositiveFormalCharge(atomCo...
[ "private", "double", "getTopologicalFactors", "(", "IAtomContainer", "atomContainer", ",", "IAtomContainer", "ac", ")", "{", "/* factor for separation of charge */", "int", "totalNCharge1", "=", "AtomContainerManipulator", ".", "getTotalNegativeFormalCharge", "(", "atomContaine...
get the topological weight factor for each atomContainer. @param atomContainer The IAtomContainer to study. @param ac The IAtomContainer to study. @return The value
[ "get", "the", "topological", "weight", "factor", "for", "each", "atomContainer", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java#L630-L671
114,478
cdk/cdk
tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java
GasteigerPEPEPartialCharges.cleanFlagReactiveCenter
private void cleanFlagReactiveCenter(IAtomContainer ac) { for (int j = 0; j < ac.getAtomCount(); j++) ac.getAtom(j).setFlag(CDKConstants.REACTIVE_CENTER, false); for (int j = 0; j < ac.getBondCount(); j++) ac.getBond(j).setFlag(CDKConstants.REACTIVE_CENTER, false); }
java
private void cleanFlagReactiveCenter(IAtomContainer ac) { for (int j = 0; j < ac.getAtomCount(); j++) ac.getAtom(j).setFlag(CDKConstants.REACTIVE_CENTER, false); for (int j = 0; j < ac.getBondCount(); j++) ac.getBond(j).setFlag(CDKConstants.REACTIVE_CENTER, false); }
[ "private", "void", "cleanFlagReactiveCenter", "(", "IAtomContainer", "ac", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "ac", ".", "getAtomCount", "(", ")", ";", "j", "++", ")", "ac", ".", "getAtom", "(", "j", ")", ".", "setFlag", "("...
clean the flags CDKConstants.REACTIVE_CENTER from the molecule. @param ac
[ "clean", "the", "flags", "CDKConstants", ".", "REACTIVE_CENTER", "from", "the", "molecule", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java#L896-L901
114,479
cdk/cdk
tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java
ForceFieldConfigurator.checkForceFieldType
public boolean checkForceFieldType(String ffname) { boolean check = false; for (int i = 0; i < fftypes.length; i++) { if (fftypes[i].equals(ffname)) { check = true; break; } } if (!check) { // logger.debug("FFError:che...
java
public boolean checkForceFieldType(String ffname) { boolean check = false; for (int i = 0; i < fftypes.length; i++) { if (fftypes[i].equals(ffname)) { check = true; break; } } if (!check) { // logger.debug("FFError:che...
[ "public", "boolean", "checkForceFieldType", "(", "String", "ffname", ")", "{", "boolean", "check", "=", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fftypes", ".", "length", ";", "i", "++", ")", "{", "if", "(", "fftypes", "[", "i...
Sets the forceFieldType attribute of the ForceFieldConfigurator object @param ffname The new forceFieldType name
[ "Sets", "the", "forceFieldType", "attribute", "of", "the", "ForceFieldConfigurator", "object" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java#L102-L115
114,480
cdk/cdk
tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java
ForceFieldConfigurator.setForceFieldConfigurator
public void setForceFieldConfigurator(String ffname, IChemObjectBuilder builder) throws CDKException { ffname = ffname.toLowerCase(); boolean check = false; if (ffname == ffName && parameterSet != null) { } else { check = this.checkForceFieldType(ffname); ffName ...
java
public void setForceFieldConfigurator(String ffname, IChemObjectBuilder builder) throws CDKException { ffname = ffname.toLowerCase(); boolean check = false; if (ffname == ffName && parameterSet != null) { } else { check = this.checkForceFieldType(ffname); ffName ...
[ "public", "void", "setForceFieldConfigurator", "(", "String", "ffname", ",", "IChemObjectBuilder", "builder", ")", "throws", "CDKException", "{", "ffname", "=", "ffname", ".", "toLowerCase", "(", ")", ";", "boolean", "check", "=", "false", ";", "if", "(", "ffn...
Constructor for the ForceFieldConfigurator object @param ffname name of the force field data file
[ "Constructor", "for", "the", "ForceFieldConfigurator", "object" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java#L122-L162
114,481
cdk/cdk
tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java
ForceFieldConfigurator.setMM2Parameters
public void setMM2Parameters(IChemObjectBuilder builder) throws CDKException { try { if (mm2 == null) mm2 = new MM2BasedParameterSetReader(); mm2.readParameterSets(builder); } catch (Exception ex1) { throw new CDKException("Problem within readParameterSets due to:" + ...
java
public void setMM2Parameters(IChemObjectBuilder builder) throws CDKException { try { if (mm2 == null) mm2 = new MM2BasedParameterSetReader(); mm2.readParameterSets(builder); } catch (Exception ex1) { throw new CDKException("Problem within readParameterSets due to:" + ...
[ "public", "void", "setMM2Parameters", "(", "IChemObjectBuilder", "builder", ")", "throws", "CDKException", "{", "try", "{", "if", "(", "mm2", "==", "null", ")", "mm2", "=", "new", "MM2BasedParameterSetReader", "(", ")", ";", "mm2", ".", "readParameterSets", "(...
Sets the parameters attribute of the ForceFieldConfigurator object, default is mm2 force field
[ "Sets", "the", "parameters", "attribute", "of", "the", "ForceFieldConfigurator", "object", "default", "is", "mm2", "force", "field" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java#L185-L194
114,482
cdk/cdk
tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java
ForceFieldConfigurator.getAtomType
private IAtomType getAtomType(String ID) throws NoSuchAtomTypeException { IAtomType at = null; for (int i = 0; i < atomTypes.size(); i++) { at = (IAtomType) atomTypes.get(i); if (at.getAtomTypeName().equals(ID)) { return at; } } throw n...
java
private IAtomType getAtomType(String ID) throws NoSuchAtomTypeException { IAtomType at = null; for (int i = 0; i < atomTypes.size(); i++) { at = (IAtomType) atomTypes.get(i); if (at.getAtomTypeName().equals(ID)) { return at; } } throw n...
[ "private", "IAtomType", "getAtomType", "(", "String", "ID", ")", "throws", "NoSuchAtomTypeException", "{", "IAtomType", "at", "=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "atomTypes", ".", "size", "(", ")", ";", "i", "++", ")", ...
Find the atomType for a id @param ID Atomtype id of the forcefield @return The atomType @exception NoSuchAtomTypeException atomType is not known.
[ "Find", "the", "atomType", "for", "a", "id" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java#L228-L237
114,483
cdk/cdk
tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java
ForceFieldConfigurator.isHeteroRingSystem
private boolean isHeteroRingSystem(IAtomContainer ac) { if (ac != null) { for (int i = 0; i < ac.getAtomCount(); i++) { if (!(ac.getAtom(i).getSymbol()).equals("H") && !(ac.getAtom(i).getSymbol()).equals("C")) { return true; } } ...
java
private boolean isHeteroRingSystem(IAtomContainer ac) { if (ac != null) { for (int i = 0; i < ac.getAtomCount(); i++) { if (!(ac.getAtom(i).getSymbol()).equals("H") && !(ac.getAtom(i).getSymbol()).equals("C")) { return true; } } ...
[ "private", "boolean", "isHeteroRingSystem", "(", "IAtomContainer", "ac", ")", "{", "if", "(", "ac", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ac", ".", "getAtomCount", "(", ")", ";", "i", "++", ")", "{", "if", "(",...
Returns true if atom is in hetero ring system @param ac AtomContainer @return true/false
[ "Returns", "true", "if", "atom", "is", "in", "hetero", "ring", "system" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java#L335-L344
114,484
cdk/cdk
tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java
ForceFieldConfigurator.setAtom
private IAtom setAtom(IAtom atom, String ID) throws NoSuchAtomTypeException { IAtomType at = null; String key = ""; List<?> data = null; Double value = null; at = getAtomType(ID); if (atom.getSymbol() == null) { atom.setSymbol(at.getSymbol()); } ...
java
private IAtom setAtom(IAtom atom, String ID) throws NoSuchAtomTypeException { IAtomType at = null; String key = ""; List<?> data = null; Double value = null; at = getAtomType(ID); if (atom.getSymbol() == null) { atom.setSymbol(at.getSymbol()); } ...
[ "private", "IAtom", "setAtom", "(", "IAtom", "atom", ",", "String", "ID", ")", "throws", "NoSuchAtomTypeException", "{", "IAtomType", "at", "=", "null", ";", "String", "key", "=", "\"\"", ";", "List", "<", "?", ">", "data", "=", "null", ";", "Double", ...
Assigns an atom type to an atom @param atom The atom to be aasigned @param ID the atom type id @exception NoSuchAtomTypeException atomType is not known @return the assigned atom
[ "Assigns", "an", "atom", "type", "to", "an", "atom" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/ForceFieldConfigurator.java#L354-L386
114,485
cdk/cdk
descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/ZagrebIndexDescriptor.java
ZagrebIndexDescriptor.calculate
@Override public DescriptorValue calculate(IAtomContainer atomContainer) { double zagreb = 0; for (IAtom atom : atomContainer.atoms()) { if (atom.getSymbol().equals("H")) continue; int atomDegree = 0; List<IAtom> neighbours = atomContainer.getConnectedAtomsList(at...
java
@Override public DescriptorValue calculate(IAtomContainer atomContainer) { double zagreb = 0; for (IAtom atom : atomContainer.atoms()) { if (atom.getSymbol().equals("H")) continue; int atomDegree = 0; List<IAtom> neighbours = atomContainer.getConnectedAtomsList(at...
[ "@", "Override", "public", "DescriptorValue", "calculate", "(", "IAtomContainer", "atomContainer", ")", "{", "double", "zagreb", "=", "0", ";", "for", "(", "IAtom", "atom", ":", "atomContainer", ".", "atoms", "(", ")", ")", "{", "if", "(", "atom", ".", "...
Evaluate the Zagreb Index for a molecule. @param atomContainer AtomContainer @return zagreb index
[ "Evaluate", "the", "Zagreb", "Index", "for", "a", "molecule", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/ZagrebIndexDescriptor.java#L101-L117
114,486
cdk/cdk
storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java
InChINumbersTools.getNumbers
public static long[] getNumbers(IAtomContainer atomContainer) throws CDKException { String aux = auxInfo(atomContainer); long[] numbers = new long[atomContainer.getAtomCount()]; parseAuxInfo(aux, numbers); return numbers; }
java
public static long[] getNumbers(IAtomContainer atomContainer) throws CDKException { String aux = auxInfo(atomContainer); long[] numbers = new long[atomContainer.getAtomCount()]; parseAuxInfo(aux, numbers); return numbers; }
[ "public", "static", "long", "[", "]", "getNumbers", "(", "IAtomContainer", "atomContainer", ")", "throws", "CDKException", "{", "String", "aux", "=", "auxInfo", "(", "atomContainer", ")", ";", "long", "[", "]", "numbers", "=", "new", "long", "[", "atomContai...
Makes an array containing the InChI atom numbers of the non-hydrogen atoms in the atomContainer. It returns zero for all hydrogens. @param atomContainer The {@link IAtomContainer} to analyze. @return The number from 1 to the number of heavy atoms. @throws CDKException When the InChI could not be gen...
[ "Makes", "an", "array", "containing", "the", "InChI", "atom", "numbers", "of", "the", "non", "-", "hydrogen", "atoms", "in", "the", "atomContainer", ".", "It", "returns", "zero", "for", "all", "hydrogens", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java#L50-L55
114,487
cdk/cdk
storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java
InChINumbersTools.parseAuxInfo
public static void parseAuxInfo(String aux, long[] numbers) { aux = aux.substring(aux.indexOf("/N:") + 3); String numberStringAux = aux.substring(0, aux.indexOf('/')); int i = 1; for (String numberString : numberStringAux.split("[,;]")) numbers[Integer.valueOf(numberString) -...
java
public static void parseAuxInfo(String aux, long[] numbers) { aux = aux.substring(aux.indexOf("/N:") + 3); String numberStringAux = aux.substring(0, aux.indexOf('/')); int i = 1; for (String numberString : numberStringAux.split("[,;]")) numbers[Integer.valueOf(numberString) -...
[ "public", "static", "void", "parseAuxInfo", "(", "String", "aux", ",", "long", "[", "]", "numbers", ")", "{", "aux", "=", "aux", ".", "substring", "(", "aux", ".", "indexOf", "(", "\"/N:\"", ")", "+", "3", ")", ";", "String", "numberStringAux", "=", ...
Parse the atom numbering from the auxinfo. @param aux InChI AuxInfo @param numbers the atom numbers
[ "Parse", "the", "atom", "numbering", "from", "the", "auxinfo", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java#L63-L69
114,488
cdk/cdk
storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java
InChINumbersTools.exch
private static void exch(long[] values, int i, int j) { long k = values[i]; values[i] = values[j]; values[j] = k; }
java
private static void exch(long[] values, int i, int j) { long k = values[i]; values[i] = values[j]; values[j] = k; }
[ "private", "static", "void", "exch", "(", "long", "[", "]", "values", ",", "int", "i", ",", "int", "j", ")", "{", "long", "k", "=", "values", "[", "i", "]", ";", "values", "[", "i", "]", "=", "values", "[", "j", "]", ";", "values", "[", "j", ...
Exchange the elements at index i with that at index j. @param values an array of values @param i an index @param j another index
[ "Exchange", "the", "elements", "at", "index", "i", "with", "that", "at", "index", "j", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java#L200-L204
114,489
cdk/cdk
storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java
InChINumbersTools.auxInfo
static String auxInfo(IAtomContainer container, INCHI_OPTION... options) throws CDKException { InChIGeneratorFactory factory = InChIGeneratorFactory.getInstance(); boolean org = factory.getIgnoreAromaticBonds(); factory.setIgnoreAromaticBonds(true); InChIGenerator gen = factory.getInChIG...
java
static String auxInfo(IAtomContainer container, INCHI_OPTION... options) throws CDKException { InChIGeneratorFactory factory = InChIGeneratorFactory.getInstance(); boolean org = factory.getIgnoreAromaticBonds(); factory.setIgnoreAromaticBonds(true); InChIGenerator gen = factory.getInChIG...
[ "static", "String", "auxInfo", "(", "IAtomContainer", "container", ",", "INCHI_OPTION", "...", "options", ")", "throws", "CDKException", "{", "InChIGeneratorFactory", "factory", "=", "InChIGeneratorFactory", ".", "getInstance", "(", ")", ";", "boolean", "org", "=", ...
Obtain the InChI auxiliary info for the provided structure using using the specified InChI options. @param container the structure to obtain the numbers of @return auxiliary info @throws CDKException the inchi could not be generated
[ "Obtain", "the", "InChI", "auxiliary", "info", "for", "the", "provided", "structure", "using", "using", "the", "specified", "InChI", "options", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java#L232-L241
114,490
cdk/cdk
storage/ctab/src/main/java/org/openscience/cdk/io/RGroupQueryReader.java
RGroupQueryReader.checkLineBeginsWith
private void checkLineBeginsWith(String line, String expect, int lineCount) throws CDKException { if (line == null) { throw new CDKException("RGFile invalid, empty/null line at #" + lineCount); } if (!line.startsWith(expect)) { throw new CDKException("RGFile invalid, line...
java
private void checkLineBeginsWith(String line, String expect, int lineCount) throws CDKException { if (line == null) { throw new CDKException("RGFile invalid, empty/null line at #" + lineCount); } if (!line.startsWith(expect)) { throw new CDKException("RGFile invalid, line...
[ "private", "void", "checkLineBeginsWith", "(", "String", "line", ",", "String", "expect", ",", "int", "lineCount", ")", "throws", "CDKException", "{", "if", "(", "line", "==", "null", ")", "{", "throw", "new", "CDKException", "(", "\"RGFile invalid, empty/null l...
Checks that a given line starts as expected, according to RGFile format. @param line @param expect @param lineCount @throws CDKException
[ "Checks", "that", "a", "given", "line", "starts", "as", "expected", "according", "to", "RGFile", "format", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/RGroupQueryReader.java#L448-L455
114,491
cdk/cdk
legacy/src/main/java/org/openscience/cdk/smsd/algorithm/matchers/DefaultBondMatcher.java
DefaultBondMatcher.isBondTypeMatch
private boolean isBondTypeMatch(IBond targetBond) { int reactantBondType = queryBond.getOrder().numeric(); int productBondType = targetBond.getOrder().numeric(); if ((queryBond.getFlag(CDKConstants.ISAROMATIC) == targetBond.getFlag(CDKConstants.ISAROMATIC)) && (reactantBondType =...
java
private boolean isBondTypeMatch(IBond targetBond) { int reactantBondType = queryBond.getOrder().numeric(); int productBondType = targetBond.getOrder().numeric(); if ((queryBond.getFlag(CDKConstants.ISAROMATIC) == targetBond.getFlag(CDKConstants.ISAROMATIC)) && (reactantBondType =...
[ "private", "boolean", "isBondTypeMatch", "(", "IBond", "targetBond", ")", "{", "int", "reactantBondType", "=", "queryBond", ".", "getOrder", "(", ")", ".", "numeric", "(", ")", ";", "int", "productBondType", "=", "targetBond", ".", "getOrder", "(", ")", ".",...
Return true if a bond is matched between query and target @param targetBond @return
[ "Return", "true", "if", "a", "bond", "is", "matched", "between", "query", "and", "target" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/matchers/DefaultBondMatcher.java#L134-L144
114,492
cdk/cdk
storage/ctab/src/main/java/org/openscience/cdk/io/MDLValence.java
MDLValence.apply
static IAtomContainer apply(IAtomContainer container) { int n = container.getAtomCount(); int[] valences = new int[n]; Map<IAtom, Integer> atomToIndex = Maps.newHashMapWithExpectedSize(n); for (IAtom atom : container.atoms()) atomToIndex.put(atom, atomToIndex.size()); ...
java
static IAtomContainer apply(IAtomContainer container) { int n = container.getAtomCount(); int[] valences = new int[n]; Map<IAtom, Integer> atomToIndex = Maps.newHashMapWithExpectedSize(n); for (IAtom atom : container.atoms()) atomToIndex.put(atom, atomToIndex.size()); ...
[ "static", "IAtomContainer", "apply", "(", "IAtomContainer", "container", ")", "{", "int", "n", "=", "container", ".", "getAtomCount", "(", ")", ";", "int", "[", "]", "valences", "=", "new", "int", "[", "n", "]", ";", "Map", "<", "IAtom", ",", "Integer"...
Apply the MDL valence model to the provided atom container. @param container an atom container loaded from an MDL format @return the container (for convenience)
[ "Apply", "the", "MDL", "valence", "model", "to", "the", "provided", "atom", "container", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLValence.java#L60-L107
114,493
cdk/cdk
legacy/src/main/java/org/openscience/cdk/smsd/algorithm/mcgregor/McGregor.java
McGregor.checkmArcs
private boolean checkmArcs(List<Integer> mArcsT, int neighborBondNumA, int neighborBondNumB) { int size = neighborBondNumA * neighborBondNumA; List<Integer> posNumList = new ArrayList<Integer>(size); for (int i = 0; i < posNumList.size(); i++) { posNumList.add(i, 0); } ...
java
private boolean checkmArcs(List<Integer> mArcsT, int neighborBondNumA, int neighborBondNumB) { int size = neighborBondNumA * neighborBondNumA; List<Integer> posNumList = new ArrayList<Integer>(size); for (int i = 0; i < posNumList.size(); i++) { posNumList.add(i, 0); } ...
[ "private", "boolean", "checkmArcs", "(", "List", "<", "Integer", ">", "mArcsT", ",", "int", "neighborBondNumA", ",", "int", "neighborBondNumB", ")", "{", "int", "size", "=", "neighborBondNumA", "*", "neighborBondNumA", ";", "List", "<", "Integer", ">", "posNum...
matrix will be stored in function partsearch.
[ "matrix", "will", "be", "stored", "in", "function", "partsearch", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/mcgregor/McGregor.java#L603-L629
114,494
cdk/cdk
descriptor/qsarbond/src/main/java/org/openscience/cdk/qsar/descriptors/bond/BondSigmaElectronegativityDescriptor.java
BondSigmaElectronegativityDescriptor.calculate
@Override public DescriptorValue calculate(IBond aBond, IAtomContainer atomContainer) { IAtomContainer ac; IBond bond; try { ac = (IAtomContainer) atomContainer.clone(); bond = ac.getBond(atomContainer.indexOf(aBond)); AtomContainerManipulator.percieveAto...
java
@Override public DescriptorValue calculate(IBond aBond, IAtomContainer atomContainer) { IAtomContainer ac; IBond bond; try { ac = (IAtomContainer) atomContainer.clone(); bond = ac.getBond(atomContainer.indexOf(aBond)); AtomContainerManipulator.percieveAto...
[ "@", "Override", "public", "DescriptorValue", "calculate", "(", "IBond", "aBond", ",", "IAtomContainer", "atomContainer", ")", "{", "IAtomContainer", "ac", ";", "IBond", "bond", ";", "try", "{", "ac", "=", "(", "IAtomContainer", ")", "atomContainer", ".", "clo...
The method calculates the sigma electronegativity of a given bond It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools.HydrogenAdder. @param atomContainer AtomContainer @return return the sigma electronegativity
[ "The", "method", "calculates", "the", "sigma", "electronegativity", "of", "a", "given", "bond", "It", "is", "needed", "to", "call", "the", "addExplicitHydrogensToSatisfyValency", "method", "from", "the", "class", "tools", ".", "HydrogenAdder", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarbond/src/main/java/org/openscience/cdk/qsar/descriptors/bond/BondSigmaElectronegativityDescriptor.java#L131-L154
114,495
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java
CanonicalLabeler.createInvarLabel
private List<InvPair> createInvarLabel(IAtomContainer atomContainer) { Iterator<IAtom> atoms = atomContainer.atoms().iterator(); IAtom a; StringBuffer inv; List<InvPair> vect = new ArrayList<InvPair>(); while (atoms.hasNext()) { a = (IAtom) atoms.next(); i...
java
private List<InvPair> createInvarLabel(IAtomContainer atomContainer) { Iterator<IAtom> atoms = atomContainer.atoms().iterator(); IAtom a; StringBuffer inv; List<InvPair> vect = new ArrayList<InvPair>(); while (atoms.hasNext()) { a = (IAtom) atoms.next(); i...
[ "private", "List", "<", "InvPair", ">", "createInvarLabel", "(", "IAtomContainer", "atomContainer", ")", "{", "Iterator", "<", "IAtom", ">", "atoms", "=", "atomContainer", ".", "atoms", "(", ")", ".", "iterator", "(", ")", ";", "IAtom", "a", ";", "StringBu...
Create initial invariant labeling corresponds to step 1 @return ArrayList containing the
[ "Create", "initial", "invariant", "labeling", "corresponds", "to", "step", "1" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java#L115-L139
114,496
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java
CanonicalLabeler.primeProduct
private void primeProduct(List<InvPair> v, IAtomContainer atomContainer) { Iterator<InvPair> it = v.iterator(); Iterator<IAtom> n; InvPair inv; IAtom a; long summ; while (it.hasNext()) { inv = (InvPair) it.next(); List<IAtom> neighbour = atomContai...
java
private void primeProduct(List<InvPair> v, IAtomContainer atomContainer) { Iterator<InvPair> it = v.iterator(); Iterator<IAtom> n; InvPair inv; IAtom a; long summ; while (it.hasNext()) { inv = (InvPair) it.next(); List<IAtom> neighbour = atomContai...
[ "private", "void", "primeProduct", "(", "List", "<", "InvPair", ">", "v", ",", "IAtomContainer", "atomContainer", ")", "{", "Iterator", "<", "InvPair", ">", "it", "=", "v", ".", "iterator", "(", ")", ";", "Iterator", "<", "IAtom", ">", "n", ";", "InvPa...
Calculates the product of the neighbouring primes. @param v the invariance pair vector
[ "Calculates", "the", "product", "of", "the", "neighbouring", "primes", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java#L146-L165
114,497
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java
CanonicalLabeler.sortArrayList
private void sortArrayList(List<InvPair> v) { Collections.sort(v, new Comparator<InvPair>() { @Override public int compare(InvPair o1, InvPair o2) { if (o1.getCurr() > o2.getCurr()) return +1; if (o1.getCurr() < o2.getCurr()) return -1; re...
java
private void sortArrayList(List<InvPair> v) { Collections.sort(v, new Comparator<InvPair>() { @Override public int compare(InvPair o1, InvPair o2) { if (o1.getCurr() > o2.getCurr()) return +1; if (o1.getCurr() < o2.getCurr()) return -1; re...
[ "private", "void", "sortArrayList", "(", "List", "<", "InvPair", ">", "v", ")", "{", "Collections", ".", "sort", "(", "v", ",", "new", "Comparator", "<", "InvPair", ">", "(", ")", "{", "@", "Override", "public", "int", "compare", "(", "InvPair", "o1", ...
Sorts the vector according to the current invariance, corresponds to step 3 @param v the invariance pair vector @cdk.todo can this be done in one loop?
[ "Sorts", "the", "vector", "according", "to", "the", "current", "invariance", "corresponds", "to", "step", "3" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java#L173-L192
114,498
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java
CanonicalLabeler.rankArrayList
private void rankArrayList(List<InvPair> v) { int num = 1; int[] temp = new int[v.size()]; InvPair last = (InvPair) v.get(0); Iterator<InvPair> it = v.iterator(); InvPair curr; for (int x = 0; it.hasNext(); x++) { curr = (InvPair) it.next(); if (!l...
java
private void rankArrayList(List<InvPair> v) { int num = 1; int[] temp = new int[v.size()]; InvPair last = (InvPair) v.get(0); Iterator<InvPair> it = v.iterator(); InvPair curr; for (int x = 0; it.hasNext(); x++) { curr = (InvPair) it.next(); if (!l...
[ "private", "void", "rankArrayList", "(", "List", "<", "InvPair", ">", "v", ")", "{", "int", "num", "=", "1", ";", "int", "[", "]", "temp", "=", "new", "int", "[", "v", ".", "size", "(", ")", "]", ";", "InvPair", "last", "=", "(", "InvPair", ")"...
Rank atomic vector, corresponds to step 4. @param v the invariance pair vector
[ "Rank", "atomic", "vector", "corresponds", "to", "step", "4", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java#L199-L219
114,499
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java
CanonicalLabeler.isInvPart
private boolean isInvPart(List<InvPair> v) { if (((InvPair) v.get(v.size() - 1)).getCurr() == v.size()) return true; Iterator<InvPair> it = v.iterator(); InvPair curr; while (it.hasNext()) { curr = (InvPair) it.next(); if (curr.getCurr() != curr.getLast()) return ...
java
private boolean isInvPart(List<InvPair> v) { if (((InvPair) v.get(v.size() - 1)).getCurr() == v.size()) return true; Iterator<InvPair> it = v.iterator(); InvPair curr; while (it.hasNext()) { curr = (InvPair) it.next(); if (curr.getCurr() != curr.getLast()) return ...
[ "private", "boolean", "isInvPart", "(", "List", "<", "InvPair", ">", "v", ")", "{", "if", "(", "(", "(", "InvPair", ")", "v", ".", "get", "(", "v", ".", "size", "(", ")", "-", "1", ")", ")", ".", "getCurr", "(", ")", "==", "v", ".", "size", ...
Checks to see if the vector is invariantly partitioned @param v the invariance pair vector @return true if the vector is invariantly partitioned, false otherwise
[ "Checks", "to", "see", "if", "the", "vector", "is", "invariantly", "partitioned" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java#L227-L236