Repository: commons-math
Updated Branches:
  refs/heads/master c5512b7d6 -> d9b0be1c9


Method name changed from "ofCartesian" to "ofReal".

See issue NUMBERS-53 on JIRA.


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

Branch: refs/heads/master
Commit: d9b0be1c9a8e9c0e34220d38276c5b449a06be54
Parents: c5512b7
Author: Gilles <[email protected]>
Authored: Sat Mar 31 02:38:47 2018 +0200
Committer: Gilles <[email protected]>
Committed: Sat Mar 31 02:38:47 2018 +0200

----------------------------------------------------------------------
 .../apache/commons/math4/complex/ComplexUtils.java    |  8 ++++----
 .../commons/math4/complex/ComplexUtilsTest.java       | 14 +++++++-------
 .../math4/transform/FastFourierTransformerTest.java   |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/d9b0be1c/src/main/java/org/apache/commons/math4/complex/ComplexUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/complex/ComplexUtils.java 
b/src/main/java/org/apache/commons/math4/complex/ComplexUtils.java
index 57f59da..b59f133 100644
--- a/src/main/java/org/apache/commons/math4/complex/ComplexUtils.java
+++ b/src/main/java/org/apache/commons/math4/complex/ComplexUtils.java
@@ -137,7 +137,7 @@ public class ComplexUtils {
      * @since 4.0
      */
     public static Complex extractComplexFromRealArray(double[] real, int 
index) {
-        return Complex.ofCartesian(real[index]);
+        return Complex.ofReal(real[index]);
     }
 
     /**
@@ -151,7 +151,7 @@ public class ComplexUtils {
      * @since 4.0
      */
     public static Complex extractComplexFromRealArray(float[] real, int index) 
{
-        return Complex.ofCartesian(real[index]);
+        return Complex.ofReal(real[index]);
     }
 
     /**
@@ -436,7 +436,7 @@ public class ComplexUtils {
         int index = 0;
         final Complex c[] = new Complex[real.length];
         for (double d : real) {
-            c[index] = Complex.ofCartesian(d);
+            c[index] = Complex.ofReal(d);
             index++;
         }
         return c;
@@ -454,7 +454,7 @@ public class ComplexUtils {
         int index = 0;
         final Complex c[] = new Complex[real.length];
         for (float d : real) {
-            c[index] = Complex.ofCartesian(d);
+            c[index] = Complex.ofReal(d);
             index++;
         }
         return c;

http://git-wip-us.apache.org/repos/asf/commons-math/blob/d9b0be1c/src/test/java/org/apache/commons/math4/complex/ComplexUtilsTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/commons/math4/complex/ComplexUtilsTest.java 
b/src/test/java/org/apache/commons/math4/complex/ComplexUtilsTest.java
index 0242732..192b350 100644
--- a/src/test/java/org/apache/commons/math4/complex/ComplexUtilsTest.java
+++ b/src/test/java/org/apache/commons/math4/complex/ComplexUtilsTest.java
@@ -117,7 +117,7 @@ public class ComplexUtilsTest {
             fi[i] = i;
             fi[i + 1] = i + 1;
             c[i / 2] = Complex.ofCartesian(i, i + 1);
-            cr[i / 2] = Complex.ofCartesian(i / 2);
+            cr[i / 2] = Complex.ofReal(i / 2);
             ci[i / 2] = Complex.ofCartesian(0, i / 2);
             sr[i / 2] = i;
             si[i / 2] = i + 1;
@@ -137,7 +137,7 @@ public class ComplexUtilsTest {
                 fi2d[i][j] = 10 * i + j;
                 fi2d[i][j + 1] = 10 * i + j + 1;
                 c2d[i][j / 2] = Complex.ofCartesian(10 * i + j, 10 * i + j + 
1);
-                cr2d[i][j / 2] = Complex.ofCartesian(10 * i + j / 2);
+                cr2d[i][j / 2] = Complex.ofReal(10 * i + j / 2);
                 ci2d[i][j / 2] = Complex.ofCartesian(0, 10 * i + j / 2);
             }
         }
@@ -155,13 +155,13 @@ public class ComplexUtilsTest {
                     fi3d[i][j][k] = 100 * i + 10 * j + k;
                     fi3d[i][j][k + 1] = 100 * i + 10 * j + k + 1;
                     c3d[i][j][k / 2] = Complex.ofCartesian(100 * i + 10 * j + 
k, 100 * i + 10 * j + k + 1);
-                    cr3d[i][j][k / 2] = Complex.ofCartesian(100 * i + 10 * j + 
k / 2);
+                    cr3d[i][j][k / 2] = Complex.ofReal(100 * i + 10 * j + k / 
2);
                     ci3d[i][j][k / 2] = Complex.ofCartesian(0, 100 * i + 10 * 
j + k / 2);
                 }
             }
         }
-        ansArrayc1r = new Complex[] { Complex.ofCartesian(3), 
Complex.ofCartesian(4), Complex.ofCartesian(5), Complex.ofCartesian(6), 
Complex.ofCartesian(7) };
-        ansArrayc2r = new Complex[] { Complex.ofCartesian(3), 
Complex.ofCartesian(5), Complex.ofCartesian(7) };
+        ansArrayc1r = new Complex[] { Complex.ofReal(3), Complex.ofReal(4), 
Complex.ofReal(5), Complex.ofReal(6), Complex.ofReal(7) };
+        ansArrayc2r = new Complex[] { Complex.ofReal(3), Complex.ofReal(5), 
Complex.ofReal(7) };
         ansArrayc1i = new Complex[] { Complex.ofCartesian(0, 3), 
Complex.ofCartesian(0, 4), Complex.ofCartesian(0, 5), Complex.ofCartesian(0, 6),
                 Complex.ofCartesian(0, 7) };
         ansArrayc2i = new Complex[] { Complex.ofCartesian(0, 3), 
Complex.ofCartesian(0, 5), Complex.ofCartesian(0, 7) };
@@ -251,9 +251,9 @@ public class ComplexUtilsTest {
     public void testExtractionMethods() {
         setArrays();
         // Extract complex from real double array, index 3
-        TestUtils.assertSame(Complex.ofCartesian(3), 
ComplexUtils.extractComplexFromRealArray(d, 3));
+        TestUtils.assertSame(Complex.ofReal(3), 
ComplexUtils.extractComplexFromRealArray(d, 3));
         // Extract complex from real float array, index 3
-        TestUtils.assertSame(Complex.ofCartesian(3), 
ComplexUtils.extractComplexFromRealArray(f, 3));
+        TestUtils.assertSame(Complex.ofReal(3), 
ComplexUtils.extractComplexFromRealArray(f, 3));
         // Extract real double from complex array, index 3
         TestUtils.assertSame(6, ComplexUtils.extractRealFromComplexArray(c, 
3));
         // Extract real float from complex array, index 3

http://git-wip-us.apache.org/repos/asf/commons-math/blob/d9b0be1c/src/test/java/org/apache/commons/math4/transform/FastFourierTransformerTest.java
----------------------------------------------------------------------
diff --git 
a/src/test/java/org/apache/commons/math4/transform/FastFourierTransformerTest.java
 
b/src/test/java/org/apache/commons/math4/transform/FastFourierTransformerTest.java
index d179fa4..5a2f3ca 100644
--- 
a/src/test/java/org/apache/commons/math4/transform/FastFourierTransformerTest.java
+++ 
b/src/test/java/org/apache/commons/math4/transform/FastFourierTransformerTest.java
@@ -301,7 +301,7 @@ public final class FastFourierTransformerTest {
         final Complex[] x = new Complex[n];
         for (int i = 0; i < n; i++) {
             final double t = min + i * (max - min) / n;
-            x[i] = Complex.ofCartesian(f.value(t));
+            x[i] = Complex.ofReal(f.value(t));
         }
         final Complex[] expected;
         final double s;

Reply via email to