summaryrefslogtreecommitdiffstats
path: root/src/math
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2008-08-20 08:46:31 +0000
committerKore Nordmann <github@kore-nordmann.de>2008-08-20 08:46:31 +0000
commit59e15d56899406f7cff4fd3eae3a370410e0c898 (patch)
tree82a07694271a329c1d34c2b4072f0a18e2bec8b6 /src/math
parent0f7144b17ea88e3c5553ca8bb40901947e947de6 (diff)
downloadzetacomponents-graph-59e15d56899406f7cff4fd3eae3a370410e0c898.zip
zetacomponents-graph-59e15d56899406f7cff4fd3eae3a370410e0c898.tar.gz
- Started with better class level documentation.
Diffstat (limited to 'src/math')
-rw-r--r--src/math/matrix.php9
-rw-r--r--src/math/polynom.php29
2 files changed, 38 insertions, 0 deletions
diff --git a/src/math/matrix.php b/src/math/matrix.php
index 0cfbed3..26da354 100644
--- a/src/math/matrix.php
+++ b/src/math/matrix.php
@@ -10,6 +10,15 @@
*/
/**
* Provides a genereic matrix class with basic math operations
+ *
+ * The matrix class is used for internal matrix calculations, and it should not
+ * be required to be used by end users. It offers the common arithmetics
+ * operations, and a __toString mechanism for debugging.
+ *
+ * Beside this it implements more complex matrix algorithms to solve non linear
+ * equatations using the Gauss-Newton algorithm and LR decomposition using the
+ * Cholesky-Crout algorithm. These algorithms are required by the average
+ * polynom calculation in the ezcGraphDataSetAveragePolynom class.
*
* @version //autogentag//
* @package Graph
diff --git a/src/math/polynom.php b/src/math/polynom.php
index 194681e..718ab5d 100644
--- a/src/math/polynom.php
+++ b/src/math/polynom.php
@@ -7,9 +7,38 @@
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
* @license http://ez.no/licenses/new_bsd New BSD License
*/
+
/**
* Provides a class for generic operations on polynoms
*
+ * This class is mainly used for internal representation of polynoms in the
+ * average dataset ezcGraphDataSetAveragePolynom.
+ *
+ * It provides only very basic mechanisms to work with polynoms, like adding of
+ * polynomes and evaluating the polynom with a given number, to calculate a
+ * point in the chart for a given value on the x axis.
+ *
+ * Beside this the __toString implementation may be used to echo the polynoms
+ * calculated by the least squares mechanism in the above mentioned average
+ * datasets. The class does not provide any options to customize the output.
+ *
+ * The class can be used like:
+ *
+ * <code>
+ * // Equivalent to: x^2 + .5
+ * $polynom = new ezcGraphPolynom( array( 2 => 1, 0 => .5 ) );
+ *
+ * // Calculate result for x = 1, echos: 1.5
+ * echo $polynom->evaluate( 1 ), PHP_EOL;
+ *
+ * // Build the sum with another polynom
+ * $polynom->add( new ezcGraphPolynom( array( 1 => 1 ) ) );
+ *
+ * // Print polynom, echos:
+ * // x^2 + x + 5.00e-1
+ * echo $polynom, PHP_EOL;
+ * </code>
+ *
* @version //autogentag//
* @package Graph
*/
OpenPOWER on IntegriCloud