MCPcopy Create free account
hub / github.com/Kitware/VTK / InvertMatrix

Method InvertMatrix

Common/Core/vtkMath.cxx:461–477  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Invert input square matrix A into matrix AI. Note that A is modified during the inversion. The size variable is the dimension of the matrix. Returns 0 if inverse not computed.

Source from the content-addressed store, hash-verified

459// the inversion. The size variable is the dimension of the matrix. Returns 0
460// if inverse not computed.
461vtkTypeBool vtkMath::InvertMatrix(double** A, double** AI, int size)
462{
463 int iScratch[VTK_MAX_SCRATCH_ARRAY_SIZE];
464 int* index = (size <= VTK_MAX_SCRATCH_ARRAY_SIZE ? iScratch : new int[size]);
465 double dScratch[VTK_MAX_SCRATCH_ARRAY_SIZE];
466 double* column = (size <= VTK_MAX_SCRATCH_ARRAY_SIZE ? dScratch : new double[size]);
467
468 vtkTypeBool retVal = vtkMath::InvertMatrix(A, AI, size, index, column);
469
470 if (size > VTK_MAX_SCRATCH_ARRAY_SIZE)
471 {
472 delete[] index;
473 delete[] column;
474 }
475
476 return retVal;
477}
478
479//------------------------------------------------------------------------------
480// Factor linear equations Ax = b using LU decomposition A = LU where L is

Callers

nothing calls this directly

Calls 1

InvertMatrixFunction · 0.70

Tested by

no test coverage detected