Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Apr 22, 2025

This changes e.g. axes(B,1) to axes(A,1) in an expression like

for j in axes(B,2)
-    for i in axes(B,1)
+    for i in axes(A,1)
        Cij = (unit ? oA : A[i,i]) * B[i,j]
        for k in i + 1:lastindex(B,1)
            Cij += A[i,k] * B[k,j]

While we obtain the correct result either way, since, firstly, triangular matrices are square, and secondly, the axes being multiplied must match, it's best to be precise here.

@jishnub jishnub merged commit e30c9c3 into master Apr 23, 2025
1 of 2 checks passed
@jishnub jishnub deleted the jishnub/trimatmul_indexing branch April 23, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants