Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What method did Julia use?

I have defined the following variable

julia> X = (1:10) * ones(1,10)

which defines a matrix with each row equals to the same number and the numbers in the column increasing from 1 to 10 by 1. I want to know which method used Julia for the function *. How can I ask that to Julia?

like image 344
dapias Avatar asked Feb 01 '16 01:02

dapias


1 Answers

@which is what you are looking for:

@which (1:10) * ones(1, 10)
# *(A::AbstractArray{T,1}, B::AbstractArray{T,2}) at linalg/matmul.jl:89

in Jupyter it will also hyperlink to the corresponding line of code where the method is defined in Julia's GitHub.

like image 141
amrods Avatar answered Oct 20 '22 23:10

amrods