public static void pinv(DMatrixRMaj A , DMatrixRMaj invA )
    {
        LinearSolverDense<DMatrixRMaj> solver = LinearSolverFactory_DDRM.pseudoInverse(true);
        if( solver.modifiesA())
            A = A.copy();

        if( !solver.setA(A) )
            throw new IllegalArgumentException("Invert failed, maybe a bug?");

        solver.invert(invA);
    }
public static void pinv ( DMatrixRMaj A , DMatrixRMaj invA ) { LinearSolverDense < DMatrixRMaj > solver = LinearSolverFactory_DDRM . pseudoInverse ( true ) ; if ( solver . modifiesA ( ) ) A = A . copy ( ) ; if ( ! solver . setA ( A ) ) throw new IllegalArgumentException ( "Invert failed, maybe a bug?" ) ; solver . invert ( invA ) ; }
<p>
Computes the Moore-Penrose pseudo-inverse:<br>
<br>
pinv(A) = (A<sup>T</sup>A)<sup>-1</sup> A<sup>T</sup><br>
or<br>
pinv(A) = A<sup>T</sup>(AA<sup>T</sup>)<sup>-1</sup><br>
</p>
<p>
Internally it uses {@link SolvePseudoInverseSvd_DDRM} to compute the inverse.  For performance reasons, this should only
be used when a matrix is singular or nearly singular.
</p>
@param A  A m by n Matrix.  Not modified.
@param invA Where the computed pseudo inverse is stored. n by m.  Modified.