18#ifndef itkBridgeMathDeterminant_h
19#define itkBridgeMathDeterminant_h
22#include "vnl/vnl_matrix.h"
23#include "vnl/vnl_matrix_fixed.h"
26#include ITK_EIGEN(Dense)
32template <
typename T,
unsigned int VRows,
unsigned int VColumns>
45template <
unsigned int VDim,
typename TReal>
49 using RowMajor = Eigen::Matrix<TReal, VDim, VDim, Eigen::RowMajor>;
50 return Eigen::Map<const RowMajor>(inData).determinant();
53template <
typename TReal>
71 using RowMajor = Eigen::Matrix<TReal, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
72 return Eigen::Map<const RowMajor>(inData, n, n).determinant();
87template <
typename TReal,
unsigned int VDim>
95template <
typename TReal,
unsigned int VDim>
103template <
typename TReal>
107 const unsigned int rows = A.rows();
108 if (rows != A.cols())
110 itkGenericExceptionMacro(
"itk::bridge::Math::Determinant requires a square matrix.");
119template <
typename TReal,
unsigned int VRows,
unsigned int VColumns>
A templated class holding a M x N size Matrix.
InternalMatrixType & GetVnlMatrix()
TReal Determinant(const vnl_matrix_fixed< TReal, VDim, VDim > &A)
Determinant of a square matrix, backed by Eigen.
Cholesky-based linear algebra for symmetric matrices, backed by Eigen.
TReal DeterminantEigen(const TReal *inData)
TReal DynamicDeterminantEigen(const TReal *inData, unsigned int n)
Convenience wrappers over third-party numerical backends, provided as a migration aid rather than as ...
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....