package init

This commit is contained in:
root 2020-08-10 16:14:50 +08:00
parent de5db93d9f
commit 11fd86b3d1
4 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,43 @@
X-Git-Url: https://git1-us-west.apache.org/repos/asf?p=commons-math.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fapache%2Fcommons%2Fmath3%2Fml%2Fneuralnet%2Fsofm%2FKohonenUpdateActionTest.java;h=b209d56b8651eb6e7bbfca10ad9bdb1802fb24f3;hp=334a5a8ebbbd011aa7d10bebbc5478df5f82becc;hb=a9006aa;hpb=838788fd6302d6cc91e1743144e0f14b71e4812e
diff --git a/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java b/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java
index 334a5a8..b209d56 100644
--- a/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java
+++ b/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java
@@ -17,18 +17,19 @@
package org.apache.commons.math3.ml.neuralnet.sofm;
-import org.apache.commons.math3.ml.neuralnet.Neuron;
-import org.apache.commons.math3.ml.neuralnet.Network;
-import org.apache.commons.math3.ml.neuralnet.MapUtils;
-import org.apache.commons.math3.ml.neuralnet.UpdateAction;
-import org.apache.commons.math3.ml.neuralnet.OffsetFeatureInitializer;
-import org.apache.commons.math3.ml.neuralnet.FeatureInitializer;
-import org.apache.commons.math3.ml.neuralnet.FeatureInitializerFactory;
import org.apache.commons.math3.ml.distance.DistanceMeasure;
import org.apache.commons.math3.ml.distance.EuclideanDistance;
+import org.apache.commons.math3.ml.neuralnet.FeatureInitializer;
+import org.apache.commons.math3.ml.neuralnet.FeatureInitializerFactory;
+import org.apache.commons.math3.ml.neuralnet.MapUtils;
+import org.apache.commons.math3.ml.neuralnet.Network;
+import org.apache.commons.math3.ml.neuralnet.Neuron;
+import org.apache.commons.math3.ml.neuralnet.OffsetFeatureInitializer;
+import org.apache.commons.math3.ml.neuralnet.UpdateAction;
import org.apache.commons.math3.ml.neuralnet.oned.NeuronString;
-import org.junit.Test;
+import org.apache.commons.math3.util.Precision;
import org.junit.Assert;
+import org.junit.Test;
/**
* Tests for {@link KohonenUpdateAction} class.
@@ -82,7 +83,7 @@ public class KohonenUpdateActionTest {
Assert.assertEquals(bestBefore, bestAfter);
// Distance is now zero.
- Assert.assertEquals(0, dist.compute(bestAfter.getFeatures(), features), 0d);
+ Assert.assertEquals(0, dist.compute(bestAfter.getFeatures(), features), Precision.EPSILON);
for (int i = 0; i < netSize; i++) {
// All distances have decreased.

44
apache-commons-math.spec Normal file
View File

@ -0,0 +1,44 @@
%global short_name commons-math3
Name: apache-commons-math
Version: 3.4.1
Release: 1
Summary: Java library of lightweight mathematics and statistics components
License: ASL 1.1 and ASL 2.0 and BSD
URL: http://commons.apache.org/math/
Source0: http://archive.apache.org/dist/commons/math/source/%{short_name}-%{version}-src.tar.gz
Patch1: %{name}-3.4.1-RHBZ1402145.patch
BuildArch: noarch
BuildRequires: java-devel >= 1:1.6.0 jpackage-utils maven-local
BuildRequires: mvn(org.apache.commons:commons-parent:pom:)
Requires: jpackage-utils
%description
Commons Math is a library of lightweight, self-contained mathematics and
statistics components addressing the most common problems not available in the
Java programming language or Commons Lang.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains the API documentation for %{name}.
%prep
%autosetup -n %{short_name}-%{version}-src -p1
%mvn_alias "org.apache.commons:%{short_name}" "%{short_name}:%{short_name}"
%mvn_file :%{short_name} %{short_name} %{name}
%pom_remove_plugin ru.concerteza.buildnumber:maven-jgit-buildnumber-plugin
%build
%mvn_build
%install
%mvn_install
%files -f .mfiles
%doc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt
%files javadoc -f .mfiles-javadoc
%doc LICENSE.txt NOTICE.txt
%changelog
* Tue Jul 28 2020 shaoqiang kang <kangshaoqiang1@huawei.com> - 3.4.1-1
- Package init

4
apache-commons-math.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: apache/commons-math
tag_prefix: "MATH_"
seperator: "_"

Binary file not shown.