Skip to main content

MtxVec Core Edition

Cross-platform feature for MtxVec

Overview

MtxVec Core Edition is the full source version of MtxVec. It allows MtxVec to be compiled completely without reference to external dlls and run with pure pascal or C# code only (100% full source code). When used with Embarcadero FireMonkey you can use common source to compile the applications for Windows, Linux, OSX, iOS and Android. The same as possible for the source of Dew Math in C# and .NET Core.

With a compiler switch, you can change how MtxVec will be included in to your application.

Main advantages:

  • Small size of distribution
  • Platform independent builds

The Core edition is the key new feature added with MtxVec v5. It allows MtxVec to be compiled completely without reference to external dlls and run with pure native code only (100% full source code). All the algorithms relevant to the add-on packages of DSP Master and Stats Master have been implemented in pascal/C#. The numerical accuracy is comparable. Great care was taken when translating Fortran Lapack code to pascal/C# to maintain nearly line by line comparability. The code runs slower (of course) than its Windows dll based counterpart, but greatly simplifies distribution on Windows and to other platforms like Android and OSx/iOS.

Delphi related features added with MtxVec v5.3:

On OSX and iOS the MtxVec now interfaces Apple Accelerate framework. The big advantage here is that no additional libraries need to be included with distribution. The following sub-systems are mapped : BLAS, LAPACK (including complex number support), math functions (sin, cos, tan, exp, ln, ...), and the FFT library. There is some support in the Accelerate framework for vectorized math, but that is not as comprehensive as on the Windows.

The DSP Master of course benefits from the faster FFTs and optimized dot product functions. Additionaly TSignalCoreAudioIn and TSignalCoreAudioOut have been upgraded to support playback and recording on Android and iOS. This simplifies development of audio processing applications immensly, because the entire application can now be debugged on Windows and only deployed to the mobile device. On the iOS the audio pack used is RemoteIO and on Android it is the AudioRecord and AudioTrack classes. These are then optimized for widest possible hardware and OS version compatibility.

The Delphi math unit and default System unit math functions have been bypassed for both Android and iOS with Math387 which now run about 20x faster by making direct using of the libm library.

According to our tests, an Apple mobile application is capable of 10x faster CPU code execution, due to better hardware and provided accelerator framework libraries, than high-end Android devices. The performance of such iOS apps is very close to Delphi Windows desktop applications when running without special optimizations. Bellow you can find some basic benchmarks using one CPU core for orientation.

Computing: for i := 0 to 511 do c[i] := sqrt(sqr(a[i]) + sqr(b[i])), 1024x. single precision

  • iPad, A9 (with acc): 6ms  (Apple A9, 1.85 GHz)
  • iPhone 5s, A7 (with acc): 9ms
  • iPhone 5s A7 (no acc, libm): 18ms  (Apple A7, 1.3GHz, dual core)
  • iPhone 12 (acc): 1.8-2.7ms (A14, 3GHz).
  • Apple Mac Mini M1 (2020), 2-3ms
  • Huawei P10 Lite (libm): 22ms  (2.4GHz, Cortex A53, 4 cores).
  • LG V700 (libm): 120ms  (1.2GHz Qualcomm, ARMv7, 4 cores)
  • Core i5-3320m (acc): 0.83ms (2.6GHz, 2 cores)
  • Core i5 4670 (no acc): 2.5ms (3.7GHz, 4 cores)
  • Core i5 4670 (acc): 0.3ms  (3.7GHz, 4 cores)
  • Core i7-7820X (no acc): 1.7ms (4Ghz, 8 cores)
  • Core i7-7820X (acc):  0.21ms (4Ghz, 8 cores)

Computing FFT (1024 samples real to complex). 1024x, single precision

  • iPad, A9 (with acc): 14ms
  • iPad, A9 (no acc): 90ms
  • iphone 5s (with acc): 37ms
  • iPhone 5s (no acc): 156ms
  • iPhone 12 (acc): 7.7-14ms (3GHz, A14)
  • Apple Mac Mini M1 (2020), 6-7ms
  • LG V700: 400ms
  • Huawei P10 Lite: 200ms
  • Core i5-3320m (acc): 2.9ms (2.6GHz, 2 cores)
  • Core i5 4670 (no acc): 27ms
  • Core i5 4670 (acc): 1ms
  • Core i7-7820X (no acc): 17ms
  • Core i7-7820X (acc):  0.51ms
Icon Delphi CBuilder

Dew Lab Studio Core 2024 VCL Trial
for Delphi/BCB

XE3 / XE4 / XE5 / XE6 / XE7 / XE8 / Seattle10 / Berlin10.1 / Tokyo 10.2 / Rio 10.3.3 / Sydney 10.4.2 /Alexandria 11.2 / Athens 12.0

(278 MB)

Core Edition

All-in-one single pass installer/uninstaller

Last updated: 12th November, 2023

Main Features of MtxVec Core Edition

The following major features are available in pascal since MtxVec v5:

  • LU Factorization and LU Solvers.
  • QR Factorization and QR solvers for rank deficient matrices
  • EIG values and vectors for symmetric and general matrices
  • SVD values and vectors
  • SVD based linear system solvers
  • FFT1D/2D
  • Remez Exchange algorithm for optimal FIR filter design used by DSP Master add-on pack.

Delphi code base maintains the following features:

  • Optionally fully range checked by using Delphi dynamic arrays
  • Requires Delphi XE6 with Update 1 or newer for substantially better performance.
  • Features automated tests.

The support for the following features are missing from the initial release of the Core Edition:

  • Sparse matrix LU solvers and eigen values
  • Lapack routines using complex number input matrices
  • The higher quality random generators

Important:

Cross-platform FireMonkey support with MtxVec requires at least Embarcadero Rad Studio XE10.