Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

IMSL, open source and overloaded operators

Brian_Murphy
New Contributor II
883 Views

I believe the IMSL has a module USE LINEAR_OPERATORS which, among other things, enables matrix multiplication with syntax such as C = A .x. B.  Are there any open source versions of this?

0 Kudos
7 Replies
Steve_Lionel
Honored Contributor III
883 Views

If you have a library that does the operation, it's straightforward to define your own operators for it. Do note that Fortran has a MATMUL intrinsic if that specific operation is what you want - you can define an operator for it.

0 Kudos
Brian_Murphy
New Contributor II
883 Views

I've cobbled something together that seems to work.  I wanted to compare what I did to how a more knowledgeable person would do it.  I'm sure plenty of skilled fortran programmers have done it, but using Google I was unable to find any.

0 Kudos
mecej4
Honored Contributor III
883 Views

The following link may be worth a read: http://www.mathcs.emory.edu/~cheung/Courses/561/Syllabus/6-Fortran/operators.html .

0 Kudos
FortranFan
Honored Contributor III
883 Views

https://books.google.com/books/about/Numerical_Computing_with_Modern_Fortran.html?id=Oe4mAgAAQBAJ

Going through a book like this whose lead author had worked extensively on IMSL code might provide a more comprehensive and structured information to OP on modern Fortran including defined operations.  There are lots of code examples in the book with source code available to purchasers that illustrate what OP asks i.e., "how a more knowledgeable person would" approach numerical computing with features in Fortran:

0 Kudos
Brian_Murphy
New Contributor II
883 Views

Thanks for the links.  The emory web site is very good.  I just bought the Hanson book at Amazon, and pdf version of the same at https://littlethingsbook.store/

In my own creation, I have gone the route of creating custom operators like .x. and .t. and .tx. rather than overloading the language's existing operators.  The ability to do this is a great addition to the Fortran standard.

0 Kudos
JohnNichols
Valued Contributor III
883 Views

Once upon a time this fairy tale existed -- nice read - last paragraph is wonderful

0 Kudos
JohnNichols
Valued Contributor III
883 Views
    write(*,101)
101 Format()    

I never knew this was valid code that prints a new line. 

0 Kudos
Reply