/** * @param[in] space The list of candidates that need to be evaluated. */ void operator() (const pfunc::space_1D& space) { /* Loop over each element in the range that is given to us */ for (size_t i=space.begin(); i<space.end(); ++i) { const int candidate = (*map)(i); /* pass this candidate through the filter */ if ((*filter)(candidate)) continue; /* Materialize Xg */ A->materialize_X (candidate, Xg.begin()); /* Materialize Cholesky (Xg'Xg) */ factorizer->materialize (candidate, cholesky_XgtXg.begin()); /* Solve Ax=y, compute cost */ solver (Xg, cholesky_XgtXg); cost (Xg); /* Check if the new gain is worth switching over from the previous */ swap (value_type (candidate, (*weights)[candidate]*cost.get_result())); } }