5 #ifndef BPP_PHYL_LIKELIHOOD_DATAFLOW_EXTENDEDFLOATEIGENTOOLS_H
6 #define BPP_PHYL_LIKELIHOOD_DATAFLOW_EXTENDEDFLOATEIGENTOOLS_H
20 template<
typename Derived>
class ExtendedFloatEigenBase;
22 template<
int R,
int C,
template<
int R2,
int C2>
class EigenType>
class ExtendedFloatEigen;
31 template<
typename DerivedEF,
typename MatType,
int Direction>
44 template<
typename OtherDerived>
45 DerivedEF&
operator=(
const OtherDerived& otherDerived)
48 efMat_.exponent_part() = otherDerived.exponent_part();
56 return DerivedEF(s,
efMat_.derived().exponent_part());
62 return DerivedEF(s,
efMat_.derived().exponent_part());
72 template<
typename DerivedEF>
82 template<
typename Otherderived>
90 template<
typename Otherderived>
94 const auto& rhs(other.
derived());
96 if (
efMat_.
derived().exponent_part () >= rhs.exponent_part ())
98 thisnoal += rhs.float_part () * constexpr_power<double>(
ExtendedFloat::radix, rhs.exponent_part () -
efMat_().derived().exponent_part ());
109 template<
typename Otherderived>
113 const auto& rhs(other.
derived());
115 if (
efMat_.
derived().exponent_part () >= rhs.exponent_part ())
117 thisnoal -= rhs.float_part () * constexpr_power<double>(
ExtendedFloat::radix, rhs.exponent_part () -
efMat_().derived().exponent_part ());
135 template<
int R,
int C,
template<
int R2,
int C2>
class EigenType>
178 template<
int R,
int C,
template<
int R2,
int C2>
class EigenType>
202 return efMat_.exponent_part();
212 return efMat_.exponent_part();
ExtendedFloatEigen< R, C, EigenType > & efMat_
const VecType & float_part() const
ExtType & exponent_part()
ExtendedFloatCol & operator=(const ExtendedFloatEigen< R, 1, EigenType > &col)
ExtendedFloatCol(ExtendedFloatEigen< R, C, EigenType > &der, Eigen::Index ncol)
EigenType< R, 1 > VecType
const ExtType & exponent_part() const
virtual const ExtType & exponent_part() const
virtual const MatType & float_part() const
std::enable_if< std::is_same< M, EFMatrix< R, C > >::value, ExtendedFloatCol< R, C, EigenType > >::type col(Eigen::Index pos)
ExtendedFloatEigenBase< DerivedEF > & operator-=(const ExtendedFloatEigenBase< Otherderived > &other)
ExtendedFloatNoAlias(ExtendedFloatEigenBase< DerivedEF > &der)
ExtendedFloatEigenBase< DerivedEF > & operator=(const ExtendedFloatEigenBase< Otherderived > &other)
ExtendedFloatEigenBase< DerivedEF > & operator+=(const ExtendedFloatEigenBase< Otherderived > &other)
ExtendedFloatEigenBase< DerivedEF > & efMat_
const ExtType & exponent_part() const
ExtendedFloatEigen< R, C, EigenType > & efMat_
EigenType< 1, C > VecType
ExtendedFloatRow(ExtendedFloatEigen< R, C, EigenType > &der, Eigen::Index nrow)
ExtType & exponent_part()
const VecType & float_part() const
ExtendedFloatRow & operator=(const ExtendedFloatEigen< 1, C, EigenType > &row)
DerivedEF & operator=(const OtherDerived &otherDerived)
ExtendedFloatVectorwiseOp(DerivedEF &der)
Eigen::VectorwiseOp< MatType, Direction > eigenVWiseOp_
static constexpr int radix
Defines the basic types of data flow nodes.