mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
-merge patch from Gael Guennebaud adding NumTraits for long long
and long double. -define scalar-multiple operators only for the current Scalar type; thanks to Gael for expaining how to make the compiler understand when automatic casting is needed. -take ScalarMultiple take only 1 template param, again. We lose some flexibility especially when dealing with complex numbers, but we gain a lot of extensibility to new scalar types.
This commit is contained in:
@@ -215,7 +215,7 @@ template<typename Scalar, typename Derived> class MatrixBase
|
||||
Scalar dot(const OtherDerived& other) const;
|
||||
RealScalar norm2() const;
|
||||
RealScalar norm() const;
|
||||
const ScalarMultiple<RealScalar, Derived> normalized() const;
|
||||
const ScalarMultiple<Derived> normalized() const;
|
||||
template<typename OtherDerived>
|
||||
bool isOrtho(const OtherDerived& other, RealScalar prec = precision<Scalar>()) const;
|
||||
bool isOrtho(RealScalar prec = precision<Scalar>()) const;
|
||||
@@ -269,17 +269,16 @@ template<typename Scalar, typename Derived> class MatrixBase
|
||||
template<typename OtherDerived>
|
||||
Derived& operator*=(const MatrixBase<Scalar, OtherDerived>& other);
|
||||
|
||||
Derived& operator*=(const int& other);
|
||||
Derived& operator*=(const float& other);
|
||||
Derived& operator*=(const double& other);
|
||||
Derived& operator*=(const std::complex<float>& other);
|
||||
Derived& operator*=(const std::complex<double>& other);
|
||||
|
||||
Derived& operator/=(const int& other);
|
||||
Derived& operator/=(const float& other);
|
||||
Derived& operator/=(const double& other);
|
||||
Derived& operator/=(const std::complex<float>& other);
|
||||
Derived& operator/=(const std::complex<double>& other);
|
||||
Derived& operator*=(const Scalar& other);
|
||||
Derived& operator/=(const Scalar& other);
|
||||
|
||||
const ScalarMultiple<Derived> operator*(const Scalar& scalar) const;
|
||||
const ScalarMultiple<Derived> operator/(const Scalar& scalar) const;
|
||||
|
||||
friend
|
||||
const ScalarMultiple<Derived> operator*(const Scalar& scalar,
|
||||
const MatrixBase& matrix)
|
||||
{ return matrix*scalar; }
|
||||
|
||||
Scalar coeff(int row, int col) const;
|
||||
Scalar operator()(int row, int col) const;
|
||||
|
||||
Reference in New Issue
Block a user