2

I have not been able to isolate, but sometimes I get an error for not including

use LayoutCS;

When I

use LinearAlgebra.Sparse;

in Chapel. When do I need to include it and what other options do I have?

Brian Dolan
  • 3,086
  • 2
  • 24
  • 35

1 Answers1

2

When do I need to include it?

LayoutCS is necessary if you are explicitly constructing a compressed sparse sparse domain using the dmapped clause:

var spsD: sparse subdomain(D) dmapped CS();

LinearAlgebra.Sparse is necessary if you are using the higher level linear algebra interface to accomplish the same thing:

var spsD = csrDomain(D);

What other options do I have?

As of Chapel 1.16, LinearAlgebra.Sparse only supports CSR arrays, so using LayoutCS would enable you to also use CSC arrays if you needed them:

var spsD: sparse subdomain(D) dmapped CS(compressRows=false);

You can also use the default sparse format of COO without using any modules:

var spsD: sparse subdomain(D);

See the sparse primer for more examples.

ben-albrecht
  • 1,785
  • 10
  • 23