numexy v0.1.3 Numexy
Documentation for Numexy.
Link to this section Summary
Functions
Add vector or matrix
Avarage matrix or vector
Calculate inner product
Get matrix or vector value
Multiplication vector or matrix
New matrix
Create ones matrix or vector
Sum matrix or vector
Calculate transpose matrix
Create zeros matrix or vector
Link to this section Functions
Link to this function
add(s, s)
Add vector or matrix.
Examples
iex> x = Numexy.new([1,2,3])
%Array{array: [1,2,3], shape: {3, nil}}
iex> y = 4
iex> Numexy.add(x, y)
%Array{array: [5,6,7], shape: {3, nil}}
Link to this function
avg(array)
Avarage matrix or vector.
Examples
iex> Numexy.new([2,9,5]) |> Numexy.avg
5.333333333333333
iex> Numexy.new([[1,2,3],[4,5,6]]) |> Numexy.avg
3.5
Link to this function
dot(array1, array2)
Calculate inner product.
Examples
iex> x = Numexy.new([1,2,3])
%Array{array: [1,2,3], shape: {3, nil}}
iex> y = Numexy.new([1,2,3])
%Array{array: [1,2,3], shape: {3, nil}}
iex> Numexy.dot(x, y)
14
Link to this function
get(array, arg)
Get matrix or vector value.
Examples
iex> Numexy.new([2,9,5]) |> Numexy.get({2, nil})
9
iex> Numexy.new([[1,2,3],[4,5,6]]) |> Numexy.get({2, 1})
4
Link to this function
mul(s, s)
Multiplication vector or matrix.
Examples
iex> x = Numexy.new([1,2,3])
%Array{array: [1,2,3], shape: {3, nil}}
iex> y = 4
iex> Numexy.mul(x, y)
%Array{array: [4,8,12], shape: {3, nil}}
Link to this function
new(array)
New matrix.
Examples
iex> Numexy.new([1,2,3])
%Array{array: [1, 2, 3], shape: {3, nil}}
iex> Numexy.new([[1,2,3],[1,2,3]])
%Array{array: [[1, 2, 3], [1, 2, 3]], shape: {2, 3}}
Link to this function
ones(arg)
Create ones matrix or vector.
Examples
iex> Numexy.ones({2, 3})
%Array{array: [[1, 1, 1], [1, 1, 1]], shape: {2, 3}}
iex> Numexy.ones({3, nil})
%Array{array: [1, 1, 1], shape: {3, nil}}
Link to this function
sum(array)
Sum matrix or vector.
Examples
iex> Numexy.new([2,9,5]) |> Numexy.sum
16
iex> Numexy.new([[1,2,3],[4,5,6]]) |> Numexy.sum
21
Link to this function
transpose(array)
Calculate transpose matrix.
Examples
iex> x = Numexy.new([[4,3],[7,5],[2,7]])
%Array{array: [[4, 3], [7, 5], [2, 7]], shape: {3, 2}}
iex> Numexy.transpose(x)
%Array{array: [[4, 7, 2], [3, 5, 7]], shape: {2, 3}}
Link to this function
zeros(arg)
Create zeros matrix or vector.
Examples
iex> Numexy.zeros({2, 3})
%Array{array: [[0, 0, 0], [0, 0, 0]], shape: {2, 3}}
iex> Numexy.zeros({3, nil})
%Array{array: [0, 0, 0], shape: {3, nil}}