Why Does My Matrix Vector Multiplication in FORTRAN Not Work as Expected?

Click For Summary

Discussion Overview

The discussion revolves around a participant's issue with matrix-vector multiplication in FORTRAN, specifically regarding the expected output of the operation and potential misunderstandings in the use of the MATMUL function.

Discussion Character

  • Technical explanation, Debate/contested

Main Points Raised

  • One participant presents a matrix and a vector, stating that the result of their multiplication should yield a specific vector.
  • Another participant confirms the expected output but questions the participant's use of the MATMUL function, suggesting a possible mix-up in naming or operations.
  • A third participant provides a link to documentation on the MATMUL function, indicating a lack of familiarity with FORTRAN among some contributors.
  • There is a clarification about the use of the word "no," with one participant correcting another's grammar while also suggesting that the original usage might have been appropriate.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the correct application of the MATMUL function, and there is uncertainty regarding the participant's understanding of the operation.

Contextual Notes

There are unresolved questions about the correct usage of the MATMUL function in FORTRAN and the implications of the naming conventions used by the participant.

Milentije
Messages
47
Reaction score
0
I have a problem with something that should be very simple,I do not no if it is programming issue or my ignorance.
If I have matrix c(5,5)
3 0 0 0 0
1 2 0 0 0
0 1 2 0 0
0 0 1 4 1
0 0 0 1 2
and vector b(1,2,3,4,5)

c*b=a

a=(3,5,8,24,14)
FORTRAN MATMUL
C=MATMUL(B,A)

Correct?
 
Physics news on Phys.org
a=(3,5,8,24,14)

That is correct.

C=MATMUL(B,A)
I don't know Fortran at all, but here you are multiplying B and A to get C. This is different from what you said earlier (multiplying C and B to get A). I don't know that MATMUL does with two vectors, but you will either get a number (the inner product) or a matrix (but not the one you expect).

Did you mix up your naming, or ... ?
 
I do not no if it is programming issue or my ignorance
'no' means negation or the absence of something.

Perhaps here he used it correctly!
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K