表达模板和矩阵乘法 [英] Expression templates and matrix multiplication

查看:88
本文介绍了表达模板和矩阵乘法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我正在尝试理解使用表达式模板技术(如Eigen for exmaple)的数学库如何处理矩阵乘法。



我尝试了什么:



在很多例子中,我发现总是只有元素-wise操作实现:



A = B * C + D



编译为单循环



for(i = 0; i< size; i ++)

{

A [i] = B [i] * C [i] + D [i];

}



但如何管理矩阵乘法(需要嵌套循环)?



谢谢

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

推荐答案

矩阵乘法c - Google搜索 [ ^ ]


我终于找到一个链接我从未注意到我的问题的答案





Eigen:懒惰评估和别名 [ ^ ]
I finally found a link i never noticed that answer to my question


Eigen: Lazy Evaluation and Aliasing[^]


这篇关于表达模板和矩阵乘法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