-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
107 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package vecxt | ||
|
||
import scala.language.implicitConversions | ||
// import scala.language.implicitConversions | ||
|
||
|
||
type vecxting = Array[Double] with vecxt | ||
|
||
given Conversion[Array[Double], vecxting] with | ||
def apply(in: Array[Double]): vecxting = in.asInstanceOf[vecxting] | ||
// given Conversion[Array[Double], vecxting] with | ||
// def apply(in: Array[Double]): vecxting = in.asInstanceOf[vecxting] | ||
|
||
|
||
extension (inline a: Array[Double]) | ||
inline def vecxtable = a.asInstanceOf[vecxting] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package vecxt | ||
|
||
import scala.scalajs.js.typedarray.Float64Array | ||
|
||
type vecxting = Float64Array with vecxt | ||
|
||
given Conversion[Float64Array, vecxting] with | ||
def apply(in: Float64Array): vecxting = in.asInstanceOf[vecxting] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package vecxt | ||
|
||
// import scala.language.implicitConversions | ||
|
||
|
||
type vecxting = Array[Double] with vecxt | ||
|
||
// given Conversion[Array[Double], vecxting] with | ||
// def apply(in: Array[Double]): vecxting = in.asInstanceOf[vecxting] | ||
|
||
extension (inline a: Array[Double]) | ||
inline def vecxtable = a.asInstanceOf[vecxting] | ||
|
||
// extension (inline a: vecxting) | ||
// inline def vecxtable = a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
import scala.language.implicitConversions | ||
|
||
import vecxt.* | ||
|
||
@main def checkBytecode = | ||
val a = Array[Double](1,2,3).vecxtable | ||
val a1 = Array[Double](1,2,3) | ||
// val b = Array[Boolean](true, false, true) | ||
// val c = Array[Boolean](false, true, true) | ||
|
||
import vecxt.BoundsCheck.yes | ||
a - a1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package vecxt | ||
|
||
transparent trait vecxt { | ||
def update(i: Int, d: Double): Unit | ||
def apply(i:Int) : Double | ||
def length: Int | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters