def test_hw06_prob02_ut20(self): print( '\n***** CS3430: S20: HW06: Problem 02: Unit Test 20 ************') s = '5x^7' zr, ni = nra.zr2(s, 10.0, delta=0.0001) print('zr={}; num_iters={}'.format(zr, ni)) assert nra.check_zr(s, zr, err=0.0000001) print('CS 3430: S20: HW06: Problem 02: Unit Test 20: pass')
def test_hw06_prob02_ut15(self): print( '\n***** CS3430: S20: HW06: Problem 02: Unit Test 15 ************') s = '2x^1' zr = nra.zr1(s, 10.0, num_iters=5) print('zr={}'.format(zr)) assert nra.check_zr(s, zr, err=0.0001) print('CS 3430: S20: HW06: Problem 02: Unit Test 15: pass')
def test_hw06_prob02_ut19(self): print( '\n***** CS3430: S20: HW06: Problem 02: Unit Test 19 ************') s = '5x^7' zr = nra.zr1(s, 5.0, num_iters=30) print('zr={}'.format(zr)) assert nra.check_zr(s, zr, err=0.0000001) print('CS 3430: S20: HW06: Problem 02: Unit Test 19: pass')
def test_hw06_prob02_ut14(self): print( '\n***** CS3430: S20: HW06: Problem 02: Unit Test 14 ************') s = '400x^5 - 6x^4 - 30x^3 + 45x^2 + 7x^1 + 10x^0' zr, ni = nra.zr2(s, 2.0, delta=0.0001) print('zr={}; num_iters={}'.format(zr, ni)) assert nra.check_zr(s, zr, err=0.0001) print('CS 3430: S20: HW06: Problem 02: Unit Test 14: pass')
def test_hw06_prob02_ut11(self): print( '\n***** CS3430: S20: HW06: Problem 02: Unit Test 11 ************') s = '300x^7 - 6x^4 - 30x^3 + 45x^2 + 7x^1 + 10x^0' zr = nra.zr1(s, 5.0, num_iters=40) print('zr={}'.format(zr)) assert nra.check_zr(s, zr, err=0.0001) print('CS 3430: S20: HW06: Problem 02: Unit Test 11: pass')
def test_hw06_prob02_ut10(self): print( '\n***** CS3430: S20: HW06: Problem 02: Unit Test 10 ************') s = '100x^4 - 2x^3 - 15x^2 - 45x^-50' zr, ni = nra.zr2(s, 1.0, delta=0.0001) print('zr={}; num_iters={}'.format(zr, ni)) assert nra.check_zr(s, zr, err=0.0001) print('CS 3430: S20: HW06: Problem 02: Unit Test 10: pass')
def test_hw06_prob02_ut09(self): print( '\n***** CS3430: S20: HW06: Problem 02: Unit Test 09 ************') s = '100x^4 - 2x^3 - 15x^2 - 45x^-50' zr = nra.zr1(s, 1.0, num_iters=10) print('zr={}'.format(zr)) assert nra.check_zr(s, zr, err=0.0001) print('CS 3430: S20: HW06: Problem 02: Unit Test 09: pass')
def test_hw06_prob02_ut07(self): print( '\n***** CS3430: S20: HW06: Problem 02: Unit Test 07 ************') s = '1x^2 - 3x^0' zr = nra.zr1(s, 1.0, num_iters=10) print('zr={}'.format(zr)) assert nra.check_zr(s, zr, err=0.0001) print('CS 3430: S20: HW06: Problem 02: Unit Test 07: pass')