20 std::vector<int> indices = {1, 5, 34, 54, 125, 499};
30 htd_sum_naive(indices, reference, features, costs, direction);
35 htd_sum(indices, output, features, costs, direction);
37 if(output != reference) {
38 for(
int i = 0; i < num_ftr; ++i) {
40 REQUIRE(output.coeff(i) == reference.coeff(i));
void htd_sum_naive(const std::vector< int > &indices, Eigen::Ref< DenseRealVector > output, const Eigen::EigenBase< Derived > &features, const DenseRealVector &costs, const DenseRealVector &direction)
void htd_sum(const std::vector< int > &indices, Eigen::Ref< DenseRealVector > output, const SparseFeatures &features, const DenseRealVector &costs, const DenseRealVector &direction)
Main namespace in which all types, classes, and functions are defined.
SparseFeatures make_uniform_sparse_matrix(int rows, int cols, int non_zeros_per_row)
Creates a sparse matrix with the given number of rows and columns.
types::DenseVector< real_t > DenseRealVector
Any dense, real values vector.
types::SparseRowMajor< real_t > SparseFeatures
Sparse Feature Matrix in Row Major format.
TEST_CASE("hessian_times_direction_sum")