Piecewise linear quadratic (plq), Consistency check
[b, er] = plq_check(plqf, ind)
matrix. A plq function.
optional integer. Which tests to perform on plqf.
boolean. True if and only if plqf is a valid PLQ function.
real number. The maximum error found in the last test run.
Performs a number of sanity checks on the PLQ function plqf. If all of the tests pass, %t is returned, otherwise %f is returned.
Test 1 tests that the plqf's x values (first column) are increasing. Test 2 checks that plqf is continuous. By default, both tests are performed. The optional index argument can specify an individual test, or vector of tests, to run.
If test 1 fails, then er is the largest decrease in x value between two consecutive pieces. If test 2 fails, then er is the maximum absolute difference between the values of two consecutive pieces at their meeting point.
Bryan Gardiner
, University of British Columbia, BC, Canada