1 /* Siconos is a program dedicated to modeling, simulation and control 2 * of non smooth dynamical systems. 3 * 4 * Copyright 2021 INRIA. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 /*!\file pinv.h 20 * \brief peseudo-inverse computations*/ 21 22 #ifndef Pinv_H 23 #define Pinv_H 24 25 #include "SiconosConfig.h" // for BUILD_AS_CPP // IWYU pragma: keep 26 27 #if defined(__cplusplus) && !defined(BUILD_AS_CPP) 28 extern "C" 29 { 30 #endif 31 32 /** Compute the pseudo-inverse of dense matrix with column major storage 33 \param A the matrix to be inversed 34 \param n the number of rows of A 35 \param m the number of columns of A 36 \param tolerance threshold used to validate the computation: if the error is less than this value, the computation is considered valid 37 \return the conditioning 38 */ 39 double pinv(double * A, int n, int m, double tolerance); 40 41 42 #if defined(__cplusplus) && !defined(BUILD_AS_CPP) 43 } 44 #endif 45 #endif 46