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.0.0/Math/Numerical/RootFinding/Common.php

Class Overview


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


Author(s):

Version:

  • Release: 1.0.0

Copyright:

  • Copyright (c) 2004-2006 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 81]
Abstract class contains common properties and methods for specified method classes.
  • Author: Firman Wandayandi <firman@php.net>
  • Version: Release: 1.0.0
  • Copyright: Copyright (c) 2004-2006 Firman Wandayandi
  • Abstract:
  • License: BSD License


[ Top ]


Class Variables

$epsError =  0

[line 118]

Epsilon error.
  • Access: protected

Type:   float


[ Top ]

$iterationCount =  0

[line 110]

Iteration count.
  • Access: protected

Type:   int


[ Top ]

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

[line 98]

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

Root value.
  • Access: protected

Type:   float


[ Top ]



Method Detail

Math_Numerical_RootFinding_Common (Constructor)   [line 139]

Math_Numerical_RootFinding_Common Math_Numerical_RootFinding_Common( [array $options = null])

Constructor.

Parameters:

array   $options   —  (optional) Options.

[ Top ]

compute   [line 207]

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 ]

getEpsError   [line 249]

float getEpsError( )

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

[ Top ]

getEqResult   [line 336]

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

int getIterationCount( )

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

[ Top ]

getRoot   [line 221]

float getRoot( )

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

[ Top ]

isDivergentRows   [line 268]

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

void reset( )

Reset all values.

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

  • Access: public

[ Top ]

set   [line 164]

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

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:36:16 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.