Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Quafadas committed Nov 20, 2024
1 parent 6951559 commit 5928b22
Show file tree
Hide file tree
Showing 23 changed files with 110 additions and 91 deletions.
2 changes: 1 addition & 1 deletion vecxt/js-native/src/array.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package vecxt

import narr.*
import narr._
import vecxt.matrix.Matrix

// These use project panama (SIMD) on the JVM, so need own JS native implementation
Expand Down
7 changes: 4 additions & 3 deletions vecxt/js/src/array.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
*/
package vecxt

import narr._
import vecxt.BoundsCheck.BoundsCheck

import scala.scalajs.js
import scala.scalajs.js.typedarray.Float64Array
import scala.util.chaining.*
import narr.*
import vecxt.BoundsCheck.BoundsCheck
import scala.util.chaining._

object arrayUtil:
extension [A](d: Array[A]) def printArr: String = d.mkString("[", ",", "]")
Expand Down
5 changes: 3 additions & 2 deletions vecxt/js/src/dimCheck.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@

package vecxt

import narr._
import vecxt.BoundsCheck.BoundsCheck

import scala.scalajs.js
import scala.scalajs.js.typedarray.Float64Array
import vecxt.BoundsCheck.BoundsCheck
import narr.*

protected[vecxt] object dimCheckLen:
inline def apply(a: Float64Array, b: Int)(using inline doCheck: BoundsCheck) =
Expand Down
16 changes: 9 additions & 7 deletions vecxt/js/src/doublematrix.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package vecxt

import narr.*
import matrix.*
import vecxt.MatrixHelper.*
import vecxt.MatrixInstance.*
import scala.scalajs.js.typedarray.Float64Array
import narr._
import vecxt.BoundsCheck.BoundsCheck
import vecxt.arrays.*
import vecxt.rangeExtender.MatrixRange.range
import vecxt.MatrixHelper._
import vecxt.MatrixInstance._
import vecxt.arrays._
import vecxt.rangeExtender.MatrixRange.RangeExtender
import vecxt.rangeExtender.MatrixRange.range

import scala.scalajs.js.typedarray.Float64Array

import matrix._

object JsDoubleMatrix:

Expand Down
6 changes: 4 additions & 2 deletions vecxt/js/src/rpt.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package vecxt.reinsurance

import vecxt.arrays._

import scala.scalajs.js.typedarray.Float64Array

import Limits.Limit
import Retentions.Retention
import vecxt.arrays.*
import scala.scalajs.js.typedarray.Float64Array

/*
Expand Down
2 changes: 1 addition & 1 deletion vecxt/jvm-native/src/dimCheck.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package vecxt

import vecxt.matrix.*
import vecxt.BoundsCheck.BoundsCheck
import vecxt.matrix._

protected[vecxt] object dimCheckLen:
inline def apply[A](a: Array[A], b: Int)(using inline doCheck: BoundsCheck) =
Expand Down
12 changes: 7 additions & 5 deletions vecxt/jvm-native/src/doublematrix.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package vecxt

import matrix.*
import narr.*
import narr._
import vecxt.BoundsCheck.BoundsCheck
import vecxt.arrays.*
import vecxt.DoubleArrays._
import vecxt.MatrixInstance._
import vecxt.arrays._

import scala.reflect.ClassTag
import vecxt.MatrixInstance.*
import vecxt.DoubleArrays.*

import matrix._

object JvmNativeDoubleMatrix:
extension (m: Matrix[Double])
Expand Down
11 changes: 5 additions & 6 deletions vecxt/jvm/src/arrays.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@
*/
package vecxt

import dev.ludovic.netlib.blas.JavaBLAS.getInstance as blas
import scala.util.chaining.*

import jdk.incubator.vector.VectorMask
import dev.ludovic.netlib.blas.JavaBLAS.{getInstance => blas}
import jdk.incubator.vector.ByteVector
import jdk.incubator.vector.DoubleVector
import jdk.incubator.vector.VectorSpecies
import jdk.incubator.vector.VectorMask
import jdk.incubator.vector.VectorOperators

