Fix transpose storage order issue

See merge request oss/rotgen!38
This commit is contained in:
Joel Falcou 2025-10-12 23:34:26 +02:00
commit 3ff3738f6b
9 changed files with 27 additions and 27 deletions

View file

@ -34,7 +34,7 @@ namespace rotgen
static constexpr int storage_order = Ref::storage_order; static constexpr int storage_order = Ref::storage_order;
static constexpr bool is_immutable = std::is_const_v<Ref>; static constexpr bool is_immutable = std::is_const_v<Ref>;
using concrete_type = matrix<value_type,Rows,Cols,storage_order>; using concrete_type = matrix<value_type,Rows,Cols,storage_order>;
using transposed_type = matrix<value_type,Cols,Rows, storage_order ^ RowMajor>; using transposed_type = matrix<value_type,Cols,Rows, storage_order>;
using concrete_dynamic_type = matrix<value_type,Dynamic,Dynamic,storage_order>; using concrete_dynamic_type = matrix<value_type,Dynamic,Dynamic,storage_order>;
static constexpr int RowsAtCompileTime = Rows; static constexpr int RowsAtCompileTime = Rows;

View file

@ -47,9 +47,9 @@ class ROTGEN_EXPORT CLASSNAME
Index startCol() const; Index startCol() const;
SOURCENAME normalized() const; SOURCENAME normalized() const;
TRANSSOURCENAME transpose() const; SOURCENAME transpose() const;
SOURCENAME conjugate() const; SOURCENAME conjugate() const;
TRANSSOURCENAME adjoint() const; SOURCENAME adjoint() const;
SOURCENAME cwiseAbs() const; SOURCENAME cwiseAbs() const;
SOURCENAME cwiseAbs2() const; SOURCENAME cwiseAbs2() const;

View file

@ -45,7 +45,7 @@ namespace rotgen
static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime; static constexpr bool IsVectorAtCompileTime = Ref::IsVectorAtCompileTime;
static constexpr bool IsCompileTimeSized = RowsAtCompileTime != -1 && ColsAtCompileTime != -1; static constexpr bool IsCompileTimeSized = RowsAtCompileTime != -1 && ColsAtCompileTime != -1;
using transposed_type = matrix<value_type,ColsAtCompileTime,RowsAtCompileTime, storage_order ^ RowMajor>; using transposed_type = matrix<value_type,ColsAtCompileTime,RowsAtCompileTime, storage_order>;
map(ptr_type ptr, Index r, Index c, stride_type s) : parent(ptr, r, c, strides<storage_order>(s,r,c)) map(ptr_type ptr, Index r, Index c, stride_type s) : parent(ptr, r, c, strides<storage_order>(s,r,c))
{ {

View file

@ -35,9 +35,9 @@ class ROTGEN_EXPORT CLASSNAME
Index outerStride() const; Index outerStride() const;
SOURCENAME normalized() const; SOURCENAME normalized() const;
TRANSSOURCENAME transpose() const; SOURCENAME transpose() const;
SOURCENAME conjugate() const; SOURCENAME conjugate() const;
TRANSSOURCENAME adjoint() const; SOURCENAME adjoint() const;
SOURCENAME cwiseAbs() const; SOURCENAME cwiseAbs() const;
SOURCENAME cwiseAbs2() const; SOURCENAME cwiseAbs2() const;

View file

@ -40,7 +40,7 @@ namespace rotgen
static constexpr bool has_static_storage = false; static constexpr bool has_static_storage = false;
static constexpr bool is_immutable = false; static constexpr bool is_immutable = false;
using transposed_type = matrix<value_type,Cols,Rows, storage_order ^ RowMajor>; using transposed_type = matrix<value_type,Cols,Rows,storage_order>;
matrix() : parent(Rows==-1?0:Rows,Cols==-1?0:Cols) {} matrix() : parent(Rows==-1?0:Rows,Cols==-1?0:Cols) {}

View file

@ -36,9 +36,9 @@ class ROTGEN_EXPORT CLASSNAME
void conservativeResize(std::size_t new_rows, std::size_t new_cols); void conservativeResize(std::size_t new_rows, std::size_t new_cols);
CLASSNAME normalized() const; CLASSNAME normalized() const;
TRANSCLASSNAME transpose() const; CLASSNAME transpose() const;
CLASSNAME conjugate() const; CLASSNAME conjugate() const;
TRANSCLASSNAME adjoint() const; CLASSNAME adjoint() const;
CLASSNAME cwiseAbs() const; CLASSNAME cwiseAbs() const;
CLASSNAME cwiseAbs2() const; CLASSNAME cwiseAbs2() const;

View file

@ -234,9 +234,9 @@ struct CLASSNAME::payload
return result; return result;
} }
TRANSSOURCENAME CLASSNAME::transpose() const SOURCENAME CLASSNAME::transpose() const
{ {
TRANSSOURCENAME result; SOURCENAME result;
storage_->apply([&](const auto& blk) { result.storage()->assign(blk.transpose().eval()); }); storage_->apply([&](const auto& blk) { result.storage()->assign(blk.transpose().eval()); });
return result; return result;
} }
@ -248,9 +248,9 @@ struct CLASSNAME::payload
return result; return result;
} }
TRANSSOURCENAME CLASSNAME::adjoint() const SOURCENAME CLASSNAME::adjoint() const
{ {
TRANSSOURCENAME result; SOURCENAME result;
storage_->apply([&](const auto& blk) { result.storage()->assign(blk.adjoint().eval()); }); storage_->apply([&](const auto& blk) { result.storage()->assign(blk.adjoint().eval()); });
return result; return result;
} }

View file

@ -74,9 +74,9 @@
return result; return result;
} }
TRANSSOURCENAME CLASSNAME::transpose() const SOURCENAME CLASSNAME::transpose() const
{ {
TRANSSOURCENAME result; SOURCENAME result;
result.storage()->assign(storage_->data.transpose().eval()); result.storage()->assign(storage_->data.transpose().eval());
return result; return result;
} }
@ -88,9 +88,9 @@
return result; return result;
} }
TRANSSOURCENAME CLASSNAME::adjoint() const SOURCENAME CLASSNAME::adjoint() const
{ {
TRANSSOURCENAME result; SOURCENAME result;
result.storage()->assign(storage_->data.adjoint().eval()); result.storage()->assign(storage_->data.adjoint().eval());
return result; return result;
} }

View file

@ -82,9 +82,9 @@ CLASSNAME CLASSNAME::normalized() const
return result; return result;
} }
TRANSCLASSNAME CLASSNAME::transpose() const CLASSNAME CLASSNAME::transpose() const
{ {
TRANSCLASSNAME result; CLASSNAME result;
result.storage()->data = storage_->data.transpose(); result.storage()->data = storage_->data.transpose();
return result; return result;
} }
@ -96,9 +96,9 @@ CLASSNAME CLASSNAME::conjugate() const
return result; return result;
} }
TRANSCLASSNAME CLASSNAME::adjoint() const CLASSNAME CLASSNAME::adjoint() const
{ {
TRANSCLASSNAME result; CLASSNAME result;
result.storage()->data = storage_->data.adjoint(); result.storage()->data = storage_->data.adjoint();
return result; return result;
} }