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

Overloading matrix-matrix multiplication

dimdol10
New Contributor I
219 Views

I tried to overload matrix-matrix multiplication through the operator *, but the intrinsic matrix-matrix multiplication has already existed as component wise multiplication, which triggers "conflict" error.

I think there are only two ways to avoid this conflict as

(1) Use my own data type in overloading the operation 

(2) Removing the intrinsic matrix-matrix multiplication

However, the first one is not desirable for me, since I need to use lots of matrix multiplication for lots of variables which requires large efforts to turn them into my own data type.

So, my question is if the second way is possible or not , and please let me know if there is another way to resolve this problem.

 

 

 

 

 

0 Kudos
1 Reply
IanH
Honored Contributor II
219 Views

You cannot suppress the accessibility of the intrinsic operations.  This is a good thing, redefining basic operations like multiplication of REAL values is only going to confuse those reading your code.

Consider defining a different operator (e.g. .mymatmul.) for the operation.
 

0 Kudos
Reply