≈ the.bay.news

Multiple Dispatch Misunderstanding?

Julia Programming Language
Multiple Dispatch Misunderstanding?
I’m trying to use multiple dispatch to let me use different data structures as a function input without having to change too much in a large codebase, but what I’ve come up with so far is significantly slower (~30%) than having just one definition of my data retrieval function. function make_model(modeltype) retrieve_A2 = if modeltype == 1 u::Array->u[:,1:10] elseif modeltype == 2 u::Array->u[:,11:20] else error("This is not a valid modeltype") end ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.