<commit_before>#include <iostream>
#include <vector>

#include <boost/range/algorithm.hpp>
#include <lib/amgcl.h>
#include "sample_problem.hpp"

int main() {
    std::vector<int>    ptr;
    std::vector<int>    col;
    std::vector<double> val;
    std::vector<double> rhs;

    int n = sample_problem(128l, val, col, ptr, rhs);

    amgclHandle prm = amgcl_params_create();
    amgcl_params_seti(prm, "coarse_enough", 1000);
    amgcl_params_setf(prm, "coarsening.aggr.eps_strong", 1e-3);
    amgcl_params_seti(prm, "L", 1);

    amgclHandle solver = amgcl_solver_create(
            amgclCoarseningSmoothedAggregation,
            amgclRelaxationSPAI0,
            amgclSolverBiCGStabL,
            prm,
            n, ptr.data(), col.data(), val.data()
            );

    amgcl_params_destroy(prm);

    std::vector<double> x(n, 0);
    conv_info cnv = amgcl_solver_solve(solver, rhs.data(), x.data());

    // Solve same problem again, but explicitly provide the matrix this time:
    boost::fill(x, 0);
    cnv = amgcl_solver_solve_mtx(
            solver, ptr.data(), col.data(), val.data(),
            rhs.data(), x.data()
            );

    std::cout << "Iterations: " << cnv.iterations << std::endl
              << "Error:      " << cnv.residual   << std::endl;

    amgcl_solver_destroy(solver);
}<commit_msg>Fix parameter setting in call_lib example<commit_after>#include <iostream>
#include <vector>

#include <boost/range/algorithm.hpp>
#include <lib/amgcl.h>
#include "sample_problem.hpp"

int main() {
    std::vector<int>    ptr;
    std::vector<int>    col;
    std::vector<double> val;
    std::vector<double> rhs;

    int n = sample_problem(128l, val, col, ptr, rhs);

    amgclHandle prm = amgcl_params_create();
    amgcl_params_seti(prm, "amg.coarse_enough", 1000);
    amgcl_params_setf(prm, "amg.coarsening.aggr.eps_strong", 1e-3);
    amgcl_params_seti(prm, "solver.L", 1);
    amgcl_params_seti(prm, "solver.maxiter", 100);

    amgclHandle solver = amgcl_solver_create(
            amgclCoarseningSmoothedAggregation,
            amgclRelaxationSPAI0,
            amgclSolverBiCGStabL,
            prm,
            n, ptr.data(), col.data(), val.data()
            );

    amgcl_params_destroy(prm);

    std::vector<double> x(n, 0);
    conv_info cnv = amgcl_solver_solve(solver, rhs.data(), x.data());

    // Solve same problem again, but explicitly provide the matrix this time:
    boost::fill(x, 0);
    cnv = amgcl_solver_solve_mtx(
            solver, ptr.data(), col.data(), val.data(),
            rhs.data(), x.data()
            );

    std::cout << "Iterations: " << cnv.iterations << std::endl
              << "Error:      " << cnv.residual   << std::endl;

    amgcl_solver_destroy(solver);
}
{'fraction_non_alphanumeric': 0.14343065693430657, 'fraction_numerical': 0.010583941605839416, 'mean_word_length': 2.876944837340877, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5681962', 'n_tokens_mistral': 1049, 'n_tokens_neox': 998, 'n_words': 184}