Skip to content

Support for 'triangular' loops #77

@MasonProtter

Description

@MasonProtter

Suppose I have a function

function pairwise(a)
    ret = Matrix{eltype(a)}(undef, length(a), length(a))
    for i in 1:(length(a)-1)
        for j in (i+1):length(a)
            ret[i, j] = a[i] * a[j]
        end
    end
    UpperTriangular(ret)
end

Is there a way to represent this loop over the 'upper triangular indices' of ret with LoopVectorization.jl?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions