mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #1412: fix compilation with nvcc+MSVC
This commit is contained in:
@@ -29,6 +29,22 @@ namespace Eigen {
|
||||
*
|
||||
* \sa Scaling(), class DiagonalMatrix, MatrixBase::asDiagonal(), class Translation, class Transform
|
||||
*/
|
||||
|
||||
namespace internal
|
||||
{
|
||||
// This helper helps nvcc+MSVC to properly parse this file.
|
||||
// See bug 1412.
|
||||
template <typename Scalar, int Dim, int Mode>
|
||||
struct uniformscaling_times_affine_returntype
|
||||
{
|
||||
enum
|
||||
{
|
||||
NewMode = int(Mode) == int(Isometry) ? Affine : Mode
|
||||
};
|
||||
typedef Transform <Scalar, Dim, NewMode> type;
|
||||
};
|
||||
}
|
||||
|
||||
template<typename _Scalar>
|
||||
class UniformScaling
|
||||
{
|
||||
@@ -60,9 +76,11 @@ public:
|
||||
|
||||
/** Concatenates a uniform scaling and an affine transformation */
|
||||
template<int Dim, int Mode, int Options>
|
||||
inline Transform<Scalar,Dim,(int(Mode)==int(Isometry)?Affine:Mode)> operator* (const Transform<Scalar,Dim, Mode, Options>& t) const
|
||||
inline typename
|
||||
internal::uniformscaling_times_affine_returntype <Scalar,Dim,Mode>::type
|
||||
operator* (const Transform<Scalar, Dim, Mode, Options>& t) const
|
||||
{
|
||||
Transform<Scalar,Dim,(int(Mode)==int(Isometry)?Affine:Mode)> res = t;
|
||||
typename internal::uniformscaling_times_affine_returntype <Scalar,Dim,Mode> res = t;
|
||||
res.prescale(factor());
|
||||
return res;
|
||||
}
|
||||
@@ -70,7 +88,7 @@ public:
|
||||
/** Concatenates a uniform scaling and a linear transformation matrix */
|
||||
// TODO returns an expression
|
||||
template<typename Derived>
|
||||
inline typename internal::plain_matrix_type<Derived>::type operator* (const MatrixBase<Derived>& other) const
|
||||
inline typename Eigen::internal::plain_matrix_type<Derived>::type operator* (const MatrixBase<Derived>& other) const
|
||||
{ return other * m_factor; }
|
||||
|
||||
template<typename Derived,int Dim>
|
||||
|
||||
Reference in New Issue
Block a user