mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-25 07:43:14 +08:00
* forgot to svn add 2 files
* idea of Keir Mierle: make the static assert error msgs UPPERCASE
This commit is contained in:
parent
8106d35408
commit
f34a4fa335
@ -122,7 +122,7 @@ template<typename MatrixType, int BlockRows, int BlockCols, int PacketAccess, in
|
|||||||
: m_matrix(matrix), m_startRow(startRow), m_startCol(startCol),
|
: m_matrix(matrix), m_startRow(startRow), m_startCol(startCol),
|
||||||
m_blockRows(matrix.rows()), m_blockCols(matrix.cols())
|
m_blockRows(matrix.rows()), m_blockCols(matrix.cols())
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && RowsAtCompileTime!=Dynamic,this_method_is_only_for_fixed_size)
|
EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && RowsAtCompileTime!=Dynamic,THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE)
|
||||||
ei_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
|
ei_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
|
||||||
&& startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols());
|
&& startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols());
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ class CwiseBinaryOp : ei_no_assignment_operator,
|
|||||||
// So allowing mixing different types gives very unexpected errors when enabling vectorization, when the user tries to
|
// So allowing mixing different types gives very unexpected errors when enabling vectorization, when the user tries to
|
||||||
// add together a float matrix and a double matrix.
|
// add together a float matrix and a double matrix.
|
||||||
EIGEN_STATIC_ASSERT((ei_is_same_type<typename Lhs::Scalar, typename Rhs::Scalar>::ret),
|
EIGEN_STATIC_ASSERT((ei_is_same_type<typename Lhs::Scalar, typename Rhs::Scalar>::ret),
|
||||||
you_mixed_different_numeric_types__you_need_to_use_the_cast_method_of_MatrixBase_to_cast_numeric_types_explicitly)
|
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
|
||||||
// require the sizes to match
|
// require the sizes to match
|
||||||
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs, Rhs)
|
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs, Rhs)
|
||||||
ei_assert(lhs.rows() == rhs.rows() && lhs.cols() == rhs.cols());
|
ei_assert(lhs.rows() == rhs.rows() && lhs.cols() == rhs.cols());
|
||||||
|
@ -102,8 +102,8 @@ template<typename MatrixType, unsigned int Mode> class Part
|
|||||||
|
|
||||||
inline Scalar& coeffRef(int row, int col)
|
inline Scalar& coeffRef(int row, int col)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(!(Flags & UnitDiagBit), writing_to_triangular_part_with_unit_diagonal_is_not_supported)
|
EIGEN_STATIC_ASSERT(!(Flags & UnitDiagBit), WRITING_TO_TRIANGULAR_PART_WITH_UNIT_DIAGONAL_IS_NOT_SUPPORTED)
|
||||||
EIGEN_STATIC_ASSERT(!(Flags & SelfAdjointBit), coefficient_write_access_to_selfadjoint_not_supported)
|
EIGEN_STATIC_ASSERT(!(Flags & SelfAdjointBit), COEFFICIENT_WRITE_ACCESS_TO_SELFADJOINT_NOT_SUPPORTED)
|
||||||
ei_assert( (Mode==Upper && col>=row)
|
ei_assert( (Mode==Upper && col>=row)
|
||||||
|| (Mode==Lower && col<=row)
|
|| (Mode==Lower && col<=row)
|
||||||
|| (Mode==StrictlyUpper && col>row)
|
|| (Mode==StrictlyUpper && col>row)
|
||||||
|
@ -199,7 +199,7 @@ template<typename LhsNested, typename RhsNested, int ProductMode> class Product
|
|||||||
// we don't allow taking products of matrices of different real types, as that wouldn't be vectorizable.
|
// we don't allow taking products of matrices of different real types, as that wouldn't be vectorizable.
|
||||||
// We still allow to mix T and complex<T>.
|
// We still allow to mix T and complex<T>.
|
||||||
EIGEN_STATIC_ASSERT((ei_is_same_type<typename Lhs::RealScalar, typename Rhs::RealScalar>::ret),
|
EIGEN_STATIC_ASSERT((ei_is_same_type<typename Lhs::RealScalar, typename Rhs::RealScalar>::ret),
|
||||||
you_mixed_different_numeric_types__you_need_to_use_the_cast_method_of_MatrixBase_to_cast_numeric_types_explicitly)
|
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
|
||||||
ei_assert(lhs.cols() == rhs.rows()
|
ei_assert(lhs.cols() == rhs.rows()
|
||||||
&& "invalid matrix product"
|
&& "invalid matrix product"
|
||||||
&& "if you wanted a coeff-wise or a dot product use the respective explicit functions");
|
&& "if you wanted a coeff-wise or a dot product use the respective explicit functions");
|
||||||
@ -284,10 +284,10 @@ MatrixBase<Derived>::operator*(const MatrixBase<OtherDerived> &other) const
|
|||||||
// * for a dot product use: v1.dot(v2)
|
// * for a dot product use: v1.dot(v2)
|
||||||
// * for a coeff-wise product use: v1.cwise()*v2
|
// * for a coeff-wise product use: v1.cwise()*v2
|
||||||
EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes),
|
EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes),
|
||||||
invalid_vector_vector_product__if_you_wanted_a_dot_or_coeff_wise_product_you_must_use_the_explicit_functions)
|
INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS)
|
||||||
EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors),
|
EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors),
|
||||||
invalid_matrix_product__if_you_wanted_a_coeff_wise_product_you_must_use_the_explicit_function)
|
INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION)
|
||||||
EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, invalid_matrix_product)
|
EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT)
|
||||||
return typename ProductReturnType<Derived,OtherDerived>::Type(derived(), other.derived());
|
return typename ProductReturnType<Derived,OtherDerived>::Type(derived(), other.derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
Eigen/src/Core/util/DisableMSVCWarnings.h
Normal file
9
Eigen/src/Core/util/DisableMSVCWarnings.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef EIGEN_DISABLEMSVCWARNINGS_H
|
||||||
|
#define EIGEN_DISABLEMSVCWARNINGS_H
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning( push )
|
||||||
|
#pragma warning( disable : 4181 4244 4127 )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // EIGEN_DISABLEMSVCWARNINGS_H
|
8
Eigen/src/Core/util/EnableMSVCWarnings.h
Normal file
8
Eigen/src/Core/util/EnableMSVCWarnings.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef EIGEN_ENABLEMSVCWARNINGS_H
|
||||||
|
#define EIGEN_ENABLEMSVCWARNINGS_H
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning( pop )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // EIGEN_ENABLEMSVCWARNINGS_H
|
@ -55,22 +55,22 @@
|
|||||||
struct ei_static_assert<true>
|
struct ei_static_assert<true>
|
||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
you_tried_calling_a_vector_method_on_a_matrix,
|
YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX,
|
||||||
you_mixed_vectors_of_different_sizes,
|
YOU_MIXED_VECTORS_OF_DIFFERENT_SIZES,
|
||||||
you_mixed_matrices_of_different_sizes,
|
YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES,
|
||||||
this_method_is_only_for_vectors_of_a_specific_size,
|
THIS_METHOD_IS_ONLY_FOR_VECTORS_OF_A_SPECIFIC_SIZE,
|
||||||
this_method_is_only_for_matrices_of_a_specific_size,
|
THIS_METHOD_IS_ONLY_FOR_MATRICES_OF_A_SPECIFIC_SIZE,
|
||||||
you_made_a_programming_mistake,
|
YOU_MADE_A_PROGRAMMING_MISTAKE,
|
||||||
you_called_a_fixed_size_method_on_a_dynamic_size_matrix_or_vector,
|
YOU_CALLED_A_FIXED_SIZE_METHOD_ON_A_DYNAMIC_SIZE_MATRIX_OR_VECTOR,
|
||||||
unaligned_load_and_store_operations_unimplemented_on_AltiVec,
|
UNALIGNED_LOAD_AND_STORE_OPERATIONS_UNIMPLEMENTED_ON_ALTIVEC,
|
||||||
numeric_type_must_be_floating_point,
|
NUMERIC_TYPE_MUST_BE_FLOATING_POINT,
|
||||||
coefficient_write_access_to_selfadjoint_not_supported,
|
COEFFICIENT_WRITE_ACCESS_TO_SELFADJOINT_NOT_SUPPORTED,
|
||||||
writing_to_triangular_part_with_unit_diagonal_is_not_supported,
|
WRITING_TO_TRIANGULAR_PART_WITH_UNIT_DIAGONAL_IS_NOT_SUPPORTED,
|
||||||
this_method_is_only_for_fixed_size,
|
THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE,
|
||||||
invalid_matrix_product,
|
INVALID_MATRIX_PRODUCT,
|
||||||
invalid_vector_vector_product__if_you_wanted_a_dot_or_coeff_wise_product_you_must_use_the_explicit_functions,
|
INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS,
|
||||||
invalid_matrix_product__if_you_wanted_a_coeff_wise_product_you_must_use_the_explicit_function,
|
INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION,
|
||||||
you_mixed_different_numeric_types__you_need_to_use_the_cast_method_of_MatrixBase_to_cast_numeric_types_explicitly
|
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -101,22 +101,22 @@
|
|||||||
// static assertion failing if the type \a TYPE is not a vector type
|
// static assertion failing if the type \a TYPE is not a vector type
|
||||||
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE) \
|
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE) \
|
||||||
EIGEN_STATIC_ASSERT(TYPE::IsVectorAtCompileTime, \
|
EIGEN_STATIC_ASSERT(TYPE::IsVectorAtCompileTime, \
|
||||||
you_tried_calling_a_vector_method_on_a_matrix)
|
YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX)
|
||||||
|
|
||||||
// static assertion failing if the type \a TYPE is not fixed-size
|
// static assertion failing if the type \a TYPE is not fixed-size
|
||||||
#define EIGEN_STATIC_ASSERT_FIXED_SIZE(TYPE) \
|
#define EIGEN_STATIC_ASSERT_FIXED_SIZE(TYPE) \
|
||||||
EIGEN_STATIC_ASSERT(TYPE::SizeAtCompileTime!=Eigen::Dynamic, \
|
EIGEN_STATIC_ASSERT(TYPE::SizeAtCompileTime!=Eigen::Dynamic, \
|
||||||
you_called_a_fixed_size_method_on_a_dynamic_size_matrix_or_vector)
|
YOU_CALLED_A_FIXED_SIZE_METHOD_ON_A_DYNAMIC_SIZE_MATRIX_OR_VECTOR)
|
||||||
|
|
||||||
// static assertion failing if the type \a TYPE is not a vector type of the given size
|
// static assertion failing if the type \a TYPE is not a vector type of the given size
|
||||||
#define EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE) \
|
#define EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE) \
|
||||||
EIGEN_STATIC_ASSERT(TYPE::IsVectorAtCompileTime && TYPE::SizeAtCompileTime==SIZE, \
|
EIGEN_STATIC_ASSERT(TYPE::IsVectorAtCompileTime && TYPE::SizeAtCompileTime==SIZE, \
|
||||||
this_method_is_only_for_vectors_of_a_specific_size)
|
THIS_METHOD_IS_ONLY_FOR_VECTORS_OF_A_SPECIFIC_SIZE)
|
||||||
|
|
||||||
// static assertion failing if the type \a TYPE is not a vector type of the given size
|
// static assertion failing if the type \a TYPE is not a vector type of the given size
|
||||||
#define EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(TYPE, ROWS, COLS) \
|
#define EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(TYPE, ROWS, COLS) \
|
||||||
EIGEN_STATIC_ASSERT(TYPE::RowsAtCompileTime==ROWS && TYPE::ColsAtCompileTime==COLS, \
|
EIGEN_STATIC_ASSERT(TYPE::RowsAtCompileTime==ROWS && TYPE::ColsAtCompileTime==COLS, \
|
||||||
this_method_is_only_for_matrices_of_a_specific_size)
|
THIS_METHOD_IS_ONLY_FOR_MATRICES_OF_A_SPECIFIC_SIZE)
|
||||||
|
|
||||||
// static assertion failing if the two vector expression types are not compatible (same fixed-size or dynamic size)
|
// static assertion failing if the two vector expression types are not compatible (same fixed-size or dynamic size)
|
||||||
#define EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(TYPE0,TYPE1) \
|
#define EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(TYPE0,TYPE1) \
|
||||||
@ -124,7 +124,7 @@
|
|||||||
(int(TYPE0::SizeAtCompileTime)==Eigen::Dynamic \
|
(int(TYPE0::SizeAtCompileTime)==Eigen::Dynamic \
|
||||||
|| int(TYPE1::SizeAtCompileTime)==Eigen::Dynamic \
|
|| int(TYPE1::SizeAtCompileTime)==Eigen::Dynamic \
|
||||||
|| int(TYPE0::SizeAtCompileTime)==int(TYPE1::SizeAtCompileTime)),\
|
|| int(TYPE0::SizeAtCompileTime)==int(TYPE1::SizeAtCompileTime)),\
|
||||||
you_mixed_vectors_of_different_sizes)
|
YOU_MIXED_VECTORS_OF_DIFFERENT_SIZES)
|
||||||
|
|
||||||
#define EIGEN_PREDICATE_SAME_MATRIX_SIZE(TYPE0,TYPE1) \
|
#define EIGEN_PREDICATE_SAME_MATRIX_SIZE(TYPE0,TYPE1) \
|
||||||
((int(TYPE0::RowsAtCompileTime)==Eigen::Dynamic \
|
((int(TYPE0::RowsAtCompileTime)==Eigen::Dynamic \
|
||||||
@ -138,6 +138,6 @@
|
|||||||
#define EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(TYPE0,TYPE1) \
|
#define EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(TYPE0,TYPE1) \
|
||||||
EIGEN_STATIC_ASSERT( \
|
EIGEN_STATIC_ASSERT( \
|
||||||
EIGEN_PREDICATE_SAME_MATRIX_SIZE(TYPE0,TYPE1),\
|
EIGEN_PREDICATE_SAME_MATRIX_SIZE(TYPE0,TYPE1),\
|
||||||
you_mixed_matrices_of_different_sizes)
|
YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES)
|
||||||
|
|
||||||
#endif // EIGEN_STATIC_ASSERT_H
|
#endif // EIGEN_STATIC_ASSERT_H
|
||||||
|
@ -140,7 +140,7 @@ template<typename Scalar>
|
|||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
Rotation2D<Scalar>& Rotation2D<Scalar>::fromRotationMatrix(const MatrixBase<Derived>& mat)
|
Rotation2D<Scalar>& Rotation2D<Scalar>::fromRotationMatrix(const MatrixBase<Derived>& mat)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(Derived::RowsAtCompileTime==2 && Derived::ColsAtCompileTime==2,you_made_a_programming_mistake)
|
EIGEN_STATIC_ASSERT(Derived::RowsAtCompileTime==2 && Derived::ColsAtCompileTime==2,YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||||
m_angle = ei_atan2(mat.coeff(1,0), mat.coeff(0,0));
|
m_angle = ei_atan2(mat.coeff(1,0), mat.coeff(0,0));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ Matrix<_Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols>
|
|||||||
template<typename Scalar, int Dim>
|
template<typename Scalar, int Dim>
|
||||||
inline static Matrix<Scalar,2,2> ei_toRotationMatrix(const Scalar& s)
|
inline static Matrix<Scalar,2,2> ei_toRotationMatrix(const Scalar& s)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(Dim==2,you_made_a_programming_mistake)
|
EIGEN_STATIC_ASSERT(Dim==2,YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||||
return Rotation2D<Scalar>(s).toRotationMatrix();
|
return Rotation2D<Scalar>(s).toRotationMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ template<typename Scalar, int Dim, typename OtherDerived>
|
|||||||
inline static const MatrixBase<OtherDerived>& ei_toRotationMatrix(const MatrixBase<OtherDerived>& mat)
|
inline static const MatrixBase<OtherDerived>& ei_toRotationMatrix(const MatrixBase<OtherDerived>& mat)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(OtherDerived::RowsAtCompileTime==Dim && OtherDerived::ColsAtCompileTime==Dim,
|
EIGEN_STATIC_ASSERT(OtherDerived::RowsAtCompileTime==Dim && OtherDerived::ColsAtCompileTime==Dim,
|
||||||
you_made_a_programming_mistake)
|
YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||||
return mat;
|
return mat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ Transform<Scalar,Dim>::Transform(const QMatrix& other)
|
|||||||
template<typename Scalar, int Dim>
|
template<typename Scalar, int Dim>
|
||||||
Transform<Scalar,Dim>& Transform<Scalar,Dim>::operator=(const QMatrix& other)
|
Transform<Scalar,Dim>& Transform<Scalar,Dim>::operator=(const QMatrix& other)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(Dim==2, you_made_a_programming_mistake)
|
EIGEN_STATIC_ASSERT(Dim==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||||
m_matrix << other.m11(), other.m21(), other.dx(),
|
m_matrix << other.m11(), other.m21(), other.dx(),
|
||||||
other.m12(), other.m22(), other.dy(),
|
other.m12(), other.m22(), other.dy(),
|
||||||
0, 0, 1;
|
0, 0, 1;
|
||||||
@ -323,7 +323,7 @@ Transform<Scalar,Dim>& Transform<Scalar,Dim>::operator=(const QMatrix& other)
|
|||||||
template<typename Scalar, int Dim>
|
template<typename Scalar, int Dim>
|
||||||
QMatrix Transform<Scalar,Dim>::toQMatrix(void) const
|
QMatrix Transform<Scalar,Dim>::toQMatrix(void) const
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(Dim==2, you_made_a_programming_mistake)
|
EIGEN_STATIC_ASSERT(Dim==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||||
return QMatrix(other.coeffRef(0,0), other.coeffRef(1,0),
|
return QMatrix(other.coeffRef(0,0), other.coeffRef(1,0),
|
||||||
other.coeffRef(0,1), other.coeffRef(1,1),
|
other.coeffRef(0,1), other.coeffRef(1,1),
|
||||||
other.coeffRef(0,2), other.coeffRef(1,2));
|
other.coeffRef(0,2), other.coeffRef(1,2));
|
||||||
@ -346,7 +346,7 @@ Transform<Scalar,Dim>::Transform(const QTransform& other)
|
|||||||
template<typename Scalar, int Dim>
|
template<typename Scalar, int Dim>
|
||||||
Transform<Scalar,Dim>& Transform<Scalar,Dim>::operator=(const QTransform& other)
|
Transform<Scalar,Dim>& Transform<Scalar,Dim>::operator=(const QTransform& other)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(Dim==2, you_made_a_programming_mistake)
|
EIGEN_STATIC_ASSERT(Dim==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||||
m_matrix << other.m11(), other.m21(), other.dx(),
|
m_matrix << other.m11(), other.m21(), other.dx(),
|
||||||
other.m12(), other.m22(), other.dy(),
|
other.m12(), other.m22(), other.dy(),
|
||||||
other.m13(), other.m23(), other.m33();
|
other.m13(), other.m23(), other.m33();
|
||||||
@ -360,7 +360,7 @@ Transform<Scalar,Dim>& Transform<Scalar,Dim>::operator=(const QTransform& other)
|
|||||||
template<typename Scalar, int Dim>
|
template<typename Scalar, int Dim>
|
||||||
QMatrix Transform<Scalar,Dim>::toQTransform(void) const
|
QMatrix Transform<Scalar,Dim>::toQTransform(void) const
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(Dim==2, you_made_a_programming_mistake)
|
EIGEN_STATIC_ASSERT(Dim==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||||
return QTransform(other.coeffRef(0,0), other.coeffRef(1,0), other.coeffRef(2,0)
|
return QTransform(other.coeffRef(0,0), other.coeffRef(1,0), other.coeffRef(2,0)
|
||||||
other.coeffRef(0,1), other.coeffRef(1,1), other.coeffRef(2,1)
|
other.coeffRef(0,1), other.coeffRef(1,1), other.coeffRef(2,1)
|
||||||
other.coeffRef(0,2), other.coeffRef(1,2), other.coeffRef(2,2);
|
other.coeffRef(0,2), other.coeffRef(1,2), other.coeffRef(2,2);
|
||||||
@ -501,7 +501,7 @@ template<typename Scalar, int Dim>
|
|||||||
Transform<Scalar,Dim>&
|
Transform<Scalar,Dim>&
|
||||||
Transform<Scalar,Dim>::shear(Scalar sx, Scalar sy)
|
Transform<Scalar,Dim>::shear(Scalar sx, Scalar sy)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(int(Dim)==2, you_made_a_programming_mistake)
|
EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||||
VectorType tmp = linear().col(0)*sy + linear().col(1);
|
VectorType tmp = linear().col(0)*sy + linear().col(1);
|
||||||
linear() << linear().col(0) + linear().col(1)*sx, tmp;
|
linear() << linear().col(0) + linear().col(1)*sx, tmp;
|
||||||
return *this;
|
return *this;
|
||||||
@ -516,7 +516,7 @@ template<typename Scalar, int Dim>
|
|||||||
Transform<Scalar,Dim>&
|
Transform<Scalar,Dim>&
|
||||||
Transform<Scalar,Dim>::preshear(Scalar sx, Scalar sy)
|
Transform<Scalar,Dim>::preshear(Scalar sx, Scalar sy)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(int(Dim)==2, you_made_a_programming_mistake)
|
EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||||
m_matrix.template block<Dim,HDim>(0,0) = LinearMatrixType(1, sx, sy, 1) * m_matrix.template block<Dim,HDim>(0,0);
|
m_matrix.template block<Dim,HDim>(0,0) = LinearMatrixType(1, sx, sy, 1) * m_matrix.template block<Dim,HDim>(0,0);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ template<typename Derived>
|
|||||||
inline void MatrixBase<Derived>::computeInverse(PlainMatrixType *result) const
|
inline void MatrixBase<Derived>::computeInverse(PlainMatrixType *result) const
|
||||||
{
|
{
|
||||||
ei_assert(rows() == cols());
|
ei_assert(rows() == cols());
|
||||||
EIGEN_STATIC_ASSERT(NumTraits<Scalar>::HasFloatingPoint,numeric_type_must_be_floating_point)
|
EIGEN_STATIC_ASSERT(NumTraits<Scalar>::HasFloatingPoint,NUMERIC_TYPE_MUST_BE_FLOATING_POINT)
|
||||||
ei_compute_inverse<PlainMatrixType>::run(eval(), result);
|
ei_compute_inverse<PlainMatrixType>::run(eval(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
: m_matrix(matrix), m_startRow(startRow), m_startCol(startCol),
|
: m_matrix(matrix), m_startRow(startRow), m_startCol(startCol),
|
||||||
m_blockRows(matrix.rows()), m_blockCols(matrix.cols())
|
m_blockRows(matrix.rows()), m_blockCols(matrix.cols())
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && RowsAtCompileTime!=Dynamic,this_method_is_only_for_fixed_size)
|
EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && RowsAtCompileTime!=Dynamic,THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE)
|
||||||
ei_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
|
ei_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
|
||||||
&& startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols());
|
&& startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user