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

Class: Math_Numerical_RootFinding_Common

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

Class Overview


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


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2004-2008 Firman Wandayandi

Variables

Methods


Child classes:

Math_Numerical_RootFinding_FixedPoint
Fixed Point method class.
Math_Numerical_RootFinding_Bisection
Bisection/Binary Chopping/Interval Halving/Bolzano method class.
Math_Numerical_RootFinding_NewtonRaphson
Newton-Raphson method class.
Math_Numerical_RootFinding_Secant
Secant method class.
Math_Numerical_RootFinding_RalstonRabinowitz
Ralston and Rabinowitz method class.
Math_Numerical_RootFinding_FalsePosition
False Position/Regula Falsi method class.
Math_Numerical_RootFinding_NewtonRaphson2
Newton-Raphson 2 method class.

Inherited Variables

Inherited Methods


Class Details

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


[ Top ]


Class Variables

$epsError =  0

[line 85]

Epsilon error.
  • Access: protected

Type:   float


[ Top ]

$iterationCount =  0

[line 77]

Iteration count.
  • Access: protected

Type:   int


[ Top ]

$options = array(
        'max_iteration'  => 30,
        'err_tolerance'  => 0.00001, // Equals to 1.0E-5
        'divergent_skip' => true
    )

[line 65]

Options.

Available 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 93]

Root value.
  • Access: protected

Type:   float


[ Top ]



Method Detail

Math_Numerical_RootFinding_Common (Constructor)   [line 106]

Math_Numerical_RootFinding_Common Math_Numerical_RootFinding_Common( [array $options = null])

Constructor.

Parameters:

array   $options   —  (optional) Options.

[ Top ]

compute   [line 194]

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_Bisection::compute()
Bisection/Binary Chopping/Interval Halving/Bolzano method.
Math_Numerical_RootFinding_NewtonRaphson::compute()
Netwon-Raphson method.
Math_Numerical_RootFinding_Secant::compute()
Secant method.
Math_Numerical_RootFinding_RalstonRabinowitz::compute()
Ralston and Rabinowitz method for calculate double root (twin root).
Math_Numerical_RootFinding_FalsePosition::compute()
False Position/Regula Falsi method.
Math_Numerical_RootFinding_NewtonRaphson2::compute()
Newton-Raphson method for calculate double root (twin root).

[ Top ]

get   [line 171]

mixed get( $option $option)

Get the option value.
  • Return: Value of the option or PEAR_Error on failure.
  • Since: Method available since Release 1.1.0a1

Parameters:

$option   $option   —  Option name.

[ Top ]

getEpsError   [line 236]

float getEpsError( )

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

[ Top ]

getEqResult   [line 324]

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 222]

int getIterationCount( )

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

[ Top ]

getRoot   [line 208]

float getRoot( )

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

[ Top ]

isDivergentRows   [line 255]

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 278]

void reset( )

Reset all values.

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

  • Access: public

[ Top ]

set   [line 131]

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 302]

bool|PEAR_Error validateEqFunction( string $eqFunction, [float $guess = 1])

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.
float   $guess   —  (optional) Initial guess value, default is 1.

[ Top ]


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