getindex for weight vector