From 760cb8469fd8f6007d8efd5232edc612099182dc Mon Sep 17 00:00:00 2001 From: Simon Parten Date: Thu, 19 Dec 2024 21:17:42 +0100 Subject: [PATCH] . --- vecxt/jvm/src/arrays.scala | 6 ++++++ vecxt/test/src/intarray.test.scala | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vecxt/jvm/src/arrays.scala b/vecxt/jvm/src/arrays.scala index 00d561e..e4f726d 100644 --- a/vecxt/jvm/src/arrays.scala +++ b/vecxt/jvm/src/arrays.scala @@ -24,6 +24,7 @@ import jdk.incubator.vector.ByteVector import jdk.incubator.vector.DoubleVector import jdk.incubator.vector.VectorOperators import jdk.incubator.vector.IntVector +import jdk.incubator.vector.VectorMask import scala.reflect.ClassTag object arrays: @@ -205,6 +206,11 @@ object arrays: inline def increments: Array[Int] = val out = new Array[Int](vec.length) + val limit = spi.loopBound(vec.length - 2) + // val inc = spil - 1 + // val maskInit = spi.maskAll(true).toArray() + // maskInit(maskInit.length - 1) = false + // val mask = VectorMask.fromArray(spi, maskInit, 0) var i = 1 while i < spi.loopBound(vec.length - 2) do diff --git a/vecxt/test/src/intarray.test.scala b/vecxt/test/src/intarray.test.scala index aed6928..595eab1 100644 --- a/vecxt/test/src/intarray.test.scala +++ b/vecxt/test/src/intarray.test.scala @@ -49,7 +49,7 @@ class IntArrayExtensionSuite extends munit.FunSuite: assertEquals(v1.sum, 45) } - test("increments") { + test("increments".only) { val v1 = NArray[Int](1, 2, 3, 4, 5, 6, 7, 8, 9, 10) v1.increments.foreach(d => assertEquals(d, 1))