tensorproduct - Multiplication of multidimensional arrays

Product of multidimensional matlab arrays following Einstein summation convention, where repeated indices sum over
96 descargas
Actualizado 16 abr 2021

Ver licencia

Implementation of Einstein summation convention for multidimensional matlab arrays, where repeated indices sum over.

Supports multiple:
- Outer products
- Inner products
- Singleton dimensions
- Pages

Example:
A = rand(5, 1,4,8); B = rand(4,10,5 ); R = tensorproduct('jzgi',A,'gxki',B,'kjg');
Outer: 'i','j', Inner: 'k', Page: 'g', Singleton: 'x','z', size(R) = [10,1,5,8].

Inputs:
- ind_R : string with indices of the output
- A : (non-empty) (multidimensional) matlab array
- ind_A : string with indices of array A
- B : (non-empty) (multidimensional) matlab array
- ind_B : string with indices of array B

Version compatibility: This implementation makes use of Matlab built-in function pagemtimes,
introduced in Matlab version R2020b. To make use of this implementation in previous Matlab releases, comment/uncomment few lines in the body of tensorproduct_core, as specified in the routine.

The performance of tensorproduct can be assessed by calling the function tensorproduct_benchmark.

Citar como

David Codony (2024). tensorproduct - Multiplication of multidimensional arrays (https://www.mathworks.com/matlabcentral/fileexchange/90586-tensorproduct-multiplication-of-multidimensional-arrays), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2021a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.1

All .m files published

1.0.0