You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to contribute a series of improvements to Surge.
Surge is already pretty nice for implementing performant number crunching and machine learning algorithms, but I find myself writing my own Vector<Scalar> types and adding extensions for common Matrix<Scalar> operations over and over again (especially the scalar variants), so I figured I might as well upstream them:
Add missing named function equivalents of .-operators (e.g. addInPlace(_:_:) for .+=(_:_:)), transforming operators into strictly forwarding calls of explicitly named equivalents. (https://github.com/mattt/Surge/pull/107)
Simply using [Float] requires one to use .+ & Co, due to otherwise colliding with array concatenation, etc. Having an explicit Vector<Scalar> type also allows for better auto-completion by keeping all the non-vector-space-related Array/Collection gunk out of it. Or and it also doesn't spill every operator/function into the global namespace of Collection.
The text was updated successfully, but these errors were encountered:
Hi Matt,
I'd like to contribute a series of improvements to Surge.
Surge is already pretty nice for implementing performant number crunching and machine learning algorithms, but I find myself writing my own
Vector<Scalar>
types and adding extensions for commonMatrix<Scalar>
operations over and over again (especially the scalar variants), so I figured I might as well upstream them:XCTAssertEqual(_:_:accuracy:)
for collections ofFloatingPoint
. (https://github.com/mattt/Surge/pull/104).
-operators (e.g.addInPlace(_:_:)
for.+=(_:_:)
), transforming operators into strictly forwarding calls of explicitly named equivalents. (https://github.com/mattt/Surge/pull/107)func mul(x: [Float], y: Float)
, etc.) where applicable.func mul(x: Matrix<Float>, y: Float)
, etc.). (https://github.com/mattt/Surge/pull/110)Vector<Scalar>
type and unit tests for performant, yet expressive vector arithmetic. (https://github.com/mattt/Surge/pull/110)Matrix<Scalar>
&Vector<Scalar>
). (https://github.com/mattt/Surge/pull/110)Why
Vector<Scalar>
if we already have[Scalar]
?Simply using
[Float]
requires one to use.+
& Co, due to otherwise colliding with array concatenation, etc. Having an explicitVector<Scalar>
type also allows for better auto-completion by keeping all the non-vector-space-relatedArray
/Collection
gunk out of it. Or and it also doesn't spill every operator/function into the global namespace ofCollection
.The text was updated successfully, but these errors were encountered: