quartercastle / vector

Yet another vector math package
MIT License
28 stars 6 forks source link

Improved api and performance #13

Closed quartercastle closed 4 years ago

quartercastle commented 4 years ago

All package level functions regarding vector arithmetic has been removed. Instead methods should be called on a vector which are changed to be immutable by default.

The concept of an UnsafeVector as been introduced, it follows the same API as a normal Vector, the difference is that an UnsafeVector does all arithmetic operations in-place and shall therefore be used with care, hence the name UnsafeVector.

a, b := Vector{1,2}, Vector{2,4}
vector.In(a).Add(b)