Seems like your constructor isn't returning x
Try to add an x
FIR (in_::Vector{in_t}, coef_::Vector{coef_t}) = (x=new(); x.in =
zeros(in_t, size (in_)); x.coef = coef_; *x*)
Regards
Ivar
kl. 17:01:06 UTC+2 onsdag 30. juli 2014 skrev Neal Becker følgende:
>
> As a learning exercise, I am trying to code a simple FIR filter.
> As a start, it has 2 fields and a constructor:
>
> type FIR{in_t, coef_t}
> in::Vector{in_t}
> coef::Vector{coef_t}
> FIR (in_::Vector{in_t}, coef_::Vector{coef_t}) = (x=new(); x.in =
> zeros(in_t, size (in_)); x.coef = coef_;)
> end
>
> w = zeros (Float64, 10)
> f = FIR{Float64,Float64}(w,w)
>
> This code executes, but seems very confused:
> julia> typeof(f)
> Array{Float64,1}
>
> Huh? I expected "f" to be of type FIR{Float64,Float64}. Clearly I'm
> doing
> something very wrong.
>
>