Scientific Reports (Oct 2023)

A new advance on dimensional-aware scalar, vector and matrix operations in C++

  • Eduard George Stan,
  • Dan Andrei Ciubotaru,
  • Michele Renda,
  • Călin Alexa

DOI
https://doi.org/10.1038/s41598-023-43683-w
Journal volume & issue
Vol. 13, no. 1
pp. 1 – 16

Abstract

Read online

Abstract We review the dimensional check problem of the high-level programming languages, discuss the existing solutions, and come up with a new solution suited for scientific and engineering computations. Then, we introduce Univec, our C++ library designed to make scalar, vector, and matrix operations using units of measurement. Moreover, Univec supports dimensional-aware operations for complex numbers, quaternions, octonions, and sedenions. We provide tables of the relevant functions and operators implemented. Our library was compared with several existing solutions, and the results are shown in the performance section. Finally, we present our future plans for improving the current implementation.