TPROD -- arbitary tensor products between n-d arrays

버전 1.4.1.0 (55 KB) 작성자: Jason Farquhar
TPROD -- efficiently allows any type of tensor product between 2 multi-dimensional arrays
다운로드 수: 4K
업데이트 날짜: 2021/11/17

tprod

Matlab library for simple tensor operations using Einstein summation convention semantics

This function computes a generalized multi-dimensional matrix product based upon the einstein summation convention (plus extras). This means given 2 n-d inputs:

X = [ A x B x C x E .... ] Y = [ D x F x G x H .... ]

we define the result, Z, to be (in ESC) Z_{c,e,d,f} = X_{a,b,c,e} Y_{d,f,a,b}

(N.B. This syntax can be used directly with the etprod wrapper script).

This translates into tprod syntax as: Z = tprod(X,[-1 -2 1 2],Y,[3 4 -1 -2])

N.B. if Y==[], then it is assumed to be a copy of X.

This result is produced by forming an inner-product (multiply+sum) for the pairs of dimensions which have the same (negative) label (i.e. -1 => X dim 1 and Y dim 3, and -2 => X dim 2 and Y dim 4) and forming an outer product for all the remaining dimensions, with the positive label determining where this dimension is placed in the output.

Download from Mathworks File-Exchange

https://www.mathworks.com/matlabcentral/fileexchange/16275-tprod-arbitary-tensor-products-between-n-d-arrays?s_tid=mwa_osa_a

인용 양식

Jason Farquhar (2024). TPROD -- arbitary tensor products between n-d arrays (https://github.com/jadref/tprod/releases/tag/v1.4.1.0), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2021b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.4.1.0

See release notes for this release on GitHub: https://github.com/jadref/tprod/releases/tag/v1.4.1.0

1.4.0.0

Updated the examples in tprod.m to show the equlivalent matlab code, and to include more complex examples

1.3.0.0

(Another) fix to make it compile with pedantic c-compilers, e.g. lcc.

1.2.0.0

Updated to work with very restrictive C dialects (such as LCC's) -- particularly when used on windows.

1.1.0.0

Bug fixes -- 1) problem with certain unusual calling orders.
2) compilation with lcc

1.0.0.0

A couple of bug-fixes to prevent memory management errors

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.