Re: [julia-users] Re: Is it possible to use Nullable with abstract types?

2015-03-31 Thread Steve Cordwell
Thanks On Tuesday, March 31, 2015 at 8:49:22 PM UTC+13, Milan Bouchet-Valat wrote: > > Le lundi 30 mars 2015 à 18:03 -0700, Steve Cordwell a écrit : > > Actually there were some bugs in the code. The following code works: > > > > zero_mask!{T,N}(a::AbstractArray{T,N},

[julia-users] Re: Is it possible to use Nullable with abstract types?

2015-03-30 Thread Steve Cordwell
UTC+13, Steve Cordwell wrote: > > Say I want to be able to set the value of an array to zero where a boolean > mask array is false, then I can define this function: > > zero_mask!(a::AbstractArray, mask::AbstractArray{Bool}) = setindex!(a, > zero(T), find(!mask)) > >

[julia-users] Is it possible to use Nullable with abstract types?

2015-03-30 Thread Steve Cordwell
Say I want to be able to set the value of an array to zero where a boolean mask array is false, then I can define this function: zero_mask!(a::AbstractArray, mask::AbstractArray{Bool}) = setindex!(a, zero(T), find(!mask)) I have a function that constructs arrays and part of its job is to ca

Re: [julia-users] Re: types, arrays, and syntax () {} []

2014-12-18 Thread Steve Cordwell
zeros, ones, rand etc all work in this way also On Friday, December 19, 2014 7:45:43 PM UTC+13, Steve Cordwell wrote: > > To get a 3 dimensional array using the syntax Stefan described, you need > to tell it the number of indices along each dimesion. Eg `Array(Int, 3, 4, > 5)` prod

Re: [julia-users] Re: types, arrays, and syntax () {} []

2014-12-18 Thread Steve Cordwell
:11 PM UTC-5, Steve Cordwell wrote: >> >> >> Hi John, >> >> `help(Array)` is telling you to use Array(SomeType, some_num_of_dims). If >> it was telling you about the type it would look more like this: &

Re: [julia-users] Re: types, arrays, and syntax () {} []

2014-12-18 Thread Steve Cordwell
Hi John, `help(Array)` is telling you to use Array(SomeType, some_num_of_dims). If it was telling you about the type it would look more like this: > help(Int) DataType : Int64

[julia-users] Test approximate equality of Float16 arrays

2014-12-14 Thread Steve Cordwell
Hi, I have been playing around with Float16 arrays and I haven't been able to figure out what is going on in this case, and whether it is expected behaviour. According to the Wikipedia article half precision floating point numbers are used for data storage and not for computations. I was surpr