Permalink
Browse files

Bug #14989 - PHPCS

  • Loading branch information...
1 parent 33d4093 commit b970a6b99eba10cc100137daee2f70becbb60766 Firman Wandayandi committed Dec 29, 2008
Showing with 40 additions and 46 deletions.
  1. +39 −46 Math/Numerical/RootFinding/Bisection.php
  2. +1 −0 Math/Numerical/RootFinding/Common.php
@@ -1,8 +1,4 @@
<?php
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
-
-// {{{ Header
-
/**
* Driver file contains Math_Numerical_RootFinding_Bisection class to provide
* Bisection/Binary Chopping/Interval Halving/Bolzano method root finding
@@ -21,51 +17,43 @@
* obtain it through the world-wide-web, please send an email
* to pear-dev@list.php.net so we can send you a copy immediately.
*
- * @category Math
- * @package Math_Numerical_RootFinding
- * @subpackage Methods
- * @author Firman Wandayandi <firman@php.net>
- * @copyright Copyright (c) 2004-2008 Firman Wandayandi
- * @license http://www.opensource.org/licenses/bsd-license.php
- * BSD License
- * @version CVS: $Id$
+ * @category Math
+ * @package Math_Numerical_RootFinding
+ * @subpackage Methods
+ * @author Firman Wandayandi <firman@php.net>
+ * @copyright 2004-2008 Firman Wandayandi
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version CVS: $Id$
*/
-// }}}
-// {{{ Dependencies
-
/**
* Math_Numerical_RootFinding_Common
*/
require_once 'Math/Numerical/RootFinding/Common.php';
-// }}}
-// {{{ Class: Math_Numerical_RootFinding_Bisection
-
/**
* Bisection/Binary Chopping/Interval Halving/Bolzano method class.
*
- * @category Math
- * @package Math_Numerical_RootFinding
- * @subpackage Methods
- * @author Firman Wandayandi <firman@php.net>
- * @copyright Copyright (c) 2004-2008 Firman Wandayandi
- * @license http://www.opensource.org/licenses/bsd-license.php
- * BSD License
- * @version Release: @package_version@
+ * @category Math
+ * @package Math_Numerical_RootFinding
+ * @subpackage Methods
+ * @author Firman Wandayandi <firman@php.net>
+ * @copyright 2004-2008 Firman Wandayandi
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: @package_version@
+ * @link http://pear.php.net/package/Math_Numerical_RootFinding
*/
-class Math_Numerical_RootFinding_Bisection
-extends Math_Numerical_RootFinding_Common
+class Math_Numerical_RootFinding_Bisection extends Math_Numerical_RootFinding_Common
{
// {{{ Constructor
/**
* Constructor.
*
- * @param array $options (optional) Options.
+ * @param array $options (optional) Options.
*
- * @access public
- * @see Math_Numerical_RootFinding_Common::Math_Numerical_RootFinding_Common()
+ * @access public
+ * @see Math_Numerical_RootFinding_Common::Math_Numerical_RootFinding_Common()
*/
function Math_Numerical_RootFinding_Bisection($options = null)
{
@@ -79,6 +67,7 @@ function Math_Numerical_RootFinding_Bisection($options = null)
* Print out parameters description for compute() function.
*
* @access public
+ * @return void
*/
function infoCompute()
{
@@ -104,21 +93,23 @@ function infoCompute()
/**
* Bisection/Binary Chopping/Interval Halving/Bolzano method.
*
- * @param callback $fxFunction Callback f(x) equation function or
- * object/method tuple.
- * @param float $xL Lower guess.
- * @param float $xU Upper guess.
+ * @param callback $fxFunction Callback f(x) equation function or
+ * object/method tuple.
+ * @param float $xL Lower guess.
+ * @param float $xU Upper guess.
*
- * @return float|PEAR_Error Root value on success or PEAR_Error on failure.
- * @access public
- * @see Math_Numerical_RootFinding::validateEqFunction()
- * @see Math_Numerical_RootFinding::getEqResult()
- * @see Math_Numerical_RootFinding_Falseposition::compute()
+ * @return float|PEAR_Error Root value on success or PEAR_Error on failure.
+ * @access public
+ * @see Math_Numerical_RootFinding::validateEqFunction()
+ * @see Math_Numerical_RootFinding::getEqResult()
+ * @see Math_Numerical_RootFinding_Falseposition::compute()
*/
function compute($fxFunction, $xL, $xU)
{
// Validate f(x) equation function.
- $err = Math_Numerical_RootFinding_Common::validateEqFunction($fxFunction, $xL);
+ $err = Math_Numerical_RootFinding_Common::validateEqFunction(
+ $fxFunction, $xL
+ );
if (PEAR::isError($err)) {
return $err;
}
@@ -127,7 +118,9 @@ function compute($fxFunction, $xL, $xU)
$xR = ($xU + $xL) / 2;
// Validate f(x) equation function.
- $err = Math_Numerical_RootFinding_Common::validateEqFunction($fxFunction, $xR);
+ $err = Math_Numerical_RootFinding_Common::validateEqFunction(
+ $fxFunction, $xR
+ );
if (PEAR::isError($err)) {
return $err;
}
@@ -159,13 +152,15 @@ function compute($fxFunction, $xL, $xU)
// Compute approximation error.
$this->epsError = abs(($xN - $xR) / $xN);
- $epsErrors[] = $this->epsError;
+ $epsErrors[] = $this->epsError;
// Detect for divergent rows.
if ($this->isDivergentRows($epsErrors) &&
$this->options['divergent_skip'])
{
- return PEAR::raiseError('Iteration skipped, divergent rows detected');
+ return PEAR::raiseError(
+ 'Iteration skipped, divergent rows detected'
+ );
break;
}
@@ -186,8 +181,6 @@ function compute($fxFunction, $xL, $xU)
// }}}
}
-// }}}
-
/*
* Local variables:
* mode: php
@@ -41,6 +41,7 @@
* @copyright 2004-2008 Firman Wandayandi
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
+ * @link http://pear.php.net/package/Math_Numerical_RootFinding
* @abstract
*/
class Math_Numerical_RootFinding_Common

0 comments on commit b970a6b

Please sign in to comment.