import jdk.incubator.vector.VectorSpecies
import vecxt.BoundsCheck.BoundsCheck

import scala.util.chaining._

object arrays:

final val spd = DoubleVector.SPECIES_PREFERRED
Expand Down
14 changes: 8 additions & 6 deletions vecxt/jvm/src/doublematrix.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package vecxt

import matrix.*
import narr.*
import dev.ludovic.netlib.blas.JavaBLAS.{getInstance => blas}
import narr._
import vecxt.BoundsCheck.BoundsCheck
import vecxt.arrays.*
import dev.ludovic.netlib.blas.JavaBLAS.getInstance as blas
import vecxt.DoubleArrays._
import vecxt.MatrixInstance._
import vecxt.arrays._

import scala.reflect.ClassTag
import vecxt.MatrixInstance.*
import vecxt.DoubleArrays.*

import matrix._

object JvmDoubleMatrix:
extension (m: Matrix[Double])
Expand Down
8 changes: 4 additions & 4 deletions vecxt/jvm/src/rpt.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package vecxt.reinsurance

import vecxt.reinsurance.*
import vecxt.reinsurance.Limits.*
import vecxt.reinsurance.Retentions.*
import vecxt.arrays.*
import vecxt.arrays._
import vecxt.reinsurance.Limits._
import vecxt.reinsurance.Retentions._
import vecxt.reinsurance._

/*
Expand Down
13 changes: 7 additions & 6 deletions vecxt/native/src/array.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
*/
package vecxt

import org.ekrich.blas.unsafe.*
import scala.scalanative.unsafe.*
import scala.util.chaining.*
import vecxt.dimCheck
import org.ekrich.blas._
import org.ekrich.blas.unsafe._
import vecxt.BoundsCheck
import vecxt.matrix.*
import org.ekrich.blas.*
import vecxt.BoundsCheck.BoundsCheck
import vecxt.dimCheck
import vecxt.matrix._

import scala.scalanative.unsafe._
import scala.util.chaining._

object arrays:

Expand Down
15 changes: 8 additions & 7 deletions vecxt/native/src/doublematrix.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package vecxt

import narr.*
import vecxt.arrays.*
import vecxt.matrix.*
import vecxt.BoundsCheck.BoundsCheck
import narr._
import org.ekrich.blas.unsafe.blas
import org.ekrich.blas.unsafe.blasEnums
import scala.scalanative.unsafe.*
import vecxt.matrixUtil.*
import vecxt.MatrixInstance.*
import vecxt.BoundsCheck.BoundsCheck
import vecxt.MatrixInstance._
import vecxt.arrays._
import vecxt.matrix._
import vecxt.matrixUtil._

import scala.scalanative.unsafe._
// import vecxt.rangeExtender.MatrixRange.range

object NativeDoubleMatrix:
Expand Down
3 changes: 2 additions & 1 deletion vecxt/native/src/rpt.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package vecxt.reinsurance

import vecxt.arrays

import Limits.Limit
import Retentions.Retention
import vecxt.arrays

