Matrex.add/4

Parsed documentation:
View on GitHub
Adds two matrices or scalar to each element of matrix. NIF.

Can optionally scale any of the two matrices.

C = αA + βB

Raises `ErlangError` if matrices' sizes do not match.

## Examples

    iex> Matrex.add(Matrex.new([[1,2,3],[4,5,6]]), Matrex.new([[7,8,9],[10,11,12]]))
    #Matrex[2×3]
    ┌                         ┐
    │     8.0    10.0    12.0 │
    │    14.0    16.0    18.0 │
    └                         ┘

Adding with scalar:

    iex> m = Matrex.magic(3)
    #Matrex[3×3]
    ┌                         ┐
    │     8.0     1.0     6.0 │
    │     3.0     5.0     7.0 │
    │     4.0     9.0     2.0 │
    └                         ┘
    iex> Matrex.add(m, 1)
    #Matrex[3×3]
    ┌                         ┐
    │     9.0     2.0     7.0 │
    │     4.0     6.0     8.0 │
    │     5.0    10.0     3.0 │
    └                         ┘

With scaling each matrix:

    iex> Matrex.add(Matrex.new("1 2 3; 4 5 6"), Matrex.new("3 2 1; 6 5 4"), 2.0, 3.0)
    #Matrex[2×3]
    ┌                         ┐
    │     11.0    10.0    9.0 │
    │     26.0    25.0   24.0 │
    └                         ┘
Suggestions:
Please help! Open an issue on GitHub if this assessment is incorrect.