Matrix with two diagonals: Difference between revisions

Line 1,013:
 
=={{header|Fortran}}==
Fortran stores data in columns. Therefore, it should be checked whether instead of filling the matrix row by row (as below) it would be better to do it column by column. The profit would be cache hit optimization, better communication between CPU and RAM. Fortran allows you to zero the entire array, such as the a array below, simply by substituting a = 0. Unfortunately, an array 100x100 (that is, the maximum size) would be filled with zeros even if, as in the example, we would need a much smaller array.
<lang Fortran>program prog