Skip to content

Commit a80765a

Browse files
committed
fix:
1 parent 0fe5a6a commit a80765a

File tree

14 files changed

+36
-36
lines changed

14 files changed

+36
-36
lines changed

benchmark/src/main/scala/spire/benchmark/Arrays.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ object Arrays {
5050
val order = Order[A]
5151
layout match {
5252
case ArrayOrder.Random =>
53-
case ArrayOrder.Sorted => spire.math.Sorting.sort(data)(order, ct)
54-
case ArrayOrder.Reversed => spire.math.Sorting.sort(data)(Order.reverse(order), ct)
53+
case ArrayOrder.Sorted => spire.math.Sorting.sort(data)(using order, ct)
54+
case ArrayOrder.Reversed => spire.math.Sorting.sort(data)(using Order.reverse(order), ct)
5555
}
5656
data
5757
}

benchmark/src/main/scala/spire/benchmark/SizedArrays.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ object SizedArrays {
4343
val order = Order[A]
4444
layout match {
4545
case ArrayOrder.Random =>
46-
case ArrayOrder.Sorted => spire.math.Sorting.sort(data)(order, ct)
47-
case ArrayOrder.Reversed => spire.math.Sorting.sort(data)(Order.reverse(order), ct)
46+
case ArrayOrder.Sorted => spire.math.Sorting.sort(data)(using order, ct)
47+
case ArrayOrder.Reversed => spire.math.Sorting.sort(data)(using Order.reverse(order), ct)
4848
}
4949
data
5050
}

core/src/main/scala/spire/algebra/UniqueFactorizationDomain.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ object UniqueFactorizationDomain {
6464
implicit def uniqueFactorizationDomainFromIntegral[A](implicit A: Integral[A]): UniqueFactorizationDomain[A] =
6565
new UniqueFactorizationDomain[A] {
6666
def isPrime(a: A): Boolean = SafeLong(A.toBigInt(a)).isPrime
67-
def factor(a: A): Decomposition[A] = WrapDecomposition[A](SafeLong(A.toBigInt(a)).factor)(A)
67+
def factor(a: A): Decomposition[A] = WrapDecomposition[A](SafeLong(A.toBigInt(a)).factor)(using A)
6868
}
6969
}

core/src/main/scala/spire/math/Polynomial.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ trait Polynomial[@sp(Double) C] { lhs =>
507507
foreach { (e, c) => bldr += Term(c, e) }
508508

509509
val ts = bldr.result()
510-
QuickSort.sort(ts)(Order.reverse(Order[Term[C]]), implicitly[ClassTag[Term[C]]])
510+
QuickSort.sort(ts)(using Order.reverse(Order[Term[C]]), implicitly[ClassTag[Term[C]]])
511511
val s = ts.mkString
512512
"(" + (if (s.take(3) == " - ") "-" + s.drop(3) else s.drop(3)) + ")"
513513
}

core/src/main/scala/spire/optional/vectorOrder.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ trait VectorOrderLow {
2727
implicit def seqEq[A, CC[A] <: SeqOps[A, Seq, CC[A]]](implicit
2828
A0: Eq[A],
2929
module: CModule[CC[A], A]
30-
): SeqVectorEq[A, CC[A]] = new SeqVectorEq[A, CC[A]]()(A0, module.scalar)
30+
): SeqVectorEq[A, CC[A]] = new SeqVectorEq[A, CC[A]](using A0, module.scalar)
3131

3232
implicit def arrayEq[@sp(Int, Long, Float, Double) A](implicit
3333
ev: Eq[A],
3434
module: CModule[Array[A], A]
3535
): ArrayVectorEq[A] =
36-
new ArrayVectorEq[A]()(ev, module.scalar)
36+
new ArrayVectorEq[A](using ev, module.scalar)
3737

