AssertEqualsListOfNumericalPoly

From ApCoCoAWiki
Revision as of 18:03, 22 June 2010 by 79.208.158.76 (talk) (New page: <command> <title>AssertEqualsListOfNumericalPoly</title> <short_description>Compares two sorted lists of numerical polynomials</short_description> <syntax> $apcocoa/ts/assert.AssertEqualsL...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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