Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to work with matrices and vectors in c++ or c#? How to set matrices of n by m, simply as in matlab that we say A=M*N, what are the needed namespaces or libraries?
Posted
Comments
Christian Amado 12-Sep-14 9:51am    
There are many articles around the net. Just search on Google.
Sergey Alexandrovich Kryukov 12-Sep-14 22:19pm    
Matrix multiplication is trivial, found in any relevant mathematics textbook. If you just act by definition, you can really easily define appropriate operators in both C++ and C#.
—SA

Hope these links helps you...
Matrix Decomposition[^]
C# Matrix Library[^]
Matrix multiplication[^]

Regards
 
Share this answer
 
Comments
Matt T Heffron 12-Sep-14 12:24pm    
See also: Math.Net Numerics which is Open Source (MIT/X11 License)
Please see my comment to the question.

First, matrix multiplication is quite a trivial mathematical operation. Please see, for example: http://en.wikipedia.org/wiki/Matrix_multiplication[^].

To code it, just act by definition.

Now, you can define appropriate operator '*' and use is exactly like in your A=M*N sample. This is all you need:
http://en.wikipedia.org/wiki/Operator_overloading[^];
C++:
http://www.learncpp.com/cpp-tutorial/91-introduction-to-operator-overloading[^],
http://www.learncpp.com/cpp-tutorial/92-overloading-the-arithmetic-operators[^],
http://en.wikibooks.org/wiki/C++_Programming/Operators/Operator_Overloading[^],
C#:
http://msdn.microsoft.com/en-us/library/8edha89s.aspx[^],
http://msdn.microsoft.com/en-us/library/aa288467%28v=vs.71%29.aspx[^] (old but quite usable).

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900