3838
implicit def mapEq[K, V](implicit V0: Eq[V], module: CModule[Map[K, V], V]): MapVectorEq[K, V] =
3939
new MapVectorEq[K, V]()(V0, module.scalar)
@@ -48,11 +48,11 @@ object vectorOrder extends VectorOrderLow {
4848
implicit def seqOrder[A, CC[A] <: SeqOps[A, Seq, CC[A]]](implicit
4949
A0: Order[A],
5050
module: CModule[CC[A], A]
51-
): SeqVectorOrder[A, CC[A]] = new SeqVectorOrder[A, CC[A]]()(A0, module.scalar)
51+
): SeqVectorOrder[A, CC[A]] = new SeqVectorOrder[A, CC[A]](using A0, module.scalar)
5252

5353
implicit def arrayOrder[@sp(Int, Long, Float, Double) A](implicit
5454
ev: Order[A],
5555
module: CModule[Array[A], A]
5656
): ArrayVectorOrder[A] =
57-
new ArrayVectorOrder[A]()(ev, module.scalar)
57+
new ArrayVectorOrder[A](using ev, module.scalar)
5858
}

extras/src/main/scala/spire/math/extras/interval/IntervalSeq.scala

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,13 @@ object IntervalSeq {
235235

236236
def hole[T: Order](value: T): IntervalSeq[T] = singleton(true, value, K01)
237237

238-
def empty[T: Order]: IntervalSeq[T] = new IntervalSeq[T](false, Array()(classTag), Array(), implicitly[Order[T]])
238+
def empty[T: Order]: IntervalSeq[T] =
239+
new IntervalSeq[T](false, Array()(using classTag), Array(), implicitly[Order[T]])
239240

240-
def all[T: Order]: IntervalSeq[T] = new IntervalSeq[T](true, Array()(classTag), Array(), implicitly[Order[T]])
241+
def all[T: Order]: IntervalSeq[T] = new IntervalSeq[T](true, Array()(using classTag), Array(), implicitly[Order[T]])
241242

242243
implicit def apply[T: Order](value: Boolean): IntervalSeq[T] =
243-
new IntervalSeq[T](value, Array()(classTag), Array(), implicitly[Order[T]])
244+
new IntervalSeq[T](value, Array()(using classTag), Array(), implicitly[Order[T]])
244245

245246
implicit def apply[T: Order](interval: Interval[T]): IntervalSeq[T] = interval.fold {
246247
case (Closed(a), Closed(b)) if a == b => point(a)
@@ -265,12 +266,12 @@ object IntervalSeq {
265266
}
266267

267268
private def fromTo[T: Order](a: T, ak: Byte, b: T, bk: Byte) =
268-
new IntervalSeq[T](false, Array(a, b)(classTag), Array(ak, bk), implicitly[Order[T]])
269+
new IntervalSeq[T](false, Array(a, b)(using classTag), Array(ak, bk), implicitly[Order[T]])
269270

270271
private def wrong: Nothing = throw new IllegalStateException("")
271272

272273
private def singleton[T: Order](belowAll: Boolean, value: T, kind: Byte): IntervalSeq[T] =
273-
new IntervalSeq(belowAll, Array(value)(classTag), Array(kind), implicitly[Order[T]])
274+
new IntervalSeq(belowAll, Array(value)(using classTag), Array(kind), implicitly[Order[T]])
274275

275276
final private val K00 = 0
276277

@@ -320,7 +321,7 @@ object IntervalSeq {
320321

321322
private[this] val order = lhs.order
322323

323-
private[this] val r = Array.ofDim[T](a.length + b.length)(classTag)
324+
private[this] val r = Array.ofDim[T](a.length + b.length)(using classTag)
324325

325326
private[this] val rk = new Array[Byte](a.length + b.length)
326327

@@ -391,7 +392,7 @@ object IntervalSeq {
391392
fromA(a0, a1, bBelow(b0))
392393
} else {
393394
val am = (a0 + a1) / 2
394-
val res = Searching.search(b, a(am), b0, b1 - 1)(order)
395+
val res = Searching.search(b, a(am), b0, b1 - 1)(using order)
395396
if (res >= 0) {
396397
// same elements
397398
val bm = res
@@ -518,7 +519,7 @@ object IntervalSeq {
518519
fromA(a0, a1, bBelow(b0))
519520
} else {
520521
val am = (a0 + a1) / 2
521-
val res = Searching.search(b, a(am), b0, b1 - 1)(order)
522+
val res = Searching.search(b, a(am), b0, b1 - 1)(using order)
522523
if (res >= 0) {
523524
// same elements
524525
val bm = res

extras/src/main/scala/spire/math/extras/interval/IntervalTrie.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ object IntervalTrie {
258258
r.toLong
259259
}
260260
def intervalToIntervalSet(i: Interval[Long]): IntervalTrie[Long] = apply(i)
261-
val intervals = text.split(';').map(Interval.apply).map(_.mapBounds(rationalToLong)(la))
261+
val intervals = text.split(';').map(Interval.apply).map(_.mapBounds(rationalToLong)(using la))
262262
val simpleSets = intervals.map(intervalToIntervalSet)
263263
simpleSets.foldLeft(empty[Long])(_ | _)
264264
}

laws/src/main/scala/spire/laws/RingLaws.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,8 @@ trait RingLaws[A] extends GroupLaws[A] {
4545
val nonZeroLaws: GroupLaws[A]
4646
def pred: Predicate[A]
4747

48-
def withPred(_pred: Predicate[A], replace: Boolean = true): RingLaws[A] = RingLaws[A](
49-
Equ,
50-
Arb,
51-
if (replace) _pred else pred && _pred
52-
)
48+
def withPred(_pred: Predicate[A], replace: Boolean = true): RingLaws[A] =
49+
RingLaws[A](using Equ, Arb, if (replace) _pred else pred && _pred)
5350

5451
implicit def Arb: Arbitrary[A]
5552
implicit def Equ: Eq[A] = nonZeroLaws.Equ

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.9.8
1+
sbt.version=1.11.6

tests/shared/src/test/scala/spire/SyntaxScalaCheckSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class SyntaxScalaCheckSuite extends munit.ScalaCheckSuite with BaseSyntaxSuite {
7373
property("Semigroup syntax")(forAll { (a: String, b: String) => testSemigroupSyntax(a, b) })
7474
property("Monoid syntax")(forAll { (a: String, b: String) => testMonoidSyntax(a, b) })
7575
property("Group syntax")(forAll { (a: Int, b: Int) =>
76-
testMonoidSyntax(a, b)(AdditiveGroup[Int].additive, implicitly)
76+
testMonoidSyntax(a, b)(using AdditiveGroup[Int].additive, implicitly)
7777
})
7878
property("AdditiveSemigroup syntax")(forAll { (a: Int, b: Int) => testAdditiveSemigroupSyntax(a, b) })
7979
property("AdditiveMonoid syntax")(forAll { (a: Int, b: Int) => testAdditiveMonoidSyntax(a, b) })
@@ -89,7 +89,7 @@ class SyntaxScalaCheckSuite extends munit.ScalaCheckSuite with BaseSyntaxSuite {
8989
property("Ring syntax")(forAll { (a: Int, b: Int) => testRingSyntax(a, b) })
9090
property("EuclideanRing syntax")(forAll { (a: Int, b: NonZero[Int]) => testEuclideanRingSyntax(a, b.x) })
9191
property("Field syntax")(forAll { (a: Double, b: NonZero[Double]) =>
92-
testFieldSyntax(a, b.x)(implicitly, spire.optional.totalfloat.TotalDoubleOrder)
92+
testFieldSyntax(a, b.x)(using implicitly, spire.optional.totalfloat.TotalDoubleOrder)
9393
})
9494
property("NRoot syntax")(forAll { (a: Positive[Double]) => testNRootSyntax(a.x) })
9595
property("LeftModule syntax")(forAll { (v: Vector[Int], w: Vector[Int], a: Int) => testLeftModuleSyntax(v, w, a) })

0 commit comments

Comments
 (0)