Skip to content

Commit

Permalink
Remove macro condition on using concepts
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesYang007 committed Apr 21, 2020
1 parent 3beb099 commit 5378777
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 37 deletions.
16 changes: 0 additions & 16 deletions include/autoppl/expr_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ using convert_to_cont_dist_param_t =

} // namespace details

#ifndef AUTOPPL_USE_CONCEPTS
/*
* Builds a Uniform expression only when the parameters
* are both valid continuous distribution parameter types.
Expand All @@ -88,10 +87,7 @@ inline constexpr auto uniform(MinType&& min_expr,

return expr::Uniform(wrap_min_expr, wrap_max_expr);
}
#else
#endif

#ifndef AUTOPPL_USE_CONCEPTS
/*
* Builds a Normal expression only when the parameters
* are both valid continuous distribution parameter types.
Expand All @@ -110,10 +106,6 @@ inline constexpr auto normal(MeanType&& mean_expr,
return expr::Normal(wrap_mean_expr, wrap_stddev_expr);
}

#else
#endif

#ifndef AUTOPPL_USE_CONCEPTS
/*
* Builds a Bernoulli expression only when the parameter
* is a valid discrete distribution parameter type.
Expand All @@ -125,14 +117,11 @@ inline constexpr auto bernoulli(const ProbType& p_expr)
{
return expr::Bernoulli(p_expr);
}
#else
#endif

////////////////////////////////////////////////////////
// Model Expression Builder
////////////////////////////////////////////////////////

#ifndef AUTOPPL_USE_CONCEPTS
/*
* Builds an EqNode to associate var with dist
* only when var is a Variable and dist is a valid distribution expression.
Expand All @@ -142,10 +131,7 @@ template <class T, class DistType>
inline constexpr auto operator|=(Variable<T>& var,
DistType&& dist)
{ return expr::EqNode(var, std::forward<DistType>(dist)); }
#else
#endif

#ifndef AUTOPPL_USE_CONCEPTS
/*
* Builds a GlueNode to "glue" the left expression with the right
* only when both parameters are valid model expressions.
Expand All @@ -158,7 +144,5 @@ inline constexpr auto operator,(LHSNodeType&& lhs,
return expr::GlueNode(std::forward<LHSNodeType>(lhs),
std::forward<RHSNodeType>(rhs));
}
#else
#endif

} // namespace ppl
7 changes: 0 additions & 7 deletions include/autoppl/util/dist_expr_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,5 @@ inline constexpr bool is_dist_expr_v =
has_func_log_pdf_v<const T>
;

#ifdef AUTOPPL_USE_CONCEPTS
// TODO: definition should be extended with a stronger
// restriction on T with interface checking.
template <class T>
concept dist_expressable = is_dist_expr_v<T>;
#endif

} // namespace util
} // namespace ppl
7 changes: 0 additions & 7 deletions include/autoppl/util/model_expr_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,5 @@ inline constexpr bool is_eq_node_expr_v =
has_func_get_distribution_v<T>
;

#ifdef AUTOPPL_USE_CONCEPTS
// TODO: definition should be extended with a stronger
// restriction on T with interface checking.
template <class T>
concept model_expressable = is_model_expr_v<T>;
#endif

} // namespace util
} // namespace ppl
7 changes: 0 additions & 7 deletions include/autoppl/util/var_expr_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,5 @@ inline constexpr bool is_var_expr_v =
std::is_convertible_v<const T, get_type_value_t_t<T>>
;

#ifdef AUTOPPL_USE_CONCEPTS
// TODO: definition should be extended with a stronger
// restriction on T with interface checking.
template <class T>
concept var_expressable = is_var_expr_v<T>;
#endif

} // namespace util
} // namespace ppl

0 comments on commit 5378777

Please sign in to comment.