Skip to content
ForCADDocumentation

sparse_left_matmul Subroutine

public pure subroutine sparse_left_matmul(A, B, C)

Compute C=matmul(A,B) by scanning structural nonzeros of A. Intended for local-support refinement maps, where A is structurally sparse but the existing API still needs a dense transformation matrix. NaN coefficients remain structural and therefore propagate rather than being silently dropped. Incompatible inner dimensions return C(0,0). This is not a compressed sparse representation: every entry of dense A is inspected and exact zeros alone are skipped. For dimensions and , work is , including the scan and result initialization. A, B, and the returned C all remain dense; result storage is .

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: A(:,:)

Left matrix, commonly a refinement transformation.

real(kind=rk), intent(in), contiguous :: B(:,:)

Dense right-hand matrix.

real(kind=rk), intent(out), allocatable :: C(:,:)

Allocatable result of shape [size(A,1),size(B,2)].