BLAS-General-Band Storage Mode

(This storage mode is used for both square and rectangular matrices.) Only the band elements of a general band matrix are stored for BLAS-general-band storage mode. The storage mode packs the matrix elements by columns into a two-dimensional array, such that each diagonal of the matrix appears as a row in the packed array.

For an m by n matrix A with band widths ml and mu, the array AGB must have a leading dimension, lda, greater than or equal to ml+mu+1. The size of the second dimension must be (at least) n, the number of columns in the matrix.

Using the array AGB, which is declared as AGB(ml+mu+1, n), the columns of elements in matrix A are stored in each column in array AGB as follows, where a11 is stored at AGB(mu+1, 1):

Array AGB Graphic

where * means you do not store an element in that position in the array. These positions are not accessed by ESSL. Unused positions in the array always occur in the upper left triangle of the array, but may not occur in the lower right triangle of the array, as you can see from the examples given here.

Following is an example where m > n, and general band matrix A is 9 by 8 with band widths of ml = 2 and mu = 3.

Given the following matrix A:
                                                  
                | 11  12  13  14   0   0   0   0 |
                | 21  22  23  24  25   0   0   0 |
                | 31  32  33  34  35  36   0   0 |
                |  0  42  43  44  45  46  47   0 |
                |  0   0  53  54  55  56  57  58 |
                |  0   0   0  64  65  66  67  68 |
                |  0   0   0   0  75  76  77  78 |
                |  0   0   0   0   0  86  87  88 |
                |  0   0   0   0   0   0  97  98 |
                                                                 
you store it in array AGB, declared as AGB(6,8), as follows, where a11 is stored in AGB(4,1):
                                                 
                |  *   *   *  14  25  36  47  58 |
                |  *   *  13  24  35  46  57  68 |
         AGB =  |  *  12  23  34  45  56  67  78 |
                | 11  22  33  44  55  66  77  88 |
                | 21  32  43  54  65  76  87  98 |
                | 31  42  53  64  75  86  97   * |
                                                
 

Following is an example where m < n, and general band matrix A is 7 by 9 with band widths of ml = 2 and mu = 3.

Given the following matrix A:
                                                    
              | 11  12  13  14   0   0   0   0   0 |
              | 21  22  23  24  25   0   0   0   0 |
              | 31  32  33  34  35  36   0   0   0 |
              |  0  42  43  44  45  46  47   0   0 |
              |  0   0  53  54  55  56  57  58   0 |
              |  0   0   0  64  65  66  67  68  69 |
              |  0   0   0   0  75  76  77  78  79 |
                                                  
 
you store it in array AGB, declared as AGB(6,9), as follows, where a11 is stored in AGB(4,1) and the leading diagonal does not fill up the whole row:
                                                    
              |  *   *   *  14  25  36  47  58  69 |
              |  *   *  13  24  35  46  57  68  79 |
        AGB = |  *  12  23  34  45  56  67  78   * |
              | 11  22  33  44  55  66  77   *   * |
              | 21  32  43  54  65  76   *   *   * |
              | 31  42  53  64  75   *   *   *   * |
                                                  
 

and where * means you do not store an element in that position in the array.

Following is an example of how to transform your general band matrix, for all values of m and n, to BLAS-general-band storage mode:
        DO 20 J=1,N
           K=MU+1-J
           DO 10 I=MAX(1,J-MU),MIN(M,J+ML)
              AGB(K+I,J)=A(I,J)
   10      CONTINUE
   20   CONTINUE