Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactor numerics -> spire

  • Loading branch information...
commit b3eaa0f2ed00c087bcd6c11f4c957d2933f23941 1 parent 1d1b0df
@non authored
Showing with 84 additions and 85 deletions.
  1. +1 −1  README
  2. 0  { → doc}/numeric-pre-sip.txt
  3. +3 −4 project/Build.scala
  4. +2 −2 src/main/scala/benchmark/Benchmark.scala
  5. +2 −2 src/main/scala/{numerics → spire}/math/Approximation.scala
  6. +1 −1  src/main/scala/{numerics → spire}/math/ApproximationContext.scala
  7. +2 −2 src/main/scala/{numerics → spire}/math/Complex.scala
  8. +1 −1  src/main/scala/{numerics → spire}/math/Convertable.scala
  9. +1 −1  src/main/scala/{numerics → spire}/math/Eq.scala
  10. +1 −1  src/main/scala/{numerics → spire}/math/EuclideanRing.scala
  11. +1 −1  src/main/scala/{numerics → spire}/math/Field.scala
  12. +1 −1  src/main/scala/{numerics → spire}/math/Fractional.scala
  13. +1 −1  src/main/scala/{numerics → spire}/math/Implicits.scala
  14. +1 −1  src/main/scala/{numerics → spire}/math/Integral.scala
  15. +1 −1  src/main/scala/{numerics → spire}/math/Interval.scala
  16. +1 −1  src/main/scala/{numerics → spire}/math/Monoid.scala
  17. +1 −1  src/main/scala/{numerics → spire}/math/NRoot.scala
  18. +2 −2 src/main/scala/{numerics → spire}/math/Number.scala
  19. +1 −1  src/main/scala/{numerics → spire}/math/Numeric.scala
  20. +1 −1  src/main/scala/{numerics → spire}/math/Order.scala
  21. +1 −1  src/main/scala/{numerics → spire}/math/Rational.scala
  22. +1 −1  src/main/scala/{numerics → spire}/math/Real.scala
  23. +1 −1  src/main/scala/{numerics → spire}/math/Ring.scala
  24. +1 −1  src/main/scala/{numerics → spire}/math/SafeLong.scala
  25. +1 −1  src/main/scala/{numerics → spire}/math/Semigroup.scala
  26. +1 −1  src/main/scala/{numerics → spire}/math/Sign.scala
  27. +1 −1  src/main/scala/{numerics → spire}/math/Sorting.scala
  28. +1 −1  src/main/scala/{numerics → spire}/math/Trig.scala
  29. +2 −2 src/main/scala/{numerics → spire}/math/fpf/FPFilter.scala
  30. +2 −2 src/main/scala/{numerics → spire}/math/fpf/FPFilterWrapper.scala
  31. +2 −2 src/main/scala/{numerics → spire}/math/fpf/MaybeDouble.scala
  32. +2 −2 src/main/scala/{numerics → spire}/math/real/BMFSSBound.scala
  33. +2 −2 src/main/scala/{numerics → spire}/math/real/BigDecimalApprox.scala
  34. +2 −2 src/main/scala/{numerics → spire}/math/real/BigDecimalApproximations.scala
  35. +2 −2 src/main/scala/{numerics → spire}/math/real/BubbleUpDivs.scala
  36. +1 −1  src/main/scala/{numerics → spire}/math/real/ConstantFolder.scala
  37. +3 −3 src/main/scala/{numerics → spire}/math/real/Expr.scala
  38. +3 −3 src/main/scala/{numerics → spire}/math/real/FPFilter.scala
  39. +1 −1  src/main/scala/{numerics → spire}/math/real/PrettyToString.scala
  40. +2 −2 src/main/scala/{numerics → spire}/math/real/RealLike.scala
  41. +2 −2 src/main/scala/{numerics → spire}/math/real/RealTransform.scala
  42. +1 −1  src/main/scala/{numerics → spire}/math/real/SeparationBound.scala
  43. +1 −1  src/main/scala/{numerics → spire}/math/real/TreeString.scala
  44. +1 −1  src/main/scala/{numerics → spire}/package.scala
  45. +2 −2 src/test/scala/{numerics → spire}/math/ComplexTest.scala
  46. +1 −1  src/test/scala/{numerics → spire}/math/NumberTest.scala
  47. +1 −1  src/test/scala/{numerics → spire}/math/NumericTest.scala
  48. +2 −2 src/test/scala/{numerics → spire}/math/PackageTest.scala
  49. +1 −1  src/test/scala/{numerics → spire}/math/RationalTest.scala
  50. +1 −1  src/test/scala/{numerics → spire}/math/RealTest.scala
  51. +2 −2 src/test/scala/{numerics → spire}/math/RingTest.scala
  52. +4 −4 src/test/scala/{numerics → spire}/math/SortingTest.scala
  53. +2 −2 src/test/scala/{numerics → spire}/math/TypeclassExistenceTest.scala
  54. +2 −2 src/test/scala/{numerics → spire}/math/fpf/FPFilterTest.scala
  55. +2 −2 src/test/scala/{numerics → spire}/math/fpf/MaybeDoubleTest.scala
  56. +2 −2 src/test/scala/{numerics → spire}/math/real/BubbleUpDivsTest.scala
