Fix bug #654: allow implicit transposition in Array to Matrix and Matrix to Array constructors

This commit is contained in:
Gael Guennebaud
2013-09-07 00:01:04 +02:00
parent 7fa007e8bf
commit 07417bd03f
3 changed files with 9 additions and 2 deletions

View File

@@ -225,7 +225,7 @@ class Array
: Base(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols())
{
Base::_check_template_params();
Base::resize(other.rows(), other.cols());
Base::_resize_to_match(other);
*this = other;
}

View File

@@ -319,7 +319,7 @@ class Matrix
: Base(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols())
{
Base::_check_template_params();
Base::resize(other.rows(), other.cols());
Base::_resize_to_match(other);
// FIXME/CHECK: isn't *this = other.derived() more efficient. it allows to
// go for pure _set() implementations, right?
*this = other;