Ags.MathUtil

Fields

None

Methods

class

coefficient_to_complex (coefficient)

class

find_exponent_parenthesis (str)

class

find_function (str)

class

find_function_parenthesis (str)

class

find_parenthesis_all (str)

class

find_symbol (str)

class

find_term_parenthesis (str)

class

is_term (term)

class

match_coefficient (offset, end_ptr)

class

match_exponent (offset, end_ptr)

class

match_function (offset, end_ptr)

class

match_operator (offset, end_ptr)

class

match_sign (offset, end_ptr)

class

match_symbol (offset, end_ptr)

class

multiply_coefficient_all (coefficient, value_count)

class

split_polynomial (polynomial)

class

split_sum (sum)

Details

class Ags.MathUtil
classmethod coefficient_to_complex(coefficient)
Parameters:

coefficient (str) – the coefficient string

Returns:

True on success, otherwise False

value:

return location of value

Return type:

(bool, value: Ags.Complex)

Compute value from coefficient.

New in version 3.6.0.

classmethod find_exponent_parenthesis(str)
Parameters:

str (str) – the string

Returns:

exponent_open_position:

exponent open position array return location

exponent_close_position:

exponent close position array return location

exponent_open_position_count:

exponent open position count return location

exponent_close_position_count:

exponent close position count return location

Return type:

(exponent_open_position: int, exponent_close_position: int, exponent_open_position_count: int, exponent_close_position_count: int)

Find exponent parenthesis.

New in version 3.2.0.

classmethod find_function(str)
Parameters:

str (str) – the string

Returns:

the string offset matching function, otherwise None

Return type:

str

Find next function.

New in version 3.2.0.

classmethod find_function_parenthesis(str)
Parameters:

str (str) – the string

Returns:

function_open_position:

function open position array return location

function_close_position:

function close position array return location

function_open_position_count:

function open position count return location

function_close_position_count:

function close position count return location

Return type:

(function_open_position: int, function_close_position: int, function_open_position_count: int, function_close_position_count: int)

Find function parenthesis.

New in version 3.2.0.

classmethod find_parenthesis_all(str)
Parameters:

str (str) – the string

Returns:

open_position:

open position array return location

close_position:

close position array return location

open_position_count:

open position count return location

close_position_count:

close position count return location

Return type:

(open_position: int, close_position: int, open_position_count: int, close_position_count: int)

Find all parenthesis.

New in version 3.2.0.

classmethod find_symbol(str)
Parameters:

str (str) – the string

Returns:

the string offset matching symbol, otherwise None

Return type:

str

Find next symbol.

New in version 3.2.0.

classmethod find_term_parenthesis(str)
Parameters:

str (str) – the string

Returns:

term_open_position:

term open position array return location

term_close_position:

term close position array return location

term_open_position_count:

term open position count return location

term_close_position_count:

term close position count return location

Return type:

(term_open_position: int, term_close_position: int, term_open_position_count: int, term_close_position_count: int)

Find term parenthesis.

New in version 3.2.0.

classmethod is_term(term)
Parameters:

term (str) – the term

Returns:

True on success, otherwise False

Return type:

bool

Test if term is a term.

New in version 3.2.0.

classmethod match_coefficient(offset, end_ptr)
Parameters:
  • offset (str) – the string pointer

  • end_ptr (str) – the end of offset

Returns:

True on success, otherwise False

start_offset:

points to start offset of matched, otherwise None

end_offset:

points to end offset of matched, otherwise None

Return type:

(bool, start_offset: str, end_offset: str)

Match coefficient including optional sign.

New in version 3.6.0.

classmethod match_exponent(offset, end_ptr)
Parameters:
  • offset (str) – the string pointer

  • end_ptr (str) – the end of offset

Returns:

True on success, otherwise False

start_offset:

points to start offset of matched, otherwise None

end_offset:

points to end offset of matched, otherwise None

Return type:

(bool, start_offset: str, end_offset: str)

Match exponent with or without parenthesis.

New in version 3.6.0.

classmethod match_function(offset, end_ptr)
Parameters:
  • offset (str) – the string pointer

  • end_ptr (str) – the end of offset

Returns:

True on success, otherwise False

start_offset:

points to start offset of matched, otherwise None

end_offset:

points to end offset of matched, otherwise None

Return type:

(bool, start_offset: str, end_offset: str)

Match function.

New in version 3.6.0.

classmethod match_operator(offset, end_ptr)
Parameters:
  • offset (str) – the string pointer

  • end_ptr (str) – the end of offset

Returns:

True on success, otherwise False

start_offset:

points to start offset of matched, otherwise None

end_offset:

points to end offset of matched, otherwise None

Return type:

(bool, start_offset: str, end_offset: str)

Match operator.

New in version 3.6.0.

classmethod match_sign(offset, end_ptr)
Parameters:
  • offset (str) – the string pointer

  • end_ptr (str) – the end of offset

Returns:

True on success, otherwise False

start_offset:

points to start offset of matched, otherwise None

end_offset:

points to end offset of matched, otherwise None

Return type:

(bool, start_offset: str, end_offset: str)

Match sign.

New in version 3.6.0.

classmethod match_symbol(offset, end_ptr)
Parameters:
  • offset (str) – the string pointer

  • end_ptr (str) – the end of offset

Returns:

True on success, otherwise False

start_offset:

points to start offset of matched, otherwise None

end_offset:

points to end offset of matched, otherwise None

Return type:

(bool, start_offset: str, end_offset: str)

Match symbol including optional sign.

New in version 3.6.0.

classmethod multiply_coefficient_all(coefficient, value_count)
Parameters:
  • coefficient (str) –

  • value_count (int) –

Return type:

Ags.Complex

classmethod split_polynomial(polynomial)
Parameters:

polynomial (str) – the polynomial

Returns:

factor:

the return location of factors

factor_exponent:

the return location of factor exponents

Return type:

(factor: str, factor_exponent: str)

Split polynomial into coefficient, powers of symbols and summand.

New in version 3.2.0.

classmethod split_sum(sum)
Parameters:

sum (str) – the sum

Returns:

the return location of summands

Return type:

summand: str

Split sum into summands.

New in version 3.2.0.