diff --git a/xdocs/userguide/complex.xml b/xdocs/userguide/complex.xml index f862a94dd..0e01ba1dd 100644 --- a/xdocs/userguide/complex.xml +++ b/xdocs/userguide/complex.xml @@ -1,7 +1,7 @@ - The Commons Math User Guide - Statistics + The Commons Math User Guide - Complex Numbers
@@ -37,6 +37,18 @@ org.apache.commons.math.complex.Complex provides a complex number type that forms the basis for the complex functionality found in commons-math. +

+

+ Complex functions and arithmetic operations are implemented in + commons-math by applying standard computational formulas and + following the rules for java.lang.Double arithmetic in + handling infinite and NaN values. No attempt is made + to comply with ANSII/IEC C99x Annex G or any other standard for + Complex arithmetic. See the class and method javadocs for the + + Complex and + + ComplexUtils classes for details on computing formulas.

To create a complex number, simply call the constructor passing in two @@ -45,9 +57,14 @@ Complex c = new Complex(1.0, 3.0); // 1 + 3i

- The Complex class provides many unary and binary + Complex numbers may also be created from polar representations + using the polar2Complex method in + ComplexUtils. +

+

+ The Complex class provides basic unary and binary complex number operations. These operations provide the means to add, - subtract, multiple and, divide complex numbers along with other + subtract, multiply and divide complex numbers along with other complex number functions similar to the real number functions found in java.math.BigDecimal: Complex lhs = new Complex(1.0, 3.0); @@ -62,7 +79,7 @@ Complex answer = lhs.add(rhs); // add two complex numbers

- org.apache.commons.math.complex.ComplexMath provides + org.apache.commons.math.complex.ComplexUtils provides implementations of serveral transcendental functions involving complex number arguments. These operations provide the means to compute the log, sine, tangent and, other complex values similar to the real diff --git a/xdocs/userguide/linear.xml b/xdocs/userguide/linear.xml index b8b336aea..2006f91b5 100644 --- a/xdocs/userguide/linear.xml +++ b/xdocs/userguide/linear.xml @@ -56,9 +56,10 @@ RealMatrix m = new RealMatrixImpl(matrixData); // One more with three rows, two columns double[][] matrixData2 = { {1d,2d}, {2d,5d}, {1d, 7d}}; -RealMatrix n = new RealMatrixImpl(matrixData2); +RealMatrix n = new RealMatixImpl(matrixData2); -// Note: The constructor copies the input double[][] array. +// Note: constructor makes a +// Fresh copy of the input double[][] array // Now multiply m by n RealMatrix p = m.multiply(n);