January 2020
Intermediate to advanced
532 pages
13h 31m
English
Since Julia arrays support broadcasting, we can generalize the function arguments from a Vector{T} to an Array{T,N} signature in order to support multidimensional arrays. Let's now define the function as follows:
sumprod_5(A::Array{S,N}, B::Array{T,N}) where {N, S <: Number, T <: Number} = sum(A .* B)
We have pretty good confidence that this would work. Let's test it now:

Fabulous! We have finally satisfied all the requirements as listed in the test scenarios. Are we done? Maybe not. For the sake of argument, we may want to support other types of containers that are ...
Read now
Unlock full access