[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: FORTRAN common blocks



Eric S Fraga wrote:
On Tue, Jan 17, 2006 at 11:12:25AM +1100, Russell Shaw wrote:

I haven't found anything i can't do in C easily. I couldn't imagine using
a language without pointers. Instead of copying 100x100 arrays by value as
a function parameter, i can just pass a pointer to it.

All arguments are passed by reference in Fortran.

I haven't used Fortran.

After looking at some papers on how to solve equations fast where the
matrices are sparse, it occured to me that the authors were misguided
by a pointerless language. Using pointers, i made a program to solve
problems with sparse matrices as one would "by hand", which eliminates
all kinds of possible numerical problems with "traditional" methods.

Not sure what you are saying here. Numerical methods for handling sparse
matrices require the use of indirect addressing no matter what the language
supports as the point (pun not intended) is to not have to store a complete
matrix. Whether you have pointers or fake them using a vector of indices
makes no difference to the algorithm and to the actual performance. I would
be interested in knowing how different your implementation is!

In any case, Fortran > 90 has pointers.

I read things about things like gaussian elimination on sparse matrices
and they had things about elements mostly zero except along matrix diagonals
and the like, and how to use various matrix operations to find the result.

Instead, you can start with the original Ax=B set up as a list of linked
lists, so the only elements in the list are non-zero elements. Now if you
solve for all the variables symbolically by hand, i just do the same
quickly with an algorithm.



Reply to: