![]() Multiple operations such as normalizing an array of vectors, or finding their projection along the axes indicated by another array of vectors can be performed easily, with no loops and with two or three rows of code. ![]() By calling MULTIPROD, multiple geometrical transformations such as rotations or roto-translations can be performed on large arrays of vectors in a single step and with no loops. MULTIPROD has a broad field of potential applications. A detailed definition of AX is provided in the manual. It does that by virtually expanding A to (2×5)×10×6, and B to (5×3)×10×6. Then C = MULTIPROD(A, B) multiplies each of the 10 matrices in A by each of the 6 matrices in B, obtaining 60 matrices stored in a (2×3)×10×6 array C. In a system running MATLAB R2008a, MULTIPROD performs it about 380 times faster than the following equivalent loop (see Appendix B):ĪX generalizes matrix expansion to multidimensional arrays of any size. We refer to this particular application of AX as virtual matrix expansion. This is done without using loops, and without actually replicating the matrix (see Appendix A). A is virtually expanded to a (2×5)×1000×10 size, then multi-multiplied by B. With MULTIPROD the six matrices in A can be multiplied by those in B in a single intuitively appealing step:īy automatically applying AX, MULTIPROD can multiply a single matrix by all the blocks of a block array. * B), MULTIPROD operates block-by-block matrix multiplications. While TIMES operates element-by-element multiplications (e.g. ![]() MULTIPROD can be also described as a generalization of the built-in function TIMES. Thus, array A can be described as a block array the elements of which are matrices, and its size can be denoted by (4×5)×3. For instance, a 4×5×3 array A contains three 4×5 matrices along its first and second dimension (fig. Multidimensional arrays may contain matrices or vectors or even scalars along one or two of their dimensions. AX allows you, for instance, to multiply a single matrix A by an array of matrices B, by virtually replicating A to obtain an array compatible with B. MULTIPROD performs multiple multiplications between matrices, vectors, or scalars contained in two multidimensional arrays, with automatic virtual array expansion (AX) enabled. ![]() While the latter works only with 2-D arrays, MULTIPROD works also with multidimensional arrays. MULTIPROD is a powerful, quick and memory efficient generalization for N-D arrays of the MATLAB matrix multiplication operator (*). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |