[CSC 335] Fortraners....

Andrew J. Pounds pounds_aj at mercer.edu
Mon Nov 30 16:40:01 EST 2015


Hey -- I noticed that most of you that turned in the homework last week 
did it correctly, but if you are going to be using the LAPACK routines 
you must remember that Fortran is column major and not row major in how 
it stores matrices.

Row major..

for (i=0; i<10; i++) {
     for (j=0; j<10; j++) {
         a[i][j] = calculation;
     }
}

Column major...

do i=1, 10
    do j = 1, 10
        a(j,i) = calculation
    enddo
enddo



-- 
Andrew J. Pounds, Ph.D.  (pounds_aj at mercer.edu)
Professor of Chemistry and Computer Science
Mercer University,  Macon, GA 31207   (478) 301-5627
http://faculty.mercer.edu/pounds_aj



More information about the csc335 mailing list