/** * Returns the log-likelihood of the specified datapoint * and the slope along the given direction. */ real_pair<T> value_slope(index_pair x, const dense_matrix<T>& dir) const { return value_slope(x.first, x.second, dir); }
/** * Returns the log-likelihood of the specified datapoint * and the slope along the given direction. */ real_pair<T> value_slope(const uint_vector& x, const dense_matrix<T>& dir) const { assert(x.size() == 2); return value_slope(x[0], x[1], dir); }
libgm::line_search_result<double> init(const vec_type& x, const vec_type& dir) { libgm::line_search_result<double> result(0); std::tie(result.value, result.slope) = value_slope(x, dir); return result; }