[Git][java-team/openchemlib][master] 3 commits: New upstream version 2020.11.4+dfsg

Andrius Merkys gitlab at salsa.debian.org
Wed Dec 2 12:20:49 GMT 2020



Andrius Merkys pushed to branch master at Debian Java Maintainers / openchemlib


Commits:
99a9383d by Andrius Merkys at 2020-12-02T06:46:10-05:00
New upstream version 2020.11.4+dfsg
- - - - -
3158502e by Andrius Merkys at 2020-12-02T06:46:21-05:00
Update upstream source from tag 'upstream/2020.11.4+dfsg'

Update to upstream version '2020.11.4+dfsg'
with Debian dir 79f14040939254136b626e0bd7ec6abceecbb215
- - - - -
471be68b by Andrius Merkys at 2020-12-02T06:47:32-05:00
Update changelog for 2020.11.4+dfsg-1 release

- - - - -


7 changed files:

- debian/changelog
- pom.xml
- src/main/java/com/actelion/research/calc/combinatorics/CombinationGenerator.java
- src/main/java/com/actelion/research/chem/StructureSearch.java
- src/main/java/com/actelion/research/chem/descriptor/flexophore/completegraphmatcher/ObjectiveFlexophoreHardMatchUncovered.java
- src/main/java/com/actelion/research/util/StringFunctions.java
- src/main/java/com/actelion/research/util/graph/complete/CompleteGraphMatcher.java


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+openchemlib (2020.11.4+dfsg-1) unstable; urgency=medium
+
+  * New upstream version 2020.11.4+dfsg
+
+ -- Andrius Merkys <merkys at debian.org>  Wed, 02 Dec 2020 06:47:29 -0500
+
 openchemlib (2020.11.3+dfsg-1) unstable; urgency=medium
 
   * New upstream version 2020.11.3+dfsg


=====================================
pom.xml
=====================================
@@ -8,7 +8,7 @@
     Please follow the naming scheme YEAR.MONTH.RELEASE_NO_OF_MONTH
     (eg. 2016.4.1 for second release in Apr 2016)
     -->
-    <version>2020.11.3</version>
+    <version>2020.11.4</version>
 
     <name>OpenChemLib</name>
     <description>Open Source Chemistry Library</description>
@@ -189,7 +189,7 @@
         <connection>scm:git:git at github.com:Actelion/openchemlib.git</connection>
         <developerConnection>scm:git:git at github.com:Actelion/openchemlib.git</developerConnection>
         <url>https://github.com/Actelion/openchemlib</url>
-      <tag>openchemlib-2020.11.3</tag>
+      <tag>openchemlib-2020.11.4</tag>
   </scm>
 
     <distributionManagement>


=====================================
src/main/java/com/actelion/research/calc/combinatorics/CombinationGenerator.java
=====================================
@@ -2,6 +2,7 @@ package com.actelion.research.calc.combinatorics;
 
 import com.actelion.research.util.ArrayUtils;
 
+import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -169,55 +170,95 @@ public class CombinationGenerator {
 		return permutations;
 	}
 
