Hi, 

Thanks for the explanation.  While writing the type abstract below I 
realized that I should have specified μ being Matrix{T} instead of 
Array{T}---but I hadn't suspected this was the culprit.  I still find it a 
difficult balance between over-specifying types in functions and type 
definitions and code generality.  

Similarly, I am not sure if I win any performance pixy points by specifying 
Matrix{T} in types and functions rather than AbstractMatrix{T}---which is 
something I see a lot in other code.  

Cheers, 

---david

On Wednesday, October 22, 2014 6:10:40 AM UTC+2, Simon Kornblith wrote:
>
> On Tuesday, October 21, 2014 6:41:24 PM UTC-4, David van Leeuwen wrote:
>  
>
>> I replaced the `γ = broadcast()` with the lines below that.  No globals, 
>> but perhaps the field type gmm.μ is spoiling things.  I am not sure if this 
>> is a case of an abstractly typed field
>>
>> type GMM{T<:FloatingPoint}
>> ...
>>    μ::Array{T}
>> ...
>> end
>>
>> Should I have written GMM{T2} in the declaration of stats()?
>>
>
> The declaration of stats() is fine, but μ is abstract because it's missing 
> the number of dimensions. It should be Array{T,2} or something like that, 
> or else GMM should be parametrized on the number of dimensions.
>
> Simon
>

Reply via email to