-
-
Notifications
You must be signed in to change notification settings - Fork 28
Description
The purpose of this issue is to discuss the future of the dozens of functions in Julia that are slight variations of matrix multiplication, matrix division and backslash. I presume that the point was to have fine-grained control over the use of matrix variables and temporaries when needed. However, I don't understand why the availability of these functions is so inconsistent: is this intentional design or a consequence of organic growth with methods being implemented as needed?
List of all the functions (existing and plausibly existing in the future)
Here are the 3x3x3x2=54 possible functions that can be constructed out of A, its transpose At and its Hermitian conjugate Ac; and similarly for B, Bt and Bc; mul, rdiv and ldiv; and mutating and non-mutating variants. (###
means that this function does not exist.)
A_mul_B #deprecated synonym of A*B
A_mul_B!
A_mul_Bt
A_mul_Bt!
A_mul_Bc
A_mul_Bc!
At_mul_B
At_mul_B!
At_mul_Bt
At_mul_Bt!
At_mul_Bc ###
At_mul_Bc! ###
Ac_mul_B
Ac_mul_B!
Ac_mul_Bt #deprecated
Ac_mul_Bt! ###
Ac_mul_Bc
Ac_mul_Bc!
A_ldiv_B ### synonym of A\B
A_ldiv_B!
A_ldiv_Bt
A_ldiv_Bt! ###
A_ldiv_Bc
A_ldiv_Bc! ###
At_ldiv_B
At_ldiv_B! ###
At_ldiv_Bt
At_ldiv_Bt! ###
At_ldiv_Bc ###
At_ldiv_Bc! ###
Ac_ldiv_B
Ac_ldiv_B! ###
Ac_ldiv_Bt ###
Ac_ldiv_Bt! ###
Ac_ldiv_Bc
Ac_ldiv_Bc! ###
A_rdiv_B ### synonym of A/B
A_rdiv_B! ###
A_rdiv_Bt
A_rdiv_Bt! ###
A_rdiv_Bc
A_rdiv_Bc! ###
At_rdiv_B
At_rdiv_B! ###
At_rdiv_Bt
At_rdiv_Bt! ###
At_rdiv_Bc ###
At_rdiv_Bc! ###
Ac_rdiv_B
Ac_rdiv_B! ###
Ac_rdiv_Bt ###
Ac_rdiv_Bt! ###
Ac_rdiv_Bc
Ac_rdiv_Bc! ###
I'm rocking this boat because it's come up as a natural consequence of systematically making methods available for special matrix types.
Specific issues
- Documentation. The existence, motivation and use of these functions is sparsely documented. Not all the functions even have defined help strings.
2 Growth and proliferation. Do we foresee an eventual future where all 54-3=51 functions (omitting the synonyms for *
, /
and \
) become defined and have methods implemented? There would a great many methods that would have to be implemented to cover all the possible types of matrices that currently exist.
- Can we eliminate any of these functions on the basis of being useless? There are no functions defined that mix
Ac
andBt
, for example; however, this is a somewhat rare but entirely plausible combination to operate on. Do we care? - How many of these functions can be implemented with just a fallback method?
- Having more things in
Base
without reason is not ideal, but conversely these functions form a coherent grouping for which it doesn't make sense to have some but not others. - How many of these functions can be defined trivially in terms of lazy array views (#5003) and rewriting rules (Label QRCompactWY.T as Triangular #122)?
cc: @JeffBezanson @StefanKarpinski @andreasnoackjensen @dmbates @lindahua