20 template<
typename T,
typename U,
22 bool NeedToTranspose = T::IsVectorAtCompileTime
23 && U::IsVectorAtCompileTime
24 && ((int(T::RowsAtCompileTime) == 1 && int(U::ColsAtCompileTime) == 1)
27 (
int(T::ColsAtCompileTime) == 1 && int(U::RowsAtCompileTime) == 1))
32 typedef typename conj_prod::result_type ResScalar;
36 return a.template binaryExpr<conj_prod>(b).sum();
40 template<
typename T,
typename U>
44 typedef typename conj_prod::result_type ResScalar;
48 return a.
transpose().template binaryExpr<conj_prod>(b).sum();
64 template<
typename Derived>
65 template<
typename OtherDerived>
70 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
71 EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
72 EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived)
73 #if !(defined(EIGEN_NO_STATIC_ASSERT) && defined(EIGEN_NO_DEBUG)) 75 EIGEN_CHECK_BINARY_COMPATIBILIY(func,
Scalar,
typename OtherDerived::Scalar);
78 eigen_assert(size() == other.size());
91 template<
typename Derived>
94 return numext::real((*this).cwiseAbs2().sum());
103 template<
typename Derived>
106 return numext::sqrt(squaredNorm());
118 template<
typename Derived>
119 inline const typename MatrixBase<Derived>::PlainObject
123 _Nested n(derived());
124 RealScalar z = n.squaredNorm();
127 return n / numext::sqrt(z);
140 template<
typename Derived>
143 RealScalar z = squaredNorm();
146 derived() /= numext::sqrt(z);
161 template<
typename Derived>
162 inline const typename MatrixBase<Derived>::PlainObject
166 _Nested n(derived());
167 RealScalar w = n.cwiseAbs().maxCoeff();
168 RealScalar z = (n/w).squaredNorm();
170 return n / (numext::sqrt(z)*w);
186 template<
typename Derived>
189 RealScalar w = cwiseAbs().maxCoeff();
190 RealScalar z = (derived()/w).squaredNorm();
192 derived() /= numext::sqrt(z)*w;
199 template<
typename Derived,
int p>
206 EIGEN_USING_STD_MATH(pow)
207 return pow(m.
cwiseAbs().array().pow(p).sum(), RealScalar(1)/p);
211 template<
typename Derived>
221 template<
typename Derived>
231 template<
typename Derived>
238 if(Derived::SizeAtCompileTime==0 || (Derived::SizeAtCompileTime==
Dynamic && m.size()==0))
239 return RealScalar(0);
256 template<
typename Derived>
258 #ifndef EIGEN_PARSED_BY_DOXYGEN 261 MatrixBase<Derived>::RealScalar
276 template<
typename Derived>
277 template<
typename OtherDerived>
283 return numext::abs2(nested.dot(otherNested)) <= prec * prec * nested.squaredNorm() * otherNested.squaredNorm();
297 template<
typename Derived>
301 for(
Index i = 0; i < cols(); ++i)
303 if(!internal::isApprox(
self.col(i).squaredNorm(), static_cast<RealScalar>(1), prec))
305 for(
Index j = 0; j < i; ++j)
306 if(!internal::isMuchSmallerThan(
self.col(i).dot(
self.col(j)), static_cast<Scalar>(1), prec))
314 #endif // EIGEN_DOT_H internal::traits< Derived >::Scalar Scalar
The numeric type of the expression' coefficients, e.g.
Definition: DenseBase.h:66
bool isUnitary(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Dot.h:298
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
Holds information about the various numeric (i.e.
Definition: NumTraits.h:150
EIGEN_DEVICE_FUNC const PlainObject normalized() const
Definition: Dot.h:120
EIGEN_DEVICE_FUNC TransposeReturnType transpose()
Definition: Transpose.h:172
EIGEN_DEVICE_FUNC RealScalar squaredNorm() const
Definition: Dot.h:92
EIGEN_DEVICE_FUNC void normalize()
Normalizes the vector, i.e.
Definition: Dot.h:141
EIGEN_DEVICE_FUNC RealScalar norm() const
Definition: Dot.h:104
EIGEN_DEVICE_FUNC void stableNormalize()
Normalizes the vector while avoid underflow and overflow.
Definition: Dot.h:187
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() const
Definition: MatrixBase.h:33
EIGEN_DEVICE_FUNC ScalarBinaryOpTraits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
Definition: Dot.h:68
Definition: benchGeometry.cpp:23
EIGEN_DEVICE_FUNC const PlainObject stableNormalized() const
Definition: Dot.h:163
Definition: BandTriangularSolver.h:13
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition: XprHelper.h:757
bool isOrthogonal(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Dot.h:279
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
Definition: BinaryFunctors.h:109
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Definition: ForwardDeclarations.h:17
const int Infinity
This value means +Infinity; it is currently used only as the p parameter to MatrixBase::lpNorm<int>()...
Definition: Constants.h:31