Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26758 Discussions

IMSL, open source and overloaded operators

Brian_Murphy
New Contributor II
135 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
Black Belt Retired Employee
135 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.

Brian_Murphy
New Contributor II
135 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.

mecej4
Black Belt
135 Views

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

FortranFan
Honored Contributor II
135 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:

Brian_Murphy
New Contributor II
135 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.

JohnNichols
Valued Contributor II
135 Views

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

JohnNichols
Valued Contributor II
135 Views
    write(*,101)
101 Format()    

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

Reply