Template Function sequant::asy_cost

Function Documentation

template<typename NodeT, typename F = Flops, typename = std::enable_if_t<IsEvalNode<NodeT>>, typename = std::enable_if_t<std::is_invocable_r_v<AsyCost, F, NodeT>>>
AsyCost sequant::asy_cost(NodeT const &node, F const &cost_fn = {})

This function object takes an evaluation node and returns the cost of evaluating the node as an AsyCost object. The cost is computed by summing the cost of evaluation of children nodes and the cost of evaluation of the node itself.

See also

AsyCost.

Parameters:
  • node – The evaluation node whose cost to be evaluated

  • cost_fn – A function object that takes an evaluation node and returns the symbolic cost of flops required for evaluation as an AsyCost object.

Returns:

The asymptotic cost of evaluating the given node.