View
2  README
@@ -1,4 +1,4 @@
-This is a library intended to support fast, generic math in Scala. It also
+Spire a library intended to support fast, generic math in Scala. It also
adds some new number types (Complex[T], Rational, etc.).
It began life as a series of proposed changes. At this point the hope is to
View
0  numeric-pre-sip.txt → doc/numeric-pre-sip.txt
File renamed without changes
View
7 project/Build.scala
@@ -3,11 +3,10 @@ import sbt.Keys._
object MyBuild extends Build {
lazy val project = Project("root", file(".")) settings(
- name := "Scala Numerics",
- organization := "na",
+ name := "Spire",
scalaVersion := "2.9.1",
- version := "0.1",
+ version := "0.2.0",
scalacOptions ++= Seq("-deprecation", "-unchecked", "-optimize"),
@@ -19,7 +18,7 @@ object MyBuild extends Build {
),
resolvers ++= Seq(
- "Scala-Tools" at "http://www.scala-tools.org/repo-reloases/",
+ //"Scala-Tools" at "http://www.scala-tools.org/repo-reloases/",
"Sonatype" at "http://oss.sonatype.org/content/repositories/snapshots"
),
View
4 src/main/scala/benchmark/Benchmark.scala
@@ -3,8 +3,8 @@ package benchmark
import scala.{specialized => spec}
import scala.util.Random._
-import numerics.math._
-import numerics.math.Implicits._
+import spire.math._
+import spire.math.Implicits._
import com.google.caliper.Runner
import com.google.caliper.SimpleBenchmark
View
4 ...n/scala/numerics/math/Approximation.scala → ...main/scala/spire/math/Approximation.scala
@@ -1,8 +1,8 @@
-package numerics.math
+package spire.math
import java.math.{ MathContext, BigDecimal => BigDec }
import scala.math.max
-import numerics.math.real.BigDecimalApproximations
+import spire.math.real.BigDecimalApproximations
/**
View
2  .../numerics/math/ApproximationContext.scala → ...ala/spire/math/ApproximationContext.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
case class ApproximationContext[A](error: A)
object ApproximationContext {
View
4 src/main/scala/numerics/math/Complex.scala → src/main/scala/spire/math/Complex.scala
@@ -1,10 +1,10 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec}
import scala.math.{ScalaNumber, ScalaNumericConversions}
import scala.math.{Pi, atan2, cos, exp, log, sin, sqrt}
-import numerics.math.fun._
+import spire.math.fun._
import Implicits._
// TODO: refactor places where Fractional is converted to Double in order to
View
2  ...ain/scala/numerics/math/Convertable.scala → src/main/scala/spire/math/Convertable.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
trait ConvertableTo[@specialized A] {
def fromByte(a:Byte): A
View
2  src/main/scala/numerics/math/Eq.scala → src/main/scala/spire/math/Eq.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec}
View
2  ...n/scala/numerics/math/EuclideanRing.scala → ...main/scala/spire/math/EuclideanRing.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec}
import scala.math.{abs, ceil, floor}
View
2  src/main/scala/numerics/math/Field.scala → src/main/scala/spire/math/Field.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec}
View
2  ...main/scala/numerics/math/Fractional.scala → src/main/scala/spire/math/Fractional.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec}
View
2  src/main/scala/numerics/math/Implicits.scala → src/main/scala/spire/math/Implicits.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec}
View
2  src/main/scala/numerics/math/Integral.scala → src/main/scala/spire/math/Integral.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec}
View
2  src/main/scala/numerics/math/Interval.scala → src/main/scala/spire/math/Interval.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import Implicits._
View
2  src/main/scala/numerics/math/Monoid.scala → src/main/scala/spire/math/Monoid.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
trait Monoid[A] extends Semigroup[A] {
def identity: A
View
2  src/main/scala/numerics/math/NRoot.scala → src/main/scala/spire/math/NRoot.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec, math => mth}
import java.math.MathContext
View
4 src/main/scala/numerics/math/Number.scala → src/main/scala/spire/math/Number.scala
@@ -1,8 +1,8 @@
-package numerics.math
+package spire.math
import scala.math.{ScalaNumber, ScalaNumericConversions, floor}
import Implicits._
-import numerics.math.fun._
+import spire.math.fun._
// TODO: implement at least BigIntNumber, BigDecimalNumber, RationalNumber.
// TODO: implement toNumber and fromNumber in ConvertableTo/From.
View
2  src/main/scala/numerics/math/Numeric.scala → src/main/scala/spire/math/Numeric.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec}
View
2  src/main/scala/numerics/math/Order.scala → src/main/scala/spire/math/Order.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec}
View
2  src/main/scala/numerics/math/Rational.scala → src/main/scala/spire/math/Rational.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.math.{ScalaNumber, ScalaNumericConversions, abs, min}
import Implicits._
View
2  src/main/scala/numerics/math/Real.scala → src/main/scala/spire/math/Real.scala
@@ -15,7 +15,7 @@
* http://stubber.math-inf.uni-greifswald.de/informatik/PEOPLE/Papers/ESA01/sepbound01.pd
* [3] "A New Constructive Root Bound for Algebraic Expressions." C. Li and C. Yap.
*/
-package numerics.math
+package spire.math
import java.math.{ MathContext, BigInteger, BigDecimal => BigDec }
import scala.math.{ ScalaNumber, ScalaNumericConversions, max }
View
2  src/main/scala/numerics/math/Ring.scala → src/main/scala/spire/math/Ring.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec}
import scala.math.{abs, ceil, floor, pow => mpow}
View
2  src/main/scala/numerics/math/SafeLong.scala → src/main/scala/spire/math/SafeLong.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.math.{abs, signum}
View
2  src/main/scala/numerics/math/Semigroup.scala → src/main/scala/spire/math/Semigroup.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
trait Semigroup[A] extends Eq[A] {
def op(x:A, y:A): A
View
2  src/main/scala/numerics/math/Sign.scala → src/main/scala/spire/math/Sign.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
/**
* The `Sign` of a number.
View
2  src/main/scala/numerics/math/Sorting.scala → src/main/scala/spire/math/Sorting.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec}
import scala.math.min
View
2  src/main/scala/numerics/math/Trig.scala → src/main/scala/spire/math/Trig.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.{specialized => spec, math => mth}
View
4 ...in/scala/numerics/math/fpf/FPFilter.scala → src/main/scala/spire/math/fpf/FPFilter.scala
@@ -1,9 +1,9 @@
-package numerics.math.fpf
+package spire.math.fpf
import scala.math.{ max, abs }
import java.lang.Double.{ NaN, isNaN, isInfinite }
-import numerics.math._
+import spire.math._
import Implicits._
View
4 ...a/numerics/math/fpf/FPFilterWrapper.scala → ...cala/spire/math/fpf/FPFilterWrapper.scala
@@ -1,6 +1,6 @@
-package numerics.math.fpf
+package spire.math.fpf
-import numerics.math._
+import spire.math._
import Implicits._
View
4 ...scala/numerics/math/fpf/MaybeDouble.scala → ...in/scala/spire/math/fpf/MaybeDouble.scala
@@ -1,6 +1,6 @@
-package numerics.math.fpf
+package spire.math.fpf
-import numerics.math._
+import spire.math._
import scala.math.{ max, abs }
import java.lang.Double.{ NaN, isNaN, isInfinite }
View
4 ...scala/numerics/math/real/BMFSSBound.scala → ...in/scala/spire/math/real/BMFSSBound.scala
@@ -1,6 +1,6 @@
-package numerics.math.real
+package spire.math.real
-import numerics.math._
+import spire.math._
import Implicits._
View
4 ...numerics/math/real/BigDecimalApprox.scala → ...la/spire/math/real/BigDecimalApprox.scala
@@ -1,6 +1,6 @@
-package numerics.math.real
+package spire.math.real
-import numerics.math._
+import spire.math._
import java.math.MathContext
import Implicits._
View
4 .../math/real/BigDecimalApproximations.scala → .../math/real/BigDecimalApproximations.scala
@@ -1,9 +1,9 @@
-package numerics.math.real
+package spire.math.real
import java.math.{ MathContext, BigDecimal => BigDec }
import scala.math.max
-import numerics.math._
+import spire.math._
/**
* Provides absolute and relative approximations to `RealLike` types that have
View
4 ...ala/numerics/math/real/BubbleUpDivs.scala → .../scala/spire/math/real/BubbleUpDivs.scala
@@ -1,6 +1,6 @@
-package numerics.math.real
+package spire.math.real
-import numerics.math._
+import spire.math._
/**
View
2  ...a/numerics/math/real/ConstantFolder.scala → ...cala/spire/math/real/ConstantFolder.scala
@@ -1,4 +1,4 @@
-package numerics.math.real
+package spire.math.real
/**
View
6 src/main/scala/numerics/math/real/Expr.scala → src/main/scala/spire/math/real/Expr.scala
@@ -1,8 +1,8 @@
-package numerics.math.real
+package spire.math.real
-import numerics.math.fpf.MaybeDouble
+import spire.math.fpf.MaybeDouble
-import numerics.math._
+import spire.math._
/**
View
6 ...n/scala/numerics/math/real/FPFilter.scala → ...main/scala/spire/math/real/FPFilter.scala
@@ -1,7 +1,7 @@
-package numerics.math.real
+package spire.math.real
-import numerics.math.fpf.MaybeDouble
-import numerics.math._
+import spire.math.fpf.MaybeDouble
+import spire.math._
/**
View
2  ...a/numerics/math/real/PrettyToString.scala → ...cala/spire/math/real/PrettyToString.scala
@@ -1,4 +1,4 @@
-package numerics.math.real
+package spire.math.real
trait PrettyToString[A <: PrettyToString[A]] extends RealLike[A] { self: A =>
View
4 ...n/scala/numerics/math/real/RealLike.scala → ...main/scala/spire/math/real/RealLike.scala
@@ -1,6 +1,6 @@
-package numerics.math.real
+package spire.math.real
-import numerics.math._
+import spire.math._
import java.math.MathContext
View
4 ...la/numerics/math/real/RealTransform.scala → ...scala/spire/math/real/RealTransform.scala
@@ -1,6 +1,6 @@
-package numerics.math.real
+package spire.math.real
-import numerics.math._
+import spire.math._
/**
View
2  .../numerics/math/real/SeparationBound.scala → ...ala/spire/math/real/SeparationBound.scala
@@ -1,4 +1,4 @@
-package numerics.math.real
+package spire.math.real
/**
View
2  ...scala/numerics/math/real/TreeString.scala → ...in/scala/spire/math/real/TreeString.scala
@@ -1,4 +1,4 @@
-package numerics.math.real
+package spire.math.real
sealed trait TreeString {
View
2  src/main/scala/numerics/package.scala → src/main/scala/spire/package.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import scala.annotation.tailrec
View
4 ...est/scala/numerics/math/ComplexTest.scala → src/test/scala/spire/math/ComplexTest.scala
@@ -1,7 +1,7 @@
-package numerics.math
+package spire.math
import org.scalatest.FunSuite
-import numerics.math.fun._
+import spire.math.fun._
import Implicits.{eqOps => _, _}
import java.math.MathContext
View
2  ...test/scala/numerics/math/NumberTest.scala → src/test/scala/spire/math/NumberTest.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import org.scalatest.FunSuite
View
2  ...est/scala/numerics/math/NumericTest.scala → src/test/scala/spire/math/NumericTest.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
// scalatest
import org.scalatest.FunSuite
View
4 ...est/scala/numerics/math/PackageTest.scala → src/test/scala/spire/math/PackageTest.scala
@@ -1,6 +1,6 @@
-package numerics.math
+package spire.math
-import numerics.math.fun._
+import spire.math.fun._
import org.scalatest.FunSuite
View
2  ...st/scala/numerics/math/RationalTest.scala → src/test/scala/spire/math/RationalTest.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import org.scalatest.FunSuite
View
2  src/test/scala/numerics/math/RealTest.scala → src/test/scala/spire/math/RealTest.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
import org.scalatest.FunSuite
import java.math.MathContext
View
4 src/test/scala/numerics/math/RingTest.scala → src/test/scala/spire/math/RingTest.scala
@@ -1,4 +1,4 @@
-package numerics.math
+package spire.math
// scalatest
import org.scalatest.FunSuite
@@ -11,7 +11,7 @@ import scala.{specialized => spec}
import java.math.MathContext
-import numerics.math.fpf.FPFilter
+import spire.math.fpf.FPFilter
class RingTest extends FunSuite {
View
8 ...est/scala/numerics/math/SortingTest.scala → src/test/scala/spire/math/SortingTest.scala
@@ -1,6 +1,6 @@
-package numerics.math
+package spire.math
-import numerics.math.fun._
+import spire.math.fun._
import org.scalatest.FunSuite
@@ -18,7 +18,7 @@ class SortingTest extends FunSuite {
Sorting.mergeSort(quicked)
// make sure our result is ok
- for (i <- 0 until goal.length) assert(merged(i) === goal(i))
- for (i <- 0 until goal.length) assert(quicked(i) === goal(i))
+ for (i <- 0 until before.length) assert(merged(i) === goal(i))
+ for (i <- 0 until before.length) assert(quicked(i) === goal(i))
}
}
View
4 ...umerics/math/TypeclassExistenceTest.scala → ...a/spire/math/TypeclassExistenceTest.scala
@@ -1,6 +1,6 @@
-package test.scala.numerics.math
+package test.scala.spire.math
-import numerics.math._
+import spire.math._
import Implicits._
import java.math.MathContext
View
4 ...cala/numerics/math/fpf/FPFilterTest.scala → ...t/scala/spire/math/fpf/FPFilterTest.scala
@@ -1,6 +1,6 @@
-package numerics.math.fpf
+package spire.math.fpf
-import numerics.math._
+import spire.math._
import Implicits._
import org.scalatest.FunSuite
View
4 ...a/numerics/math/fpf/MaybeDoubleTest.scala → ...cala/spire/math/fpf/MaybeDoubleTest.scala
@@ -1,6 +1,6 @@
-package numerics.math.fpf
+package spire.math.fpf
-import numerics.math._
+import spire.math._
import org.scalatest.FunSuite
View
4 ...numerics/math/real/BubbleUpDivsTest.scala → ...la/spire/math/real/BubbleUpDivsTest.scala
@@ -1,6 +1,6 @@
-package test.scala.numerics.math.real
+package test.scala.spire.math.real
-import numerics.math._
+import spire.math._
import Implicits._
import real._
Please sign in to comment.
Something went wrong with that request. Please try again.