Numy v0.1.5 Numy.Vcm protocol View Source

Interface to mutable Vector.

Native objects do not follow Elixir/Erlang model where an object is always immutable. We purposefully allow native objects to be mutable in order to get better performance in numerical computing.

Link to this section Summary

Functions

Mutate a vector by adding other to it, v1 = v1 + v2. Return mutated vector.

Step function, aᵢ ← 0 if aᵢ < 0 else 1

f(x) = 1/(1 + e⁻ˣ)

aᵢ ← aᵢ×factor_a + bᵢ×factor_b

Change sign of each element, aᵢ ← -aᵢ

Add a constant to each element, aᵢ ← aᵢ + offset

Reverse elements of vector in-place

Multiply each element by a constant, aᵢ ← aᵢ×scale_factor

Set N-th element to a new value

Sort elements of vector in-place

Link to this section Types

Link to this section Functions

Mutate a vector by adding other to it, v1 = v1 + v2. Return mutated vector.

Link to this function

apply_heaviside!(v, cutoff \\ 0.0)

View Source

Step function, aᵢ ← 0 if aᵢ < 0 else 1

f(x) = 1/(1 + e⁻ˣ)

aᵢ ← aᵢ×factor_a + bᵢ×factor_b

Change sign of each element, aᵢ ← -aᵢ

Add a constant to each element, aᵢ ← aᵢ + offset

Reverse elements of vector in-place

Multiply each element by a constant, aᵢ ← aᵢ×scale_factor

Set N-th element to a new value

Sort elements of vector in-place