.. default-domain:: chpl

.. module:: LayoutCSR

LayoutCSR
=========
.. class:: CSR

   
   This CSR layout provides a Compressed Sparse Row implementation
   for Chapel's sparse domains and arrays.
   
   To declare a CSR domain, invoke the ``CSR`` constructor without arguments
   in a `dmapped` clause. For example:
   
     .. code-block:: chapel
   
       use LayoutCSR;
       var D = {1..n, 1..m};  // a default-distributed domain
       var CSR_Domain: sparse subdomain(D) dmapped CSR();
   
   To declare a CSR array, use a CSR domain, for example:
   
     .. code-block:: chapel
   
       // assume the above declarations
       var CSR_Array: [CSR_Domain] real;
   
   This domain map is a layout, i.e. it maps all indices to the current locale.
   All elements of a CSR-distributed array are stored
   on the locale where the array variable is declared.


