Numy v0.1.3 Numy.Lapack View Source

NIF wrapper around LAPACK.

Link to this section Summary

Functions

Numy.Lapack structure defines a tensor. Having tensor as NIF resource helps to bring computation to the data.

Create new tensor NIF resource.

Deep copy of all elements regardless of shape and data type.

Fill tensor with a scalar.

res = generate_plane_rotation(1,2)
Keyword.fetch(res, :r | :z | :c | :s)

Callback on module's load. Loads NIF shared library.

Get string with Elixir Numy version at the moment of NIF compilation. Use it for sanity check.

Compare elements of 2 vectors for equality

If all data is viewed as a vector, get element in certain position.

Link to this section Types

Link to this section Functions

Numy.Lapack structure defines a tensor. Having tensor as NIF resource helps to bring computation to the data.

iex> tensor = %Numy.Lapack{shape: [3,2]}
Link to this function

blas_dcopy(num, src, src_step, dst, dst_step)

View Source
blas_dcopy(number(), tensor_res(), number(), tensor_res(), number()) :: number()
Link to this function

blas_drotg(a, b)

View Source
blas_drotg(float(), float()) :: {float(), float(), float(), float()}
Link to this function

copy(tensor_dst, tensor_src)

View Source
Link to this function

create_tensor(tensor_struct)

View Source
create_tensor(%Numy.Lapack{nif_resource: term(), shape: term()}) :: tensor_res()

Create new tensor NIF resource.

Link to this function

data(tensor, nelm \\ -1)

View Source
Link to this function

data_copy_all(tensor_a, tensor_b)

View Source

Deep copy of all elements regardless of shape and data type.

Fill tensor with a scalar.

Examples

iex(1)> tensor = Numy.Lapack.new_tensor([2,3])
iex(2)> Numy.Lapack.fill(tensor, 3.14)
iex(3)> Numy.Lapack.data(tensor)
[3.14, 3.14, 3.14, 3.14, 3.14, 3.14]
Link to this function

fill_tensor(tensor, fill_val)

View Source
Link to this function

generate_plane_rotation(a, b)

View Source
generate_plane_rotation(number(), number()) :: :error | Keyword.t()
res = generate_plane_rotation(1,2)
Keyword.fetch(res, :r | :z | :c | :s)
Link to this function

lapack_dgels(tensor_a, tensor_b)

View Source

Callback on module's load. Loads NIF shared library.

Link to this function

new_tensor(tensor_struct)

View Source
Link to this function

nif_numy_version()

View Source
nif_numy_version() :: String.t()

Get string with Elixir Numy version at the moment of NIF compilation. Use it for sanity check.

Examples

iex> Numy.NIF.Lapack.numy_version
'0.1.0'
Link to this function

tensor_assign(tensor, list)

View Source
Link to this function

tensor_data(tensor, nelm)

View Source
Link to this function

vector_add(tensor_a, tensor_b)

View Source
Link to this function

vector_assign_all(tensor, val)

View Source
Link to this function

vector_axpby(tensor_a, tensor_b, factor_a, factor_b)

View Source
Link to this function

vector_div(tensor_a, tensor_b)

View Source
Link to this function

vector_dot(tensor_a, tensor_b)

View Source
Link to this function

vector_equal(tensor_a, tensor_b)

View Source

Compare elements of 2 vectors for equality

Link to this function

vector_get_at(tensor, index)

View Source

If all data is viewed as a vector, get element in certain position.

Link to this function

vector_heaviside(tensor, cutoff \\ 0.0)

View Source
Link to this function

vector_max_index(tensor)

View Source
Link to this function

vector_min_index(tensor)

View Source
Link to this function

vector_mul(tensor_a, tensor_b)

View Source
Link to this function

vector_offset(tensor_a, factor)

View Source
Link to this function

vector_scale(tensor_a, factor)

View Source
Link to this function

vector_set_at(tensor, index, val)

View Source
Link to this function

vector_sub(tensor_a, tensor_b)

View Source