arrow
Return

Frameworking the vectorized basic linear algebra for prototyping codes in MATLAB

delete2025-10-27
delete0
PRE
AI
A
Alexej Moskovka
T
Talal Rahman
J
Jan Valdman
J
Jon Eivind Vatne
DOI:10.1016/j.amc.2025.129778delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
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.

Journal

Applied Mathematics and Computation cover
Applied Mathematics and Computation
IF:
3.4
Papers:
2.3W
Citations:
3.3W

Organization

I
Institute of Information Theory and Automation
Scholars:
7
Papers: 5
Citations: 0
U
University of West Bohemia
Scholars:
50
Papers: 29
Citations: 2.5K
W
Western Norway University of Applied Sciences
Scholars:
2.2K
Papers: 2.2K
Citations: 1.4K
BI Norwegian Business School cover
BI Norwegian Business School
Scholars:
810
Papers: 1.3K
Citations: 2.0K
researcher View more organizations