You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2018/05/19 15:13:29 UTC

[01/28] commons-numbers git commit: New module: "commons-numbers-field".

Repository: commons-numbers
Updated Branches:
  refs/heads/master 404189559 -> fff24948c


New module: "commons-numbers-field".


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/67446f45
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/67446f45
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/67446f45

Branch: refs/heads/master
Commit: 67446f45befd65681252b8e3aa6243c46c774984
Parents: 71303aa
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Mon Dec 25 12:12:38 2017 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Mon Dec 25 12:12:38 2017 +0100

----------------------------------------------------------------------
 commons-numbers-field/LICENSE.txt               | 201 +++++++++++++++++++
 commons-numbers-field/NOTICE.txt                |   6 +
 commons-numbers-field/README.md                 |  98 +++++++++
 commons-numbers-field/pom.xml                   |  45 +++++
 .../commons/numbers/field/package-info.java     |  20 ++
 commons-numbers-field/src/site/site.xml         |  35 ++++
 commons-numbers-field/src/site/xdoc/index.xml   |  40 ++++
 7 files changed, 445 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/67446f45/commons-numbers-field/LICENSE.txt
----------------------------------------------------------------------
diff --git a/commons-numbers-field/LICENSE.txt b/commons-numbers-field/LICENSE.txt
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/commons-numbers-field/LICENSE.txt
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/67446f45/commons-numbers-field/NOTICE.txt
----------------------------------------------------------------------
diff --git a/commons-numbers-field/NOTICE.txt b/commons-numbers-field/NOTICE.txt
new file mode 100644
index 0000000..9091baa
--- /dev/null
+++ b/commons-numbers-field/NOTICE.txt
@@ -0,0 +1,6 @@
+Apache Commons Numbers
+Copyright 2001-2017 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/67446f45/commons-numbers-field/README.md
----------------------------------------------------------------------
diff --git a/commons-numbers-field/README.md b/commons-numbers-field/README.md
new file mode 100644
index 0000000..97a7314
--- /dev/null
+++ b/commons-numbers-field/README.md
@@ -0,0 +1,98 @@
+<!---
+ 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.
+-->
+<!---
+ +======================================================================+
+ |****                                                              ****|
+ |****      THIS FILE IS GENERATED BY THE COMMONS BUILD PLUGIN      ****|
+ |****                    DO NOT EDIT DIRECTLY                      ****|
+ |****                                                              ****|
+ +======================================================================+
+ | TEMPLATE FILE: readme-md-template.md                                 |
+ | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
+ +======================================================================+
+ |                                                                      |
+ | 1) Re-generate using: mvn commons:readme-md                          |
+ |                                                                      |
+ | 2) Set the following properties in the component's pom:              |
+ |    - commons.componentid (required, alphabetic, lower case)          |
+ |    - commons.release.version (required)                              |
+ |                                                                      |
+ | 3) Example Properties                                                |
+ |                                                                      |
+ |  <properties>                                                        |
+ |    <commons.componentid>math</commons.componentid>                   |
+ |    <commons.release.version>1.2</commons.release.version>            |
+ |  </properties>                                                       |
+ |                                                                      |
+ +======================================================================+
+--->
+Apache Commons Numbers Field
+===================
+
+Utilities related to the concept of field.
+
+Documentation
+-------------
+
+More information can be found on the [homepage](https://commons.apache.org/proper/commons-numbers).
+The [JavaDoc](https://commons.apache.org/proper/commons-numbers/javadocs/api-release) can be browsed.
+Questions related to the usage of Apache Commons Numbers Field should be posted to the [user mailing list][ml].
+
+Where can I get the latest release?
+-----------------------------------
+You can download source and binaries from our [download page](https://commons.apache.org/proper/commons-numbers/download_numbers.cgi).
+
+Alternatively you can pull it from the central Maven repositories:
+
+```xml
+<dependency>
+  <groupId>org.apache.commons</groupId>
+  <artifactId>commons-numbers-filed</artifactId>
+  <version>1.0</version>
+</dependency>
+```
+
+Contributing
+------------
+
+We accept PRs via github. The [developer mailing list][ml] is the main channel of communication for contributors.
+There are some guidelines which will make applying PRs easier for us:
++ No tabs! Please use spaces for indentation.
++ Respect the code style.
++ Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change.
++ Provide JUnit tests for your changes and make sure your changes don't break any existing tests by running ```mvn clean test```.
+
+If you plan to contribute on a regular basis, please consider filing a [contributor license agreement](https://www.apache.org/licenses/#clas).
+You can learn more about contributing via GitHub in our [contribution guidelines](CONTRIBUTING.md).
+
+License
+-------
+Code is under the [Apache Licence v2](https://www.apache.org/licenses/LICENSE-2.0.txt).
+
+Donations
+---------
+You like Apache Commons Numbers Field? Then [donate back to the ASF](https://www.apache.org/foundation/contributing.html) to support the development.
+
+Additional Resources
+--------------------
+
++ [Apache Commons Homepage](https://commons.apache.org/)
++ [Apache Bugtracker (JIRA)](https://issues.apache.org/jira/)
++ [Apache Commons Twitter Account](https://twitter.com/ApacheCommons)
++ #apachecommons IRC channel on freenode.org
+
+[ml]:https://commons.apache.org/mail-lists.html

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/67446f45/commons-numbers-field/pom.xml
----------------------------------------------------------------------
diff --git a/commons-numbers-field/pom.xml b/commons-numbers-field/pom.xml
new file mode 100644
index 0000000..1dba08e
--- /dev/null
+++ b/commons-numbers-field/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<!--
+   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.
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.commons</groupId>
+    <artifactId>commons-numbers-parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.apache.commons</groupId>
+  <artifactId>commons-numbers-filed</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>Apache Commons Numbers Field</name>
+
+  <description>Utilities related to the concept of field.</description>
+
+  <properties>
+    <!-- This value must reflect the current name of the base package. -->
+    <commons.osgi.symbolicName>org.apache.commons.numbers.field</commons.osgi.symbolicName>
+    <!-- OSGi -->
+    <commons.osgi.export>org.apache.commons.numbers.field</commons.osgi.export>
+    <!-- Workaround to avoid duplicating config files. -->
+    <numbers.parent.dir>${basedir}/..</numbers.parent.dir>
+  </properties>
+
+</project>

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/67446f45/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/package-info.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/package-info.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/package-info.java
new file mode 100644
index 0000000..e923312
--- /dev/null
+++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+/**
+ * Field-related utilities.
+ */
+package org.apache.commons.numbers.field;

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/67446f45/commons-numbers-field/src/site/site.xml
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/site/site.xml b/commons-numbers-field/src/site/site.xml
new file mode 100644
index 0000000..61fd005
--- /dev/null
+++ b/commons-numbers-field/src/site/site.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<project name="Numbers">
+  <bannerRight>
+    <name>Apache Commons Numbers</name>
+    <src>/images/commons_numbers.small.png</src>
+    <href>/index.html</href>
+  </bannerRight>
+
+  <body>
+    <menu name="Numbers Field">
+      <item name="Overview" href="index.html"/>
+      <item name="Latest API docs (development)"
+            href="apidocs/index.html"/>
+      <!--item name="Javadoc (1.0 release)"
+            href="http://commons.apache.org/rng/commons-numbers-field/javadocs/api-1.0/index.html"/-->
+    </menu>
+
+  </body>
+</project>

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/67446f45/commons-numbers-field/src/site/xdoc/index.xml
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/site/xdoc/index.xml b/commons-numbers-field/src/site/xdoc/index.xml
new file mode 100644
index 0000000..95ea0ac
--- /dev/null
+++ b/commons-numbers-field/src/site/xdoc/index.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+
+<!--
+   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.
+  -->
+  
+<document>
+
+  <properties>
+    <title>Commons Numbers Field</title>
+  </properties>
+
+  <body>
+
+    <section name="Apache Commons Numbers: Number types" href="summary">
+      <p>
+        Commons Numbers provides utilities such as complex numbers and fractions.
+      </p>
+
+      <p>
+        The "field" module contains utilities related to the concept of field.
+      </p>
+    </section>
+
+  </body>
+
+</document>


[26/28] commons-numbers git commit: Jacoco trigger file.

Posted by er...@apache.org.
Jacoco trigger file.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/e5755c38
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/e5755c38
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/e5755c38

Branch: refs/heads/master
Commit: e5755c38ae0ee467d04a287c6e729ff6e0931eb2
Parents: 7c8dc8f
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Sat May 19 16:58:26 2018 +0200
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Sat May 19 16:58:26 2018 +0200

----------------------------------------------------------------------
 .../src/site/resources/profile.jacoco              | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/e5755c38/commons-numbers-field/src/site/resources/profile.jacoco
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/site/resources/profile.jacoco b/commons-numbers-field/src/site/resources/profile.jacoco
new file mode 100644
index 0000000..a12755f
--- /dev/null
+++ b/commons-numbers-field/src/site/resources/profile.jacoco
@@ -0,0 +1,17 @@
+# 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.
+# -----------------------------------------------------------------------------
+#
+# Empty file used to automatically trigger JaCoCo profile from commons parent pom


[08/28] commons-numbers git commit: Javadoc.

Posted by er...@apache.org.
Javadoc.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/d2de8370
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/d2de8370
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/d2de8370

Branch: refs/heads/master
Commit: d2de8370e4e78b2a77afb796879626ba0b98be6d
Parents: 554e32e
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Tue Dec 26 21:53:10 2017 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Tue Dec 26 21:53:10 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/commons/numbers/field/Field.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/d2de8370/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java
index 0171811..6ddf085 100644
--- a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java
+++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java
@@ -70,13 +70,13 @@ public interface Field<T> {
     T reciprocal(T a);
 
     /**
-     * @return the field element {@code 1} such that for all {@code a}, 
+     * @return the field element {@code 1} such that for all {@code a},
      * {@code 1 * a == a}.
      */
     T one();
 
     /**
-     * @return the field element {@code 0} such that for all {@code a}, 
+     * @return the field element {@code 0} such that for all {@code a},
      * {@code 0 + a == a}.
      */
     T zero();


[19/28] commons-numbers git commit: Implement "Comparable".

Posted by er...@apache.org.
Implement "Comparable".


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/7b1d76a0
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/7b1d76a0
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/7b1d76a0

Branch: refs/heads/master
Commit: 7b1d76a0f0ad89da418d88da75496428d80ccc4c
Parents: dd45364
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Wed Jan 31 15:12:58 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Wed Jan 31 15:12:58 2018 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/commons/numbers/field/FP64.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/7b1d76a0/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
index 1bb2097..19ab4b1 100644
--- a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
+++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
@@ -24,7 +24,8 @@ import org.apache.commons.numbers.core.Precision;
  * element.
  */
 public class FP64 extends Number
-    implements NativeOperators<FP64> {
+    implements NativeOperators<FP64>,
+               Comparable<FP64> {
     /** Value. */
     private final double value;
 
@@ -124,4 +125,10 @@ public class FP64 extends Number
     public byte byteValue() {
         return (byte) value;
     }
+
+    /** {@inheritDoc} */
+    @Override
+    public int compareTo(FP64 other) {
+        return Double.compare(value, other.value);
+    }
 }


[17/28] commons-numbers git commit: Check method (unit test).

Posted by er...@apache.org.
Check method (unit test).


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/e1ac4ed5
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/e1ac4ed5
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/e1ac4ed5

Branch: refs/heads/master
Commit: e1ac4ed5fa59459869121d287d70b0f97a1e7ff6
Parents: de85ffc
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Wed Jan 31 15:11:28 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Wed Jan 31 15:11:28 2018 +0100

----------------------------------------------------------------------
 .../numbers/field/FieldParametricTest.java      | 28 +++++++++++++-------
 1 file changed, 19 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/e1ac4ed5/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java
index 4fee7cd..faea48c 100644
--- a/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java
+++ b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java
@@ -58,56 +58,66 @@ public class FieldParametricTest {
     public void testAdditionAssociativity() {
         final Object r1 = field.add(field.add(a, b), c);
         final Object r2 = field.add(a, field.add(b, c));
-        Assert.assertTrue(r1.equals(r2));
+        assertEquals(r1, r2);
     }
     @Test
     public void testAdditionCommutativity() {
         final Object r1 = field.add(a, b);
         final Object r2 = field.add(b, a);
-        Assert.assertTrue(r1.equals(r2));
+        assertEquals(r1, r2);
     }
     @Test
     public void testAdditiveIdentity() {
         final Object r1 = field.add(a, field.zero());
         final Object r2 = a;
-        Assert.assertTrue(r1.equals(r2));
+        assertEquals(r1, r2);
     }
     @Test
     public void testAdditiveInverse() {
         final Object r1 = field.add(a, field.negate(a));
         final Object r2 = field.zero();
-        Assert.assertTrue(r1.equals(r2));
+        assertEquals(r1, r2);
     }
 
     @Test
     public void testMultiplicationAssociativity() {
         final Object r1 = field.multiply(field.multiply(a, b), c);
         final Object r2 = field.multiply(a, field.multiply(b, c));
-        Assert.assertTrue(r1.equals(r2));
+        assertEquals(r1, r2);
     }
     @Test
     public void testMultiplicationCommutativity() {
         final Object r1 = field.multiply(a, b);
         final Object r2 = field.multiply(b, a);
-        Assert.assertTrue(r1.equals(r2));
+        assertEquals(r1, r2);
     }
     @Test
     public void testMultiplicativeIdentity() {
         final Object r1 = field.multiply(a, field.one());
         final Object r2 = a;
-        Assert.assertTrue(r1.equals(r2));
+        assertEquals(r1, r2);
     }
     @Test
     public void testMultiplicativeInverse() {
         final Object r1 = field.multiply(a, field.reciprocal(a));
         final Object r2 = field.one();
-        Assert.assertTrue(r1.equals(r2));
+        assertEquals(r1, r2);
     }
 
     @Test
     public void testDistributivity() {
         final Object r1 = field.multiply(a, field.add(b, c));
         final Object r2 = field.add(field.multiply(a, b), field.multiply(a, c));
-        Assert.assertTrue(r1.equals(r2));
+        assertEquals(r1, r2);
+    }
+
+    /**
+     * @param a Instance.
+     * @param b Instance.
+     */
+    private void assertEquals(Object a,
+                              Object b) {
+        Assert.assertTrue(a + " != " + b,
+                          a.equals(b));
     }
 }


[11/28] commons-numbers git commit: Typo.

Posted by er...@apache.org.
Typo.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/dc83272b
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/dc83272b
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/dc83272b

Branch: refs/heads/master
Commit: dc83272b53d93bc8d79870a59a15f204815db2a6
Parents: b58c73e
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Mon Jan 29 02:03:06 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Mon Jan 29 02:03:06 2018 +0100

----------------------------------------------------------------------
 commons-numbers-field/README.md | 2 +-
 commons-numbers-field/pom.xml   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/dc83272b/commons-numbers-field/README.md
----------------------------------------------------------------------
diff --git a/commons-numbers-field/README.md b/commons-numbers-field/README.md
index 97a7314..aef0c98 100644
--- a/commons-numbers-field/README.md
+++ b/commons-numbers-field/README.md
@@ -61,7 +61,7 @@ Alternatively you can pull it from the central Maven repositories:
 ```xml
 <dependency>
   <groupId>org.apache.commons</groupId>
-  <artifactId>commons-numbers-filed</artifactId>
+  <artifactId>commons-numbers-field</artifactId>
   <version>1.0</version>
 </dependency>
 ```

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/dc83272b/commons-numbers-field/pom.xml
----------------------------------------------------------------------
diff --git a/commons-numbers-field/pom.xml b/commons-numbers-field/pom.xml
index cd78011..5295443 100644
--- a/commons-numbers-field/pom.xml
+++ b/commons-numbers-field/pom.xml
@@ -27,7 +27,7 @@
   </parent>
 
   <groupId>org.apache.commons</groupId>
-  <artifactId>commons-numbers-filed</artifactId>
+  <artifactId>commons-numbers-field</artifactId>
   <version>1.0-SNAPSHOT</version>
   <name>Apache Commons Numbers Field</name>
 


[13/28] commons-numbers git commit: Javadoc (unit test).

Posted by er...@apache.org.
Javadoc (unit test).


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/a51b5a04
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/a51b5a04
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/a51b5a04

Branch: refs/heads/master
Commit: a51b5a047044a7fd1dec085c955a75688755f336
Parents: 5ed6280
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Mon Jan 29 02:13:07 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Mon Jan 29 02:13:07 2018 +0100

----------------------------------------------------------------------
 .../src/test/java/org/apache/commons/numbers/field/FieldsList.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/a51b5a04/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java
index e937e0c..df5fa67 100644
--- a/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java
+++ b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java
@@ -24,7 +24,7 @@ import java.util.Collections;
 import org.apache.commons.numbers.fraction.Fraction;
 
 /**
- * List of samplers.
+ * List of fields.
  */
 public class FieldsList {
     /** List of all fields implemented in the library. */


[14/28] commons-numbers git commit: Merge branch 'master' into feature__NUMBERS-51__field

Posted by er...@apache.org.
Merge branch 'master' into feature__NUMBERS-51__field


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/1a71d5a7
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/1a71d5a7
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/1a71d5a7

Branch: refs/heads/master
Commit: 1a71d5a77f4d2b418f46dcfa98fb1adbdc4fb3a7
Parents: a51b5a0 6caed74
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Mon Jan 29 15:23:21 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Mon Jan 29 15:23:21 2018 +0100

----------------------------------------------------------------------
 .../apache/commons/numbers/complex/Complex.java | 30 +++++++++-----------
 .../commons/numbers/complex/ComplexUtils.java   | 24 ++++++++--------
 2 files changed, 25 insertions(+), 29 deletions(-)
----------------------------------------------------------------------



[12/28] commons-numbers git commit: Trailing spaces.

Posted by er...@apache.org.
Trailing spaces.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/5ed62806
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/5ed62806
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/5ed62806

Branch: refs/heads/master
Commit: 5ed62806c78286c006a8fe0919a8b51822542eb7
Parents: dc83272
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Mon Jan 29 02:08:10 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Mon Jan 29 02:08:10 2018 +0100

----------------------------------------------------------------------
 commons-numbers-field/src/site/xdoc/index.xml                      | 1 -
 .../java/org/apache/commons/numbers/field/FieldParametricTest.java | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/5ed62806/commons-numbers-field/src/site/xdoc/index.xml
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/site/xdoc/index.xml b/commons-numbers-field/src/site/xdoc/index.xml
index 95ea0ac..74187e7 100644
--- a/commons-numbers-field/src/site/xdoc/index.xml
+++ b/commons-numbers-field/src/site/xdoc/index.xml
@@ -16,7 +16,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
   -->
-  
 <document>
 
   <properties>

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/5ed62806/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java
index fc123b8..4fee7cd 100644
--- a/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java
+++ b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java
@@ -108,6 +108,6 @@ public class FieldParametricTest {
     public void testDistributivity() {
         final Object r1 = field.multiply(a, field.add(b, c));
         final Object r2 = field.add(field.multiply(a, b), field.multiply(a, c));
-        Assert.assertTrue(r1.equals(r2));        
+        Assert.assertTrue(r1.equals(r2));
     }
 }


[10/28] commons-numbers git commit: Merge branch 'master' into feature__NUMBERS-51__field

Posted by er...@apache.org.
Merge branch 'master' into feature__NUMBERS-51__field


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/b58c73e0
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/b58c73e0
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/b58c73e0

Branch: refs/heads/master
Commit: b58c73e0b5f88a0945ec94b68158eabd4be6b9b3
Parents: 797e402 230b026
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Mon Jan 29 01:57:14 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Mon Jan 29 01:57:14 2018 +0100

----------------------------------------------------------------------
 .gitignore                                      |   1 +
 .../apache/commons/numbers/complex/Complex.java | 821 +++++++++----------
 .../commons/numbers/complex/ComplexUtils.java   | 806 ++++++++++++------
 .../commons/numbers/complex/CStandardTest.java  | 282 +++++++
 .../commons/numbers/complex/ComplexTest.java    | 687 +---------------
 .../apache/commons/numbers/core/Precision.java  | 117 ---
 .../commons/numbers/core/PrecisionTest.java     | 107 ---
 7 files changed, 1274 insertions(+), 1547 deletions(-)
----------------------------------------------------------------------



[04/28] commons-numbers git commit: NUMBERS-51: Field API.

Posted by er...@apache.org.
NUMBERS-51: Field API.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/ec180800
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/ec180800
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/ec180800

Branch: refs/heads/master
Commit: ec180800ccec8c7929de2ab402fdc614670471e3
Parents: c098401
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Tue Dec 26 02:44:26 2017 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Tue Dec 26 02:44:26 2017 +0100

----------------------------------------------------------------------
 commons-numbers-field/pom.xml                   | 14 ++++
 .../commons/numbers/field/AbstractField.java    | 69 ++++++++++++++++
 .../org/apache/commons/numbers/field/Field.java | 83 ++++++++++++++++++++
 pom.xml                                         | 26 +++---
 4 files changed, 180 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/ec180800/commons-numbers-field/pom.xml
----------------------------------------------------------------------
diff --git a/commons-numbers-field/pom.xml b/commons-numbers-field/pom.xml
index 1dba08e..061351d 100644
--- a/commons-numbers-field/pom.xml
+++ b/commons-numbers-field/pom.xml
@@ -42,4 +42,18 @@
     <numbers.parent.dir>${basedir}/..</numbers.parent.dir>
   </properties>
 
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-numbers-core</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-numbers-core</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
 </project>

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/ec180800/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/AbstractField.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/AbstractField.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/AbstractField.java
new file mode 100644
index 0000000..b5a4ad0
--- /dev/null
+++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/AbstractField.java
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+package org.apache.commons.numbers.field;
+
+import org.apache.commons.numbers.core.NativeOperators;
+
+/**
+ * Boiler-plate code for concrete implementations of {@link Field}.
+ *
+ * @param <T> Type of the field elements.
+ */
+public abstract class AbstractField<T extends NativeOperators<T>>
+    implements Field<T> {
+    /** {@inheritDoc} */
+    @Override
+    public T add(T a, T b) {
+        return a.add(b);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public T subtract(T a, T b) {
+        return a.subtract(b);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public T negate(T a) {
+        return a.negate();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public T multiply(int n, T a) {
+        return a.multiply(n);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public T multiply(T a, T b) {
+        return a.multiply(b);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public T divide(T a, T b) {
+        return a.divide(b);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public T reciprocal(T a) {
+        return a.reciprocal();
+    }
+}

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/ec180800/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java
new file mode 100644
index 0000000..0171811
--- /dev/null
+++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+package org.apache.commons.numbers.field;
+
+/**
+ * Interface representing a <a href="http://mathworld.wolfram.com/Field.html">field</a>.
+ *
+ * @param <T> Type of the field elements.
+ */
+public interface Field<T> {
+    /**
+     * @param a Field element.
+     * @param b Field element.
+     * @return {@code a + b}.
+     */
+    T add(T a, T b);
+
+    /**
+     * @param a Field element.
+     * @param b Field element.
+     * @return {@code a - b}.
+     */
+    T subtract(T a, T b);
+
+    /**
+     * @param a Field element.
+     * @return {@code -a}.
+     */
+    T negate(T a);
+
+    /**
+     * @param a Field element.
+     * @param n Number of times {@code a} must be added to itself.
+     * @return {@code n a}.
+     */
+    T multiply(int n, T a);
+
+    /**
+     * @param a Field element.
+     * @param b Field element.
+     * @return {@code a * b}.
+     */
+    T multiply(T a, T b);
+
+    /**
+     * @param a Field element.
+     * @param b Field element.
+     * @return <code>a * b<sup>-1</sup></code>.
+     */
+    T divide(T a, T b);
+
+    /**
+     * @param a Field element.
+     * @return <code>a<sup>-1</sup></code>.
+     */
+    T reciprocal(T a);
+
+    /**
+     * @return the field element {@code 1} such that for all {@code a}, 
+     * {@code 1 * a == a}.
+     */
+    T one();
+
+    /**
+     * @return the field element {@code 0} such that for all {@code a}, 
+     * {@code 0 + a == a}.
+     */
+    T zero();
+}

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/ec180800/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ba4dc6a..aceccb0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,18 +74,19 @@
 
   <dependencyManagement>
     <dependencies>
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-numbers-core</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-numbers-core</artifactId>
-      <version>${project.version}</version>
-      <type>test-jar</type>
-      <scope>test</scope>
-    </dependency>
+      <dependency>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-numbers-core</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-numbers-core</artifactId>
+        <version>${project.version}</version>
+        <type>test-jar</type>
+        <scope>test</scope>
+      </dependency>
     </dependencies>
   </dependencyManagement>
 
@@ -602,6 +603,7 @@
     <module>commons-numbers-gamma</module>
     <module>commons-numbers-combinatorics</module>
     <module>commons-numbers-arrays</module>
+    <module>commons-numbers-field</module>
   </modules>
 
 </project>


[06/28] commons-numbers git commit: NUMBERS-51: Unit tests for "Field".

Posted by er...@apache.org.
NUMBERS-51: Unit tests for "Field".


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/b15facf8
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/b15facf8
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/b15facf8

Branch: refs/heads/master
Commit: b15facf8a0f3fbc8c8e661f1e22ba25a3834563c
Parents: 15b7b2f
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Tue Dec 26 21:35:44 2017 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Tue Dec 26 21:35:44 2017 +0100

----------------------------------------------------------------------
 .../numbers/field/FieldParametricTest.java      | 113 +++++++++++++++++++
 .../commons/numbers/field/FieldTestData.java    |  60 ++++++++++
 .../commons/numbers/field/FieldsList.java       |  70 ++++++++++++
 3 files changed, 243 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/b15facf8/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java
new file mode 100644
index 0000000..fc123b8
--- /dev/null
+++ b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldParametricTest.java
@@ -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.
+ */
+package org.apache.commons.numbers.field;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.ArrayList;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Tests for fields.
+ */
+@RunWith(value=Parameterized.class)
+public class FieldParametricTest {
+    /** Field under test. */
+    private final Field field;
+    private final Object a;
+    private final Object b;
+    private final Object c;
+
+    /**
+     * Initializes data instance.
+     *
+     * @param data Field data to be tested.
+     */
+    public FieldParametricTest(FieldTestData data) {
+        this.field = data.getField();
+        this.a = data.getA();
+        this.b = data.getB();
+        this.c = data.getC();
+    }
+
+    @Parameters(name = "{index}: data={0}")
+    public static Iterable<FieldTestData[]> getList() {
+        return FieldsList.list();
+    }
+
+    @Test
+    public void testAdditionAssociativity() {
+        final Object r1 = field.add(field.add(a, b), c);
+        final Object r2 = field.add(a, field.add(b, c));
+        Assert.assertTrue(r1.equals(r2));
+    }
+    @Test
+    public void testAdditionCommutativity() {
+        final Object r1 = field.add(a, b);
+        final Object r2 = field.add(b, a);
+        Assert.assertTrue(r1.equals(r2));
+    }
+    @Test
+    public void testAdditiveIdentity() {
+        final Object r1 = field.add(a, field.zero());
+        final Object r2 = a;
+        Assert.assertTrue(r1.equals(r2));
+    }
+    @Test
+    public void testAdditiveInverse() {
+        final Object r1 = field.add(a, field.negate(a));
+        final Object r2 = field.zero();
+        Assert.assertTrue(r1.equals(r2));
+    }
+
+    @Test
+    public void testMultiplicationAssociativity() {
+        final Object r1 = field.multiply(field.multiply(a, b), c);
+        final Object r2 = field.multiply(a, field.multiply(b, c));
+        Assert.assertTrue(r1.equals(r2));
+    }
+    @Test
+    public void testMultiplicationCommutativity() {
+        final Object r1 = field.multiply(a, b);
+        final Object r2 = field.multiply(b, a);
+        Assert.assertTrue(r1.equals(r2));
+    }
+    @Test
+    public void testMultiplicativeIdentity() {
+        final Object r1 = field.multiply(a, field.one());
+        final Object r2 = a;
+        Assert.assertTrue(r1.equals(r2));
+    }
+    @Test
+    public void testMultiplicativeInverse() {
+        final Object r1 = field.multiply(a, field.reciprocal(a));
+        final Object r2 = field.one();
+        Assert.assertTrue(r1.equals(r2));
+    }
+
+    @Test
+    public void testDistributivity() {
+        final Object r1 = field.multiply(a, field.add(b, c));
+        final Object r2 = field.add(field.multiply(a, b), field.multiply(a, c));
+        Assert.assertTrue(r1.equals(r2));        
+    }
+}

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/b15facf8/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldTestData.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldTestData.java b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldTestData.java
new file mode 100644
index 0000000..82dc1a0
--- /dev/null
+++ b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldTestData.java
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+package org.apache.commons.numbers.field;
+
+import java.util.Arrays;
+
+/**
+ * Data store for {@link FieldParametricTest}.
+ */
+class FieldTestData {
+    private final Field<?> field;
+    private final Object a;
+    private final Object b;
+    private final Object c;
+
+    public FieldTestData(Field<?> field,
+                         Object a,
+                         Object b,
+                         Object c) {
+        this.field = field;
+        this.a = a;
+        this.b = b;
+        this.c = c;
+    }
+
+    public Field<?> getField() {
+        return field;
+    }
+
+    public Object getA() {
+        return a;
+    }
+
+    public Object getB() {
+        return b;
+    }
+
+    public Object getC() {
+        return c;
+    }
+
+    @Override
+    public String toString() {
+        return field.toString() + " [a=" + a + ", b=" + b + ", c=" + c + "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/b15facf8/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java
new file mode 100644
index 0000000..e937e0c
--- /dev/null
+++ b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+package org.apache.commons.numbers.field;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+
+import org.apache.commons.numbers.fraction.Fraction;
+
+/**
+ * List of samplers.
+ */
+public class FieldsList {
+    /** List of all fields implemented in the library. */
+    private static final List<FieldTestData[]> LIST =
+        new ArrayList<FieldTestData[]>();
+
+    static {
+        try {
+            // List of fields to test.
+            add(new FractionField(),
+                new Fraction(13, 4),
+                new Fraction(5, 29),
+                new Fraction(-279, 11));
+
+        } catch (Exception e) {
+            System.err.println("Unexpected exception while creating the list of fields: " + e);
+            e.printStackTrace(System.err);
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * @param field Field.
+     * @param a Field element.
+     * @param b Field element.
+     */
+    private static <T> void add(Field<T> field,
+                                T a,
+                                T b,
+                                T c) {
+        LIST.add(new FieldTestData[] { new FieldTestData(field, a, b, c) });
+    }
+
+    /**
+     * Subclasses that are "parametric" tests can forward the call to
+     * the "@Parameters"-annotated method to this method.
+     *
+     * @return the list of all fields.
+     */
+    public static Iterable<FieldTestData[]> list() {
+        return Collections.unmodifiableList(LIST);
+    }
+}


[22/28] commons-numbers git commit: Method for computing integer powers.

Posted by er...@apache.org.
Method for computing integer powers.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/4336ff73
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/4336ff73
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/4336ff73

Branch: refs/heads/master
Commit: 4336ff7399136cb41516dfe3e5ddacba7cbac6aa
Parents: 6ae5bc3
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Mon Feb 5 01:59:54 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Mon Feb 5 01:59:54 2018 +0100

----------------------------------------------------------------------
 .../org/apache/commons/numbers/core/NativeOperators.java     | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/4336ff73/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java
----------------------------------------------------------------------
diff --git a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java
index 11f3001..483dba2 100644
--- a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java
+++ b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java
@@ -48,4 +48,12 @@ public interface NativeOperators<T>
      * @return {@code n * this}.
      */
     T multiply(int n);
+
+    /**
+     * Repeated multiplication.
+     *
+     * @param n Number of times to multiply {@code this} with itself.
+     * @return {@code this^n}.
+     */
+    T pow(int n);
 }


[21/28] commons-numbers git commit: Method for retrieving the identity element.

Posted by er...@apache.org.
Method for retrieving the identity element.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/6ae5bc3a
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/6ae5bc3a
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/6ae5bc3a

Branch: refs/heads/master
Commit: 6ae5bc3a4bbd4e5075840cf4ee735424644e7d8d
Parents: d2ff5bf
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Mon Feb 5 01:57:13 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Mon Feb 5 01:57:13 2018 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/commons/numbers/core/Addition.java  | 8 ++++++++
 .../java/org/apache/commons/numbers/core/Multiplication.java | 8 ++++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/6ae5bc3a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java
----------------------------------------------------------------------
diff --git a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java
index 90ba67c..1e31979 100644
--- a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java
+++ b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java
@@ -31,6 +31,14 @@ public interface Addition<T> {
     T add(T a);
 
     /**
+     * Identity element.
+     *
+     * @return the field element such that for all {@code a},
+     * {@code zero().add(a).equals(a)} is {@code true}.
+     */
+    T zero();
+
+    /**
      * Additive inverse.
      *
      * @return {@code -this}.

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/6ae5bc3a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java
----------------------------------------------------------------------
diff --git a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java
index 36fb6b0..e94ed86 100644
--- a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java
+++ b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java
@@ -31,6 +31,14 @@ public interface Multiplication<T> {
     T multiply(T a);
 
     /**
+     * Identity element.
+     *
+     * @return the field element such that for all {@code a},
+     * {@code one().multiply(a).equals(a)} is {@code true}.
+     */
+    T one();
+
+    /**
      * Multiplicative inverse.
      *
      * @return <code>this<sup>-1</sup></code>.


[07/28] commons-numbers git commit: Javadoc.

Posted by er...@apache.org.
Javadoc.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/554e32e3
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/554e32e3
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/554e32e3

Branch: refs/heads/master
Commit: 554e32e3cb40a35bbd2ecae94dcbeefa9b927110
Parents: b15facf
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Tue Dec 26 21:36:19 2017 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Tue Dec 26 21:36:19 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/commons/numbers/core/Addition.java    | 2 +-
 .../main/java/org/apache/commons/numbers/core/Multiplication.java  | 2 +-
 .../main/java/org/apache/commons/numbers/core/NativeOperators.java | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/554e32e3/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java
----------------------------------------------------------------------
diff --git a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java
index dff3887..90ba67c 100644
--- a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java
+++ b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java
@@ -19,7 +19,7 @@ package org.apache.commons.numbers.core;
 /**
  * Addition.
  *
- * <T> Type of elements.
+ * @param <T> Type of elements.
  */
 public interface Addition<T> {
     /**

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/554e32e3/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java
----------------------------------------------------------------------
diff --git a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java
index 7b1df66..36fb6b0 100644
--- a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java
+++ b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java
@@ -19,7 +19,7 @@ package org.apache.commons.numbers.core;
 /**
  * Multiplication.
  *
- * <T> Type of elements.
+ * @param <T> Type of elements.
  */
 public interface Multiplication<T> {
     /**

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/554e32e3/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java
----------------------------------------------------------------------
diff --git a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java
index fec6cff..11f3001 100644
--- a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java
+++ b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java
@@ -20,7 +20,7 @@ package org.apache.commons.numbers.core;
  * Operators that can be implemented in a more performant way
  * using the language constructs.
  *
- * <T> Type of elements.
+ * @param <T> Type of elements.
  */
 public interface NativeOperators<T>
     extends Addition<T>,


[18/28] commons-numbers git commit: Add "FP64" test case (unit test).

Posted by er...@apache.org.
Add "FP64" test case (unit test).


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/dd45364d
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/dd45364d
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/dd45364d

Branch: refs/heads/master
Commit: dd45364d7c1a37e99c1a788f3b493766fddf3065
Parents: e1ac4ed
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Wed Jan 31 15:12:36 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Wed Jan 31 15:12:36 2018 +0100

----------------------------------------------------------------------
 .../test/java/org/apache/commons/numbers/field/FieldsList.java   | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/dd45364d/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java
index df5fa67..0dc52cc 100644
--- a/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java
+++ b/commons-numbers-field/src/test/java/org/apache/commons/numbers/field/FieldsList.java
@@ -38,6 +38,10 @@ public class FieldsList {
                 new Fraction(13, 4),
                 new Fraction(5, 29),
                 new Fraction(-279, 11));
+            add(new FP64Field(),
+                new FP64(23.45678901),
+                new FP64(-543.2109876),
+                new FP64(-234.5678901));
 
         } catch (Exception e) {
             System.err.println("Unexpected exception while creating the list of fields: " + e);


[23/28] commons-numbers git commit: Merge branch 'feature__NUMBERS-51__field' into feature__NUMBERS-51

Posted by er...@apache.org.
Merge branch 'feature__NUMBERS-51__field' into feature__NUMBERS-51


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/0dc4b0b6
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/0dc4b0b6
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/0dc4b0b6

Branch: refs/heads/master
Commit: 0dc4b0b6239329263a0c51e7662adcb1e00fb1db
Parents: 4041895 4336ff7
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Sat May 19 16:35:16 2018 +0200
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Sat May 19 16:35:16 2018 +0200

----------------------------------------------------------------------
 .../apache/commons/numbers/core/Addition.java   |  47 +++++
 .../commons/numbers/core/Multiplication.java    |  47 +++++
 .../commons/numbers/core/NativeOperators.java   |  59 ++++++
 commons-numbers-field/LICENSE.txt               | 201 +++++++++++++++++++
 commons-numbers-field/NOTICE.txt                |   6 +
 commons-numbers-field/README.md                 |  98 +++++++++
 commons-numbers-field/pom.xml                   |  63 ++++++
 .../commons/numbers/field/AbstractField.java    |  69 +++++++
 .../org/apache/commons/numbers/field/FP64.java  | 134 +++++++++++++
 .../apache/commons/numbers/field/FP64Field.java |  39 ++++
 .../org/apache/commons/numbers/field/Field.java |  83 ++++++++
 .../commons/numbers/field/FractionField.java    |  36 ++++
 .../commons/numbers/field/package-info.java     |  20 ++
 commons-numbers-field/src/site/site.xml         |  35 ++++
 commons-numbers-field/src/site/xdoc/index.xml   |  39 ++++
 .../numbers/field/FieldParametricTest.java      | 123 ++++++++++++
 .../commons/numbers/field/FieldTestData.java    |  60 ++++++
 .../commons/numbers/field/FieldsList.java       |  74 +++++++
 .../commons/numbers/fraction/Fraction.java      |   7 +-
 pom.xml                                         |  40 ++--
 20 files changed, 1260 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/0dc4b0b6/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/0dc4b0b6/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index 433ee42,fe188c1..e39d755
--- a/pom.xml
+++ b/pom.xml
@@@ -74,23 -74,24 +74,28 @@@
  
    <dependencyManagement>
      <dependencies>
-     <dependency>
-       <groupId>org.apache.commons</groupId>
-       <artifactId>commons-numbers-core</artifactId>
-       <version>${project.version}</version>
-     </dependency>
-     <dependency>
-       <groupId>org.apache.commons</groupId>
-       <artifactId>commons-numbers-complex</artifactId>
-       <version>${project.version}</version>
-     </dependency>
-     <dependency>
-       <groupId>org.apache.commons</groupId>
-       <artifactId>commons-numbers-core</artifactId>
-       <version>${project.version}</version>
-       <type>test-jar</type>
-       <scope>test</scope>
-     </dependency>
+       <dependency>
+         <groupId>org.apache.commons</groupId>
+         <artifactId>commons-numbers-core</artifactId>
+         <version>${project.version}</version>
+       </dependency>
+       <dependency>
+         <groupId>org.apache.commons</groupId>
++        <artifactId>commons-numbers-complex</artifactId>
++        <version>${project.version}</version>
++      </dependency>
++      <dependency>
++        <groupId>org.apache.commons</groupId>
+         <artifactId>commons-numbers-fraction</artifactId>
+         <version>${project.version}</version>
+       </dependency>
 -
+       <dependency>
+         <groupId>org.apache.commons</groupId>
+         <artifactId>commons-numbers-core</artifactId>
+         <version>${project.version}</version>
+         <type>test-jar</type>
+         <scope>test</scope>
+       </dependency>
      </dependencies>
    </dependencyManagement>
  


[16/28] commons-numbers git commit: NUMBERS-51: Class "FP64" ("double" with "Field" API).

Posted by er...@apache.org.
NUMBERS-51: Class "FP64" ("double" with "Field" API).


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/de85ffc2
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/de85ffc2
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/de85ffc2

Branch: refs/heads/master
Commit: de85ffc2843e43e0c0e426151a995d0c7dc77673
Parents: 6d14b16
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Tue Jan 30 16:49:41 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Tue Jan 30 16:49:41 2018 +0100

----------------------------------------------------------------------
 .../org/apache/commons/numbers/field/FP64.java  | 127 +++++++++++++++++++
 .../apache/commons/numbers/field/FP64Field.java |  39 ++++++
 2 files changed, 166 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/de85ffc2/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
new file mode 100644
index 0000000..1bb2097
--- /dev/null
+++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
@@ -0,0 +1,127 @@
+/*
+ * 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.
+ */
+package org.apache.commons.numbers.field;
+
+import org.apache.commons.numbers.core.NativeOperators;
+import org.apache.commons.numbers.core.Precision;
+
+/**
+ * Wraps a {@code double} value in order to be used as a field
+ * element.
+ */
+public class FP64 extends Number
+    implements NativeOperators<FP64> {
+    /** Value. */
+    private final double value;
+
+    /**
+     * @param Value value.
+     */
+    public FP64(double value) {
+        this.value = value;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public FP64 add(FP64 a) {
+        return new FP64(value + a.value);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public FP64 negate() {
+        return new FP64(-value);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public FP64 multiply(FP64 a) {
+        return new FP64(value * a.value);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public FP64 reciprocal() {
+        return new FP64(1 / value);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public FP64 subtract(FP64 a) {
+        return new FP64(value - a.value);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public FP64 divide(FP64 a) {
+        return new FP64(value / a.value);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public FP64 multiply(int n) {
+        return new FP64(value * n);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public boolean equals(Object other) {
+        if (other instanceof FP64) {
+            final FP64 o = (FP64) other;
+            return Precision.equals(value, o.value, 1);
+        }
+        return false;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public int hashCode() {
+        return Double.valueOf(value).hashCode();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String toString() {
+        return Double.toString(value);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public double doubleValue() {
+        return value;
+    }
+    /** {@inheritDoc} */
+    @Override
+    public float floatValue() {
+        return (float) value;
+    }
+    /** {@inheritDoc} */
+    @Override
+    public int intValue() {
+        return (int) value;
+    }
+    /** {@inheritDoc} */
+    @Override
+    public long longValue() {
+        return (long) value;
+    }
+    /** {@inheritDoc} */
+    @Override
+    public byte byteValue() {
+        return (byte) value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/de85ffc2/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64Field.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64Field.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64Field.java
new file mode 100644
index 0000000..f63665c
--- /dev/null
+++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64Field.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+package org.apache.commons.numbers.field;
+
+/**
+ * {@link Double} field.
+ */
+public class FP64Field extends AbstractField<FP64> {
+    /** 0d */
+    private static final FP64 ZERO = new FP64(Double.valueOf(0));
+    /** 1d */
+    private static final FP64 ONE = new FP64(Double.valueOf(1));
+
+    /** {@inheritDoc} */
+    @Override
+    public FP64 one() {
+        return ONE;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public FP64 zero() {
+        return ZERO;
+    }
+}


[05/28] commons-numbers git commit: NUMBERS-51: "Fraction" field.

Posted by er...@apache.org.
NUMBERS-51: "Fraction" field.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/15b7b2f1
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/15b7b2f1
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/15b7b2f1

Branch: refs/heads/master
Commit: 15b7b2f10c20c2d95396643ab46d4052e874e802
Parents: ec18080
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Tue Dec 26 02:45:28 2017 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Tue Dec 26 02:45:28 2017 +0100

----------------------------------------------------------------------
 commons-numbers-field/pom.xml                   |  4 +++
 .../commons/numbers/field/FractionField.java    | 34 ++++++++++++++++++++
 pom.xml                                         |  5 +++
 3 files changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/15b7b2f1/commons-numbers-field/pom.xml
----------------------------------------------------------------------
diff --git a/commons-numbers-field/pom.xml b/commons-numbers-field/pom.xml
index 061351d..cd78011 100644
--- a/commons-numbers-field/pom.xml
+++ b/commons-numbers-field/pom.xml
@@ -47,6 +47,10 @@
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-numbers-core</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-numbers-fraction</artifactId>
+    </dependency>
 
     <dependency>
       <groupId>org.apache.commons</groupId>

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/15b7b2f1/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FractionField.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FractionField.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FractionField.java
new file mode 100644
index 0000000..b383e30
--- /dev/null
+++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FractionField.java
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+package org.apache.commons.numbers.field;
+
+import org.apache.commons.numbers.fraction.Fraction;
+
+/**
+ * {@link Fraction} field.
+ */
+public class FractionField extends AbstractField<Fraction> {
+    /** {@inheritDoc} */
+    public Fraction one() {
+        return Fraction.ONE;
+    }
+
+    /** {@inheritDoc} */
+    public Fraction zero() {
+        return Fraction.ZERO;
+    }
+}

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/15b7b2f1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index aceccb0..06f76f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -79,6 +79,11 @@
         <artifactId>commons-numbers-core</artifactId>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-numbers-fraction</artifactId>
+        <version>${project.version}</version>
+      </dependency>
 
       <dependency>
         <groupId>org.apache.commons</groupId>


[25/28] commons-numbers git commit: Add methods.

Posted by er...@apache.org.
Add methods.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/7c8dc8ff
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/7c8dc8ff
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/7c8dc8ff

Branch: refs/heads/master
Commit: 7c8dc8ff351c76dd88231387c6db069cb4b9d000
Parents: 27115fd
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Sat May 19 16:57:41 2018 +0200
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Sat May 19 16:57:41 2018 +0200

----------------------------------------------------------------------
 .../org/apache/commons/numbers/field/FP64.java  | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/7c8dc8ff/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
index 19ab4b1..e482b64 100644
--- a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
+++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
@@ -26,6 +26,10 @@ import org.apache.commons.numbers.core.Precision;
 public class FP64 extends Number
     implements NativeOperators<FP64>,
                Comparable<FP64> {
+    /** Additive neutral. */
+    private static final FP64 ZERO = new FP64(0);
+    /** Multiplicative neutral. */
+    private static final FP64 ONE = new FP64(1);
     /** Value. */
     private final double value;
 
@@ -80,6 +84,16 @@ public class FP64 extends Number
 
     /** {@inheritDoc} */
     @Override
+    public FP64 pow(int n) {
+        if (n == 0) {
+            return ONE;
+        }
+
+        return new FP64(Math.pow(value, n));
+    }
+
+    /** {@inheritDoc} */
+    @Override
     public boolean equals(Object other) {
         if (other instanceof FP64) {
             final FP64 o = (FP64) other;
@@ -131,4 +145,16 @@ public class FP64 extends Number
     public int compareTo(FP64 other) {
         return Double.compare(value, other.value);
     }
+
+    /** {@inheritDoc} */
+    @Override
+    public FP64 zero() {
+        return ZERO;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public FP64 one() {
+        return ONE;
+    }
 }


[24/28] commons-numbers git commit: Trailing spaces.

Posted by er...@apache.org.
Trailing spaces.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/27115fd0
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/27115fd0
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/27115fd0

Branch: refs/heads/master
Commit: 27115fd062937cfa166e5d58fb0a21198ef38f0b
Parents: 0dc4b0b
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Sat May 19 16:57:12 2018 +0200
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Sat May 19 16:57:12 2018 +0200

----------------------------------------------------------------------
 .../org/apache/commons/numbers/fraction/Fraction.java   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/27115fd0/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
----------------------------------------------------------------------
diff --git a/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java b/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
index 9ba0216..308f930 100644
--- a/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
+++ b/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
@@ -398,6 +398,18 @@ public class Fraction
         return (long)doubleValue();
     }
 
+    /** {@inheritDoc} */
+    @Override
+    public Fraction zero() {
+        return ZERO;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public Fraction one() {
+        return ONE;
+    }
+
     /**
      * Return the additive inverse of this fraction.
      * @return the negation of this fraction.


[15/28] commons-numbers git commit: Merge branch 'master' into feature__NUMBERS-51__field

Posted by er...@apache.org.
Merge branch 'master' into feature__NUMBERS-51__field


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/6d14b163
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/6d14b163
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/6d14b163

Branch: refs/heads/master
Commit: 6d14b1638b117c65b90d42d380104470e017c262
Parents: 1a71d5a d011f8b
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Tue Jan 30 16:48:25 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Tue Jan 30 16:48:25 2018 +0100

----------------------------------------------------------------------
 .../apache/commons/numbers/complex/Complex.java | 40 +++++++++++---------
 .../commons/numbers/complex/ComplexUtils.java   |  4 +-
 .../commons/numbers/core/ArithmeticUtils.java   | 14 ++++---
 .../numbers/fraction/FractionException.java     |  1 +
 .../apache/commons/numbers/gamma/Digamma.java   |  4 +-
 .../apache/commons/numbers/gamma/LogBeta.java   |  2 +-
 .../apache/commons/numbers/gamma/LogGamma.java  |  1 +
 .../commons/numbers/gamma/RegularizedGamma.java | 20 ++++++++--
 8 files changed, 54 insertions(+), 32 deletions(-)
----------------------------------------------------------------------



[27/28] commons-numbers git commit: Javadoc.

Posted by er...@apache.org.
Javadoc.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/3b3c9b33
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/3b3c9b33
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/3b3c9b33

Branch: refs/heads/master
Commit: 3b3c9b33a2e42223405053a624e09ef06e6a724f
Parents: e5755c3
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Sat May 19 17:08:36 2018 +0200
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Sat May 19 17:08:36 2018 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/commons/numbers/field/FP64.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/3b3c9b33/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
index e482b64..9bac221 100644
--- a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
+++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FP64.java
@@ -34,7 +34,7 @@ public class FP64 extends Number
     private final double value;
 
     /**
-     * @param Value value.
+     * @param value Value.
      */
     public FP64(double value) {
         this.value = value;


[09/28] commons-numbers git commit: Add "@Override" annotations.

Posted by er...@apache.org.
Add "@Override" annotations.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/797e4025
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/797e4025
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/797e4025

Branch: refs/heads/master
Commit: 797e402509cab481fea3b8bc4562e0dc4860ae0d
Parents: d2de837
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Tue Dec 26 21:53:38 2017 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Tue Dec 26 21:53:38 2017 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/commons/numbers/field/FractionField.java  | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/797e4025/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FractionField.java
----------------------------------------------------------------------
diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FractionField.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FractionField.java
index b383e30..941225d 100644
--- a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FractionField.java
+++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/FractionField.java
@@ -23,11 +23,13 @@ import org.apache.commons.numbers.fraction.Fraction;
  */
 public class FractionField extends AbstractField<Fraction> {
     /** {@inheritDoc} */
+    @Override
     public Fraction one() {
         return Fraction.ONE;
     }
 
     /** {@inheritDoc} */
+    @Override
     public Fraction zero() {
         return Fraction.ZERO;
     }


[28/28] commons-numbers git commit: Merge branch 'feature__NUMBERS-51'

Posted by er...@apache.org.
Merge branch 'feature__NUMBERS-51'


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/fff24948
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/fff24948
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/fff24948

Branch: refs/heads/master
Commit: fff24948c7f89fd9f00e721c0c5e06cbe75dc92b
Parents: 4041895 3b3c9b3
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Sat May 19 17:10:00 2018 +0200
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Sat May 19 17:10:00 2018 +0200

----------------------------------------------------------------------
 .../apache/commons/numbers/core/Addition.java   |  47 +++++
 .../commons/numbers/core/Multiplication.java    |  47 +++++
 .../commons/numbers/core/NativeOperators.java   |  59 ++++++
 commons-numbers-field/LICENSE.txt               | 201 +++++++++++++++++++
 commons-numbers-field/NOTICE.txt                |   6 +
 commons-numbers-field/README.md                 |  98 +++++++++
 commons-numbers-field/pom.xml                   |  63 ++++++
 .../commons/numbers/field/AbstractField.java    |  69 +++++++
 .../org/apache/commons/numbers/field/FP64.java  | 160 +++++++++++++++
 .../apache/commons/numbers/field/FP64Field.java |  39 ++++
 .../org/apache/commons/numbers/field/Field.java |  83 ++++++++
 .../commons/numbers/field/FractionField.java    |  36 ++++
 .../commons/numbers/field/package-info.java     |  20 ++
 .../src/site/resources/profile.jacoco           |  17 ++
 commons-numbers-field/src/site/site.xml         |  35 ++++
 commons-numbers-field/src/site/xdoc/index.xml   |  39 ++++
 .../numbers/field/FieldParametricTest.java      | 123 ++++++++++++
 .../commons/numbers/field/FieldTestData.java    |  60 ++++++
 .../commons/numbers/field/FieldsList.java       |  74 +++++++
 .../commons/numbers/fraction/Fraction.java      |  19 +-
 pom.xml                                         |  40 ++--
 21 files changed, 1315 insertions(+), 20 deletions(-)
----------------------------------------------------------------------



[20/28] commons-numbers git commit: Merge branch 'master' into feature__NUMBERS-51__field

Posted by er...@apache.org.
Merge branch 'master' into feature__NUMBERS-51__field


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/d2ff5bfb
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/d2ff5bfb
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/d2ff5bfb

Branch: refs/heads/master
Commit: d2ff5bfb36620400c4c5bf02d03396eea9acca54
Parents: 7b1d76a 810f26c
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Fri Feb 2 14:27:23 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Fri Feb 2 14:27:23 2018 +0100

----------------------------------------------------------------------
 .../src/site/resources/profile.jacoco           |  17 +
 .../src/site/resources/profile.jacoco           |  17 +
 .../src/site/resources/profile.jacoco           |  17 +
 .../apache/commons/numbers/complex/Complex.java | 415 +++++++++++--------
 .../src/site/resources/profile.jacoco           |  17 +
 .../src/site/resources/profile.jacoco           |  17 +
 .../src/site/resources/profile.jacoco           |  17 +
 .../src/site/resources/profile.jacoco           |  17 +
 .../src/site/resources/profile.jacoco           |  17 +
 .../src/site/resources/profile.jacoco           |  17 +
 pom.xml                                         |   2 +-
 src/site/site.xml                               |   6 +-
 12 files changed, 390 insertions(+), 186 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/d2ff5bfb/pom.xml
----------------------------------------------------------------------


[02/28] commons-numbers git commit: NUMBERS-51: API for basic operations.

Posted by er...@apache.org.
NUMBERS-51: API for basic operations.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/518b58ab
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/518b58ab
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/518b58ab

Branch: refs/heads/master
Commit: 518b58abf5f4716c5459fc52c7f52d17ef3d71fd
Parents: 67446f4
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Tue Dec 26 02:36:11 2017 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Tue Dec 26 02:36:11 2017 +0100

----------------------------------------------------------------------
 .../apache/commons/numbers/core/Addition.java   | 39 +++++++++++++++
 .../commons/numbers/core/Multiplication.java    | 39 +++++++++++++++
 .../commons/numbers/core/NativeOperators.java   | 51 ++++++++++++++++++++
 3 files changed, 129 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/518b58ab/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java
----------------------------------------------------------------------
diff --git a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java
new file mode 100644
index 0000000..dff3887
--- /dev/null
+++ b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Addition.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+package org.apache.commons.numbers.core;
+
+/**
+ * Addition.
+ *
+ * <T> Type of elements.
+ */
+public interface Addition<T> {
+    /**
+     * Binary addition.
+     *
+     * @param a Element.
+     * @return {@code this + a}.
+     */
+    T add(T a);
+
+    /**
+     * Additive inverse.
+     *
+     * @return {@code -this}.
+     */
+    T negate();
+}

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/518b58ab/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java
----------------------------------------------------------------------
diff --git a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java
new file mode 100644
index 0000000..7b1df66
--- /dev/null
+++ b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+package org.apache.commons.numbers.core;
+
+/**
+ * Multiplication.
+ *
+ * <T> Type of elements.
+ */
+public interface Multiplication<T> {
+    /**
+     * Binary multiplication.
+     *
+     * @param a Element.
+     * @return {@code this * a}.
+     */
+    T multiply(T a);
+
+    /**
+     * Multiplicative inverse.
+     *
+     * @return <code>this<sup>-1</sup></code>.
+     */
+    T reciprocal();
+}

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/518b58ab/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java
----------------------------------------------------------------------
diff --git a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java
new file mode 100644
index 0000000..fec6cff
--- /dev/null
+++ b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/NativeOperators.java
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+package org.apache.commons.numbers.core;
+
+/**
+ * Operators that can be implemented in a more performant way
+ * using the language constructs.
+ *
+ * <T> Type of elements.
+ */
+public interface NativeOperators<T>
+    extends Addition<T>,
+            Multiplication<T> {
+    /**
+     * Binary subtraction.
+     *
+     * @param a Element.
+     * @return {@code this - a}.
+     */
+    T subtract(T a);
+
+    /**
+     * Binary division.
+     *
+     * @param a Element.
+     * @return {@code this / a}.
+     */
+    T divide(T a);
+
+    /**
+     * Repeated addition.
+     *
+     * @param n Number of times to add {@code this} to itself.
+     * @return {@code n * this}.
+     */
+    T multiply(int n);
+}


[03/28] commons-numbers git commit: NUMBERS-51: "Fraction" implements basic operations.

Posted by er...@apache.org.
NUMBERS-51: "Fraction" implements basic operations.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/c098401c
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/c098401c
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/c098401c

Branch: refs/heads/master
Commit: c098401cc0d8e2d8293d98a94efc46c2f374b623
Parents: 518b58a
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Tue Dec 26 02:38:55 2017 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Tue Dec 26 02:38:55 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/commons/numbers/fraction/Fraction.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/c098401c/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
----------------------------------------------------------------------
diff --git a/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java b/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
index 673d0d5..5f0ece0 100644
--- a/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
+++ b/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
@@ -19,15 +19,16 @@ package org.apache.commons.numbers.fraction;
 import java.io.Serializable;
 import java.math.BigInteger;
 import org.apache.commons.numbers.core.ArithmeticUtils;
+import org.apache.commons.numbers.core.NativeOperators;
 
 /**
  * Representation of a rational number.
- *
- * implements Serializable since 2.0
  */
 public class Fraction
     extends Number
-    implements Comparable<Fraction>, Serializable {
+    implements Comparable<Fraction>,
+               Serializable,
+               NativeOperators<Fraction> {
 
     /** A fraction representing "2 / 1". */
     public static final Fraction TWO = new Fraction(2, 1);