+	public static BigInteger getFactorial (int n) {
+		BigInteger fact = BigInteger.ONE;
+		for (int i = n; i > 1; i--) {
+			fact = fact.multiply (new BigInteger (Integer.toString (i)));
+		}
+		return fact;
+	}
+
+	/**
+	 * Calculate binomial coefficient or
+	 * n choose k
+	 *
+	 * @param n
+	 * @param k
+	 * @return
+	 */
+	public static BigInteger getBinomialCoefficient(int n, int k){
+
+		BigInteger nFac = getFactorial(n);
+		BigInteger kFac = getFactorial(k);
+
+		BigInteger nMinus_k_Fac = getFactorial(n-k);
+
+		BigInteger dev = nMinus_k_Fac.multiply(kFac);
+
+		BigInteger bc = nFac.divide(dev);
+
+		return bc;
+	}
+
 	public static void main(String[] args) {
-		List<int[]> li = new ArrayList<>();
-
-//		int [] a1 = {0,1};
-//		int [] a2 = {0};
-//		int [] a3 = {1,2};
-		int [] a1 = {1,2,3,4,5,6,7,8};
-		int [] a2 = {1,2,3};
-		//int [] a3 = {5,6,7};
-		//int [] a4 = {8};
-
-		//li.add(a1);
-		//li.add(a2);
-		
-		
-		//li.add(a3);
-		//li.add(a4);
+		int n = 12;
+		int k= 3;
 
-		//List<int[]> liComb = getCombinations(li);
-		/*
-		List<int[]> liComb = getAllOutOf(9,3);
-		
-		
-		li = new ArrayList<>();
-		for(int[] l : liComb)
-			//getPermutations(l,l.length);
-			System.out.println(Arrays.toString(l));
-		*/
-		int n = 3;
-		int[] elements = IntStream.range(1,n).toArray();
-		List<int[]> liComb = getAllOutOf(7,n-1);
-
-		for(int[] r : liComb) {
-			List<int[]> permutations = getPermutations(r,r.length);
-			System.out.println("#####");
-			//System.out.println(Arrays.toString(r));
-			for(int[] per : permutations) {
-				//System.out.println(Arrays.toString(per));
-				int[] arr = new int[per.length+1];
-				arr[0] = 0;
-				IntStream.range(0, per.length).forEach(e -> {
-				arr[e+1] = per[e]+1;});
-				System.out.println(Arrays.toString(arr));
-			}
-		}
+		BigInteger bc = getBinomialCoefficient(n,k);
 
+		System.out.println(bc.toString());
 	}
 
 
+//	public static void main(String[] args) {
+//		List<int[]> li = new ArrayList<>();
+//
+////		int [] a1 = {0,1};
+////		int [] a2 = {0};
+////		int [] a3 = {1,2};
+//		int [] a1 = {1,2,3,4,5,6,7,8};
+//		int [] a2 = {1,2,3};
+//		//int [] a3 = {5,6,7};
+//		//int [] a4 = {8};
+//
+//		//li.add(a1);
+//		//li.add(a2);
+//
+//
+//		//li.add(a3);
+//		//li.add(a4);
+//
+//		//List<int[]> liComb = getCombinations(li);
+//		/*
+//		List<int[]> liComb = getAllOutOf(9,3);
+//
+//
+//		li = new ArrayList<>();
+//		for(int[] l : liComb)
+//			//getPermutations(l,l.length);
+//			System.out.println(Arrays.toString(l));
+//		*/
+//		int n = 3;
+//		int[] elements = IntStream.range(1,n).toArray();
+//		List<int[]> liComb = getAllOutOf(7,n-1);
+//
+//		for(int[] r : liComb) {
+//			List<int[]> permutations = getPermutations(r,r.length);
+//			System.out.println("#####");
+//			//System.out.println(Arrays.toString(r));
+//			for(int[] per : permutations) {
+//				//System.out.println(Arrays.toString(per));
+//				int[] arr = new int[per.length+1];
+//				arr[0] = 0;
+//				IntStream.range(0, per.length).forEach(e -> {
+//				arr[e+1] = per[e]+1;});
+//				System.out.println(Arrays.toString(arr));
+//			}
+//		}
+//
+//	}
+
+
 
 		
 	


