18#ifndef itkMathDeterminant_h
19#define itkMathDeterminant_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>
42template <
unsigned int VDim,
typename TReal>
46 using RowMajor = Eigen::Matrix<TReal, VDim, VDim, Eigen::RowMajor>;
47 return Eigen::Map<const RowMajor>(inData).determinant();
50template <
typename TReal>
68 using RowMajor = Eigen::Matrix<TReal, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
69 return Eigen::Map<const RowMajor>(inData, n, n).determinant();
84template <
typename TReal,
unsigned int VDim>
92template <
typename TReal,
unsigned int VDim>
100template <
typename TReal>
104 const unsigned int rows = A.rows();
105 if (rows != A.cols())
107 itkGenericExceptionMacro(
"itk::Math::Determinant requires a square matrix.");
116template <
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 DynamicDeterminantEigen(const TReal *inData, unsigned int n)
TReal DeterminantEigen(const TReal *inData)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....