17 double trunc(
double x);
21 double untrunc(
double x);
24 template<
typename OtherDerived,
typename Func>
25 auto trunc_common(
const Eigen::MatrixBase<OtherDerived>& x,
const Func& apply_trunc)
27 using M = Eigen::MatrixBase<OtherDerived>;
28 Eigen::Matrix<typename M::Scalar,M::RowsAtCompileTime,M::ColsAtCompileTime> u(x.rows(),x.cols());
30 for(Index i = 0 ; i < x.rows() ; i++)
31 for(Index j = 0 ; j < x.cols() ; j++)
32 u(i,j) = apply_trunc(x(i,j));
37 template<
typename OtherDerived>
38 inline auto trunc(
const Eigen::MatrixBase<OtherDerived>& x)
40 using T = Eigen::MatrixBase<OtherDerived>::Scalar;
41 return trunc_common(x,
static_cast<T(*)(
const T&)
>(&trunc));
44 template<
typename OtherDerived>
45 inline auto untrunc(
const Eigen::MatrixBase<OtherDerived>& x)
47 using T = Eigen::MatrixBase<OtherDerived>::Scalar;
48 return trunc_common(x,
static_cast<T(*)(
const T&)
>(&untrunc));
51 double graphic_trunc(
double x);
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:49
Definition codac2_OctaSym.h:21