* vectorize dot product, copying code from sum.

* make the conj functor vectorizable: it is just identity in real case,
  and complex doesn't use the vectorized path anyway.
* fix bug in Block: a 3x1 block in a 4x4 matrix (all fixed-size)
  should not be vectorizable, since in fixed-size we are assuming
  the size to be a multiple of packet size. (Or would you prefer
  Vector3d to be flagged "packetaccess" even though no packet access
  is possible on vectors of that type?)
* rename:
  isOrtho for vectors ---> isOrthogonal
  isOrtho for matrices ---> isUnitary
* add normalize()
* reimplement normalized with quotient1 functor
This commit is contained in:
Benoit Jacob
2008-06-24 15:13:00 +00:00
parent c9560df4a0
commit 3b94436d2f
12 changed files with 270 additions and 69 deletions

View File

@@ -168,8 +168,11 @@ template<typename Derived> class MatrixBase
typedef Block<Derived, (ei_traits<Derived>::RowsAtCompileTime == 1 ? 1 : Size),
(ei_traits<Derived>::ColsAtCompileTime == 1 ? 1 : Size)> Type;
};
/** Represents a product scalar-matrix */
/** Represents a scalar multiple of a matrix */
typedef CwiseUnaryOp<ei_scalar_multiple_op<Scalar>, Derived> ScalarMultipleReturnType;
/** Represents a quotient of a matrix by a scalar*/
typedef CwiseUnaryOp<ei_scalar_quotient1_op<Scalar>, Derived> ScalarQuotient1ReturnType;
/** the return type of MatrixBase::conjugate() */
typedef typename ei_meta_if<NumTraits<Scalar>::IsComplex,
CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Derived>,
@@ -280,7 +283,8 @@ template<typename Derived> class MatrixBase
Scalar dot(const MatrixBase<OtherDerived>& other) const;
RealScalar norm2() const;
RealScalar norm() const;
const ScalarMultipleReturnType normalized() const;
const ScalarQuotient1ReturnType normalized() const;
void normalize();
Transpose<Derived> transpose();
const Transpose<Derived> transpose() const;
@@ -391,9 +395,9 @@ template<typename Derived> class MatrixBase
bool isLower(RealScalar prec = precision<Scalar>()) const;
template<typename OtherDerived>
bool isOrtho(const MatrixBase<OtherDerived>& other,
RealScalar prec = precision<Scalar>()) const;
bool isOrtho(RealScalar prec = precision<Scalar>()) const;
bool isOrthogonal(const MatrixBase<OtherDerived>& other,
RealScalar prec = precision<Scalar>()) const;
bool isUnitary(RealScalar prec = precision<Scalar>()) const;
template<typename OtherDerived>
inline bool operator==(const MatrixBase<OtherDerived>& other) const