AssertEqualsListOfNumericalPoly

From ApCoCoAWiki

AssertEqualsListOfNumericalPoly

Compares two sorted lists of numerical polynomials

Syntax

$apcocoa/ts/assert.AssertEqualsListOfNumericalPoly(Result: LIST, Expected: LIST, Eps: RAT, ErrMsg: STRING)

Description

This function compares two sorted lists of numerical polynomials. Every polynomial is tested via the function AssertEqualsNumericalPoly. If the polynomials of the lists are numerically not the same it throws an error and prints the error message 'ErrMsg'.

  • @param Result: The first list of numerical polynomials

  • @param Expected: The second list of numerical polynomials

  • @param Eps: Epsilon

  • @param ErrMsg: Error message

Example

F := [2*z - 0.21*x^2, 0.212*x + 2.103*xy, 14.12*x + 0.0001*y]; E := [2*z - 0.24*x^2, 0.00001*x^2 + 0.214*x + 2.1*xy, 14.2*x];
$apcocoa/ts/assert.AssertEqualsListOfNumericalPoly(F,E,0.1, "Lists are not the same"); -- throws no error => test passed

F := [0.212*x + 2.103*xy, 14.12*x + 0.0001*y, 2*z - 0.21*x^2]; E := [2*z - 0.24*x^2, 0.00001*x^2 + 0.214*x + 2.1*xy, 14.2*x];
$apcocoa/ts/assert.AssertEqualsListOfNumericalPoly(F,E,0.1, "Lists are not the same"); -- throws an error => test not passed