=====================================
src/main/java/com/actelion/research/chem/StructureSearch.java
=====================================
@@ -256,7 +256,7 @@ public class StructureSearch {
 							}
 						else if (mSpecification.isNoStereoSearch()) {
 							for (int i=0; i<mQueryHashCode.length; i++) {
-								if (mQueryHashCode[i] == mDataSource.getNoStereoCode(row, mSpecification.isLargestFragmentOnly())) {
+								if (mQueryHashCode[i] != 0 && mQueryHashCode[i] == mDataSource.getNoStereoCode(row, mSpecification.isLargestFragmentOnly())) {
 									isMatch = true;
 									break;
 									}
@@ -264,7 +264,7 @@ public class StructureSearch {
 							}
 						else if (mSpecification.isTautomerSearch()) {
 							for (int i=0; i<mQueryHashCode.length; i++) {
-								if (mQueryHashCode[i] == mDataSource.getTautomerCode(row, mSpecification.isLargestFragmentOnly())) {
+								if (mQueryHashCode[i] != 0 && mQueryHashCode[i] == mDataSource.getTautomerCode(row, mSpecification.isLargestFragmentOnly())) {
 									isMatch = true;
 									break;
 									}
@@ -272,7 +272,7 @@ public class StructureSearch {
 							}
 						else if (mSpecification.isNoStereoTautomerSearch()) {
 							for (int i=0; i<mQueryHashCode.length; i++) {
-								if (mQueryHashCode[i] == mDataSource.getNoStereoTautomerCode(row, mSpecification.isLargestFragmentOnly())) {
+								if (mQueryHashCode[i] != 0 && mQueryHashCode[i] == mDataSource.getNoStereoTautomerCode(row, mSpecification.isLargestFragmentOnly())) {
 									isMatch = true;
 									break;
 									}
@@ -280,7 +280,7 @@ public class StructureSearch {
 							}
 						else if (mSpecification.isBackboneSearch()) {
 							for (int i=0; i<mQueryHashCode.length; i++) {
-								if (mQueryHashCode[i] == mDataSource.getBackboneCode(row, mSpecification.isLargestFragmentOnly())) {
+								if (mQueryHashCode[i] != 0 && mQueryHashCode[i] == mDataSource.getBackboneCode(row, mSpecification.isLargestFragmentOnly())) {
 									isMatch = true;
 									break;
 									}


=====================================
src/main/java/com/actelion/research/chem/descriptor/flexophore/completegraphmatcher/ObjectiveFlexophoreHardMatchUncovered.java
=====================================
@@ -327,16 +327,12 @@ public class ObjectiveFlexophoreHardMatchUncovered implements IObjectiveComplete
 						mapping = false;
 						break outer;
 					} else {
-
 						// System.out.println("Match");
-
 					}
 				}
 			}
 		}
-		
 		return mapping;
-		
 	}
 
 	/**


=====================================
src/main/java/com/actelion/research/util/StringFunctions.java
=====================================
@@ -922,6 +922,18 @@ public class StringFunctions {
         return sb.toString();
     }
 
+    public static String toStringInteger(List<Integer> li, String sep){
+
+        StringBuilder sb = new  StringBuilder();
+        for (int i = 0; i < li.size(); i++) {
+            sb.append(li.get(i));
+            if(i < li.size()-1){
+                sb.append(sep);
+            }
+        }
+        return sb.toString();
+    }
+
 //    public static String toStringInt(List<Integer> li){
 //
 //        StringBuilder sb = new  StringBuilder();


=====================================
src/main/java/com/actelion/research/util/graph/complete/CompleteGraphMatcher.java
=====================================
@@ -58,11 +58,8 @@ public class CompleteGraphMatcher<T extends ICompleteGraph> {
 	private long createdSolutions;
 	
 	public CompleteGraphMatcher(IObjectiveCompleteGraph<T> objectiveCompleteGraph) {
-		
 		this.objectiveCompleteGraph = objectiveCompleteGraph;
-		
 		init();
-		
 	}
 
 	/**
@@ -103,11 +100,8 @@ public class CompleteGraphMatcher<T extends ICompleteGraph> {
 	
 	
 	public void set(T cgBase, T cgQuery){
-		
 		objectiveCompleteGraph.setBase(cgBase);
-		
 		objectiveCompleteGraph.setQuery(cgQuery);
-		
 	}
 	
 	



View it on GitLab: https://salsa.debian.org/java-team/openchemlib/-/compare/7c444c4785444f0986e5bcd13b080f0dd0e45eac...471be68b69b2ce89cf5a0dbc01048909209c2dc3

-- 
View it on GitLab: https://salsa.debian.org/java-team/openchemlib/-/compare/7c444c4785444f0986e5bcd13b080f0dd0e45eac...471be68b69b2ce89cf5a0dbc01048909209c2dc3
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20201202/5393c9de/attachment.html>


More information about the pkg-java-commits mailing list