Hi there,
we are looking for a certified (ISO 26262) and possibly Misra compliant Math library. Both C or C++ would do. We would need it to run on both Arm and Intel architectures which for instance eliminates Intel MKL (which is apparently getting certified).
We have looked through the open source implementations, in particular Eigen, Armadillo, or Blaze but all of them throw too many Misra defects.
We would heavily appreciate any suggestions or if none of the libraries are available  what do automotive folks then normally do?
We are looking for the following features in the library:
1. static memory representation:
dense matrices (probably column major for efficient vector representations)
sparse matrices
symmetric matrices
upper/lower triangular matrices
diagonal matrices
block representations
2. basic math operations (in a memory efficient manner):
addition
subtraction
multiplications:
matrixmatrix
matrixvector
matrixscalar
vectorvector (inner, outer products)
vectorscalar
transposition
integer powers
able to apply basic scalar math operations on the entire matrix
3. basic solvers:
norms:
froebenius
l2
l1
infinity
matrix inversion
linear system solvers (e.g. Ax = b) <= most gradientbased (optimization) approaches
boil down to solving linear systems
SVD <= spectral learning
eigendecomposition <= also spectral learning
cholesky/LDL solvers <= numerical stability for symmetric matrix representations
determinant <= likelihood and matrix calculus miscellanea
4. QoL:
slicing:
slicing should be a thin wrapper around a matrix that also allows all of the above
operations
wrappers/amenable to FPGA/GPU backend
multithreading support
Misra Compliant Math Library
Moderators: misrac, david ward

 Posts: 6
 Joined: Sat Mar 31, 2018 3:30 am
 Company: Apex.AI, Inc

 Posts: 48
 Joined: Fri Sep 17, 2004 10:53 pm
 Company: Phaedrus Systems
 Location: Phaedrus Systems Tamworth, UK
 Contact:
Re: Misra Compliant Math Library
I suggest talking to NAG (Numerical Algorithms Group )https://www.nag.co.uk/content/naglibrary
BTWI have no connection to them.
BTWI have no connection to them.
This post is made in a personal capacity
Member of MISRACWG since 2002
Member of MISRACWG since 2002

 Posts: 572
 Joined: Thu Jan 05, 2006 1:11 pm
Re: Misra Compliant Math Library
The MISRA C Working Group is not able to offer specific recommendations.
With regards potential adoption of any particular library (whether commercial or opensource) there are (at least) three options to consider:
1. Work with the O/S project or commercial company to improve the MISRA compliance
2. Treat the library as "Adopted Code" (as per MISRA Compliance:2016) and enforce a different Guideline Classification
3. Adopt the code within your project, and (subject to licence terms) modify to be more MISRA compliant.
With regards potential adoption of any particular library (whether commercial or opensource) there are (at least) three options to consider:
1. Work with the O/S project or commercial company to improve the MISRA compliance
2. Treat the library as "Adopted Code" (as per MISRA Compliance:2016) and enforce a different Guideline Classification
3. Adopt the code within your project, and (subject to licence terms) modify to be more MISRA compliant.

Posted by and on behalf of
the MISRA C Working Group
Posted by and on behalf of
the MISRA C Working Group

 Posts: 6
 Joined: Sat Mar 31, 2018 3:30 am
 Company: Apex.AI, Inc
Re: Misra Compliant Math Library
@misrac: "The MISRA C Working Group is not able to offer specific recommendations."
Does this mean that you are not aware of any Misra compliant library or that you do not want to give favorable treatment to any possible provider of a such library?
If the latter I'd just like to clarify that we are just looking for publicly available information that we might have missed because this is such a specialized feature request.
Does this mean that you are not aware of any Misra compliant library or that you do not want to give favorable treatment to any possible provider of a such library?
If the latter I'd just like to clarify that we are just looking for publicly available information that we might have missed because this is such a specialized feature request.