Find the number of rows or columns in a Chapel Matrix

Viewed 64

I created the following Matrix, and I want to determine the number of rows/columns the matrix now has:

module AswanBigMatrix {
  use LinearAlgebra;

  proc main() {
    var A = Matrix(
         [0.0, 0.8, 1.1, 0.0, 2.0]
        ,[0.8, 0.0, 1.3, 1.0, 0.0]
        ,[1.1, 1.3, 0.0, 0.5, 1.7]
        ,[0.0, 1.0, 0.5, 0.0, 1.5]
        ,[2.0, 0.0, 1.7, 1.5, 0.0]
        );
    }
   writeln(A.domain);
}

This returns {0..4, 0..4} which makes sense, but I can't take A.domain[0] for instance and get the length.

1 Answers
Related