Math_Numerical_RootFinding
[ class tree: Math_Numerical_RootFinding ] [ index: Math_Numerical_RootFinding ] [ all elements ]

Class: Math_Numerical_RootFinding_Common

Source Location: /Math_Numerical_RootFinding-0.3.0/Math/Numerical/RootFinding/Common.php

Class Overview


Abstract class contains common properties and methods for specified method classes.


Author(s):

Variables

Methods


Child classes:

Math_Numerical_RootFinding_Fixedpoint
Fixed Point method class.
Math_Numerical_RootFinding_Newtonraphson2
Newton-Raphson 2 method class.
Math_Numerical_RootFinding_Bisection
Bisection/Binary Chopping/Interval Halving/Bolzano method class.
Math_Numerical_RootFinding_Falseposition
False Position/Regula Falsi method class.
Math_Numerical_RootFinding_Secant
Secant method class.
Math_Numerical_RootFinding_Newtonraphson
Newton-Raphson method class.
Math_Numerical_RootFinding_Ralstonrabinowitz
Ralston and Rabinowitz method class.

Inherited Variables

Inherited Methods


Class Details

[line 75]
Abstract class contains common properties and methods for specified method classes.


[ Top ]


Class Variables

$epsError =  0

[line 112]

Epsilon error.
  • Access: protected

Type:   float


[ Top ]

$iterationCount =  0

[line 104]

Iteration count.
  • Access: protected

Type:   int


[ Top ]

$options = array(
        'max_iteration'  => 30,
        'err_tolerance'  => 1E-005,
        'divergent_skip' => true
    )

[line 92]

Options.

Known options:

   max_iteration  int    Maximum iteration count.
   err_tolerance  float  Error tolerance.
   divergent_skip  bool  Flag whether to skip the current iteration if
                         divergent rows detected or not.

  • Access: protected

Type:   array


[ Top ]

$root =  null

[line 120]

Root value.
  • Access: protected

Type:   float


[ Top ]



Method Detail

__construct (Constructor)   [line 146]

Math_Numerical_RootFinding_Common __construct( [array $options = null])

PHP5 Compatible Constructor.

Parameters:

array   $options   —  (optional) Options.

[ Top ]

Math_Numerical_RootFinding_Common (Constructor)   [line 133]

Math_Numerical_RootFinding_Common Math_Numerical_RootFinding_Common( [array $options = null])

PHP4 Compatible Constructor.

Parameters:

array   $options   —  (optional) Options.

[ Top ]

compute   [line 214]

void compute( )

Compute the root.

This method implemented in the extend class of this class. Please Note: DIFFERENT METHOD, DIFFERENT PARAMETERS. See the function parameter carefully or error will be throwed. For information about parameter just call infoCompute().


Overridden in child classes as:

Math_Numerical_RootFinding_Fixedpoint::compute()
Fixed Point method.
Math_Numerical_RootFinding_Newtonraphson2::compute()
Newton-Raphson method for calculate double root (twin root).
Math_Numerical_RootFinding_Bisection::compute()
Bisection/Binary Chopping/Interval Halving/Bolzano method.
Math_Numerical_RootFinding_Falseposition::compute()
False Position/Regula Falsi method.
Math_Numerical_RootFinding_Secant::compute()
Secant method.
Math_Numerical_RootFinding_Newtonraphson::compute()
Netwon-Raphson method.
Math_Numerical_RootFinding_Ralstonrabinowitz::compute()
Ralston and Rabinowitz method for calculate double root (twin root).

[ Top ]

getEpsError   [line 256]

float getEpsError( )

Get epsilon error.
  • Return: Epsilon error.
  • Access: public

[ Top ]

getEqResult   [line 343]

float|PEAR_Error getEqResult( callback $eqFunction, float $varValue)

Compute a value using given equation function or object/method.
  • Return: result value on success, PEAR_Error on failure.
  • Access: public

Parameters:

callback   $eqFunction   —  Equation function name or object method tuple.
float   $varValue   —  Variable value.

[ Top ]

getIterationCount   [line 242]

int getIterationCount( )

Get iteration count.
  • Return: Iteration count.
  • Access: public

[ Top ]

getRoot   [line 228]

float getRoot( )

Get root value.
  • Return: Root value.
  • Access: public

[ Top ]

isDivergentRows   [line 275]

bool isDivergentRows( $epsErrors, array $epsilonErrors)

Detect for divergent rows.

Compare 3 rows of last epsilon errors, if no.3 bigger than no.2 and no.2 bigger than no.1, rows are divergent.

  • Return: TRUE if divergent, otherwise FALSE
  • Access: public

Parameters:

array   $epsilonErrors   —  Epsilon errors collection
   $epsErrors   — 

[ Top ]

reset   [line 298]

void reset( )

Reset all values.

This method allow you to use same object with different parameter.

  • Access: public

[ Top ]

set   [line 171]

bool|PEAR_Error set( mixed $option, [mixed $value = null])

Set the option(s).

Set a single option or multiple options.

  • Return: TRUE on success or PEAR_Error on failure.
  • Access: public

Parameters:

mixed   $option   —  A string with option name as value for single option or An associative array contains options array('<option>' => <value>) for multiple options.
mixed   $value   —  (optional) Option value. Require when $option is string (single option mode).

[ Top ]

validateEqFunction   [line 321]

bool|PEAR_Error validateEqFunction( string $eqFunction)

Validate equation function or object/method.

Simple function to know the whether equation function or object/method callback is working.


Parameters:

string   $eqFunction   —  Equation function name or object method tuple.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:15:24 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.