The missing restart must be thing - I've just gotten used to not worrying 
about reloading when using IJulia.

This type works - thanks!

On Friday, October 17, 2014 10:48:28 PM UTC+2, Mauro wrote:
>
> >>> I am having some troubles understanding and selecting the right types. 
> >>> 
> >>> I have implemented an approximation of Lambert’s W function in two 
> >>> versions: One for scalar input and one for array input. 
> >>> 
> >>> I’ve chosen the type Real for the scalar version and Array{Float64} 
> for 
> >>> the array version. 
> >>> But if I delete the array version I can still call the function with 
> an 
> >>> array. How can this be? 
>
> I cannot reproduce this, I get a no method error.  Do you restart Julia 
> between the tries? 
>
> >>> Also, I would prefer to have a type like Array{Real} instead 
> >>> Array{Float64}, but this does not seem to work. 
>
> try: 
>
> function lambertw{T<:Real}(x::Array{T}, k::Int=0, prec=10e-10) 
> ... 
> end 
>
> >>> A third thing is that the function takes a second input that is either 
> -1 
> >>> or 0. Now I specify the type as Int and check if it is -1 or 0. Is 
> there a 
> >>> smarter way to do this? 
>
> I think this is fine.  You could use a Boolean instead. 
>

Reply via email to