next up previous
Next: Grading Up: ECE242F (Fall 2002) Assignment Previous: Dividing by a monic


What to submit

Submit your implementations of plus, mult, eval, and monDiv (specified in Polynomial.h) in a single file named Polynomial.c (note both the spelling and upper/lower case). Polynomial.c must include Polynomial.h. Each function must have a function header explaining any non-obvious details of the algorithm and its implementation. Variables should be named so as to make their purpose obvious, and commented when this is not possible.

Your Polynomial.c must compile when it is located in the same directory as TestPolynomial.c, Polynomial.h, and makefile, and the commands in makefile are executed. Once you have successfully built TestPolynomial, you can test drive it by typing:

TestPolynomial < fourByThree.txt
...where you can replace fourByThree.txt with any file (in the same directory as TestPolynomial.c) having the following format:
n m
a0 a1 ... an
b0 b1 ... bm
c0 c1 ... c(m+n)
d0 d1 ... d(max(m,n))
x
eval1
y
eval2
q0 q1 ... q(n-m)
r0 r1 ... rk
...where the meaning of the cryptic variables is: $ n$ and $ m$ are the degrees of poly1 and poly2 in TestPolynomial.c, $ a0$ ...$ an$ are the coefficients of poly1, $ b0$ ... $ bn$ are the coefficients of poly2, $ c0$ ...$ c(m+n)$ are the coefficients of mult(poly1, poly2), $ d0$ ... $ d\max(m,n)$ are the coefficients of plus(poly1, poly2), $ x$ is some integer, and eval1 is poly1(x), and eval2 is poly2(y). The quotient's coefficients are q0, q1, ..., q(n-m), and r0, r1 ...rk are the remainder's coefficients. poly2 must be monic and of degree no greater than poly1.


next up previous
Next: Grading Up: ECE242F (Fall 2002) Assignment Previous: Dividing by a monic
Danny Heap 2002-09-20