/*
Expand Down
10 changes: 6 additions & 4 deletions vecxt/src/MatrixHelper.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package vecxt

import matrix.*
import narr.*
import narr._
import vecxt.BoundsCheck.BoundsCheck
import vecxt.arrays.*
import vecxt.arrays._

import scala.compiletime._
import scala.reflect.ClassTag
import scala.compiletime.*

import matrix._

object MatrixHelper:
extension (m: Matrix.type)
Expand Down
14 changes: 8 additions & 6 deletions vecxt/src/MatrixInstance.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package vecxt

import matrix.*
import narr.*
import narr._
import vecxt.BoundsCheck.BoundsCheck
import vecxt.rangeExtender.*
import vecxt.arrays.*
import scala.reflect.ClassTag
import vecxt.arrays._
import vecxt.rangeExtender._

import scala.annotation.targetName
import scala.compiletime.*
import scala.compiletime._
import scala.reflect.ClassTag

import matrix._

object MatrixInstance:
extension [A](m: Matrix[A])
Expand Down
4 changes: 2 additions & 2 deletions vecxt/src/cosineSimilarity.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package vecxt

import vecxt.arrays.norm
import vecxt.arrays.dot
import narr.NArray
import vecxt.BoundsCheck.BoundsCheck
import vecxt.arrays.dot
import vecxt.arrays.norm

/** Compute the cosine similarity between two vectors
*
Expand Down
6 changes: 3 additions & 3 deletions vecxt/src/dimMatCheck.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package vecxt

import vecxt.matrix.*
import vecxt.MatrixInstance.*
import narr.*
import narr._
import vecxt.BoundsCheck.BoundsCheck
import vecxt.MatrixInstance._
import vecxt.matrix._

protected[vecxt] object dimMatCheck:
inline def apply[A](a: Matrix[A], b: Matrix[A])(using inline doCheck: BoundsCheck) =
Expand Down
7 changes: 4 additions & 3 deletions vecxt/src/doublearray.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package vecxt

import narr.*
import arrays.*
import vecxt.JsNativeDoubleArrays.*
import narr._
import vecxt.JsNativeDoubleArrays._

import arrays._

object DoubleArrays:
extension (vec: NArray[Double])
Expand Down
19 changes: 10 additions & 9 deletions vecxt/src/doublematrix.scala
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package vecxt

import narr.*
import matrix.*
import vecxt.MatrixHelper.*
import vecxt.MatrixInstance.*
import narr._
import vecxt.BoundsCheck.BoundsCheck
import vecxt.arrays.*
import vecxt.rangeExtender.MatrixRange.range
import vecxt.JsDoubleMatrix._
import vecxt.JvmDoubleMatrix._
import vecxt.MatrixHelper._
import vecxt.MatrixInstance._
import vecxt.NativeDoubleMatrix._
import vecxt.arrays._
import vecxt.rangeExtender.MatrixRange.RangeExtender
import vecxt.JvmDoubleMatrix.*
import vecxt.JsDoubleMatrix.*
import vecxt.NativeDoubleMatrix.*
import vecxt.rangeExtender.MatrixRange.range

import matrix._

object DoubleMatrix:

Expand Down
10 changes: 5 additions & 5 deletions vecxt/src/matrix.scala
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package vecxt

import narr.*
import jdk.incubator.vector.DoubleVector
import narr._
import vecxt.BoundsCheck
import vecxt.BoundsCheck.BoundsCheck
import vecxt.arrays._
import vecxt.dimMatInstantiateCheck
import vecxt.indexCheckMat
import vecxt.rangeExtender._
import vecxt.sameDimMatCheck
import vecxt.rangeExtender.*
import vecxt.arrays.*

import vecxt.indexCheckMat
import vecxt.BoundsCheck.BoundsCheck
import scala.reflect.ClassTag

object matrix:
Expand Down
13 changes: 7 additions & 6 deletions vecxt/src/matrixutil.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package vecxt

import narr.*
import vecxt.matrix.*
import vecxt.MatrixInstance.*
import narr._
import vecxt.BoundsCheck
import vecxt.arrays.multInPlace
import vecxt.matrix.*
import vecxt.BoundsCheck.BoundsCheck
import scala.reflect.ClassTag
import vecxt.MatrixInstance._
import vecxt.arrayUtil.printArr
import vecxt.arrays.multInPlace
import vecxt.matrix._
import vecxt.matrix._

import scala.reflect.ClassTag
// import vecxt.arrayUtil.printArr
object matrixUtil:

Expand Down
2 changes: 1 addition & 1 deletion vecxt/src/rangeExtender.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package vecxt.rangeExtender

import narr.*
import narr._

export MatrixRange.*

Expand Down
2 changes: 1 addition & 1 deletion vecxt/src/tvar.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package vecxt.reinsurance

import narr.*
import narr._
// import narr.native.Extensions.sort

extension [N <: Int](thisVector: NArray[Double])
Expand Down

0 comments on commit 5928b22

Please sign in to comment.