22 template<
typename T,
typename U,
23 bool NeedToTranspose = T::IsVectorAtCompileTime && U::IsVectorAtCompileTime &&
24 ((int(T::RowsAtCompileTime) == 1 && int(U::ColsAtCompileTime) == 1) ||
25 (
int(T::ColsAtCompileTime) == 1 && int(U::RowsAtCompileTime) == 1))>
28 typedef scalar_conj_product_op<typename traits<T>::Scalar,
typename traits<U>::Scalar> conj_prod;
29 typedef typename conj_prod::result_type ResScalar;
32 static ResScalar run(
const MatrixBase<T>&
a,
const MatrixBase<U>&
b)
34 return a.template binaryExpr<conj_prod>(
b).sum();
38 template<
typename T,
typename U>
39 struct dot_nocheck<
T, U, true>
41 typedef scalar_conj_product_op<typename traits<T>::Scalar,
typename traits<U>::Scalar> conj_prod;
42 typedef typename conj_prod::result_type ResScalar;
45 static ResScalar run(
const MatrixBase<T>&
a,
const MatrixBase<U>&
b)
47 return a.transpose().template binaryExpr<conj_prod>(
b).sum();
64 template<
typename Derived>
65 template<
typename OtherDerived>
68 typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,
typename internal::traits<OtherDerived>::Scalar>::ReturnType
74 #if !(defined(EIGEN_NO_STATIC_ASSERT) && defined(EIGEN_NO_DEBUG))
76 Eigen::internal::scalar_conj_product_op<Scalar EIGEN_COMMA typename OtherDerived::Scalar>,
77 Scalar,
typename OtherDerived::Scalar);
82 return internal::dot_nocheck<Derived,OtherDerived>::run(*
this, other);
93 template<
typename Derived>
105 template<
typename Derived>
120 template<
typename Derived>
124 typedef typename internal::nested_eval<Derived,2>::type Nested_;
125 Nested_
n(derived());
142 template<
typename Derived>
163 template<
typename Derived>
167 typedef typename internal::nested_eval<Derived,3>::type Nested_;
168 Nested_
n(derived());
188 template<
typename Derived>
201 template<
typename Derived,
int p>
202 struct lpNorm_selector
213 template<
typename Derived>
214 struct lpNorm_selector<Derived, 1>
217 static inline typename NumTraits<typename traits<Derived>::Scalar>::Real run(
const MatrixBase<Derived>&
m)
219 return m.cwiseAbs().sum();
223 template<
typename Derived>
224 struct lpNorm_selector<Derived, 2>
227 static inline typename NumTraits<typename traits<Derived>::Scalar>::Real run(
const MatrixBase<Derived>&
m)
233 template<
typename Derived>
234 struct lpNorm_selector<Derived,
Infinity>
236 typedef typename NumTraits<typename traits<Derived>::Scalar>::Real RealScalar;
238 static inline RealScalar run(
const MatrixBase<Derived>&
m)
240 if(Derived::SizeAtCompileTime==0 || (Derived::SizeAtCompileTime==
Dynamic &&
m.size()==0))
241 return RealScalar(0);
242 return m.cwiseAbs().maxCoeff();
258 template<
typename Derived>
260 #ifndef EIGEN_PARSED_BY_DOXYGEN
261 EIGEN_DEVICE_FUNC inline typename NumTraits<typename internal::traits<Derived>::Scalar>::Real
267 return internal::lpNorm_selector<Derived, p>::run(*
this);
278 template<
typename Derived>
279 template<
typename OtherDerived>
283 typename internal::nested_eval<Derived,2>::type nested(derived());
284 typename internal::nested_eval<OtherDerived,2>::type otherNested(other.
derived());
285 return numext::abs2(nested.dot(otherNested)) <= prec * prec * nested.squaredNorm() * otherNested.squaredNorm();
299 template<
typename Derived>
302 typename internal::nested_eval<Derived,1>::type
self(derived());
ColXpr col(Index i)
This is the const version of col().
RealReturnType real() const
#define EIGEN_USING_STD(FUNC)
#define EIGEN_DEVICE_FUNC
const CwiseAbsReturnType cwiseAbs() const
#define EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(TYPE0, TYPE1)
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Eigen::Triplet< double > T
#define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP, LHS, RHS)
NumTraits< Scalar >::Real RealScalar
internal::traits< Derived >::Scalar Scalar
EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Base class for all dense matrices, vectors, and expressions.
const PlainObject stableNormalized() const
const PlainObject normalized() const
RealScalar lpNorm() const
bool isUnitary(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Base::PlainObject PlainObject
RealScalar squaredNorm() const
ScalarBinaryOpTraits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
bool isOrthogonal(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
EIGEN_ALWAYS_INLINE float sqrt(const float &x)
Eigen::Index Index
The interface type of indices.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.