aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-09-03 20:52:26 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-09-03 20:52:26 +0000
commitc29c7b0ea95b86f73d77224efb26f96abdc189ac (patch)
tree621b6db8df4a4d9e3f771bc6ffdb455e24bc25e5 /Eigen/src/Core
parente14aa8c8aa1646bbfdf501a84b0665bb17220229 (diff)
Fix bugs reported by Timothy Hunter:
* CholeskyWithoutSqrt with 1x1 matrices * .part<Diagonal>() Updated unit tests to handle these cases
Diffstat (limited to 'Eigen/src/Core')
-rw-r--r--Eigen/src/Core/Part.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Eigen/src/Core/Part.h b/Eigen/src/Core/Part.h
index 4d39c4c08..931933575 100644
--- a/Eigen/src/Core/Part.h
+++ b/Eigen/src/Core/Part.h
@@ -88,7 +88,7 @@ template<typename MatrixType, unsigned int Mode> class Part
inline Scalar coeff(int row, int col) const
{
- if(Flags & LowerTriangularBit ? col>row : row>col)
+ if( (Flags & LowerTriangularBit) && (col>row) || (Flags & UpperTriangularBit) && (row>col) )
return (Flags & SelfAdjointBit) ? ei_conj(m_matrix.coeff(col, row)) : (Scalar)0;
if(Flags & UnitDiagBit)
return col==row ? (Scalar)1 : m_matrix.coeff(row, col);