JuliaArrays / JuliaArrays/ArrayInterface.jl

[Feature request] `compatible_multiplicative_operand` interface

Open
#261 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
140
Forks
44
Avg merge
4d 14h
Merged PRs (30d)
5

Description

In the discussion under this PR: https://github.com/SciML/ExponentialUtilities.jl/pull/84 . We meet a using case of multipling a linear operator of certain type to a dense matrix. We think it would be fantastic if there is an API called compatible_multiplicative_operand(target, source) in ArrayInterface. That is,

  • compatible_multiplicative_operand(::CuArray, dense::Matrix) = CuArray(dense)
  • compatible_multiplicative_operand(::Matrix, cuarray::CuArray) = Matrix(cuarray)
  • compatible_multiplicative_operand(::SparseMatrixCSC, dense::Matrix) = dense
  • compatible_multiplicative_operand(::Matrix, sparse::SparseMatrixCSC) = sparse

Similarly, we can define them for Transpose, Adjoint, SubArray, and ReshapedArray, DistributedArray et al.

The key point is, we want two arrays can have compatible array types for multiplication, which is quite different from Base.convert.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the discussion in PR #84 and the current ArrayInterface API; the issue names no files or tests. Compare the proposed compatible_multiplicative_operand behavior across dense, sparse, GPU, and wrapper array types, with completion defined by an agreed interface and coverage for the supported operand combinations.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.