Skip to content

Commit

Permalink
Test math70 and fix classpath issue (#79)
Browse files Browse the repository at this point in the history
* Fix classpath issue. Add math70 test.

Signed-off-by: André Silva <[email protected]>

* Fix compliance levels for math70

Signed-off-by: André Silva <[email protected]>

* Run math70 only on java

Signed-off-by: André Silva <[email protected]>

* Add test detection test (see #80)

Signed-off-by: André Silva <[email protected]>
  • Loading branch information
andre15silva authored Aug 11, 2021
1 parent b89bfe7 commit 656be0f
Show file tree
Hide file tree
Showing 812 changed files with 182,400 additions and 11 deletions.
7 changes: 6 additions & 1 deletion .github/install_examples.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# Script that generates the required target files for each example project
JAVA_MAJOR_VERSION=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed 's/^1\.//' | cut -d'.' -f1)

# Compile maven projects
mvn clean test -DskipTests -Dmaven.compiler.source=$SRC_VERSION -Dmaven.compiler.target=$SRC_VERSION -B -f examples/exampleFL1/FLtest1/
Expand All @@ -11,8 +12,12 @@ mvn clean test -DskipTests -Dmaven.compiler.source=$SRC_VERSION -Dmaven.compiler
mvn clean test -DskipTests -Dmaven.compiler.source=$SRC_VERSION -Dmaven.compiler.target=$SRC_VERSION -B -f examples/exampleFL7SameNamedMethods/FLtest1/
mvn clean test -DskipTests -Dmaven.compiler.source=$SRC_VERSION -Dmaven.compiler.target=$SRC_VERSION -B -f examples/exampleFL11/FLtest1/

# Compile real projects
if [ $JAVA_MAJOR_VERSION -eq "8" ]; then
mvn clean test -DskipTests -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8 -B -f examples/math_70/
fi

# We only execute this example test if the java version is lower than 11, since the compliance level 1.4 was dropped in 11
JAVA_MAJOR_VERSION=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed 's/^1\.//' | cut -d'.' -f1)
if [ $JAVA_MAJOR_VERSION -lt "11" ]; then
mvn clean test -DskipTests -Dmaven.compiler.source=1.4 -Dmaven.compiler.target=1.4 -B -f examples/exampleFL12Compliance4/FLtest1/
fi
Expand Down
31 changes: 31 additions & 0 deletions examples/math_70/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
3 changes: 3 additions & 0 deletions examples/math_70/.defects4j.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Config file generated by Defects4J
vid=70b
pid=Math
2 changes: 2 additions & 0 deletions examples/math_70/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target/
/.settings/
24 changes: 24 additions & 0 deletions examples/math_70/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>commons-math-70</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
376 changes: 376 additions & 0 deletions examples/math_70/LICENSE.txt

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions examples/math_70/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Apache Commons Math
Copyright 2001-2010 The Apache Software Foundation

This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).

===============================================================================
The LinearConstraint, LinearObjectiveFunction, LinearOptimizer,
RelationShip, SimplexSolver and SimplexTableau classes in package
org.apache.commons.math.optimization.linear include software developed by
Benjamin McCann (http://www.benmccann.com) and distributed with
the following copyright: Copyright 2009 Google Inc.
===============================================================================

This product includes software developed by the
University of Chicago, as Operator of Argonne National
Laboratory.
The LevenbergMarquardtOptimizer class in package
org.apache.commons.math.optimization.general includes software
translated from the lmder, lmpar and qrsolv Fortran routines
from the Minpack package
Minpack Copyright Notice (1999) University of Chicago. All rights reserved
===============================================================================

The GraggBulirschStoerIntegrator class in package
org.apache.commons.math.ode.nonstiff includes software translated
from the odex Fortran routine developed by E. Hairer and G. Wanner.
Original source copyright:
Copyright (c) 2004, Ernst Hairer
===============================================================================

The EigenDecompositionImpl class in package
org.apache.commons.math.linear includes software translated
from some LAPACK Fortran routines. Original source copyright:
Copyright (c) 1992-2008 The University of Tennessee. All rights reserved.
===============================================================================

The MersenneTwister class in package org.apache.commons.math.random
includes software translated from the 2002-01-26 version of
the Mersenne-Twister generator written in C by Makoto Matsumoto and Takuji
Nishimura. Original source copyright:
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved
===============================================================================

The complete text of licenses and disclaimers associated with the the original
sources enumerated above at the time of code translation are in the LICENSE.txt
file.
113 changes: 113 additions & 0 deletions examples/math_70/PROPOSAL.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<html>
<head>
<title>Proposal for math Package</title>
</head>
<body bgcolor="white">

<div align="center">
<h1>Proposal for <em>math</em> Package</h1>
</div>

<h3>(0) Rationale</h3>

<p>The Java programming language and the math extensions in commons-lang provide implementations for only the most basic mathematical algorithms. Routine development tasks such as computing basic statistics or solving a system of linear equations require components not available in java or commons-lang.</p>

<p>Most basic mathematical or statistical algorithms are available in open source implementations, but to assemble a simple set of capabilities one has to use multiple libraries, many of which have more restrictive licensing terms than the ASF. In addition, many of the best open source implementations (e.g. the R statistical package) are either not available in Java or require large support libraries and/or external dependencies to work.</p>

<p>A commons-math community will provide a productive environment for aggregation, testing and support of efficient Java implementations of commonly used mathematical and statistical algorithms.</p>
</p>


<h3>(1) Scope of the Package</h3>

<p>The Math project shall create and maintain a library of lightweight, self-contained mathematics and statistics components addressing the most common practical problems not immediately available in the Java programming language or commons-lang. The guiding principles for commons-math will be:

<ol>
<li>Real-world application use cases determine priority</li>
<li>Emphasis on small, easily integrated components rather than large libraries with complex dependencies</li>
<li>All algorithms are fully documented and follow generally accepted best practices</li>
<li>In situations where multiple standard algorithms exist, use the Strategy pattern to support multiple implementations</li>
<li>Limited dependencies. No external dependencies beyond Commons components and the JDK</li>
</ol>

<h3>(1.5) Interaction With Other Packages</h3>

<p><em>math</em> relies only on standard JDK 1.2 (or later) APIs for
production deployment. It utilizes the JUnit unit testing framework for
developing and executing unit tests, but this is of interest only to
developers of the component.</p>

<p>No external configuration files are utilized.</p>


<h3>(2) Initial Source of the Package</h3>

<p>The initial codebase will consist of implementations of basic statistical algorithms such as the following:
<ul>
<li>Simple univariate statistics (mean, standard deviation, n, confidence intervals)</li>
<li>Frequency distributions</li>
<li>t-test, chi-square test</li>
<li>Random numbers from Gaussian, Exponential, Poisson distributions</li>
<li>Random sampling/resampling</li>
<li>Bivariate regression, corellation</li>
</ul>

and mathematical algorithms such as the following:
<ul>
<li>Basic Complex Number representation with algebraic operations</li>
<li>Newton's method for finding roots</li>
<li>Binomial coefficients</li>
<li>Exponential growth and decay (set up for financial applications)</li>
<li>Polynomial Interpolation (curve fitting)</li>
<li>Basic Matrix representation with algebraic operations</li>
</ul>
</p>

<p>The proposed package name for the new component is
<code>org.apache.commons.math</code>.</p>


<h3>(3) Required Jakarta-Commons Resources</h3>

<ul>
<li>CVS Repository - New directory <code>math</code> in the
<code>jakarta-commons</code> CVS repository.</li>
<li>Mailing List - Discussions will take place on the general
<em>[email protected]</em> mailing list. To help
list subscribers identify messages of interest, it is suggested that
the message subject of messages about this component be prefixed with
[math].</li>
<li>Bugzilla - New component "math" under the "Commons" product
category, with appropriate version identifiers as needed.</li>
<li>Jyve FAQ - New category "commons-math" (when available).</li>
</ul>


<h3>(4) Initial Committers</h3>

<p>The initial committers on the math component shall be:
<ul>
<li><a href="mailto:[email protected]">Robert Burrell Donkin</a></li>
<li><a href="mailto:[email protected]">Tim O'Brien</a></li>
</ul>
</p>

</body>
</html>
Loading

0 comments on commit 656be0f

Please sign in to comment.