mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
* Fix #97 : Householder operations on 1x1 matrices
* Fix VectorBlock on 1x1 "vectors" * remove useless makeTrivialHouseholder function
This commit is contained in:
@@ -59,20 +59,33 @@ template<typename VectorType, int Size>
|
||||
struct ei_traits<VectorBlock<VectorType, Size> >
|
||||
: public ei_traits<Block<VectorType,
|
||||
ei_traits<VectorType>::RowsAtCompileTime==1 ? 1 : Size,
|
||||
ei_traits<VectorType>::ColsAtCompileTime==1 ? 1 : Size> >
|
||||
ei_traits<VectorType>::ColsAtCompileTime==1
|
||||
// handle the 1x1 case. Taking a dynamic-sized vectorblock in a 1x1 xpr.
|
||||
// example: when doing HouseholderQR<Matrix<float,1,1> >.
|
||||
&& ei_traits<VectorType>::RowsAtCompileTime!=1
|
||||
? 1 : Size> >
|
||||
{
|
||||
};
|
||||
|
||||
template<typename VectorType, int Size> class VectorBlock
|
||||
: public Block<VectorType,
|
||||
ei_traits<VectorType>::RowsAtCompileTime==1 ? 1 : Size,
|
||||
ei_traits<VectorType>::ColsAtCompileTime==1 ? 1 : Size>
|
||||
ei_traits<VectorType>::ColsAtCompileTime==1
|
||||
// handle the 1x1 case. Taking a dynamic-sized vectorblock in a 1x1 xpr.
|
||||
// example: when doing HouseholderQR<Matrix<float,1,1> >.
|
||||
&& ei_traits<VectorType>::RowsAtCompileTime!=1
|
||||
? 1 : Size>
|
||||
{
|
||||
typedef Block<VectorType,
|
||||
ei_traits<VectorType>::RowsAtCompileTime==1 ? 1 : Size,
|
||||
ei_traits<VectorType>::ColsAtCompileTime==1 ? 1 : Size> Base;
|
||||
ei_traits<VectorType>::ColsAtCompileTime==1
|
||||
// handle the 1x1 case. Taking a dynamic-sized vectorblock in a 1x1 xpr.
|
||||
// example: when doing HouseholderQR<Matrix<float,1,1> >.
|
||||
&& ei_traits<VectorType>::RowsAtCompileTime!=1
|
||||
? 1 : Size
|
||||
> Base;
|
||||
enum {
|
||||
IsColVector = ei_traits<VectorType>::ColsAtCompileTime==1
|
||||
IsColVector = ei_traits<VectorType>::ColsAtCompileTime==1 && ei_traits<VectorType>::RowsAtCompileTime!=1
|
||||
};
|
||||
public:
|
||||
EIGEN_DENSE_PUBLIC_INTERFACE(VectorBlock)
|
||||
|
||||
Reference in New Issue
Block a user