Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
Hello,

I'm trying to understand how mathematical libraries that use Expression Templates techniques ( like Eigen for exmaple ) handle Matrix Multiplication.

What I have tried:

In many examples I found there is always just the element-wise operation implemented:

A = B*C + D

is compiled as a single loop

for ( i = 0 ; i < size; i++ )
{
A[i] = B[i]*C[i] + D[i];
}

but how to manage matrix multiplication ( that needs nested loops )?

Thank you
Posted
Updated 15-Nov-18 22:06pm
Comments
CPallini 16-Nov-18 4:31am    
It depends on A,B,C type. If the '*' and '+' operators are overloaded for such type, then you might write like that.
Stefan_Lang 16-Nov-18 9:28am    
Eigen does implement matrix multiplication, so the information you ask for is right there. Do you have trouble understanding or using it? Or is it something else you want to know?
Optimistic76 17-Nov-18 9:20am    
You were right....looking more deeply into the eigen documentation i found the answer to my question. It is a page i never noticed. It is in the section "understanding eigen"

 
Share this answer
 
I finally found a link i never noticed that answer to my question


Eigen: Lazy Evaluation and Aliasing[^]
 
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