Add float array operations across JVM (SIMD), JS, and Native platforms#66
Merged
Add float array operations across JVM (SIMD), JS, and Native platforms#66
Conversation
Closed
…ve platforms Agent-Logs-Url: https://github.com/Quafadas/vecxt/sessions/13e4bb2a-657d-47a6-a532-f7a905bd6a42 Co-authored-by: Quafadas <24899792+Quafadas@users.noreply.github.com>
…ge test Agent-Logs-Url: https://github.com/Quafadas/vecxt/sessions/13e4bb2a-657d-47a6-a532-f7a905bd6a42 Co-authored-by: Quafadas <24899792+Quafadas@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add float operations similar to double methods
Add float array operations across JVM (SIMD), JS, and Native platforms
Apr 4, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements
Array[Float]extension methods mirroring the existingArray[Double]API across all three platforms, with platform-optimised implementations.New files
src/floatarray.scala—FloatArraysobject:select,unique,argsortsrc-js-native/floatarray.scala—JsNativeFloatArrays: while-loop implementations shared between JS and Native (clamping, math unary ops with!in-place variants, element-wise ops, comparisons,outer,logSumExp,productExceptSelf,cumsum,increments, etc.)test/src/floatarray.test.scala— 54 cross-platform float testsPlatform implementations
src-jvm/arrays.scala):FloatVector.SPECIES_PREFERREDSIMD viajdk.incubator.vectorfor arithmetic, math ops, reductions, comparisons, and statisticssrc-native/array.scala): BLAS single-precision routines —cblas_saxpy(+=/−=),cblas_sdot(dot),cblas_snrm2(norm),cblas_sscal(∗=/÷=)src-js/array.scala): while-loop implementations for arithmetic, statistics, and linear algebraOperations covered
All the standard ops from the double API: scalar and array arithmetic (
+,-,*,/, in-place variants), math unary ops (exp,log,sqrt,sin,cos,tan,abs, …),dot,norm,mean,variance,std,cumsum,clamp*,argmax/argmin,outer,logSumExp,pearsonCorrelationCoefficient,spearmansRankCorrelation,covariance,elementRanks,fma,**.Also exports
FloatArrays.*fromall.scalaand addsArray[Float]overloads todimCheckon JS.