MOAB  4.9.3pre
Eigen::internal::scalar_hypot_op< Scalar > Struct Template Reference

Template functor to compute the hypot of two scalars. More...

#include <BinaryFunctors.h>

List of all members.

Public Member Functions

EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const
Scalar 
operator() (const Scalar &_x, const Scalar &_y) const

Detailed Description

template<typename Scalar>
struct Eigen::internal::scalar_hypot_op< Scalar >

Template functor to compute the hypot of two scalars.

See also:
MatrixBase::stableNorm(), class Redux

Definition at line 219 of file BinaryFunctors.h.


Member Function Documentation

template<typename Scalar >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar Eigen::internal::scalar_hypot_op< Scalar >::operator() ( const Scalar &  _x,
const Scalar &  _y 
) const [inline]

Definition at line 222 of file BinaryFunctors.h.

  {
    using std::sqrt;
    Scalar p, qp;
    if(_x>_y)
    {
      p = _x;
      qp = _y / p;
    }
    else
    {
      p = _y;
      qp = _x / p;
    }
    return p * sqrt(Scalar(1) + qp*qp);
  }

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines