Fortran function to overload multiplication between derived types with allocatable components
问题 Foreword In order to store banded matrices whose full counterparts can have both rows and columns indexed from indices other than 1 , I defined a derived data type as TYPE CDS REAL, DIMENSION(:,:), ALLOCATABLE :: matrix INTEGER, DIMENSION(2) :: lb, ub INTEGER :: ld, ud END TYPE CDS where CDS stands for compressed diagonal storage. Given the declaration TYPE(CDS) :: A , The rank-2 component matrix is supposed to contain, as columns, the diagonals of the actual full matrix (like here, except