You really want those to be colindex::Int and rowindex::Int – Integer is an
abstract type, whereas Int is the concrete type of the native size integer
(32/64 depending on your system).


On Fri, Jan 10, 2014 at 5:42 AM, Sheehan Olver <[email protected]>wrote:

> Hi,
>
> I have the code below that wraps an array to allow non-standard index
> ranges, as part of an implementation of a linear algebra algorithm (Givens
> rotations).  Surprisingly the setindex! routine is taking a significant
> portion of the computational cost, 30%, so I think I must not be getting
> the command to compile properly.  Any hints?
>
>
> Cheers,
>
> Sheehan
>
>
>
>
>
>
> type ShiftArray{T<:Number}
>   data::Array{T,2}
>   colindex::Integer
>   rowindex::Integer
> end
>
> Base.setindex!{T<:Number}(S::ShiftArray{T},x::T,k::Integer,j::Integer)=(S.data[k
> + S.rowindex, j + S.colindex] = x)
>

Reply via email to