Oh, I see the problem -- ``zero(x)`` is not defined with ``x`` is of type
normal.
I will make a patch soon to allow this.
- Dahua
On Monday, January 6, 2014 9:29:37 PM UTC-6, Dahua Lin wrote:
>
> What is normal(u, v)?
>
> Julia base does not have such a function/type.
>
> - Dahua
>
> On Monday, January 6, 2014 4:52:21 PM UTC-6, Bernie Wang wrote:
>>
>> I've recently upgraded to v0.3.0 on my Ubuntu machine, but it seems that
>> the sum() has a bug (the following code runs fine in 0.2.0).....
>>
>>
>> [65]:
>>
>> type normal{T<:Float64}
>>
>> tau::T
>>
>> pi::T
>>
>> end
>>
>> In [73]:
>>
>> function +(g1::normal, g2::normal)
>>
>> return normal(g1.tau+g2.tau, g1.pi+g2.pi)
>>
>> end
>>
>> Out[73]:
>>
>> + (generic function with 110 methods)
>>
>> In [74]:
>>
>> sum([normal(0.0,1.0) for i=1:2])
>>
>> no method convert(Type{normal{Float64}}, Int64)
>> while loading In[74], in expression starting on line 1
>> in sum_seq at abstractarray.jl:1420
>> in sum_pairwise at abstractarray.jl:1480
>> in anonymous at no file
>>
>>
>> In [76]:
>>
>> sum([normal(0.0,1.0) for i=1:3])
>>
>> no method convert(Type{normal{Float64}}, Int64)
>> while loading In[76], in expression starting on line 1
>> in sum_seq at abstractarray.jl:1420
>> in sum_pairwise at abstractarray.jl:1480
>> in anonymous at no file
>>
>>
>> In [77]:
>>
>> sum([normal(0.0,1.0) for i=1:4])
>>
>> no method convert(Type{normal{Float64}}, Int64)
>> while loading In[77], in expression starting on line 1
>> in sum_seq at abstractarray.jl:1420
>> in sum_pairwise at abstractarray.jl:1480
>> in anonymous at no file
>>
>>
>> In [78]:
>>
>> sum([normal(0.0,1.0) for i=1:5])
>>
>> Out[78]:
>>
>> normal{Float64}(0.0,5.0)
>>
>>
>>
>>