Skip to content

Commit

Permalink
Drop support for v0.5 + v0.6 updates (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmorley authored and Jutho committed Aug 24, 2017
1 parent 0a19cf7 commit 71fba9f
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 64 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ os:
- linux
- osx
julia:
- 0.5
- 0.6
- nightly
notifications:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Fast tensor operations using a convenient index notation.

## What's new

- Fully compatible with Julia v0.5.
- Fully compatible with Julia v0.6. (v0.5 no longer supported)

## Installation

Expand Down
3 changes: 1 addition & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
julia 0.5
Compat 0.24.0
julia 0.6
2 changes: 0 additions & 2 deletions src/TensorOperations.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module TensorOperations

using Compat

export tensorcopy, tensoradd, tensortrace, tensorcontract, tensorproduct, scalar
export tensorcopy!, tensoradd!, tensortrace!, tensorcontract!, tensorproduct!

Expand Down
4 changes: 2 additions & 2 deletions src/auxiliary/axpby.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# special singleton types (immutables) to remove any overhead of multiplication
# by one or addition by zero.

immutable Zero <: Integer
struct Zero <: Integer
end
immutable One <: Integer
struct One <: Integer
end

const _zero = Zero()
Expand Down
2 changes: 1 addition & 1 deletion src/auxiliary/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# An exception type for reporting errors in the index specificatino

immutable IndexError{S<:AbstractString} <: Exception
struct IndexError{S<:AbstractString} <: Exception
msg::S
end

Expand Down
8 changes: 4 additions & 4 deletions src/auxiliary/meta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
#
# A bunch of auxiliary metaprogramming tools and generated functions

@generated function _strides{T,N}(A::StridedArray{T,N})
@generated function _strides(A::StridedArray{T,N}) where {T,N}
meta = Expr(:meta,:inline)
ex = Expr(:tuple,[:(stride(A,$d)) for d = 1:N]...)
Expr(:block, meta, ex)
end

@generated function _indmax{N,T}(values::NTuple{N,T})
@generated function _indmax(values::NTuple{N,T}) where {N,T}
meta = Expr(:meta,:inline)
Expr(:block, meta, :(dmax = 1), :(max = values[1]), [:(values[$d] > max && (dmax = $d; max = values[$d])) for d = 2:N]..., :(return dmax))
end

@generated function _permute{T,N}(t::NTuple{N,T}, p)
@generated function _permute(t::NTuple{N,T}, p) where {T,N}
meta = Expr(:meta,:inline)
ex = Expr(:tuple,[:(t[p[$d]]) for d = 1:N]...)
Expr(:block, meta, ex)
end

@generated function _memjumps{N}(dims::NTuple{N,Int},strides::NTuple{N,Int})
@generated function _memjumps(dims::NTuple{N,Int},strides::NTuple{N,Int}) where N
meta = Expr(:meta,:inline)
ex = Expr(:tuple,[:((dims[$d]-1)*strides[$d]) for d = 1:N]...)
Expr(:block, meta, ex)
Expand Down
6 changes: 3 additions & 3 deletions src/auxiliary/stridedarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
Returns the number of indices of a tensor-like object `A`, i.e. for a multidimensional array (`<:AbstractArray`) we have `numind(A) = ndims(A)`. Also works in type domain.
"""
numind(A::AbstractArray) = ndims(A)
numind{T<:AbstractArray}(::Type{T}) = ndims(T)
numind(::Type{T}) where {T<:AbstractArray} = ndims(T)

"""`similar_from_indices(T, indices, A, conjA=Val{:N})`
Returns an object similar to `A` which has an `eltype` given by `T` and dimensions/sizes corresponding to a selection of those of `op(A)`, where the selection is specified by `indices` (which contains integer between `1` and `numind(A)`) and `op` is `conj` if `conjA=Val{:C}` or does nothing if `conjA=Val{:N}` (default).
"""
function similar_from_indices{T,CA}(::Type{T}, indices, A::StridedArray, ::Type{Val{CA}}=Val{:N})
function similar_from_indices(::Type{T}, indices, A::StridedArray, ::Type{Val{CA}}=Val{:N}) where {T,CA}
dims = size(A)
return similar(A,T,dims[indices])
end
Expand All @@ -23,7 +23,7 @@ end
Returns an object similar to `A` which has an `eltype` given by `T` and dimensions/sizes corresponding to a selection of those of `op(A)` and `op(B)` concatenated, where the selection is specified by `indices` (which contains integers between `1` and `numind(A)+numind(B)` and `op` is `conj` if `conjA` or `conjB` equal `Val{:C}` or does nothing if `conjA` or `conjB` equal `Val{:N}` (default).
"""
function similar_from_indices{T,CA,CB}(::Type{T}, indices, A::StridedArray, B::StridedArray, ::Type{Val{CA}}=Val{:N}, ::Type{Val{CB}}=Val{:N})
function similar_from_indices(::Type{T}, indices, A::StridedArray, B::StridedArray, ::Type{Val{CA}}=Val{:N}, ::Type{Val{CB}}=Val{:N}) where {T,CA,CB}
dims = tuple(size(A)...,size(B)...)
return similar(A,T,dims[indices])
end
Expand Down
21 changes: 11 additions & 10 deletions src/auxiliary/strideddata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
# inside the region and a collection of strides to interpret this memory as a
# multidimensional array.

immutable StridedData{N,T,C}
struct StridedData{N,T,C}
data::Vector{T}
strides::NTuple{N,Int}
start::Int
end
@compat const NormalStridedData{N,T} = StridedData{N,T,:N}
@compat const ConjugatedStridedData{N,T} = StridedData{N,T,:C}

@compat const StridedSubArray{T,N,A<:Array,I<:Tuple{Vararg{Union{Colon,Range{Int64},Int64}}},LD} = SubArray{T,N,A,I,LD}
NormalStridedData{N,T} = StridedData{N,T,:N}
ConjugatedStridedData{N,T} = StridedData{N,T,:C}

StridedData{N,T,C}(a::Array{T}, strides::NTuple{N,Int} = _strides(a), ::Type{Val{C}} = Val{:N}) =
StridedSubArray{T,N,A<:Array,I<:Tuple{Vararg{Union{Colon,Range{Int64},Int64}}},LD} = SubArray{T,N,A,I,LD}

StridedData(a::Array{T}, strides::NTuple{N,Int} = _strides(a), ::Type{Val{C}} = Val{:N}) where {N,T,C} =
StridedData{N,T,C}(vec(a), strides, 1)
StridedData{N,T,C}(a::StridedSubArray{T}, strides::NTuple{N,Int} = _strides(a), ::Type{Val{C}} = Val{:N}) =
StridedData(a::StridedSubArray{T}, strides::NTuple{N,Int} = _strides(a), ::Type{Val{C}} = Val{:N}) where {N,T,C} =
StridedData{N,T,C}(vec(a.parent), strides, Base.first_index(a))

Base.getindex(a::NormalStridedData,i) = a.data[i]
Expand All @@ -26,16 +27,16 @@ Base.setindex!(a::NormalStridedData,v,i) = (@inbounds a.data[i] = v)
Base.setindex!(a::ConjugatedStridedData,v,i) = (@inbounds a.data[i] = conj(v))

# set dimensions dims[d]==1 for all d where a.strides[d] == 0.
@generated function _filterdims{N}(dims::NTuple{N,Int}, a::StridedData{N})
@generated function _filterdims(dims::NTuple{N,Int}, a::StridedData{N}) where N
meta = Expr(:meta,:inline)
ex = Expr(:tuple,[:(a.strides[$d]==0 ? 1 : dims[$d]) for d=1:N]...)
Expr(:block,meta,ex)
end

# initial scaling of a block specified by dims
_scale!{N}(C::StridedData{N}, β::One, dims::NTuple{N,Int}, offset::Int=0) = C
_scale!(C::StridedData{N}, β::One, dims::NTuple{N,Int}, offset::Int=0) where {N} = C

@generated function _scale!{N}(C::StridedData{N}, β::Zero, dims::NTuple{N,Int}, offset::Int=0)
@generated function _scale!(C::StridedData{N}, β::Zero, dims::NTuple{N,Int}, offset::Int=0) where N
meta = Expr(:meta,:inline)
quote
$meta
Expand All @@ -47,7 +48,7 @@ _scale!{N}(C::StridedData{N}, β::One, dims::NTuple{N,Int}, offset::Int=0) = C
end
end

@generated function _scale!{N}(C::StridedData{N}, β::Number, dims::NTuple{N,Int}, offset::Int=0)
@generated function _scale!(C::StridedData{N}, β::Number, dims::NTuple{N,Int}, offset::Int=0) where N
meta = Expr(:meta,:inline)
quote
$meta
Expand Down
6 changes: 3 additions & 3 deletions src/implementation/kernels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Implements the microkernels for solving the subproblems of the various problems.

@generated function add_micro!{N}(α, A::StridedData{N}, β, C::StridedData{N}, dims::NTuple{N, Int}, offsetA::Int, offsetC::Int)
@generated function add_micro!(α, A::StridedData{N}, β, C::StridedData{N}, dims::NTuple{N, Int}, offsetA::Int, offsetC::Int) where N
quote
startA = A.start+offsetA
stridesA = A.strides
Expand All @@ -13,7 +13,7 @@
end
end

@generated function trace_micro!{N}(α, A::StridedData{N}, β, C::StridedData{N}, dims::NTuple{N, Int}, offsetA::Int, offsetC::Int)
@generated function trace_micro!(α, A::StridedData{N}, β, C::StridedData{N}, dims::NTuple{N, Int}, offsetA::Int, offsetC::Int) where N
quote
_scale!(C, β, dims, offsetC)
startA = A.start+offsetA
Expand All @@ -25,7 +25,7 @@ end
end
end

@generated function contract_micro!{N}(α, A::StridedData{N}, B::StridedData{N}, β, C::StridedData{N}, dims::NTuple{N, Int}, offsetA, offsetB, offsetC)
@generated function contract_micro!(α, A::StridedData{N}, B::StridedData{N}, β, C::StridedData{N}, dims::NTuple{N, Int}, offsetA, offsetB, offsetC) where N
quote
_scale!(C, β, dims, offsetC)
startA = A.start+offsetA
Expand Down
8 changes: 4 additions & 4 deletions src/implementation/recursive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

const BASELENGTH=2048

@generated function add_rec!{N}(α, A::StridedData{N}, β, C::StridedData{N}, dims::NTuple{N, Int}, offsetA::Int, offsetC::Int, minstrides::NTuple{N, Int})
@generated function add_rec!(α, A::StridedData{N}, β, C::StridedData{N}, dims::NTuple{N, Int}, offsetA::Int, offsetC::Int, minstrides::NTuple{N, Int}) where N
quote
if 2*prod(dims) <= BASELENGTH
add_micro!(α, A, β, C, dims, offsetA, offsetC)
Expand All @@ -23,7 +23,7 @@ const BASELENGTH=2048
end
end

@generated function trace_rec!{N}(α, A::StridedData{N}, β, C::StridedData{N}, dims::NTuple{N, Int}, offsetA::Int, offsetC::Int, minstrides::NTuple{N, Int})
@generated function trace_rec!(α, A::StridedData{N}, β, C::StridedData{N}, dims::NTuple{N, Int}, offsetA::Int, offsetC::Int, minstrides::NTuple{N, Int}) where N
quote
if prod(dims) + prod(_filterdims(dims,C)) <= BASELENGTH
trace_micro!(α, A, β, C, dims, offsetA, offsetC)
Expand All @@ -43,8 +43,8 @@ end
end
end

@generated function contract_rec!{N}(α, A::StridedData{N}, B::StridedData{N}, β, C::StridedData{N},
dims::NTuple{N, Int}, offsetA::Int, offsetB::Int, offsetC::Int, minstrides::NTuple{N, Int})
@generated function contract_rec!(α, A::StridedData{N}, B::StridedData{N}, β, C::StridedData{N},
dims::NTuple{N, Int}, offsetA::Int, offsetB::Int, offsetC::Int, minstrides::NTuple{N, Int}) where N

quote
odimsA = _filterdims(_filterdims(dims, A), C)
Expand Down
8 changes: 4 additions & 4 deletions src/implementation/stridedarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Implements `C = β*C+α*permute(op(A))` where `A` is permuted according to `indCinA` and `op` is `conj` if `conjA=Val{:C}` or the identity map if `conjA=Val{:N}`. The indexable collection `indCinA` contains as nth entry the dimension of `A` associated with the nth dimension of `C`.
"""
function add!{CA}(α, A::StridedArray, ::Type{Val{CA}}, β, C::StridedArray, indCinA)
function add!(α, A::StridedArray, ::Type{Val{CA}}, β, C::StridedArray, indCinA) where CA
for i = 1:ndims(C)
size(A,indCinA[i]) == size(C,i) || throw(DimensionMismatch())
end
Expand Down Expand Up @@ -39,7 +39,7 @@ end
Implements `C = β*C+α*partialtrace(op(A))` where `A` is permuted and partially traced, according to `indCinA`, `cindA1` and `cindA2`, and `op` is `conj` if `conjA=Val{:C}` or the identity map if `conjA=Val{:N}`. The indexable collection `indCinA` contains as nth entry the dimension of `A` associated with the nth dimension of `C`. The partial trace is performed by contracting dimension `cindA1[i]` of `A` with dimension `cindA2[i]` of `A` for all `i in 1:length(cindA1)`.
"""
function trace!{CA}(α, A::StridedArray, ::Type{Val{CA}}, β, C::StridedArray, indCinA, cindA1, cindA2)
function trace!(α, A::StridedArray, ::Type{Val{CA}}, β, C::StridedArray, indCinA, cindA1, cindA2) where CA
NC = ndims(C)
NA = ndims(A)

Expand Down Expand Up @@ -79,7 +79,7 @@ Implements `C = β*C+α*contract(op(A),op(B))` where `A` and `B` are contracted
The optional argument `method` specifies whether the contraction is performed using BLAS matrix multiplication by specifying `Val{:BLAS}` (default), or using a native algorithm by specifying `Val{:native}`. The native algorithm does not copy the data but is typically slower.
"""
function contract!{CA,CB,TC<:Base.LinAlg.BlasFloat}(α, A::StridedArray, ::Type{Val{CA}}, B::StridedArray, ::Type{Val{CB}}, β, C::StridedArray{TC}, oindA, cindA, oindB, cindB, indCinoAB, ::Type{Val{:BLAS}}=Val{:BLAS})
function contract!(α, A::StridedArray, ::Type{Val{CA}}, B::StridedArray, ::Type{Val{CB}}, β, C::StridedArray{TC}, oindA, cindA, oindB, cindB, indCinoAB, ::Type{Val{:BLAS}}=Val{:BLAS}) where {CA,CB,TC<:Base.LinAlg.BlasFloat}
NA = ndims(A)
NB = ndims(B)
NC = ndims(C)
Expand Down Expand Up @@ -179,7 +179,7 @@ function contract!{CA,CB,TC<:Base.LinAlg.BlasFloat}(α, A::StridedArray, ::Type{
return C
end

function contract!{CA,CB}(α, A::StridedArray, ::Type{Val{CA}}, B::StridedArray, ::Type{Val{CB}}, β, C::StridedArray, oindA, cindA, oindB, cindB, indCinoAB, ::Type{Val{:native}}=Val{:native})
function contract!(α, A::StridedArray, ::Type{Val{CA}}, B::StridedArray, ::Type{Val{CB}}, β, C::StridedArray, oindA, cindA, oindB, cindB, indCinoAB, ::Type{Val{:native}}=Val{:native}) where {CA,CB}
NA = ndims(A)
NB = ndims(B)
NC = ndims(C)
Expand Down
8 changes: 4 additions & 4 deletions src/implementation/strides.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Implements the stride calculations of the various problems

@generated function add_strides{N}(dims::NTuple{N,Int}, stridesA::NTuple{N,Int}, stridesC::NTuple{N,Int})
@generated function add_strides(dims::NTuple{N,Int}, stridesA::NTuple{N,Int}, stridesC::NTuple{N,Int}) where N
minstridesex = Expr(:tuple,[:(min(stridesA[$d],stridesC[$d])) for d = 1:N]...)
quote
minstrides = $minstridesex
Expand All @@ -16,7 +16,7 @@
end
end

@generated function trace_strides{NA,NC}(dims::NTuple{NA,Int}, stridesA::NTuple{NA,Int}, stridesC::NTuple{NC,Int})
@generated function trace_strides(dims::NTuple{NA,Int}, stridesA::NTuple{NA,Int}, stridesC::NTuple{NC,Int}) where {NA,NC}
M = div(NA-NC,2)
dimsex = Expr(:tuple,[:(dims[$d]) for d=1:(NC+M)]...)
stridesAex = Expr(:tuple,[:(stridesA[$d]) for d = 1:NC]...,[:(stridesA[$(NC+d)]+stridesA[$(NC+M+d)]) for d = 1:M]...)
Expand All @@ -34,8 +34,8 @@ end
end
end

@generated function contract_strides{NA, NB, NC}(dimsA::NTuple{NA, Int}, dimsB::NTuple{NB, Int},
stridesA::NTuple{NA, Int}, stridesB::NTuple{NB, Int}, stridesC::NTuple{NC, Int})
@generated function contract_strides(dimsA::NTuple{NA, Int}, dimsB::NTuple{NB, Int},
stridesA::NTuple{NA, Int}, stridesB::NTuple{NB, Int}, stridesC::NTuple{NC, Int}) where {NA, NB, NC}
meta = Expr(:meta, :inline)
cN = div(NA+NB-NC, 2)
oNA = NA - cN
Expand Down
31 changes: 16 additions & 15 deletions src/indexnotation/indexedobject.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,45 @@

import Base: +, -, *

immutable Indices{I}
struct Indices{I}
end

@compat abstract type AbstractIndexedObject end
abstract type AbstractIndexedObject end

indices(a::AbstractIndexedObject) = indices(typeof(a))

immutable IndexedObject{I,C,A,T} <: AbstractIndexedObject
struct IndexedObject{I,C,A,T} <: AbstractIndexedObject
object::A
α::T
function (::Type{IndexedObject{I,C,A,T}}){I,C,A,T}(object::A, α::T)
function IndexedObject{I,C,A,T}(object::A, α::T) where {I,C,A,T}
checkindices(object, I)
new{I,C,A,T}(object, α)
end
end
(::Type{IndexedObject{I,C}}){I, C, A, T}(object::A, α::T=1) = IndexedObject{I,C, A, T}(object, α)
IndexedObject{I,C}(object::A, α::T=1) where {I, C, A, T} = IndexedObject{I,C, A, T}(object, α)

Base.conj{I}(a::IndexedObject{I,:N}) = IndexedObject{I,:C}(a.object, conj(a.α))
Base.conj{I}(a::IndexedObject{I,:C}) = IndexedObject{I,:N}(a.object, conj(a.α))
Base.conj(a::IndexedObject{I,:N}) where {I} = IndexedObject{I,:C}(a.object, conj(a.α))
Base.conj(a::IndexedObject{I,:C}) where {I} = IndexedObject{I,:N}(a.object, conj(a.α))

Base.eltype(A::IndexedObject) = promote_type(eltype(A.object), typeof(A.α))
Base.eltype{I,C, A, T}(::Type{IndexedObject{I,C, A, T}}) = promote_type(eltype(A), T)
Base.eltype(::Type{IndexedObject{I,C, A, T}}) where {I,C, A, T} = promote_type(eltype(A), T)

*{I,C}(a::IndexedObject{I,C}, β::Number) = IndexedObject{I,C}(a.object, a.α*β)
*(a::IndexedObject{I,C}, β::Number) where {I,C} = IndexedObject{I,C}(a.object, a.α*β)
*::Number, a::IndexedObject) = *(a, β)
-(a::IndexedObject) = *(a, -1)

@generated function indices{I,C,A,T}(::Type{IndexedObject{I,C,A,T}})
@generated function indices(::Type{IndexedObject{I,C,A,T}}) where {I,C,A,T}
J = tuple(unique2(I)...)
meta = Expr(:meta, :inline)
Expr(:block, meta, :($J))
end

indexify{I}(object, ::Indices{I}) = IndexedObject{I,:N}(object)
indexify(object, ::Indices{I}) where {I} = IndexedObject{I,:N}(object)

deindexify{I}(A::IndexedObject{I,:N}, ::Indices{I}) = A.α == 1 ? A.object : A.α*A.object
deindexify{I}(A::IndexedObject{I,:C}, ::Indices{I}) = A.α == 1 ? conj(A.object) : A.α*conj(A.object)
deindexify(A::IndexedObject{I,:N}, ::Indices{I}) where {I} = A.α == 1 ? A.object : A.α*A.object
deindexify(A::IndexedObject{I,:C}, ::Indices{I}) where {I} = A.α == 1 ? conj(A.object) : A.α*conj(A.object)

@generated function deindexify{I,C,J}(A::IndexedObject{I,C}, ::Indices{J}, T::Type = eltype(A))
@generated function deindexify(A::IndexedObject{I,C}, ::Indices{J}, T::Type = eltype(A)) where {I,C,J}
meta = Expr(:meta, :inline)
indCinA, = trace_indices(I,J)
conj = Val{C}
Expand All @@ -53,7 +54,7 @@ deindexify{I}(A::IndexedObject{I,:C}, ::Indices{I}) = A.α == 1 ? conj(A.object)
end
end

@generated function deindexify!{Idst, Isrc, C}(dst, src::IndexedObject{Isrc, C}, ::Indices{Idst}, β=0)
@generated function deindexify!(dst, src::IndexedObject{Isrc, C}, ::Indices{Idst}, β=0) where {Idst, Isrc, C}
meta = Expr(:meta, :inline)
Jdst = unique2(Idst)
length(Jdst) == length(Idst) || throw(IndexError("left-hand side cannot have partial trace: $Idst"))
Expand Down
8 changes: 4 additions & 4 deletions src/indexnotation/product.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# A wrapper to store the contraction (product) of two indexed objects and
# evaluate lazily, i.e. evaluate upon calling `deindexify`.

immutable ProductOfIndexedObjects{IA,IB,CA,CB,OA,OB,TA,TB} <: AbstractIndexedObject
struct ProductOfIndexedObjects{IA,IB,CA,CB,OA,OB,TA,TB} <: AbstractIndexedObject
A::IndexedObject{IA,CA,OA,TA}
B::IndexedObject{IB,CB,OB,TB}
end
Expand All @@ -16,7 +16,7 @@ Base.eltype(P::ProductOfIndexedObjects) = promote_type(eltype(P.A),eltype(P.B))
*::Number, P::ProductOfIndexedObjects) = *(P,β)
-(P::ProductOfIndexedObjects) = *(-1, P)

@generated function indices{IA,IB,CA,CB,OA,OB,TA,TB}(::Type{ProductOfIndexedObjects{IA,IB,CA,CB,OA,OB,TA,TB}})
@generated function indices(::Type{ProductOfIndexedObjects{IA,IB,CA,CB,OA,OB,TA,TB}}) where {IA,IB,CA,CB,OA,OB,TA,TB}
J = unique2([IA...,IB...])
J = tuple(J...)
meta = Expr(:meta, :inline)
Expand Down Expand Up @@ -49,7 +49,7 @@ end
Expr(:block,meta,:(ProductOfIndexedObjects($argA,$argB)))
end

@generated function deindexify{IA,IB,CA,CB,IC}(P::ProductOfIndexedObjects{IA,IB,CA,CB}, I::Indices{IC}, T::Type = eltype(P))
@generated function deindexify(P::ProductOfIndexedObjects{IA,IB,CA,CB}, I::Indices{IC}, T::Type = eltype(P)) where {IA,IB,CA,CB,IC}
meta = Expr(:meta, :inline)
oindA, cindA, oindB, cindB, indCinoAB = contract_indices(IA, IB, IC)
indCinAB = vcat(oindA,length(IA)+oindB)[indCinoAB]
Expand All @@ -61,7 +61,7 @@ end
end
end

@generated function deindexify!{IA,IB,CA,CB,IC}(dst, P::ProductOfIndexedObjects{IA,IB,CA,CB}, ::Indices{IC}, β=0)
@generated function deindexify!(dst, P::ProductOfIndexedObjects{IA,IB,CA,CB}, ::Indices{IC}, β=0) where {IA,IB,CA,CB,IC}
oindA, cindA, oindB, cindB, indCinoAB = contract_indices(IA, IB, IC)
conjA = Val{CA}
conjB = Val{CB}
Expand Down
Loading

0 comments on commit 71fba9f

Please sign in to comment.