Frameworking the vectorized basic linear algebra for prototyping codes in MATLAB

When writing high-performance code for numerical computations in a scripting language such as MATLAB, it is crucial to vectorize operations within large for-loops. However, this vectorization process often obscures the original mathematical structure, making the code less readable. This issue is particularly pronounced in finite element method (FEM) implementations, despite the inherently structured nature of FEM. A practical remedy is to decouple the vectorization layer from the mathematical logic of the code. This can be effectively achieved by building on top of already-vectorized basic linear algebra subprograms. Over the past 15 years, this idea has been applied in a series of works, resulting in fast, structured, and maintainable code. In this paper, we present a vectorized basic linear algebra package and introduce a formalism based on multilinear algebra to define and explain its functions. We also incorporate MATLAB’s recently introduced page-wise functions to enhance expressiveness. We provide examples such as computing normal vectors, volumes, and finite element assembly to demonstrate the clarity and efficiency of the approach. The resulting codes closely follow mathematical abstraction, facilitate reuse and extension, and support rapid development and prototyping by scientists, engineers, and students.

Authors

Publication Details

Journal
Applied Mathematics and Computation
Published
2025-10-27
DOI
https://doi.org/10.1016/j.amc.2025.129778
Citations
2
Primary Topic
Tensor decomposition and applications
Type
article
Field-Weighted Citation Impact
3.07
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Frameworking the vectorized basic linear algebra for prototyping codes in MATLAB

Alexej Moskovka, Jan Valdman, Jon Eivind Vatne, Talal Rahman
2 citations
Applied Mathematics and Computation
Tensor decomposition and applications
3.07
article

Frameworking the vectorized basic linear algebra for prototyping codes in MATLAB

Alexej Moskovka, Jan Valdman, Jon Eivind Vatne, Talal Rahman
article en
2 citations

Abstract

When writing high-performance code for numerical computations in a scripting language such as MATLAB, it is crucial to vectorize operations within large for-loops. However, this vectorization process often obscures the original mathematical structure, making the code less readable. This issue is particularly pronounced in finite element method (FEM) implementations, despite the inherently structured nature of FEM. A practical remedy is to decouple the vectorization layer from the mathematical logic of the code. This can be effectively achieved by building on top of already-vectorized basic linear algebra subprograms. Over the past 15 years, this idea has been applied in a series of works, resulting in fast, structured, and maintainable code. In this paper, we present a vectorized basic linear algebra package and introduce a formalism based on multilinear algebra to define and explain its functions. We also incorporate MATLAB’s recently introduced page-wise functions to enhance expressiveness. We provide examples such as computing normal vectors, volumes, and finite element assembly to demonstrate the clarity and efficiency of the approach. The resulting codes closely follow mathematical abstraction, facilitate reuse and extension, and support rapid development and prototyping by scientists, engineers, and students.

Applied Mathematics and ComputationVol. 513
Openalex Percentile: Top 7%
Tensor decomposition and applications
3.07
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.