001 package ps1.test;
002
003 import ps1.*;
004
005 import junit.framework.*;
006
007 /**
008 * This class contains a set of test cases that can be used to test the
009 * implementation of the RatPoly class.
010 * <p>
011 */
012 public final class RatPolyTest extends TestCase {
013 // get a RatNum for an integer
014 private RatNum num(int i) {
015 return new RatNum(i);
016 }
017
018 // convenient way to make a RatPoly
019 private RatPoly poly(int coef, int expt) {
020 return new RatPoly(coef, expt);
021 }
022
023 // Convenient way to make a quadratic polynomial, arguments
024 // are just the coefficients, highest degree term to lowest
025 private RatPoly quadPoly(int x2, int x1, int x0) {
026 RatPoly ratPoly = new RatPoly(x2, 2);
027 return ratPoly.add(poly(x1, 1)).add(poly(x0, 0));
028 }
029
030 // convenience for valueOf
031 private RatPoly valueOf(String s) {
032 return RatPoly.valueOf(s);
033 }
034
035 // convenience for zero RatPoly
036 private RatPoly zero() {
037 return new RatPoly();
038 }
039
040 public RatPolyTest(String name) {
041 super(name);
042 }
043
044 // only toString is tested here
045 private void eq(RatPoly p, String target) {
046 String t = p.toString();
047 assertEquals(target, t);
048 }
049
050 private void eq(RatPoly p, String target, String message) {
051 String t = p.toString();
052 assertEquals(message, target, t);
053 }
054
055 // parses s into p, and then checks that it is as anticipated
056 // forall i, valueOf(s).coeff(anticipDegree - i) = anticipCoeffForExpts(i)
057 // (anticipDegree - i) means that we expect coeffs to be expressed
058 // corresponding to decreasing expts
059 private void eqP(String s, int anticipDegree, RatNum[] anticipCoeffs) {
060 RatPoly p = valueOf(s);
061 assertTrue(p.degree() == anticipDegree);
062 for (int i = 0; i <= anticipDegree; i++) {
063 assertTrue("wrong coeff; \n" + "anticipated: " + anticipCoeffs[i]
064 + "; received: " + p.getTerm(anticipDegree - i).getCoeff()
065 + "\n" + " received: " + p + " anticipated:" + s, p
066 .getTerm(anticipDegree - i).getCoeff().equals(
067 anticipCoeffs[i]));
068 }
069 }
070
071 // added convenience: express coeffs as ints
072 private void eqP(String s, int anticipDegree, int[] intCoeffs) {
073 RatNum[] coeffs = new RatNum[intCoeffs.length];
074 for (int i = 0; i < coeffs.length; i++) {
075 coeffs[i] = num(intCoeffs[i]);
076 }
077 eqP(s, anticipDegree, coeffs);
078 }
079
080 // make sure that unparsing a parsed string yields the string itself
081 private void assertToStringWorks(String s) {
082 assertEquals(s, valueOf(s).toString());
083 }
084
085 public void testNoArgCtor() {
086 eq(new RatPoly(), "0");
087 }
088
089 public void testTwoArgCtor() {
090 eq(poly(0, 0), "0");
091 eq(poly(0, 1), "0");
092 eq(poly(1, 0), "1");
093 eq(poly(-1, 0), "-1");
094 eq(poly(1, 1), "x");
095 eq(poly(1, 2), "x^2");
096 eq(poly(2, 2), "2*x^2");
097 eq(poly(2, 3), "2*x^3");
098 eq(poly(-2, 3), "-2*x^3");
099 eq(poly(-1, 1), "-x");
100 eq(poly(-1, 3), "-x^3");
101 }
102
103 public void testIsNaN() {
104 assertTrue(RatPoly.valueOf("NaN").isNaN());
105 assertFalse(RatPoly.valueOf("1").isNaN());
106 assertFalse(RatPoly.valueOf("1/2").isNaN());
107 assertFalse(RatPoly.valueOf("x+1").isNaN());
108 assertFalse(RatPoly.valueOf("x^2+x+1").isNaN());
109 RatPoly empty = new RatPoly();
110 assertTrue(empty.div(empty).isNaN());
111 }
112
113 public void testValueOfSimple() {
114 eqP("0", 0, new int[] { 0 });
115 eqP("x", 1, new int[] { 1, 0 });
116 eqP("x^2", 2, new int[] { 1, 0, 0 });
117 }
118
119 public void testValueOfMultTerms() {
120 eqP("x^3+x^2", 3, new int[] { 1, 1, 0, 0 });
121 eqP("x^3-x^2", 3, new int[] { 1, -1, 0, 0 });
122 eqP("x^10+x^2", 10, new int[] { 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 });
123 }
124
125 public void testValueOfLeadingNeg() {
126 eqP("-x^2", 2, new int[] { -1, 0, 0 });
127 eqP("-x^2+1", 2, new int[] { -1, 0, 1 });
128 eqP("-x^2+x", 2, new int[] { -1, 1, 0 });
129 }
130
131 public void testValueOfLeadingConstants() {
132 eqP("10*x", 1, new int[] { 10, 0 });
133
134 eqP("10*x^4+x^2", 4, new int[] { 10, 0, 1, 0, 0 });
135
136 eqP("10*x^4+100*x^2", 4, new int[] { 10, 0, 100, 0, 0 });
137
138 eqP("-10*x^4+100*x^2", 4, new int[] { -10, 0, 100, 0, 0 });
139 }
140
141 public void testValueOfRationals() {
142 eqP("1/2", 0, new RatNum[] { num(1).div(num(2)) });
143 eqP("1/2*x", 1, new RatNum[] { num(1).div(num(2)), num(0) });
144 eqP("x+1/3", 1, new RatNum[] { num(1), num(1).div(num(3)) });
145 eqP("1/2*x+1/3", 1, new RatNum[] { num(1).div(num(2)),
146 num(1).div(num(3)) });
147 eqP("1/2*x+3/2", 1, new RatNum[] { num(1).div(num(2)),
148 num(3).div(num(2)) });
149 eqP("1/2*x^3+3/2", 3, new RatNum[] { num(1).div(num(2)), num(0),
150 num(0), num(3).div(num(2)) });
151 eqP("1/2*x^3+3/2*x^2+1", 3, new RatNum[] { num(1).div(num(2)),
152 num(3).div(num(2)), num(0), num(1) });
153 }
154
155 public void testValueOfNaN() {
156 assertTrue(valueOf("NaN").isNaN());
157 }
158
159 public void testToStringSimple() {
160 assertToStringWorks("0");
161 assertToStringWorks("x");
162 assertToStringWorks("x^2");
163 }
164
165 public void testToStringMultTerms() {
166 assertToStringWorks("x^3+x^2");
167 assertToStringWorks("x^3-x^2");
168 assertToStringWorks("x^100+x^2");
169 }
170
171 public void testToStringLeadingNeg() {
172 assertToStringWorks("-x^2");
173 assertToStringWorks("-x^2+1");
174 assertToStringWorks("-x^2+x");
175 }
176
177 public void testToStringLeadingConstants() {
178 assertToStringWorks("10*x");
179 assertToStringWorks("10*x^100+x^2");
180 assertToStringWorks("10*x^100+100*x^2");
181 assertToStringWorks("-10*x^100+100*x^2");
182 }
183
184 public void testToStringRationals() {
185 assertToStringWorks("1/2");
186 assertToStringWorks("1/2*x");
187 assertToStringWorks("x+1/3");
188 assertToStringWorks("1/2*x+1/3");
189 assertToStringWorks("1/2*x+3/2");
190 assertToStringWorks("1/2*x^10+3/2");
191 assertToStringWorks("1/2*x^10+3/2*x^2+1");
192 }
193
194 public void testToStringNaN() {
195 assertToStringWorks("NaN");
196 }
197
198 public void testDegree() {
199 assertTrue("x^0 degree 0", poly(1, 0).degree() == 0);
200 assertTrue("x^1 degree 1", poly(1, 1).degree() == 1);
201 assertTrue("x^100 degree 100", poly(1, 100).degree() == 100);
202 assertTrue("0*x^100 degree 0", poly(0, 100).degree() == 0);
203 assertTrue("0*x^0 degree 0", poly(0, 0).degree() == 0);
204 }
205
206 public void testAdd() {
207 RatPoly _XSqPlus2X = poly(1, 2).add(poly(1, 1)).add(poly(1, 1));
208 RatPoly _2XSqPlusX = poly(1, 2).add(poly(1, 2)).add(poly(1, 1));
209
210 eq(poly(1, 0).add(poly(1, 0)), "2");
211 eq(poly(1, 0).add(poly(5, 0)), "6");
212 eq(poly(1, 0).add(poly(-1, 0)), "0");
213 eq(poly(1, 1).add(poly(1, 1)), "2*x");
214 eq(poly(1, 2).add(poly(1, 2)), "2*x^2");
215 eq(poly(1, 2).add(poly(1, 1)), "x^2+x");
216 eq(_XSqPlus2X, "x^2+2*x");
217 eq(_2XSqPlusX, "2*x^2+x");
218 eq(poly(1, 3).add(poly(1, 1)), "x^3+x");
219 }
220
221 public void testSub() {
222 eq(poly(1, 1).sub(poly(1, 0)), "x-1");
223 eq(poly(1, 1).add(poly(1, 0)), "x+1");
224 eq(poly(1, 0).sub(poly(1, 0)), "0");
225 }
226
227 public void testMul() {
228 eq(poly(0, 0).mul(poly(0, 0)), "0");
229 eq(poly(1, 0).mul(poly(1, 0)), "1");
230 eq(poly(1, 0).mul(poly(2, 0)), "2");
231 eq(poly(2, 0).mul(poly(2, 0)), "4");
232 eq(poly(1, 0).mul(poly(1, 1)), "x");
233 eq(poly(1, 1).mul(poly(1, 1)), "x^2");
234 eq(poly(1, 1).sub(poly(1, 0)).mul(poly(1, 1).add(poly(1, 0))), "x^2-1");
235 }
236
237 public void testOpsWithNaN(RatPoly p) {
238 RatPoly nan = RatPoly.valueOf("NaN");
239 eq(p.add(nan), "NaN");
240 eq(nan.add(p), "NaN");
241 eq(p.sub(nan), "NaN");
242 eq(nan.sub(p), "NaN");
243 eq(p.mul(nan), "NaN");
244 eq(nan.mul(p), "NaN");
245 eq(p.div(nan), "NaN");
246 eq(nan.div(p), "NaN");
247 }
248
249 public void testOpsWithNaN() {
250 testOpsWithNaN(poly(0, 0));
251 testOpsWithNaN(poly(0, 1));
252 testOpsWithNaN(poly(1, 0));
253 testOpsWithNaN(poly(1, 1));
254 testOpsWithNaN(poly(2, 0));
255 testOpsWithNaN(poly(2, 1));
256 testOpsWithNaN(poly(0, 2));
257 testOpsWithNaN(poly(1, 2));
258 }
259
260 public void testImmutabilityOfOperations() {
261 // not the most thorough test possible, but hopefully will
262 // catch the easy cases early on...
263 RatPoly one = poly(1, 0);
264 RatPoly two = poly(2, 0);
265 RatPoly empty = new RatPoly();
266
267 one.degree();
268 two.degree();
269 eq(one, "1", "Degree mutates receiver!");
270 eq(two, "2", "Degree mutates receiver!");
271
272 one.getTerm(0);
273 two.getTerm(0);
274 eq(one, "1", "Coeff mutates receiver!");
275 eq(two, "2", "Coeff mutates receiver!");
276
277 one.isNaN();
278 two.isNaN();
279 eq(one, "1", "isNaN mutates receiver!");
280 eq(two, "2", "isNaN mutates receiver!");
281
282 one.eval(0.0);
283 two.eval(0.0);
284 eq(one, "1", "eval mutates receiver!");
285 eq(two, "2", "eval mutates receiver!");
286
287 one.negate();
288 two.negate();
289 eq(one, "1", "Negate mutates receiver!");
290 eq(two, "2", "Negate mutates receiver!");
291
292 one.add(two);
293 eq(one, "1", "Add mutates receiver!");
294 eq(two, "2", "Add mutates argument!");
295
296 one.sub(two);
297 eq(one, "1", "Sub mutates receiver!");
298 eq(two, "2", "Sub mutates argument!");
299
300 one.mul(two);
301 eq(one, "1", "Mul mutates receiver!");
302 eq(two, "2", "Mul mutates argument!");
303
304 one.div(two);
305 eq(one, "1", "Div mutates receiver!");
306 eq(two, "2", "Div mutates argument!");
307
308 empty.div(new RatPoly());
309 assertFalse("Div Mutates reciever", empty.isNaN());
310 }
311
312 public void testEval() {
313 RatPoly zero = new RatPoly();
314 RatPoly one = new RatPoly(1, 0);
315 RatPoly _X = new RatPoly(1, 1);
316 RatPoly _2X = new RatPoly(2, 1);
317 RatPoly _XSq = new RatPoly(1, 2);
318
319 assertEquals(" 0 at 0 ", 0.0, zero.eval(0.0), 0.0001);
320 assertEquals(" 0 at 1 ", 0.0, zero.eval(1.0), 0.0001);
321 assertEquals(" 0 at 2 ", 0.0, zero.eval(2.0), 0.0001);
322 assertEquals(" 1 at 0 ", 1.0, one.eval(0.0), 0.0001);
323 assertEquals(" 1 at 1 ", 1.0, one.eval(1.0), 0.0001);
324 assertEquals(" 1 at 1 ", 1.0, one.eval(2.0), 0.0001);
325
326 assertEquals(" x at 0 ", 0.0, _X.eval(0.0), 0.0001);
327 assertEquals(" x at 1 ", 1.0, _X.eval(1.0), 0.0001);
328 assertEquals(" x at 2 ", 2.0, _X.eval(2.0), 0.0001);
329
330 assertEquals(" 2*x at 0 ", 0.0, _2X.eval(0.0), 0.0001);
331 assertEquals(" 2*x at 1 ", 2.0, _2X.eval(1.0), 0.0001);
332 assertEquals(" 2*x at 2 ", 4.0, _2X.eval(2.0), 0.0001);
333
334 assertEquals(" x^2 at 0 ", 0.0, _XSq.eval(0.0), 0.0001);
335 assertEquals(" x^2 at 1 ", 1.0, _XSq.eval(1.0), 0.0001);
336 assertEquals(" x^2 at 2 ", 4.0, _XSq.eval(2.0), 0.0001);
337
338 RatPoly _XSq_minus_2X = _XSq.sub(_2X);
339
340 assertEquals(" x^2-2*x at 0 ", 0.0, _XSq_minus_2X.eval(0.0), 0.0001);
341 assertEquals(" x^2-2*x at 1 ", -1.0, _XSq_minus_2X.eval(1.0), 0.0001);
342 assertEquals(" x^2-2*x at 2 ", 0.0, _XSq_minus_2X.eval(2.0), 0.0001);
343 assertEquals(" x^2-2*x at 3 ", 3.0, _XSq_minus_2X.eval(3.0), 0.0001);
344 }
345
346 public void testGetTerm() {
347 // getTerm already gets some grunt testing in eqP; checking an
348 // interesting
349 // input here...
350 RatPoly _XSqPlus2X = poly(1, 2).add(poly(1, 1)).add(poly(1, 1));
351 RatPoly _2XSqPlusX = poly(1, 2).add(poly(1, 2)).add(poly(1, 1));
352
353 assertEquals(RatTerm.ZERO, _XSqPlus2X.getTerm(-1));
354 assertEquals(RatTerm.ZERO, _XSqPlus2X.getTerm(-10));
355 assertEquals(RatTerm.ZERO, _2XSqPlusX.getTerm(-1));
356 assertEquals(RatTerm.ZERO, _2XSqPlusX.getTerm(-10));
357 assertEquals(RatTerm.ZERO, zero().getTerm(-10));
358 assertEquals(RatTerm.ZERO, zero().getTerm(-1));
359 }
360
361 public void testDiv() {
362 // 0/x = 0
363 eq(poly(0, 1).div(poly(1, 1)), "0");
364
365 // 2/1 = 2
366 eq(poly(2, 0).div(poly(1, 0)), "2");
367
368 // x/x = 1
369 eq(poly(1, 1).div(poly(1, 1)), "1");
370
371 // -x/x = -1
372 eq(poly(-1, 1).div(poly(1, 1)), "-1");
373
374 // x/-x = -1
375 eq(poly(1, 1).div(poly(-1, 1)), "-1");
376
377 // -x/-x = 1
378 eq(poly(-1, 1).div(poly(-1, 1)), "1");
379
380 // -x^2/x = -x
381 eq(poly(-1, 2).div(poly(1, 1)), "-x");
382
383 // x^100/x^1000 = 0
384 eq(poly(1, 100).div(poly(1, 1000)), "0");
385
386 // x^100/x = x^99
387 eq(poly(1, 100).div(poly(1, 1)), "x^99");
388
389 // x^99/x^98 = x
390 eq(poly(1, 99).div(poly(1, 98)), "x");
391
392 // x^10 / x = x^9 (r: 0)
393 eq(poly(1, 10).div(poly(1, 1)), "x^9");
394
395 // x^10 / x^3+x^2 = x^7-x^6+x^5-x^4+x^3-x^2+x-1 (r: -x^2)
396 eq(poly(1, 10).div(poly(1, 3).add(poly(1, 2))),
397 "x^7-x^6+x^5-x^4+x^3-x^2+x-1");
398
399 // x^10 / x^3+x^2+x = x^7-x^6+x^4-x^3+x-1 (r: -x)
400 eq(poly(1, 10).div(poly(1, 3).add(poly(1, 2).add(poly(1, 1)))),
401 "x^7-x^6+x^4-x^3+x-1");
402
403 // x^10+x^5 / x = x^9+x^4 (r: 0)
404 eq(poly(1, 10).add(poly(1, 5)).div(poly(1, 1)), "x^9+x^4");
405
406 // x^10+x^5 / x^3 = x^7+x^2 (r: 0)
407 eq(poly(1, 10).add(poly(1, 5)).div(poly(1, 3)), "x^7+x^2");
408
409 // x^10+x^5 / x^3+x+3 = x^7-x^5-3*x^4+x^3+7*x^2+8*x-10 (r:
410 // 29*x^2+14*x-30)
411 eq(poly(1, 10).add(poly(1, 5)).div(
412 poly(1, 3).add(poly(1, 1)).add(poly(3, 0))),
413 "x^7-x^5-3*x^4+x^3+7*x^2+8*x-10");
414 }
415
416 public void testDivComplexI() {
417 // (x+1)*(x+1) = x^2+2*x+1
418 eq(poly(1, 2).add(poly(2, 1)).add(poly(1, 0)).div(
419 poly(1, 1).add(poly(1, 0))), "x+1");
420
421 // (x-1)*(x+1) = x^2-1
422 eq(poly(1, 2).add(poly(-1, 0)).div(poly(1, 1).add(poly(1, 0))), "x-1");
423 }
424
425 public void testDivComplexII() {
426 // x^8+2*x^6+8*x^5+2*x^4+17*x^3+11*x^2+8*x+3 =
427 // (x^3+2*x+1) * (x^5+7*x^2+2*x+3)
428 RatPoly large = poly(1, 8).add(poly(2, 6)).add(poly(8, 5)).add(
429 poly(2, 4)).add(poly(17, 3)).add(poly(11, 2)).add(poly(8, 1))
430 .add(poly(3, 0));
431
432 // x^3+2*x+1
433 RatPoly sub1 = poly(1, 3).add(poly(2, 1)).add(poly(1, 0));
434 // x^5+7*x^2+2*x+3
435 RatPoly sub2 = poly(1, 5).add(poly(7, 2)).add(poly(2, 1)).add(
436 poly(3, 0));
437
438 // just a last minute typo check...
439 eq(sub1.mul(sub2), large.toString());
440 eq(sub2.mul(sub1), large.toString());
441
442 eq(large.div(sub2), "x^3+2*x+1");
443 eq(large.div(sub1), "x^5+7*x^2+2*x+3");
444 }
445
446 public void testDivExamplesFromSpec() {
447 // seperated this test case out because it has a dependency on
448 // both "valueOf" and "div" functioning properly
449
450 // example 1 from spec
451 eq(valueOf("x^3-2*x+3").div(valueOf("3*x^2")), "1/3*x");
452 // example 2 from spec
453 eq(valueOf("x^2+2*x+15").div(valueOf("2*x^3")), "0");
454 }
455
456 public void testDivExampleFromPset() {
457 eq(valueOf("x^8+x^6+10*x^4+10*x^3+8*x^2+2*x+8").div(
458 valueOf("3*x^6+5*x^4+9*x^2+4*x+8")), "1/3*x^2-2/9");
459 }
460
461 private void assertIsNaNanswer(RatPoly nanAnswer) {
462 eq(nanAnswer, "NaN");
463 }
464
465 public void testDivByZero() {
466 RatPoly nanAnswer;
467 nanAnswer = poly(1, 0).div(zero());
468 assertIsNaNanswer(nanAnswer);
469
470 nanAnswer = poly(1, 1).div(zero());
471 assertIsNaNanswer(nanAnswer);
472 }
473
474 public void testDivByPolyWithNaN() {
475 RatPoly nan_x2 = poly(1, 2).mul(poly(1, 1).div(zero()));
476 RatPoly one_x1 = new RatPoly(1, 1);
477
478 assertIsNaNanswer(nan_x2.div(one_x1));
479 assertIsNaNanswer(one_x1.div(nan_x2));
480 assertIsNaNanswer(nan_x2.div(zero()));
481 assertIsNaNanswer(zero().div(nan_x2));
482 assertIsNaNanswer(nan_x2.div(nan_x2));
483 }
484
485 public void testDifferentiate() {
486 eq(poly(1, 1).differentiate(), "1");
487 eq(quadPoly(7, 5, 99).differentiate(), "14*x+5");
488 eq(quadPoly(3, 2, 1).differentiate(), "6*x+2");
489 eq(quadPoly(1, 0, 1).differentiate(), "2*x");
490 assertIsNaNanswer(RatPoly.valueOf("NaN").differentiate());
491 }
492
493 public void testAntiDifferentiate() {
494 eq(poly(1, 0).antiDifferentiate(new RatNum(1)), "x+1");
495 eq(poly(2, 1).antiDifferentiate(new RatNum(1)), "x^2+1");
496 eq(quadPoly(0, 6, 2).antiDifferentiate(new RatNum(1)), "3*x^2+2*x+1");
497 eq(quadPoly(4, 6, 2).antiDifferentiate(new RatNum(0)),
498 "4/3*x^3+3*x^2+2*x");
499
500 assertIsNaNanswer(RatPoly.valueOf("NaN").antiDifferentiate(
501 new RatNum(1)));
502 assertIsNaNanswer(poly(1, 0).antiDifferentiate(new RatNum(1, 0)));
503 }
504
505 public void testIntegrate() {
506 assertEquals("one from 0 to 1", 1.0, poly(1, 0).integrate(0, 1), 0.0001);
507 assertEquals("2x from 1 to -2", 3.0, poly(2, 1).integrate(1, -2),
508 0.0001);
509 assertEquals("7*x^2+6*x+2 from 1 to 5", 369.33333333, quadPoly(7, 6, 2)
510 .integrate(1, 5), 0.0001);
511 assertEquals("NaN", RatPoly.valueOf("NaN").integrate(0, 1), Double.NaN);
512 }
513
514 // Tell JUnit what order to run the tests in
515 public static Test suite() {
516 TestSuite suite = new TestSuite();
517 suite.addTest(new RatPolyTest("testValueOfSimple"));
518 suite.addTest(new RatPolyTest("testValueOfMultTerms"));
519 suite.addTest(new RatPolyTest("testValueOfLeadingNeg"));
520 suite.addTest(new RatPolyTest("testValueOfLeadingConstants"));
521 suite.addTest(new RatPolyTest("testValueOfRationals"));
522 suite.addTest(new RatPolyTest("testValueOfNaN"));
523 suite.addTest(new RatPolyTest("testToStringSimple"));
524 suite.addTest(new RatPolyTest("testToStringMultTerms"));
525 suite.addTest(new RatPolyTest("testToStringLeadingNeg"));
526 suite.addTest(new RatPolyTest("testToStringLeadingConstants"));
527 suite.addTest(new RatPolyTest("testToStringRationals"));
528 suite.addTest(new RatPolyTest("testToStringNaN"));
529 suite.addTest(new RatPolyTest("testNoArgCtor"));
530 suite.addTest(new RatPolyTest("testTwoArgCtor"));
531 suite.addTest(new RatPolyTest("testDegree"));
532 suite.addTest(new RatPolyTest("testAdd"));
533 suite.addTest(new RatPolyTest("testSub"));
534 suite.addTest(new RatPolyTest("testMul"));
535 suite.addTest(new RatPolyTest("testOpsWithNaN"));
536 suite.addTest(new RatPolyTest("testDiv"));
537 suite.addTest(new RatPolyTest("testDivComplexI"));
538 suite.addTest(new RatPolyTest("testDivComplexII"));
539 suite.addTest(new RatPolyTest("testDivExamplesFromSpec"));
540 suite.addTest(new RatPolyTest("testDivExampleFromPset"));
541 suite.addTest(new RatPolyTest("testDivByZero"));
542 suite.addTest(new RatPolyTest("testDivByPolyWithNaN"));
543 suite.addTest(new RatPolyTest("testIsNaN"));
544 suite.addTest(new RatPolyTest("testEval"));
545 suite.addTest(new RatPolyTest("testImmutabilityOfOperations"));
546 suite.addTest(new RatPolyTest("testDifferentiate"));
547 suite.addTest(new RatPolyTest("testAntiDifferentiate"));
548 suite.addTest(new RatPolyTest("testIntegrate"));
549 return suite;
550 }
551 }