mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
remove the Triangular suffix to Upper, Lower, UnitLower, etc,
and remove the respective bit flags
This commit is contained in:
@@ -41,14 +41,8 @@ const typename Derived::Scalar ei_bruteforce_det4_helper
|
||||
* (matrix.coeff(m,2) * matrix.coeff(n,3) - matrix.coeff(n,2) * matrix.coeff(m,3));
|
||||
}
|
||||
|
||||
// FIXME update computation of triangular det
|
||||
|
||||
const int TriangularDeterminant = 0;
|
||||
|
||||
template<typename Derived,
|
||||
int DeterminantType =
|
||||
(Derived::Flags & (UpperTriangularBit | LowerTriangularBit))
|
||||
? TriangularDeterminant : Derived::RowsAtCompileTime
|
||||
int DeterminantType = Derived::RowsAtCompileTime
|
||||
> struct ei_determinant_impl
|
||||
{
|
||||
static inline typename ei_traits<Derived>::Scalar run(const Derived& m)
|
||||
@@ -57,19 +51,6 @@ template<typename Derived,
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Derived> struct ei_determinant_impl<Derived, TriangularDeterminant>
|
||||
{
|
||||
static inline typename ei_traits<Derived>::Scalar run(const Derived& m)
|
||||
{
|
||||
if (Derived::Flags & UnitDiagBit)
|
||||
return 1;
|
||||
else if (Derived::Flags & ZeroDiagBit)
|
||||
return 0;
|
||||
else
|
||||
return m.diagonal().redux(ei_scalar_product_op<typename ei_traits<Derived>::Scalar>());
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Derived> struct ei_determinant_impl<Derived, 1>
|
||||
{
|
||||
static inline typename ei_traits<Derived>::Scalar run(const Derived& m)
|
||||
|
||||
@@ -541,7 +541,7 @@ struct ei_kernel_retval<FullPivLU<_MatrixType> >
|
||||
m.row(i).tail(cols-i) = dec().matrixLU().row(pivots.coeff(i)).tail(cols-i);
|
||||
}
|
||||
m.block(0, 0, rank(), rank());
|
||||
m.block(0, 0, rank(), rank()).template triangularView<StrictlyLowerTriangular>().setZero();
|
||||
m.block(0, 0, rank(), rank()).template triangularView<StrictlyLower>().setZero();
|
||||
for(int i = 0; i < rank(); ++i)
|
||||
m.col(i).swap(m.col(pivots.coeff(i)));
|
||||
|
||||
@@ -549,7 +549,7 @@ struct ei_kernel_retval<FullPivLU<_MatrixType> >
|
||||
// notice that the math behind this suggests that we should apply this to the
|
||||
// negative of the RHS, but for performance we just put the negative sign elsewhere, see below.
|
||||
m.corner(TopLeft, rank(), rank())
|
||||
.template triangularView<UpperTriangular>().solveInPlace(
|
||||
.template triangularView<Upper>().solveInPlace(
|
||||
m.corner(TopRight, rank(), dimker)
|
||||
);
|
||||
|
||||
@@ -638,7 +638,7 @@ struct ei_solve_retval<FullPivLU<_MatrixType>, Rhs>
|
||||
// Step 2
|
||||
dec().matrixLU()
|
||||
.corner(Eigen::TopLeft,smalldim,smalldim)
|
||||
.template triangularView<UnitLowerTriangular>()
|
||||
.template triangularView<UnitLower>()
|
||||
.solveInPlace(c.corner(Eigen::TopLeft, smalldim, c.cols()));
|
||||
if(rows>cols)
|
||||
{
|
||||
@@ -650,7 +650,7 @@ struct ei_solve_retval<FullPivLU<_MatrixType>, Rhs>
|
||||
// Step 3
|
||||
dec().matrixLU()
|
||||
.corner(TopLeft, nonzero_pivots, nonzero_pivots)
|
||||
.template triangularView<UpperTriangular>()
|
||||
.template triangularView<Upper>()
|
||||
.solveInPlace(c.corner(TopLeft, nonzero_pivots, c.cols()));
|
||||
|
||||
// Step 4
|
||||
|
||||
@@ -349,7 +349,7 @@ struct ei_partial_lu_impl
|
||||
A_2.row(i).swap(A_2.row(row_transpositions[i]));
|
||||
|
||||
// A12 = A11^-1 A12
|
||||
A11.template triangularView<UnitLowerTriangular>().solveInPlace(A12);
|
||||
A11.template triangularView<UnitLower>().solveInPlace(A12);
|
||||
|
||||
A22.noalias() -= A21 * A12;
|
||||
}
|
||||
@@ -426,10 +426,10 @@ struct ei_solve_retval<PartialPivLU<_MatrixType>, Rhs>
|
||||
dst = dec().permutationP() * rhs();
|
||||
|
||||
// Step 2
|
||||
dec().matrixLU().template triangularView<UnitLowerTriangular>().solveInPlace(dst);
|
||||
dec().matrixLU().template triangularView<UnitLower>().solveInPlace(dst);
|
||||
|
||||
// Step 3
|
||||
dec().matrixLU().template triangularView<UpperTriangular>().solveInPlace(dst);
|
||||
dec().matrixLU().template triangularView<Upper>().solveInPlace(dst);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user