matlab三维矩阵乘二维矩阵,多维支持快速矩阵乘法

更新时间:2023-06-13 08:34:03 阅读: 评论:0

matlab三维矩阵乘⼆维矩阵,多维⽀持快速矩阵乘法MTIMESX - Fast Matrix Multiply with Multi-Dimensional Support
MTIMESX is a fast general purpo matrix and scalar multiply routine that has the following features:
- Supports multi-dimensional (nD, n>2) arrays directly
连眉
- Supports Transpo, Conjugate Transpo, and Conjugate pre-operations
- Supports singleton expansion
- Utilizes BLAS calls, custom C loop code, or OpenMP multi-threaded C loop code
自序
- Can match MATLAB results exactly or approximately as desired
- Can meet or beat MATLAB for speed in most cas
MTIMESX has six basic operating modes:
- BLAS: Always us BLAS library calls
- LOOPS: Always us C loops if available
- LOOPSOMP: Always us OpenMP multi-threaded C loops if available
- MATLAB: Fastest BLAS or LOOPS method that matches MATLAB exactly (default)
- SPEED: Fastest BLAS or LOOPS method even if it doesn't match MATLAB exactly
暖流是什么意思
- SPEEDOMP: Fastest BLAS, LOOPS, or LOOPOMP method even if it doesn't match MATLAB exactly
无线怎么改密码
MTIMESX inputs can be:
single
double
double spar
The general syntax is (arguments in brackets [ ] are optional):
mtimesx( [directive] )
mtimesx( A [,transa] ,B [,transb] [,directive] )
Where transa, transb, and directive are the optional inputs:
transa = A character indicating a pre-operation on A:
transb = A character indicating a pre-operation on B:
The pre-operation can be any of:
'N' or 'n' = No pre-operation (the default if trans_ is missing)
'T' or 't' = Transpo
'C' or 'c' = Conjugate Transpo
'G' or 'g' = Conjugate (no transpo)
directive = One of the modes listed above, or other directives
Examples:
C = mtimesx(A,B) % performs the calculation C = A * B
初中英语词组
C = mtimesx(A,'T',B) % performs the calculation C = A.' * B挂字组词
C = mtimesx(A,B,'g') % performs the calculation C = A * conj(B)
C = mtimesx(A,'c',B,'C') % performs the calculation C = A' * B'
家庭氛围mtimesx('SPEEDOMP','OMP_SET_NUM_THREADS(4)') % ts SPEEDOMP mode with number of threads = 4
For nD cas, the first two dimensions specify the matrix multiply involved. The remaining dimensions are duplicated and specify the number of individual matrix multiplies to perform for the result. i.e., MTIMESX treats the cas as arrays of 2D matrices and performs the operation on the associated parings. For example:
If A is (2,3,4,5) and B is (3,6,4,5), then
mtimesx(A,B) would result in C(2,6,4,5), where C(:,:,i,j) = A(:,:,i,j) * B(:,:,i,j), i=1:4, j=1:5
漫画动物which would be equivalent to the MATLAB m-code:
C = zeros(2,6,4,5);
for m=1:4
for n=1:5
C(:,:,m,n) = A(:,:,m,n) * B(:,:,m,n);
end
end
The first two dimensions must conform using the standard matrix multiply rules taking the transa and transb pre-operations into account, and dimensions 3:end must match exactly or be singleton (equal to 1). If a dimension is singleton then it is virtually expanded to the required size (i.e., equivalent to a repmat operation to get it to a conforming size but without the actual data copy). This is equivalent to a bsxfun capability for matrix multiplication.

本文发布于:2023-06-13 08:34:03,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/943631.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:矩阵   暖流   无线
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图