!******************************************************************************!
! Simple test case for polyeval:
!
! @author:  Scott Fernandez
! @version: $Id: test_polyeval.mm,v 1.1 2011/06/24 21:58:26 saf Exp $
!******************************************************************************!
startmacro d:size[4k] fn:infile[ram:input] fn:fitfile[ram:fit] fn:expected[ram:expected] &
           fn:difffile[ram:diff] fn:polyfile[ram:poly] fn:errfile[ram:err]
  wave infile elem=size form=SD
  polyfit infile 20 coef polyfile expected errfile
  polyeval fitfile coef size
  fcalc/type=d difffile fitfile expected -
  statistics difffile max=max min=min
  assert/text="^{reg.main.name}: Difference between evaluated and expected results is zero" max == 0 and min == 0
endmacro
