Fixed coeffs bug...

Coeffs need to be sorted BE and have zero coefficients for gaps for
correct long division operations in quotmod gcd etc...
Added Polynomial

Added Polynomial.scala to spire.math -> contains Term, Polynomial and
PolynomialRing
Added PolynomialTest.scala to tests/math -> contains tests for basic
functionality but not arithmetic yet.
Fixed coeff function bug in Polynomial class. Now outputs correct big
endian ordering.
Exponents are hardwired with Long as the concrete type.
Compiles and tests check.
Fixed polynomial arithmetic issues with sparse polynomials

Added an Eq[C] and Ring[C] evidence requirement for Polynomial
companion apply method. This enables filtering out the zero
coefficients for correct long division.
remove tabs from the source
add factory method to build polynomials from strings
ScalaCheck saves the day!

So, I went ahead and cleaned up the tests a bit, which included adding
a bunch of ScalaCheck properties. As soon as I did, the bugs started
popping out of the woodwork. There were three major classes of bugs:

1. Zero coefficient terms ending up in the map
2. Generating terms with the same degree via Map#map
3. Everything else

Type #1 was the most common. I ended up making the default constructor
private, and adding a factory method that removes zeros from the map
before calling new. I also added a few other strategic filters.

Type #2 caused problems with multiplication, and would potentially
have caused problems with the Iterable[Term[C]] constructor as well.
The issue here is essentially:

  Map(1 -> 9, 3 -> 6) map { case (k, v) => (k % 2, v) }

This returns Map(1 -> 6), since it discards the earlier (1, 9) tuple.
Obviously this caused us some problems.

Type #3 just encompassed everything else. The most notable bug here
was an issue when dividing by constants, where quotMod would hit a
divide-by-zero bug. I just special-cased that, which appeased
ScalaCheck. There may be a more principled solution.
Merge pull request #1 from non/topic/polynomials

Topic/polynomials
quotmod fix

Quotmod is fixed and now obeys the relevant algebra laws
Long -> Int
Array -> Long & therefore No more classtags
Views added to test
maxOrder is now degree as there are no zero terms allowed in a
Polynomial!
Merge pull request #135 from jamesthompson/2.10.0

Quotmod fixed & Int -> Long & Array -> List
C Type implicit requirements baked in

C must have Ring and Signed evidence now
.show removed, overriden toString

Tests updated to use .toString instead of .show
Merge remote-tracking branch 'james/2.10.0' into topic/polynomials
Updated info at top

doc info updated to reflect changes
Add binary operators directly to Term and Polynomial.

This moves much of the polynomial logic into Polynomial itself. It
adds generalized Ring[Polynomial[C]] and EuclideanRing[Polynomial[C]]
instances. And it simplifies a few other things.
Merge pull request #2 from non/topic/polynomials

Topic/polynomials
Add polynomial string interpolation support.

This change adds support for the poly"..." interpolator. For example:

    import spire.implicits._

    val i = 99.3
    val j = r"3/17"
    val k = BigInt(12345)

    poly"${i}x^2 + ${j}x + $k"

This will produce (993/10x^2 + 3/17x + 12345). Any value whose toString
produces a valid rational number will work, even things like:

    val s = "5"
    poly"${s}x + 1"

For now, this is all happening at runtime, although it would be
possible to write a macro that evaluates these at compile-time, when
there is no interpolation, e.g.:

    poly"x^2 + 3x - 6"

Also, this commit adds some cute new factory methods:

    Polynomial.constant(3.0)
    Polynomial.linear(r"44/7")
    Polynomial.quadratic(4)
    Polynomial.cubic(BigDecimal(16.23))
Merge pull request #3 from non/topic/polynomials

Add polynomial string interpolation support.
Polynomial Benchmarks

Added org.apache.commons commons-math3 3.2 dependency to Build.scala.
Added PolynomialBenchmark.scala caliper benchmarks to benchmark
subproject.
Minor changes
Benchmarking

Added Caliper benchmarks for basic polynomial operations.
Compares with basic operations from Apache Commons Math.