Misra Compliant Math Library

Questions and discussions about MISRA C not fitting under migration or rules forums

Moderators: misra-c, david ward

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

Misra Compliant Math Library

Postby dejanpan » Mon Apr 23, 2018 6:17 am

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:
matrix-matrix
matrix-vector
matrix-scalar
vector-vector (inner, outer products)
vector-scalar
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 gradient-based (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

phaedsys
Posts: 50
Joined: Fri Sep 17, 2004 10:53 pm
Company: Phaedrus Systems
Location: Phaedrus Systems Tamworth, UK
Contact:

Re: Misra Compliant Math Library

Postby phaedsys » Tue Apr 24, 2018 10:38 am

I suggest talking to NAG (Numerical Algorithms Group )https://www.nag.co.uk/content/nag-library

BTWI have no connection to them.
This post is made in a personal capacity
Member of MISRA-C-WG since 2002

misra-c
Posts: 535
Joined: Thu Jan 05, 2006 1:11 pm

Re: Misra Compliant Math Library

Postby misra-c » Tue Apr 24, 2018 10:48 am

The MISRA C Working Group is not able to offer specific recommendations.

With regards potential adoption of any particular library (whether commercial or open-source) 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

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

Re: Misra Compliant Math Library

Postby dejanpan » Wed Oct 10, 2018 3:16 am

@misra-c: "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.


Return to “General Questions”

Who is online

Users browsing this forum: No registered users and 2 guests