name
stringlengths
1
473k
code
stringlengths
7
647k
asm
stringlengths
4
3.39M
file
stringlengths
8
196
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<double>, baryonyx::itm::minimize_tag>::replace_result(int, baryonyx::bit_array const&, double, double, unsigned long, long, int)
void replace_result(const int id, const bit_array& x, const double value, const double duration, const std::size_t hash, const long int loop, const int remaining_constraints) noexcept { m_indices_reader lock{ m_indices_mutex }; m_data[id].x = x; m_data[id].value = value; m_data[id].duration = duration; m_data[id].hash = hash; m_data[id].loop = loop; m_data[id].remaining_constraints = remaining_constraints; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rdi, 0x18(%rsp) movl %r9d, %ebx movq %r8, %r14 movq %rcx, %r15 vmovsd %xmm1, 0x10(%rsp) vmovsd %xmm0, 0x8(%rsp) movq %rdx, %r13 movl %esi, %ebp movq %rdi, %r12 movb $0x1, 0x20(%rsp) callq 0x3c460 movq 0x50(%r12), %rdi movslq %ebp, %rax imulq $0x38, %rax, %rbp addq %rbp, %rdi movq %r13, %rsi callq 0x36a44 vmovsd 0x8(%rsp), %xmm0 vmovsd 0x10(%rsp), %xmm1 movq 0x50(%r12), %rax leaq 0x18(%rsp), %rdi vmovsd %xmm0, 0x10(%rax,%rbp) vmovsd %xmm1, 0x18(%rax,%rbp) movq %r15, 0x20(%rax,%rbp) movq %r14, 0x28(%rax,%rbp) movl %ebx, 0x30(%rax,%rbp) callq 0x3c450 addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rdi callq 0xeb9f nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<double>, baryonyx::itm::minimize_tag>::can_be_inserted(unsigned long, int) const
bool can_be_inserted(const std::size_t hash, const int constraints) const noexcept { m_indices_reader lock(m_indices_mutex); for (int i = 0; i != m_size; ++i) if (m_data[i].remaining_constraints == constraints && m_data[i].hash == hash) return false; return true; }
pushq %r15 pushq %r14 pushq %rbx subq $0x10, %rsp movq %rdi, (%rsp) movl %edx, %ebx movq %rsi, %r14 movq %rdi, %r15 movb $0x1, 0x8(%rsp) callq 0x3c460 movl 0x98(%r15), %eax movq 0x50(%r15), %rcx xorl %edx, %edx imulq $0x38, %rax, %rax cmpq %rdx, %rax je 0x87932 cmpl %ebx, 0x30(%rcx,%rdx) jne 0x8792c cmpq %r14, 0x20(%rcx,%rdx) je 0x87932 addq $0x38, %rdx jmp 0x8791a cmpq %rdx, %rax movq %rsp, %rdi sete %bl callq 0x3c450 movl %ebx, %eax addq $0x10, %rsp popq %rbx popq %r14 popq %r15 retq movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<double>, baryonyx::itm::minimize_tag>::insert(baryonyx::itm::local_context&, baryonyx::bit_array const&, unsigned long, int, double, long)
void insert(local_context& ctx, const bit_array& x, const std::size_t hash, const int remaining_constraints, const double duration, const long int loop) noexcept { to_log(stdout, 5u, "- insert advance {} (hash: {}) {}s in {} loops\n", remaining_constraints, hash, duration, loop); int id_to_delete = m_indices[choose_a_bad_solution(ctx)]; to_log(stdout, 5u, "- delete {} ({})\n", id_to_delete, m_data[id_to_delete].value); replace_result(id_to_delete, x, costs.results(x, cost_constant), duration, hash, loop, remaining_constraints); sort(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq 0x5b565f(%rip), %r12 # 0x63cfc8 movq %rdi, %rbx leaq 0x20(%rsp), %rax leaq 0xc(%rsp), %r10 leaq 0x18(%rsp), %r11 leaq 0x10(%rsp), %r13 movq %rdx, %r14 movq %rsi, %r15 movq %rcx, (%rax) movl %r8d, (%r10) vmovsd %xmm0, (%r11) movq %r9, (%r13) movq (%r12), %rdi leaq 0x3d2b6d(%rip), %rcx # 0x45a50d pushq $0x5 popq %rsi pushq $0x2f popq %rdx movq %r10, %r8 movq %rax, %r9 pushq %r13 pushq %r11 callq 0x3ff5c popq %rax popq %rcx leaq 0x68(%r15), %rdi movq %r15, %rsi callq 0x3fce2 movq 0x38(%rbx), %rcx cltq leaq 0x8(%rsp), %r8 movq (%r12), %rdi movslq (%rcx,%rax,4), %rax movl %eax, (%r8) imulq $0x38, %rax, %rax movq 0x50(%rbx), %rcx leaq 0x10(%rcx,%rax), %r9 leaq 0x3d2b0e(%rip), %rcx # 0x45a4fb pushq $0x5 popq %rsi pushq $0x11 popq %rdx callq 0x3c388 vmovsd 0x90(%rbx), %xmm0 movl 0x8(%rsp), %ebp movq 0x88(%rbx), %rdi movq %r14, %rsi callq 0x6e096 vmovsd 0x18(%rsp), %xmm1 movq 0x20(%rsp), %rcx movq 0x10(%rsp), %r8 movl 0xc(%rsp), %r9d movq %rbx, %rdi movl %ebp, %esi movq %r14, %rdx callq 0x8784c movq %rbx, %rdi callq 0x8204a addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<double>, baryonyx::itm::minimize_tag>::get_best(int&, double&, double&, long&) const
void get_best(int& constraints_remaining, double& value, double& duration, long int& loop) const noexcept { m_indices_reader lock(m_indices_mutex); int id = m_indices.front(); constraints_remaining = m_data[id].remaining_constraints; value = m_data[id].value; duration = m_data[id].duration; loop = m_data[id].loop; }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x10, %rsp movq %rdi, (%rsp) movq %r8, %rbx movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %r13 movb $0x1, 0x8(%rsp) callq 0x3c460 movq 0x38(%r13), %rax movq 0x50(%r13), %rcx movq %rsp, %rdi movslq (%rax), %rax imulq $0x38, %rax, %rax movl 0x30(%rcx,%rax), %edx movl %edx, (%r12) vmovsd 0x10(%rcx,%rax), %xmm0 vmovsd %xmm0, (%r15) vmovsd 0x18(%rcx,%rax), %xmm0 vmovsd %xmm0, (%r14) movq 0x28(%rcx,%rax), %rax movq %rax, (%rbx) callq 0x3c450 addq $0x10, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq movq %rax, %rdi callq 0xeb9f nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<double>, baryonyx::itm::minimize_tag>::show_population(baryonyx::context const&) const
void show_population(const context& ctx) const { info(ctx, " Population {}:\n", m_indices.size()); for (int i = 0; i != m_size; ++i) info(ctx, " - {}: value {} constraints {} hash {}\n", m_indices[i], m_data[m_indices[i]].value, m_data[m_indices[i]].remaining_constraints, m_data[m_indices[i]].hash); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x10, %rsp movq 0x40(%rdi), %rax movq %rsi, %rbx leaq 0x8(%rsp), %rdx leaq 0x3d171d(%rip), %rsi # 0x45a53d movq %rdi, %r14 subq 0x38(%rdi), %rax movq %rbx, %rdi sarq $0x2, %rax movq %rax, (%rdx) callq 0x41545 leaq 0x3d1711(%rip), %r15 # 0x45a54e xorl %r12d, %r12d xorl %r13d, %r13d movl 0x98(%r14), %eax cmpq %rax, %r13 je 0x88e85 movq 0x38(%r14), %rdx movq 0x50(%r14), %rax movq %rbx, %rdi movslq (%rdx,%r12), %rcx addq %r12, %rdx imulq $0x38, %rcx, %rsi leaq 0x10(%rax,%rsi), %rcx leaq 0x30(%rax,%rsi), %r8 leaq 0x20(%rax,%rsi), %r9 movq %r15, %rsi callq 0x41567 incq %r13 addq $0x4, %r12 jmp 0x88e43 addq $0x10, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>>, double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<double> const&, double)
result operator()(const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { result r; bit_array x(variables); int best_remaining = INT_MAX; auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const long int w_limit = static_cast<long int>(p.w); Solver slv( m_rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); { std::bernoulli_distribution choose_mutation( m_ctx.parameters.init_policy_random); bit_array empty_x; switch (p.init_policy) { case solver_parameters::init_policy_type::pessimistic_solve: init_with_pre_solve<Cost, Mode>( x, empty_x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::optimistic_solve: init_with_pre_solve<Cost, Mode>( empty_x, x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::bastert: init_with_bastert<Cost, Mode>(x, original_costs, variables, 0); break; } for (int i = 0, e = x.size(); i != e; ++i) if (choose_mutation(m_rng)) x.invert(i); } bool start_push = false; auto kappa = static_cast<Float>(p.kappa_min); Observer obs("img", slv.m, slv.n, p.limit); m_begin = std::chrono::steady_clock::now(); m_end = std::chrono::steady_clock::now(); compute.init(slv, x); for (long int i = 0; i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta); obs.make_observation(slv.ap, slv.P.get(), slv.pi.get()); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), i); best_remaining = remaining; start_push = true; break; } if (remaining < best_remaining) { store_if_better(x, remaining, i); best_remaining = remaining; } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) { r.status = result_status::kappa_max_reached; break; } if (is_timelimit_reached()) { r.status = result_status::time_limit_reached; break; } } if (!start_push) { r.status = result_status::limit_reached; } else { for (int push = 0; push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_rng, pushing_k_factor * kappa, delta, theta, pushing_objective_amplifier); if (remaining == 0) store_if_better(x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); if (is_timelimit_reached()) break; for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run(slv, x, m_rng, kappa, delta, theta); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; if (is_timelimit_reached()) break; } } } if (m_best.remaining_constraints == 0) r.status = result_status::success; if (!m_best.x.empty()) { r.solutions.resize(1); convert(m_best, r.solutions[0], variables); } return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x3b8, %rsp # imm = 0x3B8 vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %r8, %r13 movl %ecx, %ebx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, 0x8(%rsp) vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) leaq 0x18(%rsp), %rdi movl %ecx, %esi vzeroupper callq 0x368ae movq 0x10(%r14), %r12 movq 0x18(%r14), %rcx leaq 0x80(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x6fb57 vmovsd 0x20(%r12), %xmm0 vmovsd 0x10(%r12), %xmm1 vmovsd %xmm0, 0x60(%rsp) vmovsd 0x28(%r12), %xmm0 vmovsd %xmm1, 0x28(%rsp) vmovsd %xmm0, 0x68(%rsp) vmovsd 0x30(%r12), %xmm0 vmovsd %xmm0, 0x58(%rsp) vmovsd 0x8(%r12), %xmm0 vmovsd %xmm0, 0x30(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vucomisd %xmm1, %xmm0 jbe 0x88faa movq 0x10(%r14), %rdi vmovsd 0x30(%rsp), %xmm0 leaq 0x80(%rsp), %rsi movl %ebx, %edx callq 0x6fc31 vmovsd %xmm0, 0x28(%rsp) vcvttsd2si 0xa0(%r12), %rax vmovsd 0x38(%r12), %xmm0 vmovsd 0x40(%r12), %xmm1 movq 0x18(%r14), %rsi movq %rax, 0x48(%rsp) movq 0x8(%r15), %rax vmovsd %xmm0, 0x78(%rsp) vmovsd %xmm1, 0x70(%rsp) subq (%r15), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0xd8(%rsp), %rdi leaq 0x80(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0x839f2 movl 0xcc(%r12), %esi leaq 0xa0(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x54(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, (%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0x160(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0x89087 cmpl $0x1, %eax je 0x89061 cmpl $0x2, %eax jne 0x89098 movq 0x18(%r14), %rdx leaq 0x160(%rsp), %rdi leaq 0x18(%rsp), %rsi jmp 0x89072 movq 0x18(%r14), %rdx leaq 0x18(%rsp), %rdi leaq 0x160(%rsp), %rsi vmovsd 0x3cafbe(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x81d84 jmp 0x89098 leaq 0x18(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0x81d0f leaq 0x18(%rsp), %r15 movq %r13, 0x38(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0x890cd movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd (%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x890c9 movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0x890a7 leaq 0x168(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 movl 0x158(%rsp), %ecx movl 0x15c(%rsp), %r8d movq 0xb0(%r12), %r9 vmovsd %xmm0, (%rsp) leaq 0x3d1473(%rip), %rdx # 0x45a577 leaq 0x160(%rsp), %rdi pushq $0x3 popq %rsi callq 0x42b5a callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi leaq 0x18(%rsp), %rdx callq 0x83d1a vmovsd (%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x18(%rsp), %r13 xorl %r15d, %r15d cmpq 0xb0(%r12), %r15 je 0x89231 movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi movq %r13, %rdx vmovsd %xmm0, (%rsp) callq 0x83d5c movq 0x140(%rsp), %rdx movq 0x138(%rsp), %rcx movl %eax, %ebx leaq 0x160(%rsp), %rdi leaq 0xe0(%rsp), %rsi callq 0x6c2be testl %ebx, %ebx je 0x892d6 cmpl %ebp, %ebx jge 0x891d1 movq %r14, %rdi movq %r13, %rsi movl %ebx, %edx movq %r15, %rcx callq 0x8a1d8 movl %ebx, %ebp cmpq 0x48(%rsp), %r15 jle 0x89206 vcvtsi2sd %ebx, %xmm3, %xmm0 vcvtsi2sdl 0x158(%rsp), %xmm3, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x58(%rsp), %xmm1 callq 0xb1f0 vmovsd (%rsp), %xmm1 vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0x8920b vmovsd (%rsp), %xmm0 vucomisd 0x68(%rsp), %xmm0 ja 0x89231 movq %r14, %rdi vmovsd %xmm0, (%rsp) callq 0x8a210 vmovsd (%rsp), %xmm0 testb %al, %al jne 0x89231 incq %r15 jmp 0x89151 movq 0x8(%rsp), %rax movl $0x5, 0xa0(%rax) cmpl $0x0, 0x50(%r14) jne 0x89253 movq 0x8(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0x89281 movq 0x8(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x54(%rsp), %edx movq %r14, %rdi callq 0x4f485 leaq 0x160(%rsp), %rdi callq 0x42cbc leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0x84294 leaq 0x80(%rsp), %rdi callq 0x6d8d6 leaq 0x20(%rsp), %rdi callq 0x357fe movq 0x8(%rsp), %rax addq $0x3b8, %rsp # imm = 0x3B8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi leaq 0x18(%rsp), %rbx movq %rbx, %rsi callq 0x6e096 movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0x8a18a vmovsd (%rsp), %xmm0 leaq 0xd8(%rsp), %r15 leaq 0x18(%rsp), %rbp xorl %ebx, %ebx movl $0x0, 0x14(%rsp) cmpl 0xbc(%r12), %ebx jge 0x89240 vmovsd %xmm0, (%rsp) vmulsd 0x78(%rsp), %xmm0, %xmm0 movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 vmovsd 0x70(%rsp), %xmm3 leaq 0xa0(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx callq 0x84072 testl %eax, %eax jne 0x8938c vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x6e096 movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x8a18a movq %r14, %rdi callq 0x8a210 vmovsd (%rsp), %xmm0 testb %al, %al jne 0x89240 movl %ebx, 0x48(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0x8948d movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx vmovsd %xmm0, (%rsp) callq 0x83d5c testl %eax, %eax je 0x89451 vcvtsi2sd %r13d, %xmm4, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0x89427 vcvtsi2sd %eax, %xmm4, %xmm0 vcvtsi2sdl 0x158(%rsp), %xmm4, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x58(%rsp), %xmm1 callq 0xb1f0 vmovsd (%rsp), %xmm1 vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0x8942c vmovsd (%rsp), %xmm0 vucomisd 0x68(%rsp), %xmm0 ja 0x8948d movq %r14, %rdi vmovsd %xmm0, (%rsp) callq 0x8a210 testb %al, %al jne 0x89488 vmovsd (%rsp), %xmm0 incl %ebx jmp 0x893aa vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x6e096 movl 0xc0(%r12), %eax imull 0x14(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x8a18a vmovsd (%rsp), %xmm0 jmp 0x8948d vmovsd (%rsp), %xmm0 movl 0x48(%rsp), %ebx decl 0x14(%rsp) incl %ebx jmp 0x89318 jmp 0x894d3 jmp 0x894ac jmp 0x894d3 movq %rax, %r14 jmp 0x894e3 movq %rax, %r14 jmp 0x894f0 movq %rax, %r14 jmp 0x894fd movq %rax, %r14 jmp 0x8950a movq %rax, %r14 jmp 0x89514 jmp 0x894d3 jmp 0x894d3 jmp 0x894d3 leaq 0x168(%rsp), %rdi movq %rax, %r14 callq 0x357fe jmp 0x894e3 leaq 0x160(%rsp), %rdi movq %rax, %r14 callq 0x42cbc leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0x84294 leaq 0x80(%rsp), %rdi callq 0x6d8d6 leaq 0x20(%rsp), %rdi callq 0x357fe movq 0x8(%rsp), %rdi callq 0xea60 movq %r14, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>>, double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<double> const&, double)
result operator()(const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { result r; bit_array x(variables); int best_remaining = INT_MAX; auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const long int w_limit = static_cast<long int>(p.w); Solver slv( m_rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); { std::bernoulli_distribution choose_mutation( m_ctx.parameters.init_policy_random); bit_array empty_x; switch (p.init_policy) { case solver_parameters::init_policy_type::pessimistic_solve: init_with_pre_solve<Cost, Mode>( x, empty_x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::optimistic_solve: init_with_pre_solve<Cost, Mode>( empty_x, x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::bastert: init_with_bastert<Cost, Mode>(x, original_costs, variables, 0); break; } for (int i = 0, e = x.size(); i != e; ++i) if (choose_mutation(m_rng)) x.invert(i); } bool start_push = false; auto kappa = static_cast<Float>(p.kappa_min); Observer obs("img", slv.m, slv.n, p.limit); m_begin = std::chrono::steady_clock::now(); m_end = std::chrono::steady_clock::now(); compute.init(slv, x); for (long int i = 0; i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta); obs.make_observation(slv.ap, slv.P.get(), slv.pi.get()); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), i); best_remaining = remaining; start_push = true; break; } if (remaining < best_remaining) { store_if_better(x, remaining, i); best_remaining = remaining; } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) { r.status = result_status::kappa_max_reached; break; } if (is_timelimit_reached()) { r.status = result_status::time_limit_reached; break; } } if (!start_push) { r.status = result_status::limit_reached; } else { for (int push = 0; push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_rng, pushing_k_factor * kappa, delta, theta, pushing_objective_amplifier); if (remaining == 0) store_if_better(x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); if (is_timelimit_reached()) break; for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run(slv, x, m_rng, kappa, delta, theta); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; if (is_timelimit_reached()) break; } } } if (m_best.remaining_constraints == 0) r.status = result_status::success; if (!m_best.x.empty()) { r.solutions.resize(1); convert(m_best, r.solutions[0], variables); } return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x3b8, %rsp # imm = 0x3B8 vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %r8, %r13 movl %ecx, %ebx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, 0x8(%rsp) vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) leaq 0x18(%rsp), %rdi movl %ecx, %esi vzeroupper callq 0x368ae movq 0x10(%r14), %r12 movq 0x18(%r14), %rcx leaq 0x80(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x6fb57 vmovsd 0x20(%r12), %xmm0 vmovsd 0x10(%r12), %xmm1 vmovsd %xmm0, 0x60(%rsp) vmovsd 0x28(%r12), %xmm0 vmovsd %xmm1, 0x28(%rsp) vmovsd %xmm0, 0x68(%rsp) vmovsd 0x30(%r12), %xmm0 vmovsd %xmm0, 0x58(%rsp) vmovsd 0x8(%r12), %xmm0 vmovsd %xmm0, 0x30(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vucomisd %xmm1, %xmm0 jbe 0x89614 movq 0x10(%r14), %rdi vmovsd 0x30(%rsp), %xmm0 leaq 0x80(%rsp), %rsi movl %ebx, %edx callq 0x6fc31 vmovsd %xmm0, 0x28(%rsp) vcvttsd2si 0xa0(%r12), %rax vmovsd 0x38(%r12), %xmm0 vmovsd 0x40(%r12), %xmm1 movq 0x18(%r14), %rsi movq %rax, 0x48(%rsp) movq 0x8(%r15), %rax vmovsd %xmm0, 0x78(%rsp) vmovsd %xmm1, 0x70(%rsp) subq (%r15), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0xd8(%rsp), %rdi leaq 0x80(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0x839f2 movl 0xcc(%r12), %esi leaq 0xa0(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x54(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, (%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0x160(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0x896f1 cmpl $0x1, %eax je 0x896cb cmpl $0x2, %eax jne 0x89702 movq 0x18(%r14), %rdx leaq 0x160(%rsp), %rdi leaq 0x18(%rsp), %rsi jmp 0x896dc movq 0x18(%r14), %rdx leaq 0x18(%rsp), %rdi leaq 0x160(%rsp), %rsi vmovsd 0x3ca954(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x81d84 jmp 0x89702 leaq 0x18(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0x81d0f leaq 0x18(%rsp), %r15 movq %r13, 0x38(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0x89737 movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd (%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x89733 movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0x89711 leaq 0x168(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 movl 0x158(%rsp), %ecx movl 0x15c(%rsp), %r8d movq 0xb0(%r12), %r9 vmovsd %xmm0, (%rsp) leaq 0x3d0e09(%rip), %rdx # 0x45a577 leaq 0x160(%rsp), %rdi pushq $0x3 popq %rsi callq 0x4346e callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi leaq 0x18(%rsp), %rdx callq 0x83d1a vmovsd (%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x18(%rsp), %r13 xorl %r15d, %r15d cmpq 0xb0(%r12), %r15 je 0x8989b movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi movq %r13, %rdx vmovsd %xmm0, (%rsp) callq 0x83d5c movq 0x140(%rsp), %rdx movq 0x138(%rsp), %rcx movl %eax, %ebx leaq 0x160(%rsp), %rdi leaq 0xe0(%rsp), %rsi callq 0x6c6c0 testl %ebx, %ebx je 0x89940 cmpl %ebp, %ebx jge 0x8983b movq %r14, %rdi movq %r13, %rsi movl %ebx, %edx movq %r15, %rcx callq 0x8a2be movl %ebx, %ebp cmpq 0x48(%rsp), %r15 jle 0x89870 vcvtsi2sd %ebx, %xmm3, %xmm0 vcvtsi2sdl 0x158(%rsp), %xmm3, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x58(%rsp), %xmm1 callq 0xb1f0 vmovsd (%rsp), %xmm1 vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0x89875 vmovsd (%rsp), %xmm0 vucomisd 0x68(%rsp), %xmm0 ja 0x8989b movq %r14, %rdi vmovsd %xmm0, (%rsp) callq 0x8a2f6 vmovsd (%rsp), %xmm0 testb %al, %al jne 0x8989b incq %r15 jmp 0x897bb movq 0x8(%rsp), %rax movl $0x5, 0xa0(%rax) cmpl $0x0, 0x50(%r14) jne 0x898bd movq 0x8(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0x898eb movq 0x8(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x54(%rsp), %edx movq %r14, %rdi callq 0x4f485 leaq 0x160(%rsp), %rdi callq 0x435d0 leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0x84294 leaq 0x80(%rsp), %rdi callq 0x6d8d6 leaq 0x20(%rsp), %rdi callq 0x357fe movq 0x8(%rsp), %rax addq $0x3b8, %rsp # imm = 0x3B8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi leaq 0x18(%rsp), %rbx movq %rbx, %rsi callq 0x6e096 movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0x8a270 vmovsd (%rsp), %xmm0 leaq 0xd8(%rsp), %r15 leaq 0x18(%rsp), %rbp xorl %ebx, %ebx movl $0x0, 0x14(%rsp) cmpl 0xbc(%r12), %ebx jge 0x898aa vmovsd %xmm0, (%rsp) vmulsd 0x78(%rsp), %xmm0, %xmm0 movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 vmovsd 0x70(%rsp), %xmm3 leaq 0xa0(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx callq 0x84072 testl %eax, %eax jne 0x899f6 vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x6e096 movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x8a270 movq %r14, %rdi callq 0x8a2f6 vmovsd (%rsp), %xmm0 testb %al, %al jne 0x898aa movl %ebx, 0x48(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0x89af7 movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx vmovsd %xmm0, (%rsp) callq 0x83d5c testl %eax, %eax je 0x89abb vcvtsi2sd %r13d, %xmm4, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0x89a91 vcvtsi2sd %eax, %xmm4, %xmm0 vcvtsi2sdl 0x158(%rsp), %xmm4, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x58(%rsp), %xmm1 callq 0xb1f0 vmovsd (%rsp), %xmm1 vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0x89a96 vmovsd (%rsp), %xmm0 vucomisd 0x68(%rsp), %xmm0 ja 0x89af7 movq %r14, %rdi vmovsd %xmm0, (%rsp) callq 0x8a2f6 testb %al, %al jne 0x89af2 vmovsd (%rsp), %xmm0 incl %ebx jmp 0x89a14 vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x6e096 movl 0xc0(%r12), %eax imull 0x14(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x8a270 vmovsd (%rsp), %xmm0 jmp 0x89af7 vmovsd (%rsp), %xmm0 movl 0x48(%rsp), %ebx decl 0x14(%rsp) incl %ebx jmp 0x89982 jmp 0x89b3d jmp 0x89b16 jmp 0x89b3d movq %rax, %r14 jmp 0x89b4d movq %rax, %r14 jmp 0x89b5a movq %rax, %r14 jmp 0x89b67 movq %rax, %r14 jmp 0x89b74 movq %rax, %r14 jmp 0x89b7e jmp 0x89b3d jmp 0x89b3d jmp 0x89b3d leaq 0x168(%rsp), %rdi movq %rax, %r14 callq 0x357fe jmp 0x89b4d leaq 0x160(%rsp), %rdi movq %rax, %r14 callq 0x435d0 leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0x84294 leaq 0x80(%rsp), %rdi callq 0x6d8d6 leaq 0x20(%rsp), %rdi callq 0x357fe movq 0x8(%rsp), %rdi callq 0xea60 movq %r14, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>>, double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<double> const&, double)
result operator()(const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { result r; bit_array x(variables); int best_remaining = INT_MAX; auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const long int w_limit = static_cast<long int>(p.w); Solver slv( m_rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); { std::bernoulli_distribution choose_mutation( m_ctx.parameters.init_policy_random); bit_array empty_x; switch (p.init_policy) { case solver_parameters::init_policy_type::pessimistic_solve: init_with_pre_solve<Cost, Mode>( x, empty_x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::optimistic_solve: init_with_pre_solve<Cost, Mode>( empty_x, x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::bastert: init_with_bastert<Cost, Mode>(x, original_costs, variables, 0); break; } for (int i = 0, e = x.size(); i != e; ++i) if (choose_mutation(m_rng)) x.invert(i); } bool start_push = false; auto kappa = static_cast<Float>(p.kappa_min); Observer obs("img", slv.m, slv.n, p.limit); m_begin = std::chrono::steady_clock::now(); m_end = std::chrono::steady_clock::now(); compute.init(slv, x); for (long int i = 0; i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta); obs.make_observation(slv.ap, slv.P.get(), slv.pi.get()); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), i); best_remaining = remaining; start_push = true; break; } if (remaining < best_remaining) { store_if_better(x, remaining, i); best_remaining = remaining; } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) { r.status = result_status::kappa_max_reached; break; } if (is_timelimit_reached()) { r.status = result_status::time_limit_reached; break; } } if (!start_push) { r.status = result_status::limit_reached; } else { for (int push = 0; push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_rng, pushing_k_factor * kappa, delta, theta, pushing_objective_amplifier); if (remaining == 0) store_if_better(x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); if (is_timelimit_reached()) break; for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run(slv, x, m_rng, kappa, delta, theta); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; if (is_timelimit_reached()) break; } } } if (m_best.remaining_constraints == 0) r.status = result_status::success; if (!m_best.x.empty()) { r.solutions.resize(1); convert(m_best, r.solutions[0], variables); } return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x178, %rsp # imm = 0x178 vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %r8, %r13 movl %ecx, %ebx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, 0x8(%rsp) vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) leaq 0x18(%rsp), %rdi movl %ecx, %esi vzeroupper callq 0x368ae movq 0x10(%r14), %r12 movq 0x18(%r14), %rcx leaq 0x98(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x6fb57 vmovsd 0x20(%r12), %xmm0 vmovsd 0x10(%r12), %xmm1 vmovsd %xmm0, 0x60(%rsp) vmovsd 0x28(%r12), %xmm0 vmovsd %xmm1, 0x28(%rsp) vmovsd %xmm0, 0x68(%rsp) vmovsd 0x30(%r12), %xmm0 vmovsd %xmm0, 0x58(%rsp) vmovsd 0x8(%r12), %xmm0 vmovsd %xmm0, 0x30(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vucomisd %xmm1, %xmm0 jbe 0x89c7e movq 0x10(%r14), %rdi vmovsd 0x30(%rsp), %xmm0 leaq 0x98(%rsp), %rsi movl %ebx, %edx callq 0x6fc31 vmovsd %xmm0, 0x28(%rsp) vcvttsd2si 0xa0(%r12), %rax vmovsd 0x38(%r12), %xmm0 vmovsd 0x40(%r12), %xmm1 movq 0x18(%r14), %rsi movq %rax, 0x48(%rsp) movq 0x8(%r15), %rax vmovsd %xmm0, 0x90(%rsp) vmovsd %xmm1, 0x88(%rsp) subq (%r15), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0xf0(%rsp), %rdi leaq 0x98(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0x839f2 movl 0xcc(%r12), %esi leaq 0xb8(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x54(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, (%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0x70(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0x89d58 cmpl $0x1, %eax je 0x89d35 cmpl $0x2, %eax jne 0x89d69 movq 0x18(%r14), %rdx leaq 0x70(%rsp), %rdi leaq 0x18(%rsp), %rsi jmp 0x89d43 movq 0x18(%r14), %rdx leaq 0x18(%rsp), %rdi leaq 0x70(%rsp), %rsi vmovsd 0x3ca2ed(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x81d84 jmp 0x89d69 leaq 0x18(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0x81d0f leaq 0x18(%rsp), %r15 movq %r13, 0x38(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0x89d9e movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd (%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x89d9a movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0x89d78 leaq 0x78(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 vmovsd %xmm0, (%rsp) callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0xb8(%rsp), %rdi leaq 0xf0(%rsp), %rsi leaq 0x18(%rsp), %rdx callq 0x83d1a vmovsd (%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x18(%rsp), %rbx xorl %r15d, %r15d cmpq 0xb0(%r12), %r15 je 0x89eb1 movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 leaq 0xb8(%rsp), %rdi leaq 0xf0(%rsp), %rsi movq %rbx, %rdx vmovsd %xmm0, (%rsp) callq 0x83d5c movl %eax, %r13d testl %eax, %eax je 0x89f49 cmpl %ebp, %r13d jge 0x89e50 movq %r14, %rdi movq %rbx, %rsi movl %r13d, %edx movq %r15, %rcx callq 0x8a3a4 movl %r13d, %ebp cmpq 0x48(%rsp), %r15 jle 0x89e86 vcvtsi2sd %r13d, %xmm3, %xmm0 vcvtsi2sdl 0x170(%rsp), %xmm3, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x58(%rsp), %xmm1 callq 0xb1f0 vmovsd (%rsp), %xmm1 vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0x89e8b vmovsd (%rsp), %xmm0 vucomisd 0x68(%rsp), %xmm0 ja 0x89eb1 movq %r14, %rdi vmovsd %xmm0, (%rsp) callq 0x8a3dc vmovsd (%rsp), %xmm0 testb %al, %al jne 0x89eb1 incq %r15 jmp 0x89df1 movq 0x8(%rsp), %rax movl $0x5, 0xa0(%rax) cmpl $0x0, 0x50(%r14) jne 0x89ed3 movq 0x8(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0x89f01 movq 0x8(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x54(%rsp), %edx movq %r14, %rdi callq 0x4f485 leaq 0xb8(%rsp), %rdi callq 0x393ac leaq 0xf0(%rsp), %rdi callq 0x84294 leaq 0x98(%rsp), %rdi callq 0x6d8d6 leaq 0x20(%rsp), %rdi callq 0x357fe movq 0x8(%rsp), %rax addq $0x178, %rsp # imm = 0x178 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi leaq 0x18(%rsp), %rbx movq %rbx, %rsi callq 0x6e096 movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0x8a356 vmovsd (%rsp), %xmm0 leaq 0xf0(%rsp), %r15 leaq 0x18(%rsp), %rbp xorl %ebx, %ebx movl $0x0, 0x14(%rsp) cmpl 0xbc(%r12), %ebx jge 0x89ec0 vmovsd %xmm0, (%rsp) vmulsd 0x90(%rsp), %xmm0, %xmm0 movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 vmovsd 0x88(%rsp), %xmm3 leaq 0xb8(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx callq 0x84072 testl %eax, %eax jne 0x8a005 vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x6e096 movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x8a356 movq %r14, %rdi callq 0x8a3dc vmovsd (%rsp), %xmm0 testb %al, %al jne 0x89ec0 movl %ebx, 0x48(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0x8a106 movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 leaq 0xb8(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx vmovsd %xmm0, (%rsp) callq 0x83d5c testl %eax, %eax je 0x8a0ca vcvtsi2sd %r13d, %xmm4, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0x8a0a0 vcvtsi2sd %eax, %xmm4, %xmm0 vcvtsi2sdl 0x170(%rsp), %xmm4, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x58(%rsp), %xmm1 callq 0xb1f0 vmovsd (%rsp), %xmm1 vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0x8a0a5 vmovsd (%rsp), %xmm0 vucomisd 0x68(%rsp), %xmm0 ja 0x8a106 movq %r14, %rdi vmovsd %xmm0, (%rsp) callq 0x8a3dc testb %al, %al jne 0x8a101 vmovsd (%rsp), %xmm0 incl %ebx jmp 0x8a023 vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x6e096 movl 0xc0(%r12), %eax imull 0x14(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x8a356 vmovsd (%rsp), %xmm0 jmp 0x8a106 vmovsd (%rsp), %xmm0 movl 0x48(%rsp), %ebx decl 0x14(%rsp) incl %ebx jmp 0x89f8b jmp 0x8a144 jmp 0x8a120 jmp 0x8a144 movq %rax, %r14 jmp 0x8a154 movq %rax, %r14 jmp 0x8a161 movq %rax, %r14 jmp 0x8a16e movq %rax, %r14 jmp 0x8a178 jmp 0x8a144 jmp 0x8a144 jmp 0x8a144 leaq 0x78(%rsp), %rdi movq %rax, %r14 callq 0x357fe jmp 0x8a147 movq %rax, %r14 leaq 0xb8(%rsp), %rdi callq 0x393ac leaq 0xf0(%rsp), %rdi callq 0x84294 leaq 0x98(%rsp), %rdi callq 0x6d8d6 leaq 0x20(%rsp), %rdi callq 0x357fe movq 0x8(%rsp), %rdi callq 0xea60 movq %r14, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>>, double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long)
void store_if_better(const bit_array& x, double current, long int i) { if (is_better_solution<Mode>(current, m_best.value)) { m_best.x = x; m_best.duration = duration(); m_best.loop = i; m_best.remaining_constraints = 0; m_best.value = current; } }
vmovsd 0x30(%rdi), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x8a1d6 pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0x8a250 vmovsd (%rsp), %xmm1 vmovsd %xmm0, 0x38(%r14) movq %rbx, 0x48(%r14) andl $0x0, 0x50(%r14) vmovsd %xmm1, 0x30(%r14) addq $0x8, %rsp popq %rbx popq %r14 retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>>, double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::pnm_observer>::is_timelimit_reached()
bool is_timelimit_reached() { m_end = std::chrono::steady_clock::now(); return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end); }
pushq %rbx movq %rdi, %rbx callq 0xb5a0 movq %rax, 0x8(%rbx) vxorpd %xmm2, %xmm2, %xmm2 movq 0x10(%rbx), %rcx subq (%rbx), %rax vmovsd (%rcx), %xmm0 vcvtsi2sd %rax, %xmm1, %xmm1 vdivsd 0x3cf847(%rip), %xmm1, %xmm1 # 0x459a80 vcmpnlepd %xmm2, %xmm0, %k1 vcmpltpd %xmm1, %xmm0, %k0 {%k1} kmovd %k0, %eax andb $0x1, %al popq %rbx retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>>, double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long)
void store_if_better(const bit_array& x, double current, long int i) { if (is_better_solution<Mode>(current, m_best.value)) { m_best.x = x; m_best.duration = duration(); m_best.loop = i; m_best.remaining_constraints = 0; m_best.value = current; } }
vmovsd 0x30(%rdi), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x8a2bc pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0x8a336 vmovsd (%rsp), %xmm1 vmovsd %xmm0, 0x38(%r14) movq %rbx, 0x48(%r14) andl $0x0, 0x50(%r14) vmovsd %xmm1, 0x30(%r14) addq $0x8, %rsp popq %rbx popq %r14 retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>>, double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::file_observer>::is_timelimit_reached()
bool is_timelimit_reached() { m_end = std::chrono::steady_clock::now(); return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end); }
pushq %rbx movq %rdi, %rbx callq 0xb5a0 movq %rax, 0x8(%rbx) vxorpd %xmm2, %xmm2, %xmm2 movq 0x10(%rbx), %rcx subq (%rbx), %rax vmovsd (%rcx), %xmm0 vcvtsi2sd %rax, %xmm1, %xmm1 vdivsd 0x3cf761(%rip), %xmm1, %xmm1 # 0x459a80 vcmpnlepd %xmm2, %xmm0, %k1 vcmpltpd %xmm1, %xmm0, %k0 {%k1} kmovd %k0, %eax andb $0x1, %al popq %rbx retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>>, double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::none_observer>::store_if_better(baryonyx::bit_array const&, double, long)
void store_if_better(const bit_array& x, double current, long int i) { if (is_better_solution<Mode>(current, m_best.value)) { m_best.x = x; m_best.duration = duration(); m_best.loop = i; m_best.remaining_constraints = 0; m_best.value = current; } }
vmovsd 0x30(%rdi), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x8a3a2 pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0x8a41c vmovsd (%rsp), %xmm1 vmovsd %xmm0, 0x38(%r14) movq %rbx, 0x48(%r14) andl $0x0, 0x50(%r14) vmovsd %xmm1, 0x30(%r14) addq $0x8, %rsp popq %rbx popq %r14 retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>>, double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::none_observer>::is_timelimit_reached()
bool is_timelimit_reached() { m_end = std::chrono::steady_clock::now(); return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end); }
pushq %rbx movq %rdi, %rbx callq 0xb5a0 movq %rax, 0x8(%rbx) vxorpd %xmm2, %xmm2, %xmm2 movq 0x10(%rbx), %rcx subq (%rbx), %rax vmovsd (%rcx), %xmm0 vcvtsi2sd %rax, %xmm1, %xmm1 vdivsd 0x3cf67b(%rip), %xmm1, %xmm1 # 0x459a80 vcmpnlepd %xmm2, %xmm0, %k1 vcmpltpd %xmm1, %xmm0, %k0 {%k1} kmovd %k0, %eax andb $0x1, %al popq %rbx retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::result baryonyx::itm::optimize_problem<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&)
inline result optimize_problem(const context& ctx, const problem& pb) { result r; if (ctx.start) ctx.start(ctx.parameters); auto constraints{ make_merged_constraints(ctx, pb) }; if (constraints.empty() || pb.vars.values.empty()) { r.status = result_status::success; r.solutions.resize(1); r.solutions.back().value = pb.objective.value; r.strings = pb.strings; r.affected_vars = pb.affected_vars; r.variable_name = pb.vars.names; return r; } random_engine rng(init_random_generator_seed(ctx)); auto variables = length(pb.vars.values); auto cost = Cost(pb.objective, variables); auto cost_constant = pb.objective.value; const auto thread = get_thread_number(ctx); std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors; std::vector<std::thread> pool(thread); best_solution_recorder<Cost, Float, Mode> best_recorder( rng, thread, cost, cost_constant, variables, constraints, ctx.parameters.init_population_size); auto seeds = generate_seed(rng, thread); std::atomic_bool stop_task; stop_task.store(false); for (unsigned i = 0u; i != thread; ++i) functors.emplace_back(ctx, i, seeds[i]); for (unsigned i = 0u; i != thread; ++i) pool[i] = std::thread(std::ref(functors[i]), std::ref(stop_task), std::ref(best_recorder), std::cref(constraints), variables, std::cref(cost), cost_constant); const auto start = std::chrono::steady_clock::now(); auto end = start; do { std::this_thread::sleep_for(std::chrono::seconds{ 1L }); if (ctx.update) { auto call_number = 0L; for (auto i = 0u; i != thread; ++i) call_number += functors[i].m_call_number; int constraints_remaining; long int loop; double value; double duration; best_recorder.get_best( constraints_remaining, value, duration, loop); ctx.update( constraints_remaining, value, loop, duration, call_number); } end = std::chrono::steady_clock::now(); } while (!is_time_limit(ctx.parameters.time_limit, start, end)); stop_task.store(true); for (auto& t : pool) t.join(); r.strings = pb.strings; r.affected_vars = pb.affected_vars; r.variable_name = pb.vars.names; r.variables = variables; r.constraints = length(constraints); const auto& first = best_recorder.get_best(0); if (!first.is_solution()) r.status = result_status::time_limit_reached; else r.status = result_status::success; r.duration = first.duration; r.loop = first.loop; r.remaining_constraints = first.remaining_constraints; switch (ctx.parameters.storage) { case solver_parameters::storage_type::one: { r.solutions.resize(1); convert(first, r.solutions[0], variables); } break; case solver_parameters::storage_type::bound: { r.solutions.resize(2); convert(first, r.solutions[0], variables); convert(best_recorder.get_worst(), r.solutions[1], variables); } break; case solver_parameters::storage_type::five: { r.solutions.resize(5); for (int i = 0; i != 5; ++i) convert(best_recorder.get_best(i), r.solutions[i], variables); } break; } best_recorder.show_population(ctx); if (ctx.finish) ctx.finish(r); return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x188, %rsp # imm = 0x188 vxorpd %xmm0, %xmm0, %xmm0 movq %rdx, %r13 movq %rsi, %r15 movq %rdi, %r12 vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) cmpq $0x0, 0x128(%rsi) je 0x8a4a1 leaq 0x118(%r15), %rdi movq %r15, %rsi vzeroupper callq 0x3527e leaq 0x48(%rsp), %rdi movq %r15, %rsi movq %r13, %rdx vzeroupper callq 0x450078 movq 0x48(%rsp), %rax cmpq 0x50(%rsp), %rax je 0x8a5fd movq 0xa8(%r13), %rax cmpq 0xb0(%r13), %rax je 0x8a5fd movq %r15, %rdi callq 0x353ba movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF xorl %edx, %edx divq %rcx cmpq $0x1, %rdx adcq $0x0, %rdx movq %rdx, 0x40(%rsp) movq 0xb0(%r13), %rax subq 0xa8(%r13), %rax pushq $0xc popq %rcx cqto leaq 0x10(%r13), %rsi idivq %rcx movl %eax, 0x4(%rsp) leaq 0x60(%rsp), %rdi movl %eax, %edx movq %r12, 0x10(%rsp) callq 0x8adb0 vmovsd 0x40(%r13), %xmm0 vmovsd %xmm0, 0x38(%rsp) movq %r15, %rdi callq 0x35447 andq $0x0, 0x80(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movl %eax, %ebp vmovapd %xmm0, 0x70(%rsp) leaq 0xb0(%rsp), %rdi leaq 0xc8(%rsp), %rdx movq %rbp, %rsi callq 0x35462 vmovsd 0x38(%rsp), %xmm0 movl 0xc4(%r15), %eax movl 0x4(%rsp), %r8d subq $0x8, %rsp movl %ebp, %edx leaq 0xd0(%rsp), %rdi leaq 0x48(%rsp), %rsi leaq 0x68(%rsp), %rcx leaq 0x50(%rsp), %r9 pushq %rax callq 0x8ae24 popq %rax popq %rcx leaq 0x30(%rsp), %rdi leaq 0x40(%rsp), %rsi movl %ebp, %edx callq 0x3551c xorl %eax, %eax movb %al, 0x3(%rsp) xorl %ecx, %ecx leaq 0x70(%rsp), %rbx leaq 0x8(%rsp), %r14 xchgb %cl, 0x3(%rsp) leaq 0x90(%r13), %rcx movq %rcx, 0x98(%rsp) movl %eax, 0x8(%rsp) cmpl %ebp, %eax je 0x8a658 movl %eax, %ecx shlq $0x3, %rcx addq 0x30(%rsp), %rcx movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x8ae8a movl 0x8(%rsp), %eax incl %eax jmp 0x8a5d4 andl $0x0, 0xa0(%r12) leaq 0x68(%r12), %rdi pushq $0x1 popq %rsi callq 0x35292 vmovsd 0x40(%r13), %xmm0 movq 0x70(%r12), %rax vmovsd %xmm0, -0x8(%rax) movq %r12, %rdi movq %r13, %rsi callq 0x31d28 leaq 0xc0(%r13), %rsi leaq 0x20(%r12), %rdi callq 0x352c2 addq $0x90, %r13 leaq 0x50(%r12), %rdi movq %r13, %rsi callq 0x352ec jmp 0x8a9ed movq %r13, 0x90(%rsp) movq %r15, %r13 leaq 0x8(%rsp), %r15 leaq 0xa8(%rsp), %r14 leaq 0x4(%rsp), %rbx xorl %r12d, %r12d cmpq %rbp, %r12 je 0x8a719 imulq $0xc0, %r12, %rax addq 0x70(%rsp), %rax leaq 0x3(%rsp), %r10 leaq 0xc8(%rsp), %r11 movq %r10, 0x20(%rsp) leaq 0x48(%rsp), %r10 movq %r11, 0x18(%rsp) movq %r10, 0xa8(%rsp) movq %rax, 0x28(%rsp) leaq 0x60(%rsp), %rax movq %rax, 0xa0(%rsp) leaq 0x20(%rsp), %rdx leaq 0x38(%rsp), %rax movq %r15, %rdi leaq 0x28(%rsp), %rsi leaq 0x18(%rsp), %rcx movq %r14, %r8 movq %rbx, %r9 pushq %rax leaq 0xa8(%rsp), %rax pushq %rax callq 0x8aed6 popq %rax popq %rcx leaq (,%r12,8), %rdi addq 0xb0(%rsp), %rdi movq %r15, %rsi callq 0x356d6 movq %r15, %rdi callq 0x356f0 incq %r12 jmp 0x8a678 callq 0xb5a0 imulq $0xc0, %rbp, %r15 leaq 0x138(%r13), %r12 leaq 0x8(%rsp), %rbp movq %rax, %rbx movq $0x1, 0x8(%rsp) movq %rbp, %rdi callq 0x356fd cmpq $0x0, 0x148(%r13) je 0x8a7ae movq 0x70(%rsp), %rax xorl %ecx, %ecx xorl %r14d, %r14d cmpq %rcx, %r15 je 0x8a76f addq 0xb0(%rax,%rcx), %r14 addq $0xc0, %rcx jmp 0x8a759 leaq 0xd0(%rsp), %rdi leaq 0x18(%rsp), %rsi leaq 0x28(%rsp), %rdx leaq 0x20(%rsp), %rcx movq %rbp, %r8 callq 0x93ba8 vmovsd 0x28(%rsp), %xmm0 vmovsd 0x20(%rsp), %xmm1 movq 0x8(%rsp), %rdx movl 0x18(%rsp), %esi movq %r12, %rdi movq %r14, %rcx callq 0x35736 callq 0xb5a0 vmovsd (%r13), %xmm0 subq %rbx, %rax vxorpd %xmm1, %xmm1, %xmm1 vucomisd %xmm0, %xmm1 vcvtsi2sd %rax, %xmm2, %xmm1 vdivsd 0x3cf2af(%rip), %xmm1, %xmm1 # 0x459a80 jae 0x8a734 vucomisd %xmm0, %xmm1 jbe 0x8a734 movb $0x1, %al xchgb %al, 0x3(%rsp) movq 0xb0(%rsp), %rbx movq 0xb8(%rsp), %r14 movq 0x10(%rsp), %r12 cmpq %r14, %rbx je 0x8a80f movq %rbx, %rdi callq 0xb1a0 addq $0x8, %rbx jmp 0x8a7fc movq 0x90(%rsp), %rbx movq %r12, %rdi movq %rbx, %rsi callq 0x31d28 addq $0xc0, %rbx leaq 0x20(%r12), %rdi movq %rbx, %rsi callq 0x352c2 leaq 0x50(%r12), %rdi movq 0x98(%rsp), %rsi callq 0x352ec movl 0x4(%rsp), %eax movl %eax, 0x90(%r12) movq 0x50(%rsp), %rax subq 0x48(%rsp), %rax pushq $0x28 popq %rcx cqto xorl %esi, %esi idivq %rcx movq 0x108(%rsp), %rdi movq 0x120(%rsp), %rcx movl %eax, 0x94(%r12) movslq (%rdi), %rax imulq $0x38, %rax, %rax movl 0x30(%rcx,%rax), %edx leaq (%rcx,%rax), %rbx testl %edx, %edx setne %sil leal (%rsi,%rsi,2), %esi movl %esi, 0xa0(%r12) vmovsd 0x18(%rcx,%rax), %xmm0 vmovsd %xmm0, 0x80(%r12) movq 0x28(%rcx,%rax), %rax movq %rax, 0x88(%r12) movl %edx, 0x98(%r12) movl 0xe8(%r13), %eax testl %eax, %eax je 0x8a96a cmpl $0x1, %eax je 0x8a932 cmpl $0x2, %eax jne 0x8a989 leaq 0x68(%r12), %rbx pushq $0x5 popq %rsi movq %rbx, %rdi callq 0x35292 xorl %r14d, %r14d xorl %r15d, %r15d cmpq $0x5, %r15 je 0x8a989 movq 0x108(%rsp), %rax movq (%rbx), %rsi movl 0x4(%rsp), %edx movslq (%rax,%r15,4), %rax addq %r14, %rsi imulq $0x38, %rax, %rdi addq 0x120(%rsp), %rdi callq 0x35781 incq %r15 addq $0x20, %r14 jmp 0x8a8f8 leaq 0x68(%r12), %r14 pushq $0x2 popq %rsi movq %r14, %rdi callq 0x35292 movl 0x4(%rsp), %edx movq (%r14), %rsi movq %rbx, %rdi callq 0x35781 leaq 0xd0(%rsp), %rdi callq 0x93c26 movq (%r14), %rsi movq %rax, %rbx addq $0x20, %rsi jmp 0x8a97d leaq 0x68(%r12), %r14 pushq $0x1 popq %rsi movq %r14, %rdi callq 0x35292 movq (%r14), %rsi movl 0x4(%rsp), %edx movq %rbx, %rdi callq 0x35781 leaq 0xc8(%rsp), %rdi movq %r13, %rsi callq 0x8af88 cmpq $0x0, 0x168(%r13) je 0x8a9b5 addq $0x158, %r13 # imm = 0x158 movq %r13, %rdi movq %r12, %rsi callq 0x357ea leaq 0x30(%rsp), %rdi callq 0x357fe leaq 0xc8(%rsp), %rdi callq 0x8af9c leaq 0xb0(%rsp), %rdi callq 0x35836 leaq 0x70(%rsp), %rdi callq 0x93d06 leaq 0x68(%rsp), %rdi callq 0x8affa leaq 0x48(%rsp), %rdi callq 0x35858 movq %r12, %rax addq $0x188, %rsp # imm = 0x188 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx jmp 0x8aa4e movq %rax, %rbx jmp 0x8aa5b movq %rax, %rbx jmp 0x8aa68 jmp 0x8aa32 jmp 0x8aa23 jmp 0x8aa41 jmp 0x8aa41 movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0x8aa86 movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0x8aa7c jmp 0x8aa41 jmp 0x8aa41 jmp 0x8aa41 jmp 0x8aa41 jmp 0x8aa41 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x357fe leaq 0xc8(%rsp), %rdi callq 0x8af9c leaq 0xb0(%rsp), %rdi callq 0x35836 leaq 0x70(%rsp), %rdi callq 0x93d06 leaq 0x68(%rsp), %rdi callq 0x8affa leaq 0x48(%rsp), %rdi callq 0x35858 movq 0x10(%rsp), %rdi callq 0xea60 movq %rbx, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::result baryonyx::itm::solve_problem<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&)
inline result solve_problem(const context& ctx, const problem& pb) { if (ctx.start) ctx.start(ctx.parameters); result ret; auto variables = length(pb.vars.values); auto constraints{ make_merged_constraints(ctx, pb) }; if (!constraints.empty() && !pb.vars.values.empty()) { random_engine rng(init_random_generator_seed(ctx)); auto cost = Cost(pb.objective, variables); auto cost_constant = pb.objective.value; switch (ctx.parameters.observer) { case solver_parameters::observer_type::pnm: { using obs = pnm_observer; solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng); ret = slv(constraints, variables, cost, cost_constant); } break; case solver_parameters::observer_type::file: { using obs = file_observer; solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng); ret = slv(constraints, variables, cost, cost_constant); } break; default: { using obs = none_observer; solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng); ret = slv(constraints, variables, cost, cost_constant); break; } } } else { ret.status = result_status::success; ret.solutions.resize(1); ret.solutions.back().value = pb.objective.value; } ret.strings = pb.strings; ret.variable_name = std::move(pb.vars.names); ret.affected_vars = std::move(pb.affected_vars); ret.variables = variables; ret.constraints = length(constraints); if (ctx.finish) ctx.finish(ret); return ret; }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x130, %rsp # imm = 0x130 cmpq $0x0, 0x128(%rsi) movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx je 0x8aaca leaq 0x118(%r14), %rdi movq %r14, %rsi callq 0x3527e vxorps %xmm0, %xmm0, %xmm0 vmovups %zmm0, 0x58(%rbx) vmovups %zmm0, 0x40(%rbx) vmovups %zmm0, (%rbx) movq $0x7fffffff, 0x98(%rbx) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rbx) movq 0xb0(%r15), %rax subq 0xa8(%r15), %rax pushq $0xc popq %rcx cqto idivq %rcx movq %rax, %r12 leaq 0x8(%rsp), %rdi movq %r14, %rsi movq %r15, %rdx vzeroupper callq 0x450078 movq 0x8(%rsp), %rax cmpq 0x10(%rsp), %rax je 0x8abf3 movq 0xa8(%r15), %rax cmpq 0xb0(%r15), %rax je 0x8abf3 movq %r14, %rdi callq 0x353ba movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF xorl %edx, %edx leaq 0x10(%r15), %rsi divq %rcx cmpq $0x1, %rdx adcq $0x0, %rdx movq %rdx, (%rsp) leaq 0x20(%rsp), %rdi movl %r12d, %edx callq 0x8adb0 vmovsd 0x40(%r15), %xmm0 movl 0xe4(%r14), %eax vxorps %xmm1, %xmm1, %xmm1 leaq 0x30(%rsp), %rsi cmpl $0x1, %eax je 0x8ac1a cmpl $0x2, %eax jne 0x8ac69 movabsq $-0x10000000000000, %r9 # imm = 0xFFF0000000000000 vmovaps %xmm1, (%rsi) movq %r14, 0x10(%rsi) movq %rsp, %rax movq %rax, 0x18(%rsi) vmovaps %xmm1, 0x20(%rsi) movq %r9, 0x30(%rsi) andq $0x0, 0x48(%rsi) vmovups %xmm1, 0x38(%rsi) movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF leaq 0x88(%rsp), %rdi leaq 0x8(%rsp), %rdx leaq 0x20(%rsp), %r8 movl %r12d, %ecx callq 0x9446a jmp 0x8acb6 andl $0x0, 0xa0(%rbx) leaq 0x68(%rbx), %rdi pushq $0x1 popq %rsi callq 0x35292 vmovsd 0x40(%r15), %xmm0 movq 0x70(%rbx), %rax vmovsd %xmm0, -0x8(%rax) jmp 0x8ace5 movabsq $-0x10000000000000, %r9 # imm = 0xFFF0000000000000 vmovaps %xmm1, (%rsi) movq %r14, 0x10(%rsi) movq %rsp, %rax movq %rax, 0x18(%rsi) vmovaps %xmm1, 0x20(%rsi) movq %r9, 0x30(%rsi) andq $0x0, 0x48(%rsi) vmovups %xmm1, 0x38(%rsi) movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF leaq 0x88(%rsp), %rdi leaq 0x8(%rsp), %rdx leaq 0x20(%rsp), %r8 movl %r12d, %ecx callq 0x93d2e jmp 0x8acb6 movabsq $-0x10000000000000, %r9 # imm = 0xFFF0000000000000 vmovaps %xmm1, (%rsi) movq %r14, 0x10(%rsi) movq %rsp, %rax movq %rax, 0x18(%rsi) vmovaps %xmm1, 0x20(%rsi) movq %r9, 0x30(%rsi) andq $0x0, 0x48(%rsi) vmovups %xmm1, 0x38(%rsi) movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF leaq 0x88(%rsp), %rdi leaq 0x8(%rsp), %rdx leaq 0x20(%rsp), %r8 movl %r12d, %ecx callq 0x94ba6 leaq 0x88(%rsp), %r13 movq %rbx, %rdi movq %r13, %rsi callq 0x41d9e movq %r13, %rdi callq 0xea60 leaq 0x58(%rsp), %rdi callq 0x357fe leaq 0x28(%rsp), %rdi callq 0x8affa leaq 0x90(%r15), %r13 movq %rbx, %rdi movq %r15, %rsi callq 0x31d28 leaq 0x50(%rbx), %rdi movq %r13, %rsi callq 0x352ec addq $0xc0, %r15 leaq 0x20(%rbx), %rdi movq %r15, %rsi callq 0x352c2 movq 0x10(%rsp), %rax movl %r12d, 0x90(%rbx) subq 0x8(%rsp), %rax pushq $0x28 popq %rcx cqto idivq %rcx movl %eax, 0x94(%rbx) cmpq $0x0, 0x168(%r14) je 0x8ad51 addq $0x158, %r14 # imm = 0x158 movq %r14, %rdi movq %rbx, %rsi callq 0x357ea leaq 0x8(%rsp), %rdi callq 0x35858 movq %rbx, %rax addq $0x130, %rsp # imm = 0x130 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x8ad73 jmp 0x8ad73 leaq 0x58(%rsp), %rdi movq %rax, %r14 callq 0x357fe leaq 0x28(%rsp), %rdi callq 0x8affa jmp 0x8ad96 jmp 0x8ad93 movq %rax, %r14 jmp 0x8ada0 movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x35858 movq %rbx, %rdi callq 0xea60 movq %r14, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::default_cost_type<long double>::default_cost_type(baryonyx::objective_function const&, int)
default_cost_type(const objective_function& obj_, int n) : obj(obj_) , linear_elements(std::make_unique<Float[]>(n)) { for (const auto& elem : obj.elements) { bx_ensures(0 <= elem.variable_index && elem.variable_index < n); linear_elements[elem.variable_index] += static_cast<Float>(elem.factor); } }
pushq %r14 pushq %rbx pushq %rax movq %rsi, (%rdi) movq %rdi, %r14 addq $0x8, %rdi movslq %edx, %rsi movl %edx, %ebx callq 0x8afb9 movq (%r14), %rdx movq 0x8(%r14), %rax movq (%rdx), %rcx movq 0x8(%rdx), %rdx cmpq %rdx, %rcx je 0x8adfa movslq 0x8(%rcx), %rsi testq %rsi, %rsi js 0x8ae02 cmpl %ebx, %esi jge 0x8ae02 shlq $0x4, %rsi fldt (%rax,%rsi) faddl (%rcx) fstpt (%rax,%rsi) addq $0x10, %rcx jmp 0x8add6 addq $0x8, %rsp popq %rbx popq %r14 retq leaq 0x3cd621(%rip), %rdi # 0x45842a leaq 0x3cf148(%rip), %rsi # 0x459f58 leaq 0x3cf175(%rip), %rdx # 0x459f8c leaq 0x3cf1ca(%rip), %rcx # 0x459fe8 callq 0x2813f nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::maximize_tag>::storage(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, baryonyx::itm::default_cost_type<long double> const&, double, int, int, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&)
storage(random_engine& rng, const Cost& costs_, const double cost_constant_, const int population_size, const int variables, const std::vector<merged_constraint>& constraints_) : m_indices(population_size) , m_data(population_size) , m_bastert(variables) , m_random(variables) , costs(costs_) , cost_constant(cost_constant_) , m_size(population_size) { for (auto& elem : m_data) elem.x = bit_array(variables); init_with_bastert<Cost, Mode>(m_bastert, costs_, variables, 0); for (int i = 0, e = m_size / 2; i != e; ++i) { m_data[i].x = m_bastert; std::bernoulli_distribution dist( std::clamp(static_cast<double>(i) / (5 * e), 0.0, 1.0)); for (int v = 0; v != variables; ++v) if (dist(rng)) m_data[i].x.invert(v); } for (int i = m_size / 2, e = m_size; i + 1 < e; i += 2) { init_with_random(m_data[i].x, rng, variables, 0.2); init_with_random(m_data[i + 1].x, rng, variables, 0.8); init_with_pre_solve<Cost, Mode>( m_data[i].x, m_data[i + 1].x, rng, costs_, constraints_, std::clamp(static_cast<double>(i) / (5 * e), 0.0, 1.0)); } for (int i = 0, e = m_size; i != e; ++i) { m_data[i].make_hash(); m_data[i].value = costs.results(m_data[i].x, cost_constant_); m_data[i].remaining_constraints = 0; for (int k = 0, end_k = length(constraints_); k != end_k; ++k) { int sum = 0; for (const auto& elem : constraints_[k].elements) { if (m_data[i].x[elem.variable_index]) sum += elem.factor; } if (!(constraints_[k].min <= sum && sum <= constraints_[k].max)) ++m_data[i].remaining_constraints; } } std::iota(std::begin(m_indices), std::end(m_indices), 0); sort(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %rdx, 0x18(%rsp) movq %rdi, %r15 movslq %ecx, %r12 leaq 0x58(%rsp), %rdx movq %rsi, %r13 movq %r9, 0x28(%rsp) movl %r8d, %ebp movl %ecx, %ebx vmovupd %ymm0, 0x18(%rdi) vmovupd %ymm0, (%rdi) addq $0x38, %rdi movq %r12, %rsi movq %rdi, 0x48(%rsp) vzeroupper callq 0x3140c leaq 0x50(%r15), %r14 leaq 0x58(%rsp), %rdx movq %r14, %rdi movq %r12, %rsi callq 0x36194 leaq 0x68(%r15), %rdi movl %ebp, %esi movq %rdi, 0x10(%rsp) callq 0x368ae leaq 0x78(%r15), %rdi movl %ebp, %esi callq 0x368ae vmovsd 0x40(%rsp), %xmm0 movq 0x18(%rsp), %rax movq %r15, 0x8(%rsp) leaq 0x58(%rsp), %r12 movq %rax, 0x88(%r15) vmovsd %xmm0, 0x90(%r15) movl %ebx, 0x98(%r15) movq 0x50(%r15), %rbx movq 0x58(%r15), %r15 cmpq %r15, %rbx je 0x8b101 movq %r12, %rdi movl %ebp, %esi callq 0x368ae movq %rbx, %rdi movq %r12, %rsi callq 0x3696c leaq 0x60(%rsp), %rdi callq 0x357fe addq $0x38, %rbx jmp 0x8b0d7 movq 0x10(%rsp), %rdi movq 0x18(%rsp), %rsi xorl %r15d, %r15d movl %ebp, %edx xorl %ecx, %ecx callq 0x8b41f movq 0x8(%rsp), %rax movl 0x98(%rax), %eax pushq $0x2 popq %rcx cltd idivl %ecx movq %rax, 0x20(%rsp) leal (%rax,%rax,4), %eax vcvtsi2sd %eax, %xmm1, %xmm0 vmovsd %xmm0, 0x50(%rsp) cmpq 0x20(%rsp), %r15 je 0x8b1b3 movq (%r14), %rdi imulq $0x38, %r15, %r12 addq %r12, %rdi movq 0x10(%rsp), %rsi callq 0x36a44 vcvtsi2sd %r15d, %xmm3, %xmm0 vdivsd 0x50(%rsp), %xmm0, %xmm0 vmovsd 0x3c8ed0(%rip), %xmm1 # 0x454038 xorl %ebx, %ebx vminsd %xmm0, %xmm1, %xmm2 vxorpd %xmm1, %xmm1, %xmm1 vcmpltsd %xmm1, %xmm0, %k1 vmovsd %xmm1, %xmm2, %xmm2 {%k1} vmovapd %xmm2, 0x30(%rsp) cmpl %ebx, %ebp je 0x8b1ae movq %r13, %rdi callq 0x36ac3 vmovapd 0x30(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x8b1aa movq (%r14), %rdi movl %ebx, %esi addq %r12, %rdi callq 0x3626e incl %ebx jmp 0x8b185 incq %r15 jmp 0x8b13a movq 0x8(%rsp), %rax movslq 0x98(%rax), %rsi movl %esi, %eax cltd pushq $0x2 popq %rcx idivl %ecx leal (%rsi,%rsi,4), %ecx movq %rsi, 0x30(%rsp) vcvtsi2sd %ecx, %xmm3, %xmm0 vmovsd %xmm0, 0x10(%rsp) movslq %eax, %r12 movl %eax, %r15d imulq $0x38, %r12, %rbx incq %r12 cmpq 0x30(%rsp), %r12 jge 0x8b279 vmovsd 0x3ce88f(%rip), %xmm0 # 0x459a88 movq (%r14), %rdi movq %r13, %rsi movl %ebp, %edx addq %rbx, %rdi callq 0x362ac vmovsd 0x3ce87f(%rip), %xmm0 # 0x459a90 movq (%r14), %rax movq %r13, %rsi movl %ebp, %edx leaq 0x38(%rax,%rbx), %rdi callq 0x362ac vcvtsi2sd %r15d, %xmm3, %xmm0 vdivsd 0x10(%rsp), %xmm0, %xmm1 vmovsd 0x3c8e02(%rip), %xmm0 # 0x454038 movq (%r14), %rdi movq 0x18(%rsp), %rcx movq 0x28(%rsp), %r8 vxorpd %xmm2, %xmm2, %xmm2 movq %r13, %rdx leaq 0x38(%rdi,%rbx), %rsi addq %rbx, %rdi vcmpltsd %xmm2, %xmm1, %k1 vminsd %xmm1, %xmm0, %xmm0 vmovsd %xmm2, %xmm0, %xmm0 {%k1} callq 0x8b497 addl $0x2, %r15d addq $0x70, %rbx addq $0x2, %r12 jmp 0x8b1e6 movq 0x8(%rsp), %rax movl 0x98(%rax), %eax movq %rax, 0x20(%rsp) xorl %eax, %eax cmpq 0x20(%rsp), %rax je 0x8b370 movq 0x8(%rsp), %rbx imulq $0x38, %rax, %rbp movq %rax, 0x10(%rsp) movq 0x50(%rbx), %rdi addq %rbp, %rdi callq 0x365b4 vmovsd 0x40(%rsp), %xmm0 movq 0x50(%rbx), %rsi movq 0x88(%rbx), %rdi addq %rbp, %rsi callq 0x8b74a movq 0x50(%rbx), %rax vmovsd %xmm0, 0x10(%rax,%rbp) andl $0x0, 0x30(%rax,%rbp) movq 0x28(%rsp), %rax movq (%rax), %rcx movq 0x8(%rax), %rax subq %rcx, %rax cqto pushq $0x28 popq %rsi idivq %rsi movl %eax, %eax movq %rax, 0x18(%rsp) xorl %eax, %eax cmpq 0x18(%rsp), %rax je 0x8b363 imulq $0x28, %rax, %r12 movq %rax, 0x30(%rsp) xorl %r15d, %r15d movq (%rcx,%r12), %r13 movq 0x8(%rcx,%r12), %rbx cmpq %rbx, %r13 je 0x8b339 movq (%r14), %rdi movl 0x4(%r13), %esi addq %rbp, %rdi callq 0x3664a testl %eax, %eax je 0x8b330 movl (%r13), %eax addl %eax, %r15d addq $0x8, %r13 jmp 0x8b314 movq 0x28(%rsp), %rax movq (%rax), %rcx cmpl %r15d, 0x18(%rcx,%r12) jg 0x8b352 addq %rcx, %r12 cmpl 0x1c(%r12), %r15d jle 0x8b359 movq (%r14), %rax incl 0x30(%rax,%rbp) movq 0x30(%rsp), %rax incq %rax jmp 0x8b2f8 movq 0x10(%rsp), %rax incq %rax jmp 0x8b28b movq 0x8(%rsp), %rdi xorl %edx, %edx movq 0x38(%rdi), %rax movq 0x40(%rdi), %rcx cmpq %rcx, %rax je 0x8b38e movl %edx, (%rax) incl %edx addq $0x4, %rax jmp 0x8b37f callq 0x8b7c0 addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx jmp 0x8b3c9 movq %rax, %rbx jmp 0x8b3d5 movq %rax, %rbx jmp 0x8b3dd jmp 0x8b3b5 jmp 0x8b3b5 movq 0x8(%rsp), %r15 movq %rax, %rbx leaq 0x80(%r15), %rdi callq 0x357fe addq $0x70, %r15 movq %r15, %rdi callq 0x357fe movq %r14, %rdi callq 0x36742 movq 0x48(%rsp), %rdi callq 0x26a34 movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
void baryonyx::itm::init_with_bastert<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::maximize_tag>(baryonyx::bit_array&, baryonyx::itm::default_cost_type<long double> const&, int, int)
void init_with_bastert(bit_array& x, const Cost& c, const int variables, const int value_if_0) noexcept { for (int i = 0; i != variables; ++i) if (init_x<Mode>(c[i], value_if_0)) x.set(i); else x.unset(i); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %edx, %r13d shlq $0x4, %r13 movl %ecx, %ebx movq %rsi, %r14 movq %rdi, %r15 xorl %r12d, %r12d xorl %ebp, %ebp cmpq %rbp, %r13 je 0x8b488 movq 0x8(%r14), %rcx testl %ebx, %ebx setne %al fldt (%rcx,%rbp) fldz fucomi %st(1), %st fxch %st(1) setnp %dl sete %cl fucompi %st(1), %st fstp %st(0) ja 0x8b474 andb %dl, %cl andb %cl, %al jne 0x8b474 movq %r15, %rdi movl %r12d, %esi callq 0x36a06 jmp 0x8b47f movq %r15, %rdi movl %r12d, %esi callq 0x369c8 addq $0x10, %rbp incl %r12d jmp 0x8b43e addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
void baryonyx::itm::init_with_pre_solve<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::maximize_tag>(baryonyx::bit_array&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, baryonyx::itm::default_cost_type<long double> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, double)
void init_with_pre_solve(bit_array& x_pessimistic, bit_array& x_optimistic, random_engine& rng, const Cost& c, const std::vector<merged_constraint>& constraints, const double init_random) noexcept { int max_length = 0; for (const auto& cst : constraints) if (length(cst.elements) > max_length) max_length = length(cst.elements); struct reduced_cost { float value; int factor; int id; }; std::vector<reduced_cost> R(max_length); std::bernoulli_distribution dist(init_random); for (const auto& cst : constraints) { if (!dist(rng)) continue; R.resize(cst.elements.size()); const int r_size = length(cst.elements); for (int i = 0; i != r_size; ++i) { R[i].value = static_cast<float>(c[cst.elements[i].variable_index]); R[i].factor = cst.elements[i].factor; R[i].id = cst.elements[i].variable_index; } std::shuffle(std::begin(R), std::end(R), rng); std::sort( std::begin(R), std::end(R), [](const auto& lhs, const auto& rhs) { return is_better_solution<Mode>(lhs.value, rhs.value); }); if (!x_pessimistic.empty()) { int sum = 0; int best = -2; for (int i = -1; i < r_size; ++i) { if (cst.min <= sum && sum <= cst.max) { best = i; break; } if (i + 1 < r_size) sum += R[i + 1].factor; } int i = 0; for (; i <= best; ++i) x_pessimistic.set(R[i].id); for (; i != r_size; ++i) { x_pessimistic.unset(R[i].id); } } if (!x_optimistic.empty()) { int sum = 0; int best = -2; for (int i = -1; i < r_size; ++i) { if (cst.min <= sum && sum <= cst.max) best = i; if (best != -2 && i + 1 < r_size && stop_iterating<Mode>(R[i + 1].value)) break; if (i + 1 < r_size) sum += R[i + 1].factor; } int i = 0; for (; i <= best; ++i) x_optimistic.set(R[i].id); for (; i != r_size; ++i) x_optimistic.unset(R[i].id); } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rcx, 0x38(%rsp) movq (%r8), %rax movq 0x8(%r8), %rcx movq %rdx, 0x30(%rsp) vmovsd %xmm0, 0x48(%rsp) movq %r8, %r13 xorl %edx, %edx movq %rsi, 0x28(%rsp) movq %rdi, 0x20(%rsp) cmpq %rcx, %rax je 0x8b4e8 movq 0x8(%rax), %rsi subq (%rax), %rsi shrq $0x3, %rsi cmpl %esi, %edx cmovgl %edx, %esi addq $0x28, %rax movl %esi, %edx jmp 0x8b4cb movl %edx, %esi leaq 0x8(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0x8b89c movq 0x8(%r13), %rax movq (%r13), %rbp movq 0x30(%rsp), %r13 movq %rax, 0x50(%rsp) cmpq 0x50(%rsp), %rbp je 0x8b727 movq %r13, %rdi callq 0x36ac3 vmovsd 0x48(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x8b71e movq 0x8(%rbp), %rsi subq (%rbp), %rsi sarq $0x3, %rsi leaq 0x8(%rsp), %rdi callq 0x8b8f0 movq 0x38(%rsp), %rcx movq (%rbp), %rax movq 0x8(%rbp), %r15 movq 0x8(%rsp), %rdx movl $0x2003, %esi # imm = 0x2003 movq 0x8(%rcx), %rcx subq %rax, %r15 addq $0x4, %rdx bextrq %rsi, %r15, %r14 xorl %esi, %esi cmpq %rsi, %r14 je 0x8b594 movq (%rax,%rsi,8), %rdi incq %rsi movq %rdi, %r8 sarq $0x20, %r8 shlq $0x4, %r8 fldt (%rcx,%r8) fstps -0x4(%rdx) movq %rdi, (%rdx) addq $0xc, %rdx jmp 0x8b56d movq 0x8(%rsp), %rdi movq 0x10(%rsp), %rsi movq %r13, %rdx callq 0x8b928 movq 0x8(%rsp), %rdi movq 0x10(%rsp), %rsi callq 0x8bd8b movq 0x20(%rsp), %rax cmpq $0x0, 0x8(%rax) je 0x8b660 movq 0x8(%rsp), %rax movq %r15, %rcx shrq $0x3, %rcx xorl %esi, %esi movslq %ecx, %rdx addq $0x4, %rax pushq $-0x1 popq %rcx movq %r15, 0x40(%rsp) imulq $0xc, %rcx, %rdi addq %rax, %rdi cmpq %rdx, %rcx jge 0x8b608 cmpl %esi, 0x18(%rbp) jg 0x8b5f8 cmpl 0x1c(%rbp), %esi jle 0x8b60b incq %rcx addq $0xc, %rdi cmpq %rdx, %rcx jge 0x8b5e9 addl (%rdi), %esi jmp 0x8b5e2 pushq $-0x2 popq %rcx movslq %ecx, %r15 movq %r14, %rbx pushq $0x8 popq %r13 xorl %r12d, %r12d cmpq %r15, %r12 jg 0x8b63c movq 0x8(%rsp), %rax movq 0x20(%rsp), %rdi movl (%rax,%r13), %esi callq 0x369c8 incq %r12 addq $0xc, %r13 decq %rbx jmp 0x8b618 movq 0x40(%rsp), %r15 subq $0x1, %rbx jb 0x8b660 movq 0x8(%rsp), %rax movq 0x20(%rsp), %rdi movl (%rax,%r13), %esi callq 0x36a06 addq $0xc, %r13 jmp 0x8b641 movq 0x28(%rsp), %rax movq 0x30(%rsp), %r13 cmpq $0x0, 0x8(%rax) je 0x8b71e movq 0x8(%rsp), %rax shrq $0x3, %r15 xorl %edx, %edx movslq %r15d, %rcx addq $0xc, %rax pushq $-0x1 popq %rsi pushq $-0x2 popq %rdi imulq $0xc, %rsi, %r8 addq %rax, %r8 movl %edi, %r9d cmpq %rcx, %rsi jge 0x8b6d6 cmpl 0x1c(%rbp), %edx movl %esi, %edi cmovgl %r9d, %edi cmpl %edx, 0x18(%rbp) cmovgl %r9d, %edi incq %rsi cmpl $-0x2, %edi je 0x8b6c4 cmpq %rcx, %rsi jge 0x8b6c4 vxorpd %xmm0, %xmm0, %xmm0 vucomiss (%r8), %xmm0 ja 0x8b6d3 addq $0xc, %r8 cmpq %rcx, %rsi jge 0x8b694 addl -0x8(%r8), %edx jmp 0x8b68d movl %edi, %r9d movslq %r9d, %r15 pushq $0x8 popq %rbx xorl %r12d, %r12d cmpq %r15, %r12 jg 0x8b718 movq 0x8(%rsp), %rax movq 0x28(%rsp), %rdi movl (%rax,%rbx), %esi callq 0x369c8 incq %r12 addq $0xc, %rbx decq %r14 jmp 0x8b6df movq 0x8(%rsp), %rax movq 0x28(%rsp), %rdi movl (%rax,%rbx), %esi callq 0x36a06 addq $0xc, %rbx subq $0x1, %r14 jae 0x8b702 addq $0x28, %rbp jmp 0x8b50b leaq 0x8(%rsp), %rdi callq 0x8bb34 addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x8b742 movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::default_cost_type<long double>::results(baryonyx::bit_array const&, double) const
double results(const bit_array& x, double cost_constant) const noexcept { for (int i = 0, e = length(obj.elements); i != e; ++i) if (x[obj.elements[i].variable_index]) cost_constant += obj.elements[i].factor; return cost_constant; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq (%rdi), %rax movabsq $0xffffffff0, %r15 # imm = 0xFFFFFFFF0 vmovsd %xmm0, (%rsp) movq %rsi, %rbx movq %rdi, %r14 xorl %r12d, %r12d movq 0x8(%rax), %rcx subq (%rax), %rcx andq %rcx, %r15 cmpq %r12, %r15 je 0x8b7af movq (%r14), %rax movq %rbx, %rdi movq (%rax), %rax movl 0x8(%rax,%r12), %esi callq 0x3664a testl %eax, %eax je 0x8b7a9 movq (%r14), %rax vmovsd (%rsp), %xmm0 movq (%rax), %rax vaddsd (%rax,%r12), %xmm0, %xmm0 vmovsd %xmm0, (%rsp) addq $0x10, %r12 jmp 0x8b777 vmovsd (%rsp), %xmm0 addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::maximize_tag>::sort()
void sort() noexcept { m_indices_writer lock{ m_indices_mutex }; std::sort( std::begin(m_indices), std::end(m_indices), [this](int i1, int i2) { const int cst_1 = this->m_data[i1].remaining_constraints; const int cst_2 = this->m_data[i2].remaining_constraints; const double value_1 = this->m_data[i1].value; const double value_2 = this->m_data[i2].value; if (cst_1 < cst_2) return true; if (cst_1 == cst_2) return is_better_solution<Mode>(value_1, value_2); return false; }); #ifdef BARYONYX_ENABLE_DEBUG to_log(stdout, 3u, "- Solutions init population:\n"); for (int i = 0; i != m_size; ++i) { to_log(stdout, 5u, "- {} id {} value {} constraint {} hash {}\n", i, m_indices[i], m_data[m_indices[i]].value, m_data[m_indices[i]].remaining_constraints, m_data[m_indices[i]].hash); } #endif }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %rdi movq %rbx, %rsi callq 0x377e6 movq 0x38(%rbx), %rdi movq 0x40(%rbx), %rsi movq %rbx, %rdx callq 0x8c309 movq 0x5b17d3(%rip), %r13 # 0x63cfc8 movq (%r13), %rdi leaq 0x3ce898(%rip), %rcx # 0x45a098 pushq $0x3 popq %rsi pushq $0x1d popq %rdx callq 0x377fc leaq 0x3ce8a4(%rip), %r14 # 0x45a0b6 xorl %eax, %eax pushq $0x5 popq %rbp pushq $0x2a popq %r15 leaq 0x4(%rsp), %r12 movl %eax, 0x4(%rsp) cmpl 0x98(%rbx), %eax je 0x8b879 movq 0x38(%rbx), %rcx cltq movq 0x50(%rbx), %rdx movq (%r13), %rdi leaq (%rcx,%rax,4), %r9 movslq (%r9), %rax imulq $0x38, %rax, %rax leaq 0x10(%rdx,%rax), %r10 leaq 0x30(%rdx,%rax), %r11 leaq 0x20(%rdx,%rax), %rax subq $0x8, %rsp movq %r15, %rdx movl %ebp, %esi movq %r14, %rcx movq %r12, %r8 pushq %rax pushq %r11 pushq %r10 callq 0x3783f addq $0x20, %rsp movl 0x4(%rsp), %eax incl %eax jmp 0x8b820 leaq 0x8(%rsp), %rdi callq 0x378b4 addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x8b894 movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::optimize_functor<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<long double>, long double, baryonyx::itm::maximize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double)
void operator()(const std::atomic_bool& stop_task, best_solution_recorder<Cost, Float, Mode>& best_recorder, const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { bit_array x(variables); auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_local_ctx.rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const auto w_limit = static_cast<long int>(p.w); Solver slv(m_local_ctx.rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); bool is_a_solution = false; while (!stop_task.load()) { ++m_call_number; const auto kappa_start = static_cast<Float>(best_recorder.reinit( m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x)); auto kappa = kappa_start; compute.init(slv, x); auto best_remaining = INT_MAX; is_a_solution = false; for (long int i = 0; !stop_task.load() && i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta); if (remaining == 0) { best_recorder.try_update( m_local_ctx, x, original_costs.results(x, cost_constant), i); best_remaining = 0; is_a_solution = true; break; } else { best_remaining = std::min(remaining, best_remaining); } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; } if (best_remaining > 0) { best_recorder.try_advance( m_local_ctx, x, best_remaining, p.limit); continue; } for (int push = 0; !stop_task.load() && push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_local_ctx.rng, pushing_k_factor, delta, theta, pushing_objective_amplifier); if (remaining == 0) { best_recorder.try_update( m_local_ctx, x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); is_a_solution = true; } kappa = kappa_start; for (int iter = 0; !stop_task.load() && iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run( slv, x, m_local_ctx.rng, kappa, delta, theta); if (remaining == 0) { best_recorder.try_update( m_local_ctx, x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); is_a_solution = true; break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; } } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1e8, %rsp # imm = 0x1E8 movq %rdi, %rbp leaq 0x58(%rsp), %rdi movq %rsi, %r15 movl %r8d, %esi vmovsd %xmm0, 0x88(%rsp) movq %r9, %r12 movl %r8d, %ebx movq %rcx, %r14 movq %rdx, 0x68(%rsp) callq 0x368ae movq (%rbp), %r13 movq %rbp, 0xb0(%rsp) addq $0x8, %rbp leaq 0xb8(%rsp), %rdi movq %r13, %rsi movq %r12, 0x80(%rsp) movq %r12, %rdx movq %rbp, %rcx movl %ebx, %r8d callq 0x8d226 fldl 0x20(%r13) fstpt 0xe0(%rsp) vxorpd %xmm1, %xmm1, %xmm1 fldl 0x28(%r13) fstpt 0xec(%rsp) fldl 0x30(%r13) fstpt 0xd4(%rsp) fldl 0x8(%r13) vmovsd 0x10(%r13), %xmm0 fld %st(0) fstpt 0x44(%rsp) vucomisd %xmm0, %xmm1 jbe 0x8cd41 movq 0xb0(%rsp), %rax movq (%rax), %rdi leaq 0xb8(%rsp), %rsi movl %ebx, %edx fstpt (%rsp) callq 0x8d304 fstpt 0x94(%rsp) jmp 0x8cd5a fstp %st(0) vmovsd %xmm0, 0x108(%rsp) fldl 0x108(%rsp) fstpt 0x94(%rsp) fldl 0x38(%r13) fstpt 0x11c(%rsp) fldl 0x40(%r13) fstpt 0x110(%rsp) vcvttsd2si 0xa0(%r13), %rax movq %rax, 0xf8(%rsp) movq 0x8(%r14), %rax subq (%r14), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0x160(%rsp), %rdi leaq 0xb8(%rsp), %r8 movq %rbp, %rsi movl %eax, %edx movl %ebx, %ecx movq %r14, %r9 callq 0x8d378 movl 0xcc(%r13), %esi leaq 0x128(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq $0x0, 0x50(%rsp) movb (%r15), %al testb $0x1, %al jne 0x8d18e movq 0xb0(%rsp), %rax incq 0xb0(%rax) vmovsd 0x18(%r13), %xmm0 vmovsd 0x28(%r13), %xmm1 movzbl 0x50(%rsp), %edx movq 0x68(%rsp), %rdi leaq 0x58(%rsp), %rbx movq %rbp, %rsi movq %rbx, %rcx andl $0x1, %edx callq 0x8d5a0 vmovsd %xmm0, 0x100(%rsp) fldl 0x100(%rsp) fstpt 0xc8(%rsp) leaq 0x128(%rsp), %rdi leaq 0x160(%rsp), %rsi movq %rbx, %rdx callq 0x8d6a0 fldt 0xc8(%rsp) fldt 0x44(%rsp) movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF xorl %r14d, %r14d movb (%r15), %al testb $0x1, %al jne 0x8cf23 cmpq 0xb0(%r13), %r14 je 0x8cf23 fstpt 0x20(%rsp) leaq 0x128(%rsp), %rdi leaq 0x160(%rsp), %rsi leaq 0x58(%rsp), %rdx movq %rbp, %rcx fldt 0x94(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x74(%rsp) fstpt (%rsp) callq 0x8d6e2 testl %eax, %eax je 0x8cf3d cmpl %eax, %ebx cmovgel %eax, %ebx cmpq 0xf8(%rsp), %r14 jle 0x8cf02 movl %eax, 0xa8(%rsp) fildl 0xa8(%rsp) movl 0x1e0(%rsp), %eax movl %eax, 0xac(%rsp) fidivl 0xac(%rsp) fldt 0xd4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xe0(%rsp) fmulp %st, %st(1) fldt 0x74(%rsp) faddp %st, %st(1) fldt 0x44(%rsp) jmp 0x8cf0c fldt 0x44(%rsp) fldt 0x74(%rsp) fxch %st(1) fldt 0xec(%rsp) fxch %st(2) fucomi %st(2), %st fstp %st(2) ja 0x8cf23 incq %r14 jmp 0x8ce53 fstp %st(1) testl %ebx, %ebx jg 0x8d16c movq $0x0, 0x50(%rsp) leaq 0x58(%rsp), %rbx jmp 0x8cf79 vmovsd 0x88(%rsp), %xmm0 movq 0x80(%rsp), %rdi leaq 0x58(%rsp), %rbx movq %rbx, %rsi callq 0x8b74a movq 0x68(%rsp), %rdi movq %rbp, %rsi movq %rbx, %rdx movq %r14, %rcx callq 0x8d912 movb $0x1, %al movq %rax, 0x50(%rsp) fldt 0x44(%rsp) xorl %r14d, %r14d movl $0x0, 0x70(%rsp) movb (%r15), %al testb $0x1, %al jne 0x8d165 cmpl 0xbc(%r13), %r14d jge 0x8d165 fldt 0x110(%rsp) fstpt 0x30(%rsp) fstpt 0x20(%rsp) leaq 0x128(%rsp), %rdi leaq 0x160(%rsp), %rsi movq %rbx, %rdx movq %rbp, %rcx fldt 0x94(%rsp) fstpt 0x10(%rsp) fldt 0x11c(%rsp) fstpt (%rsp) callq 0x8da1c testl %eax, %eax jne 0x8d01f vmovsd 0x88(%rsp), %xmm0 movq 0x80(%rsp), %rdi movq %rbx, %rsi callq 0x8b74a movl 0xc0(%r13), %eax movq 0x68(%rsp), %rdi movq %rbp, %rsi movq %rbx, %rdx imull %r14d, %eax notl %eax movslq %eax, %rcx callq 0x8d912 movb $0x1, %al movq %rax, 0x50(%rsp) pushq $0x1 popq %rax fldt 0xc8(%rsp) fldt 0x44(%rsp) movl %eax, %ebx movb (%r15), %al testb $0x1, %al jne 0x8d103 leal -0x1(%rbx), %r12d cmpl 0xc0(%r13), %r12d jge 0x8d103 fstpt 0x20(%rsp) leaq 0x128(%rsp), %rdi leaq 0x160(%rsp), %rsi leaq 0x58(%rsp), %rdx movq %rbp, %rcx fldt 0x94(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x74(%rsp) fstpt (%rsp) callq 0x8d6e2 testl %eax, %eax je 0x8d10c vcvtsi2sd %r12d, %xmm2, %xmm0 vucomisd 0xa0(%r13), %xmm0 jbe 0x8d0e3 movl %eax, 0xa0(%rsp) fildl 0xa0(%rsp) movl 0x1e0(%rsp), %eax movl %eax, 0xa4(%rsp) fidivl 0xa4(%rsp) fldt 0xd4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xe0(%rsp) fmulp %st, %st(1) fldt 0x74(%rsp) faddp %st, %st(1) fldt 0x44(%rsp) jmp 0x8d0ed fldt 0x44(%rsp) fldt 0x74(%rsp) fxch %st(1) fldt 0xec(%rsp) fxch %st(2) fucomi %st(2), %st fstp %st(2) ja 0x8d103 incl %ebx jmp 0x8d02f fstp %st(1) leaq 0x58(%rsp), %rbx jmp 0x8d159 vmovsd 0x88(%rsp), %xmm0 movq 0x80(%rsp), %rdi leaq 0x58(%rsp), %r12 movq %r12, %rsi callq 0x8b74a movl 0xc0(%r13), %eax movq 0x68(%rsp), %rdi movq %rbp, %rsi movq %r12, %rdx imull 0x70(%rsp), %eax subl %ebx, %eax movq %r12, %rbx movslq %eax, %rcx callq 0x8d912 movb $0x1, %al movq %rax, 0x50(%rsp) fldt 0x44(%rsp) decl 0x70(%rsp) incl %r14d jmp 0x8cf84 fstp %st(0) jmp 0x8cdce fstp %st(0) movq 0xb0(%r13), %r8 movq 0x68(%rsp), %rdi leaq 0x58(%rsp), %rdx movq %rbp, %rsi movl %ebx, %ecx callq 0x8d99a jmp 0x8cdc5 leaq 0x128(%rsp), %rdi callq 0x393ac leaq 0x160(%rsp), %rdi callq 0x8dca8 leaq 0xc0(%rsp), %rdi callq 0x8affa leaq 0x60(%rsp), %rdi callq 0x357fe addq $0x1e8, %rsp # imm = 0x1E8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x8d1d8 movq %rax, %rbx jmp 0x8d1fa movq %rax, %rbx jmp 0x8d207 movq %rax, %rbx jmp 0x8d214 jmp 0x8d1ea jmp 0x8d1ea jmp 0x8d1ea jmp 0x8d1ea leaq 0x128(%rsp), %rdi movq %rax, %rbx callq 0x393ac leaq 0x160(%rsp), %rdi callq 0x8dca8 leaq 0xc0(%rsp), %rdi callq 0x8affa leaq 0x60(%rsp), %rdi callq 0x357fe movq %rbx, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::default_cost_type<long double> baryonyx::itm::normalize_costs<long double, baryonyx::itm::default_cost_type<long double>>(baryonyx::context const&, baryonyx::itm::default_cost_type<long double> const&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int)
inline Cost normalize_costs(const context& ctx, const Cost& c, random_engine& rng, int n) { Cost ret(c, n); switch (ctx.parameters.cost_norm) { case solver_parameters::cost_norm_type::none: info(ctx, " - No norm"); return ret; case solver_parameters::cost_norm_type::random: info(ctx, " - Compute random norm\n"); ret.make_random_norm(n, rng); return ret; case solver_parameters::cost_norm_type::l1: info(ctx, " - Compute l1 norm\n"); ret.make_l1_norm(n); return ret; case solver_parameters::cost_norm_type::l2: info(ctx, " - Compute l2 norm\n"); ret.make_l2_norm(n); return ret; default: info(ctx, " - Compute infinity-norm (default)\n"); ret.make_loo_norm(n); return ret; } }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rsi, %r14 movq %rdx, %rsi movl %r8d, %edx movl %r8d, %ebp movq %rcx, %r15 movq %rdi, %rbx callq 0x8dce6 movl 0xd8(%r14), %eax cmpq $0x3, %rax ja 0x8d2c6 leaq 0x3ccab0(%rip), %rcx # 0x459d08 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x3cce7f(%rip), %rsi # 0x45a0e7 movq %r14, %rdi callq 0x348e9 jmp 0x8d2df leaq 0x3cce93(%rip), %rsi # 0x45a10c movq %r14, %rdi callq 0x348e9 movq %rbx, %rdi movl %ebp, %esi callq 0x8df4c jmp 0x8d2df leaq 0x3cce8d(%rip), %rsi # 0x45a121 movq %r14, %rdi callq 0x348e9 movq %rbx, %rdi movl %ebp, %esi callq 0x8dfb4 jmp 0x8d2df leaq 0x3cce44(%rip), %rsi # 0x45a0f3 movq %r14, %rdi callq 0x348e9 movq %rbx, %rdi movl %ebp, %esi movq %r15, %rdx callq 0x8dd3c jmp 0x8d2df leaq 0x3cce69(%rip), %rsi # 0x45a136 movq %r14, %rdi callq 0x348e9 movq %rbx, %rdi movl %ebp, %esi callq 0x8e01c movq %rbx, %rax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq addq $0x8, %rbx movq %rax, %r14 movq %rbx, %rdi callq 0x8affa movq %r14, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-common.hpp
long double baryonyx::itm::compute_delta<long double, baryonyx::itm::default_cost_type<long double>>(baryonyx::context const&, baryonyx::itm::default_cost_type<long double> const&, long double, int)
inline Float compute_delta(const context& ctx, const Cost& c, Float theta, int n) { info(ctx, " - delta not defined, compute it:\n"); const auto mini = c.min(n); const auto ret = mini - theta * mini; info(ctx, " - delta={} (min normalized cost:{} / theta: {})\n", ret, mini, theta); return ret; }
pushq %r15 pushq %r14 pushq %rbx subq $0x40, %rsp movq %rsi, %r14 leaq 0x3ccebd(%rip), %rsi # 0x45a1d4 fldt 0x60(%rsp) fld %st(0) fstpt 0x4(%rsp) movl %edx, %ebx movq %rdi, %r15 fstpt 0x30(%rsp) callq 0x348e9 movq %r14, %rdi movl %ebx, %esi callq 0x8ee30 fld %st(0) fstpt 0x20(%rsp) leaq 0x3cceb2(%rip), %rsi # 0x45a1f8 leaq 0x10(%rsp), %rdx leaq 0x20(%rsp), %rcx leaq 0x30(%rsp), %r8 movq %r15, %rdi fldt 0x4(%rsp) fmul %st(1), %st fsubrp %st, %st(1) fstpt 0x10(%rsp) callq 0x8ee71 fldt 0x10(%rsp) addq $0x40, %rsp popq %rbx popq %r14 popq %r15 retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>::solver_random_inequalities_101coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::default_cost_type<long double> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&)
solver_random_inequalities_101coeff( random_engine& rng_, int m_, int n_, const cost_type& c_, const std::vector<merged_constraint>& csts) : rng(rng_) , ap(csts, m_, n_) , A(std::make_unique<int[]>(ap.size())) , R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts))) , b(std::make_unique<bound_factor[]>(m_)) , pi(std::make_unique<Float[]>(m_)) , P(std::make_unique<Float[]>(ap.size())) , c(c_) , dist(0.5) , m(m_) , n(n_) { int id = 0; for (int i = 0, e = length(csts); i != e; ++i) { int lower = 0, upper = 0; for (const auto& cst : csts[i].elements) { bx_ensures(std::abs(cst.factor) == 1); A[id++] = cst.factor; if (cst.factor > 0) upper++; else lower++; } if (csts[i].min == csts[i].max) { b[i].min = csts[i].min; b[i].max = csts[i].max; } else { b[i].min = std::max(-lower, csts[i].min); b[i].max = std::min(upper, csts[i].max); } bx_ensures(b[i].min <= b[i].max); } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp leaq 0x8(%rdi), %r13 movq %rsi, (%rdi) movq %rdi, %r15 movq %r9, %r12 movq %r8, 0x20(%rsp) movl %edx, %r14d movq %r9, %rsi movl %ecx, 0x4(%rsp) movq %r13, %rdi callq 0x3a4ca movl 0x30(%r15), %esi leaq 0x48(%r15), %rbx movq %rbx, %rdi movq %r13, 0x18(%rsp) callq 0x28eb6 movq %r12, %rdi leaq 0x50(%r15), %rbp callq 0x3a89d movq %rbp, 0x10(%rsp) movq %rbp, %rdi movq %rax, %rsi callq 0x8eefe movslq %r14d, %rbp leaq 0x58(%r15), %rdi movq %rbp, %rsi movq %rdi, 0x8(%rsp) callq 0x8ef3e leaq 0x60(%r15), %r13 movq %r13, %rdi movq %rbp, %rsi callq 0x8afb9 movl 0x30(%r15), %esi leaq 0x68(%r15), %rdi callq 0x8afb9 movq 0x20(%rsp), %rax movq %rax, 0x70(%r15) movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000 movq %rax, 0x78(%r15) movl 0x4(%rsp), %eax movl %r14d, 0x80(%r15) movl %eax, 0x84(%r15) movq (%r12), %rcx movq 0x8(%r12), %rax subq %rcx, %rax pushq $0x28 popq %rsi cqto xorl %edi, %edi idivq %rsi movq 0x58(%r15), %rdx xorl %esi, %esi movl %eax, %eax cmpq %rax, %rsi je 0x8d522 imulq $0x28, %rsi, %r8 movq (%rbx), %r15 movslq %edi, %rdi xorl %r10d, %r10d movq (%rcx,%r8), %r11 movq 0x8(%rcx,%r8), %r14 leaq (%rcx,%r8), %r9 xorl %r8d, %r8d cmpq %r14, %r11 je 0x8d4b5 movl (%r11), %r12d leal 0x1(%r12), %ebp testl $0xfffffffd, %ebp # imm = 0xFFFFFFFD jne 0x8d531 movl %r12d, (%r15,%rdi,4) incq %rdi xorl %ebp, %ebp xorl %r12d, %r12d cmpl $0x0, (%r11) setle %bpl setg %r12b addq $0x8, %r11 addl %r12d, %r10d addl %ebp, %r8d jmp 0x8d478 movl 0x18(%r9), %r11d cmpl 0x1c(%r9), %r11d jne 0x8d4cc imulq $0xc, %rsi, %r8 movl %r11d, (%rdx,%r8) movl %r11d, %r8d jmp 0x8d4ec negl %r8d cmpl %r8d, %r11d cmovgl %r11d, %r8d imulq $0xc, %rsi, %r11 movl %r8d, (%rdx,%r11) movl 0x1c(%r9), %r9d cmpl %r10d, %r9d cmovll %r9d, %r10d movl %r10d, %r11d imulq $0xc, %rsi, %r9 incq %rsi movl %r11d, 0x4(%rdx,%r9) cmpl %r11d, %r8d jle 0x8d452 leaq 0x3caf22(%rip), %rdi # 0x45842a leaq 0x3ccd9a(%rip), %rsi # 0x45a2a9 leaq 0x3ccd31(%rip), %rdx # 0x45a247 leaq 0x3ccda1(%rip), %rcx # 0x45a2be callq 0x2813f addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3caef2(%rip), %rdi # 0x45842a leaq 0x3cccee(%rip), %rsi # 0x45a22d leaq 0x3ccd01(%rip), %rdx # 0x45a247 leaq 0x3ccd59(%rip), %rcx # 0x45a2a6 callq 0x2813f movq %r13, %rdi movq %rax, %r14 callq 0x8affa jmp 0x8d562 movq %rax, %r14 movq 0x8(%rsp), %rdi callq 0x8ef7c jmp 0x8d571 movq %rax, %r14 movq 0x10(%rsp), %rdi callq 0x8ef96 jmp 0x8d580 movq %rax, %r14 movq %rbx, %rdi callq 0x28fb6 jmp 0x8d58d movq %rax, %r14 movq 0x18(%rsp), %rdi callq 0x3a954 movq %r14, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/random-solver.cpp
baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<long double>, long double, baryonyx::itm::maximize_tag>::reinit(baryonyx::itm::local_context&, bool, double, double, baryonyx::bit_array&)
double reinit(local_context& ctx, const bool /*is_solution*/, const double kappa_min, const double kappa_max, bit_array& x) { to_log(stdout, 3u, "- reinitinialization thread {}.\n", ctx.thread_id); double kappa = kappa_min; if (m_kappa_append[ctx.thread_id] < ctx.init_kappa_improve_stop) { m_kappa_append[ctx.thread_id] += ctx.init_kappa_improve_increase; kappa = kappa_min + (kappa_max - kappa_min) * m_kappa_append[ctx.thread_id]; to_log(stdout, 5u, "- improve with kappa {}\n", kappa); } else { m_kappa_append[ctx.thread_id] = ctx.init_kappa_improve_start; crossover(ctx, x); to_log(stdout, 5u, "- crossover\n"); } mutation(ctx, x); return kappa; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x18, %rsp movq 0x5afa16(%rip), %r12 # 0x63cfc8 movq %rdi, %r15 movq %rcx, %rbx leaq 0x3ccd9c(%rip), %rcx # 0x45a35b vmovsd %xmm1, 0x8(%rsp) vmovsd %xmm0, 0x10(%rsp) movq %rsi, %r14 leaq 0xa0(%rsi), %r8 movq (%r12), %rdi pushq $0x3 popq %rsi pushq $0x20 popq %rdx callq 0x3be57 vmovsd 0x10(%rsp), %xmm2 vmovsd %xmm2, (%rsp) movl 0xa0(%r14), %eax movq 0xa8(%r15), %rcx vmovsd 0x98(%r14), %xmm1 vmovsd (%rcx,%rax,8), %xmm0 vucomisd %xmm0, %xmm1 jbe 0x8d64e vaddsd 0x90(%r14), %xmm0, %xmm0 vmovsd 0x8(%rsp), %xmm1 movq %rsp, %r8 vsubsd %xmm2, %xmm1, %xmm1 vmovsd %xmm0, (%rcx,%rax,8) leaq 0x3ccd49(%rip), %rcx # 0x45a37c vfmadd213sd %xmm2, %xmm0, %xmm1 # xmm1 = (xmm0 * xmm1) + xmm2 movq (%r12), %rdi vmovsd %xmm1, (%r8) pushq $0x5 popq %rsi pushq $0x18 popq %rdx callq 0x3bea4 jmp 0x8d681 vmovsd 0x88(%r14), %xmm0 leaq 0x8(%r15), %rdi movq %r14, %rsi movq %rbx, %rdx vmovsd %xmm0, (%rcx,%rax,8) callq 0x8f126 movq (%r12), %rdi leaq 0x3ccd1f(%rip), %rcx # 0x45a395 pushq $0x5 popq %rsi pushq $0xc popq %rdx callq 0x377fc movq %r15, %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x8efcc vmovsd (%rsp), %xmm0 addq $0x18, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>> const&, baryonyx::bit_array const&)
void init(const Solver& s, const Xtype& x) { switch (order) { case solver_parameters::constraint_order::infeasibility_decr: case solver_parameters::constraint_order::infeasibility_incr: infeasibility_local_compute_violated_constraints(s, x); break; case solver_parameters::constraint_order::pi_sign_change: std::iota(R.begin(), R.end(), 0); break; case solver_parameters::constraint_order::none: case solver_parameters::constraint_order::reversing: case solver_parameters::constraint_order::random_sorting: case solver_parameters::constraint_order::lagrangian_decr: case solver_parameters::constraint_order::lagrangian_incr: default: compute_violated_constraints(s, x, R); break; } }
movl 0x30(%rdi), %ecx movq %rdi, %rax leal -0x3(%rcx), %edi cmpl $0x2, %edi jae 0x8d6b6 movq %rax, %rdi jmp 0x8f420 cmpl $0x7, %ecx jne 0x8d6d3 movq (%rax), %rcx movq 0x8(%rax), %rax xorl %edx, %edx cmpq %rax, %rcx je 0x8d6e1 movl %edx, (%rcx) incl %edx addq $0x4, %rcx jmp 0x8d6c4 movq %rsi, %rdi movq %rdx, %rsi movq %rax, %rdx jmp 0x8f522 retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array, long double>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double)
int run(Solver& solver, Xtype& x, random_engine& rng, Float kappa, Float delta, Float theta) { bool pi_changed = false; int remaining = 0; switch (order) { case solver_parameters::constraint_order::reversing: solver.compute_update_row( x, R.crbegin(), R.crend(), kappa, delta, theta); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::random_sorting: std::shuffle(R.begin(), R.end(), rng); solver.compute_update_row( x, R.begin(), R.end(), kappa, delta, theta); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::infeasibility_decr: std::sort(m_order.begin(), m_order.end(), [](const auto& lhs, const auto& rhs) { return rhs.second < lhs.second; }); solver.compute_update_row( x, m_order.cbegin(), m_order.cend(), kappa, delta, theta); return infeasibility_local_compute_violated_constraints(solver, x); case solver_parameters::constraint_order::infeasibility_incr: std::sort(m_order.begin(), m_order.end(), [](const auto& lhs, const auto& rhs) { return lhs.second < rhs.second; }); solver.compute_update_row( x, m_order.cbegin(), m_order.cend(), kappa, delta, theta); return infeasibility_local_compute_violated_constraints(solver, x); case solver_parameters::constraint_order::lagrangian_decr: std::sort( R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) { return solver.pi[rhs] < solver.pi[lhs]; }); solver.compute_update_row( x, R.cbegin(), R.cend(), kappa, delta, theta); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::lagrangian_incr: std::sort( R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) { return solver.pi[lhs] < solver.pi[rhs]; }); solver.compute_update_row( x, R.cbegin(), R.cend(), kappa, delta, theta); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::pi_sign_change: std::shuffle(R.begin(), R.end(), rng); pi_changed = solver.compute_update_row( x, R.begin(), R.end(), kappa, delta, theta); remaining = local_compute_violated_constraints(solver, x); if (!pi_changed && remaining == 0) return 0; return remaining; case solver_parameters::constraint_order::none: default: solver.compute_update_row( x, R.begin(), R.end(), kappa, delta, theta); return compute_violated_constraints(solver, x, R); } }
pushq %r15 pushq %r14 pushq %rbx subq $0x70, %rsp fldt 0xb0(%rsp) fldt 0xa0(%rsp) fldt 0x90(%rsp) movl 0x30(%rdi), %eax movq %rdx, %rbx movq %rsi, %r15 movq %rdi, %r14 decl %eax cmpl $0x6, %eax ja 0x8d803 leaq 0x3cc5fa(%rip), %rdx # 0x459d18 movslq (%rdx,%rax,4), %rax addq %rdx, %rax jmpq *%rax movq 0x8(%r14), %rax leaq 0x68(%rsp), %rdx leaq 0x60(%rsp), %rcx movq %r15, %rdi movq %rbx, %rsi movq %rax, (%rdx) movq (%r14), %rax movq %rax, (%rcx) fxch %st(2) fstpt 0x20(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0x8f618 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0x8f522 addq $0x70, %rsp popq %rbx popq %r14 popq %r15 retq movq (%r14), %rdi movq 0x8(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) movq %r15, %rdx fstpt 0x3c(%rsp) callq 0x919e3 jmp 0x8d877 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) fstpt 0x3c(%rsp) callq 0x9110d jmp 0x8d7c2 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) fstpt 0x3c(%rsp) callq 0x91578 movq 0x18(%r14), %rdx movq 0x20(%r14), %rcx fldt 0x3c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x48(%rsp) fstpt 0x10(%rsp) fldt 0x54(%rsp) fstpt (%rsp) callq 0x8ff0a movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0x9037c movq (%r14), %rdx movq 0x8(%r14), %rcx fxch %st(2) fstpt 0x20(%rsp) fstpt 0x10(%rsp) jmp 0x8d84c movq (%r14), %rdi movq 0x8(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) movq %rcx, %rdx fstpt 0x3c(%rsp) callq 0x3ceed movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x3c(%rsp) fstpt 0x20(%rsp) fldt 0x48(%rsp) fstpt 0x10(%rsp) fldt 0x54(%rsp) fstpt (%rsp) movq %r15, %rdi movq %rbx, %rsi callq 0x8fa98 jmp 0x8d8a0 movq (%r14), %rdi movq 0x8(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) movq %r15, %rdx fstpt 0x3c(%rsp) callq 0x91f37 movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x3c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x48(%rsp) fstpt 0x10(%rsp) fldt 0x54(%rsp) fstpt (%rsp) callq 0x9047e movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0x8f522 movq (%r14), %rdi movq 0x8(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) movq %rcx, %rdx fstpt 0x3c(%rsp) callq 0x3ceed movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x3c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x48(%rsp) fstpt 0x10(%rsp) fldt 0x54(%rsp) fstpt (%rsp) callq 0x8fa98 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0x908f0
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<long double>, long double, baryonyx::itm::maximize_tag>::try_update(baryonyx::itm::local_context&, baryonyx::bit_array const&, double, long)
void try_update(local_context& ctx, const bit_array& solution, const double value, const long int loop) { auto hash = bit_array_hash()(solution); if (m_storage.can_be_inserted(hash, value)) { const auto end = std::chrono::steady_clock::now(); const auto duration = compute_duration(m_start, end); m_storage.insert(ctx, solution, hash, value, duration, loop); } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rdi, %r13 leaq 0xf(%rsp), %rdi movq %rsi, %r15 movq %rdx, %rsi movq %rcx, %rbx vmovsd %xmm0, 0x10(%rsp) movq %rdx, %r14 callq 0x3775a vmovsd 0x10(%rsp), %xmm0 leaq 0x8(%r13), %rbp movq %rax, %r12 movq %rax, %rsi movq %rbp, %rdi callq 0x92488 testb %al, %al je 0x8d98b callq 0xb5a0 subq (%r13), %rax movq %rbp, %rdi movq %r15, %rsi movq %r14, %rdx movq %r12, %rcx movq %rbx, %r8 vcvtsi2sd %rax, %xmm1, %xmm0 vdivsd 0x3cc100(%rip), %xmm0, %xmm1 # 0x459a80 vmovsd 0x10(%rsp), %xmm0 callq 0x92508 addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<long double>, long double, baryonyx::itm::maximize_tag>::try_advance(baryonyx::itm::local_context&, baryonyx::bit_array const&, int, long)
void try_advance(local_context& ctx, const bit_array& solution, const int remaining_constraints, const long int loop) { auto hash = bit_array_hash()(solution); if (m_storage.can_be_inserted(hash, remaining_constraints)) { const auto end = std::chrono::steady_clock::now(); const auto duration = compute_duration(m_start, end); m_storage.insert( ctx, solution, hash, remaining_constraints, duration, loop); } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rdi, %r13 leaq 0xf(%rsp), %rdi movq %rsi, %r15 movq %rdx, %rsi movq %r8, 0x10(%rsp) movl %ecx, %ebp movq %rdx, %r14 callq 0x3775a leaq 0x8(%r13), %rbx movq %rax, %r12 movq %rax, %rsi movl %ebp, %edx movq %rbx, %rdi callq 0x92688 testb %al, %al je 0x8da0c callq 0xb5a0 subq (%r13), %rax movq 0x10(%rsp), %r9 movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx movq %r12, %rcx movl %ebp, %r8d vcvtsi2sd %rax, %xmm0, %xmm0 vdivsd 0x3cc079(%rip), %xmm0, %xmm0 # 0x459a80 callq 0x926f2 addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array, long double>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double, long double)
int push_and_run(Solver& solver, Xtype& x, random_engine& rng, Float kappa, Float delta, Float theta, Float objective_amplifier) { bool pi_changed = 0; int remaining = 0; if (use_cycle) order = next_state(order); switch (order) { case solver_parameters::constraint_order::reversing: solver.push_and_compute_update_row(x, R.crbegin(), R.crend(), kappa, delta, theta, objective_amplifier); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::random_sorting: std::shuffle(R.begin(), R.end(), rng); solver.push_and_compute_update_row( x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::infeasibility_decr: std::sort(m_order.begin(), m_order.end(), [](const auto& lhs, const auto& rhs) { return rhs.second < lhs.second; }); solver.push_and_compute_update_row(x, m_order.cbegin(), m_order.cend(), kappa, delta, theta, objective_amplifier); return infeasibility_local_compute_violated_constraints(solver, x); case solver_parameters::constraint_order::infeasibility_incr: std::sort(m_order.begin(), m_order.end(), [](const auto& lhs, const auto& rhs) { return lhs.second < rhs.second; }); solver.push_and_compute_update_row(x, m_order.cbegin(), m_order.cend(), kappa, delta, theta, objective_amplifier); return infeasibility_local_compute_violated_constraints(solver, x); case solver_parameters::constraint_order::lagrangian_decr: std::sort( R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) { return solver.pi[rhs] < solver.pi[lhs]; }); solver.push_and_compute_update_row(x, R.cbegin(), R.cend(), kappa, delta, theta, objective_amplifier); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::lagrangian_incr: std::sort( R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) { return solver.pi[lhs] < solver.pi[rhs]; }); solver.push_and_compute_update_row(x, R.cbegin(), R.cend(), kappa, delta, theta, objective_amplifier); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::pi_sign_change: std::shuffle(R.begin(), R.end(), rng); pi_changed = solver.push_and_compute_update_row( x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier); remaining = local_compute_violated_constraints(solver, x); if (!pi_changed && remaining == 0) return 0; return remaining; case solver_parameters::constraint_order::none: default: solver.push_and_compute_update_row(x, R.cbegin(), R.cend(), kappa, delta, theta, objective_amplifier); return compute_violated_constraints(solver, x, R); } }
pushq %r15 pushq %r14 pushq %rbx subq $0x80, %rsp fldt 0xd0(%rsp) fldt 0xc0(%rsp) fldt 0xb0(%rsp) fldt 0xa0(%rsp) movl 0x30(%rdi), %eax cmpb $0x1, 0x34(%rdi) movq %rdx, %rbx movq %rsi, %r15 movq %rdi, %r14 jne 0x8da67 xorl %esi, %esi leal 0x1(%rax), %edx cmpl $0x7, %eax cmovll %edx, %esi movl %esi, %eax movl %esi, 0x30(%r14) decl %eax cmpl $0x6, %eax ja 0x8db7c leaq 0x3cc2bb(%rip), %rdx # 0x459d34 movslq (%rdx,%rax,4), %rax addq %rdx, %rax jmpq *%rax movq 0x8(%r14), %rax leaq 0x78(%rsp), %rdx leaq 0x70(%rsp), %rcx movq %r15, %rdi movq %rbx, %rsi movq %rax, (%rdx) movq (%r14), %rax movq %rax, (%rcx) fxch %st(3) fstpt 0x30(%rsp) fxch %st(1) fstpt 0x20(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0x927f2 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0x8f522 addq $0x80, %rsp popq %rbx popq %r14 popq %r15 retq fstp %st(3) movq (%r14), %rdi movq 0x8(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) movq %r15, %rdx fstpt 0x4c(%rsp) callq 0x93103 jmp 0x8dc01 fstp %st(3) movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) fstpt 0x4c(%rsp) callq 0x9282d jmp 0x8db38 fstp %st(3) movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) fstpt 0x4c(%rsp) callq 0x92c98 movq 0x18(%r14), %rdx movq 0x20(%r14), %rcx fldt 0x4c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x58(%rsp) fstpt 0x10(%rsp) fldt 0x64(%rsp) fstpt (%rsp) callq 0x8ff0a movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x80, %rsp popq %rbx popq %r14 popq %r15 jmp 0x9037c fstp %st(3) movq (%r14), %rdx movq 0x8(%r14), %rcx fxch %st(1) fstpt 0x20(%rsp) fstpt 0x10(%rsp) jmp 0x8dc1c fstp %st(3) movq (%r14), %rdi movq 0x8(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) movq %rcx, %rdx fstpt 0x4c(%rsp) callq 0x3ceed movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x4c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x58(%rsp) fstpt 0x10(%rsp) fldt 0x64(%rsp) fstpt (%rsp) callq 0x8fa98 jmp 0x8dc2a fstp %st(3) movq (%r14), %rdi movq 0x8(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) movq %r15, %rdx fstpt 0x4c(%rsp) callq 0x93657 movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x4c(%rsp) fstpt 0x20(%rsp) fldt 0x58(%rsp) fstpt 0x10(%rsp) fldt 0x64(%rsp) fstpt (%rsp) movq %r15, %rdi movq %rbx, %rsi callq 0x9047e movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x80, %rsp popq %rbx popq %r14 popq %r15 jmp 0x8f522 fstp %st(3) movq (%r14), %rdi movq 0x8(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) movq %rcx, %rdx fstpt 0x4c(%rsp) callq 0x3ceed movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x4c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x58(%rsp) fstpt 0x10(%rsp) fldt 0x64(%rsp) fstpt (%rsp) callq 0x8fa98 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x80, %rsp popq %rbx popq %r14 popq %r15 jmp 0x908f0
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::default_cost_type<long double>::default_cost_type(baryonyx::itm::default_cost_type<long double> const&, int)
default_cost_type(const default_cost_type& other, int n) : obj(other.obj) , linear_elements(std::make_unique<Float[]>(n)) { std::copy_n(other.linear_elements.get(), n, linear_elements.get()); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq (%rsi), %rax movq %rdi, %r15 addq $0x8, %r15 movslq %edx, %r12 movq %rsi, %r14 movl %edx, %ebx movq %r12, %rsi movq %rax, (%rdi) movq %r15, %rdi callq 0x8afb9 testl %r12d, %r12d jle 0x8dd30 movq (%r15), %rdi movq 0x8(%r14), %rsi movl %ebx, %edx shlq $0x4, %rdx addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 jmp 0xb140 addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
void baryonyx::itm::default_cost_type<long double>::make_random_norm<std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>>(int, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&)
void make_random_norm(int n, Random& rng) { std::vector<std::pair<Float, int>> r(n); for (int i = 0; i != n; ++i) r[i] = { linear_elements[i], i }; std::sort(r.begin(), r.end(), [](const auto& lhs, const auto& rhs) { return lhs.first < rhs.first; }); auto begin = r.begin(); auto end = r.end(); auto next = r.begin()++; for (; next != end; ++next) { if (next->first != begin->first) { if (std::distance(begin, next) > 1) random_epsilon_unique( begin, next, rng, begin->first, next->first); begin = next; } } if (std::distance(begin, end) > 1) { if (begin == r.begin()) { random_epsilon_unique( begin, end, rng, begin->first, begin->first + 1); } else { auto value = linearize(std::ptrdiff_t(0), r.front().first, std::distance(r.begin(), begin), begin->first, std::distance(r.begin(), r.end())); random_epsilon_unique(begin, end, rng, begin->first, value); } } // Reorder the vector according to the variable index, so, it // restores the initial order. std::sort(r.begin(), r.end(), [](const auto& lhs, const auto& rhs) { return lhs.second < rhs.second; }); for (int i = 0; i != n; ++i) linear_elements[i] = r[i].first; // Finally we compute the l+oo norm. Float div = *std::max_element(linear_elements.get(), linear_elements.get() + n); if (std::isnormal(div)) for (int i = 0; i != n; ++i) linear_elements[i] /= div; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movslq %esi, %rbx movq %rdx, %r15 leaq 0x28(%rsp), %r12 leaq 0x27(%rsp), %rdx movq %rdi, %r14 movq %r12, %rdi movq %rbx, %rsi callq 0x8e090 movq 0x8(%r14), %rax movq (%r12), %rdi movq %rbx, 0x58(%rsp) movl %ebx, %ebx shlq $0x4, %rbx xorl %ecx, %ecx xorl %edx, %edx cmpq %rdx, %rbx je 0x8dd96 fldt (%rax,%rdx) fstpt (%rdi,%rdx,2) movl %ecx, 0x10(%rdi,%rdx,2) addq $0x10, %rdx incl %ecx jmp 0x8dd7f movq 0x30(%rsp), %rsi movq %r14, 0x60(%rsp) callq 0x8e2b3 movq 0x28(%rsp), %r13 movq 0x30(%rsp), %r12 movq %r13, %rbp movq %r13, %r14 cmpq %r12, %rbp je 0x8de15 fldt (%rbp) fldt (%r14) fxch %st(1) fucomi %st(1), %st jne 0x8ddc8 jnp 0x8ddf7 movq %r13, %rcx subq %r14, %rcx movq %rbp, %rax cmpq $0x21, %rcx jl 0x8de04 fstpt 0x10(%rsp) fstpt (%rsp) movq %r14, %rdi movq %rbp, %rsi movq %r15, %rdx callq 0x8e0e3 fldz fldz movq %rbp, %rax fxch %st(1) jmp 0x8de04 fstp %st(0) fstp %st(0) fldz fldz movq %r14, %rax fxch %st(1) fstp %st(0) fstp %st(0) addq $0x20, %rbp addq $0x20, %r13 movq %rax, %r14 jmp 0x8ddb5 movq %r12, %rax subq %r14, %rax cmpq $0x21, %rax jl 0x8de89 movq 0x28(%rsp), %rax movq %r14, %rsi subq %rax, %rsi je 0x8de6d fldt (%rax) fldt (%r14) movq 0x30(%rsp), %rdx sarq $0x5, %rsi fstpt 0x10(%rsp) fstpt (%rsp) xorl %edi, %edi subq %rax, %rdx sarq $0x5, %rdx callq 0x8e159 fldt (%r14) fxch %st(1) fstpt 0x10(%rsp) fstpt (%rsp) movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x8e0e3 jmp 0x8de89 fldt (%r14) fld1 fadd %st(1), %st fstpt 0x10(%rsp) fstpt (%rsp) movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x8e0e3 movq 0x28(%rsp), %rdi movq 0x30(%rsp), %rsi callq 0x8e902 movq 0x60(%rsp), %r14 movq 0x28(%rsp), %rax xorl %ecx, %ecx movq 0x8(%r14), %rdi cmpq %rcx, %rbx je 0x8deb9 fldt (%rax,%rcx,2) fstpt (%rdi,%rcx) addq $0x10, %rcx jmp 0x8dea8 movq 0x58(%rsp), %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0x8ee05 fldt (%rax) fld %st(0) fstpt 0x40(%rsp) btq $0x3f, 0x40(%rsp) movzwl 0x48(%rsp), %eax setae %cl andl $0x7fff, %eax # imm = 0x7FFF decl %eax movzwl %ax, %eax cmpl $0x7ffe, %eax # imm = 0x7FFE setae %al orb %cl, %al jne 0x8df10 movq 0x8(%r14), %rax xorl %ecx, %ecx cmpq %rcx, %rbx je 0x8df10 fldt (%rax,%rcx) fdiv %st(1), %st fstpt (%rax,%rcx) addq $0x10, %rcx jmp 0x8defd leaq 0x28(%rsp), %rdi fstp %st(0) callq 0x8e1fe addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x8df37 jmp 0x8df37 jmp 0x8df37 jmp 0x8df37 fstp %st(0) fstp %st(0) leaq 0x28(%rsp), %rdi movq %rax, %rbx callq 0x8e1fe movq %rbx, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::default_cost_type<long double>::make_l1_norm(int)
void make_l1_norm(int n) { Float div = { 0 }; for (int i = 0; i != n; ++i) div += std::abs(linear_elements[i]); if (std::isnormal(div)) for (int i = 0; i != n; ++i) linear_elements[i] /= div; }
movq 0x8(%rdi), %rax movl %esi, %ecx shlq $0x4, %rcx xorl %edx, %edx fldz cmpq %rdx, %rcx je 0x8df6c fldt (%rax,%rdx) fabs faddp %st, %st(1) addq $0x10, %rdx jmp 0x8df5a fld %st(0) fstpt -0x18(%rsp) btq $0x3f, -0x18(%rsp) movzwl -0x10(%rsp), %esi setae %dl andl $0x7fff, %esi # imm = 0x7FFF decl %esi movzwl %si, %esi cmpl $0x7ffe, %esi # imm = 0x7FFE setae %sil orb %dl, %sil jne 0x8dfb0 xorl %edx, %edx cmpq %rdx, %rcx je 0x8dfb0 fldt (%rax,%rdx) fdiv %st(1), %st fstpt (%rax,%rdx) addq $0x10, %rdx jmp 0x8df9d fstp %st(0) retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::default_cost_type<long double>::make_l2_norm(int)
void make_l2_norm(int n) { Float div = { 0 }; for (int i = 0; i != n; ++i) div += linear_elements[i] * linear_elements[i]; if (std::isnormal(div)) for (int i = 0; i != n; ++i) linear_elements[i] /= div; }
movq 0x8(%rdi), %rax movl %esi, %ecx shlq $0x4, %rcx xorl %edx, %edx fldz cmpq %rdx, %rcx je 0x8dfd4 fldt (%rax,%rdx) fmul %st, %st(0) faddp %st, %st(1) addq $0x10, %rdx jmp 0x8dfc2 fld %st(0) fstpt -0x18(%rsp) btq $0x3f, -0x18(%rsp) movzwl -0x10(%rsp), %esi setae %dl andl $0x7fff, %esi # imm = 0x7FFF decl %esi movzwl %si, %esi cmpl $0x7ffe, %esi # imm = 0x7FFE setae %sil orb %dl, %sil jne 0x8e018 xorl %edx, %edx cmpq %rdx, %rcx je 0x8e018 fldt (%rax,%rdx) fdiv %st(1), %st fstpt (%rax,%rdx) addq $0x10, %rdx jmp 0x8e005 fstp %st(0) retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::default_cost_type<long double>::make_loo_norm(int)
void make_loo_norm(int n) { Float div = *std::max_element(linear_elements.get(), linear_elements.get() + n); if (std::isnormal(div)) for (int i = 0; i != n; ++i) linear_elements[i] /= div; }
pushq %r14 pushq %rbx subq $0x18, %rsp movq %rdi, %r14 movq 0x8(%rdi), %rdi movl %esi, %ebx movslq %esi, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0x8ee05 fldt (%rax) fld %st(0) fstpt (%rsp) btq $0x3f, (%rsp) movzwl 0x8(%rsp), %eax setae %cl andl $0x7fff, %eax # imm = 0x7FFF decl %eax movzwl %ax, %eax cmpl $0x7ffe, %eax # imm = 0x7FFE setae %al orb %cl, %al jne 0x8e085 movq 0x8(%r14), %rax movl %ebx, %ecx shlq $0x4, %rcx xorl %edx, %edx cmpq %rdx, %rcx je 0x8e085 fldt (%rax,%rdx) fdiv %st(1), %st fstpt (%rax,%rdx) addq $0x10, %rdx jmp 0x8e072 fstp %st(0) addq $0x18, %rsp popq %rbx popq %r14 retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
void baryonyx::itm::random_epsilon_unique<long double, __gnu_cxx::__normal_iterator<std::pair<long double, int>*, std::vector<std::pair<long double, int>, std::allocator<std::pair<long double, int>>>>>(__gnu_cxx::__normal_iterator<std::pair<long double, int>*, std::vector<std::pair<long double, int>, std::allocator<std::pair<long double, int>>>>, __gnu_cxx::__normal_iterator<std::pair<long double, int>*, std::vector<std::pair<long double, int>, std::allocator<std::pair<long double, int>>>>, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double)
inline void random_epsilon_unique(iteratorT begin, iteratorT end, random_engine& rng, floatingpointT min, floatingpointT max) { bx_expects(min != max); std::uniform_real_distribution<floatingpointT> distribution(min, max); for (; begin != end; ++begin) begin->first = distribution(rng); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x28, %rsp fldt 0x60(%rsp) fldt 0x50(%rsp) fucomi %st(1), %st jne 0x8e0fc jnp 0x8e134 fstpt (%rsp) movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 movq %rsp, %r12 fstpt 0x10(%rsp) cmpq %r14, %r15 je 0x8e128 movq %r12, %rdi movq %rbx, %rsi callq 0x8e806 fstpt (%r15) addq $0x20, %r15 jmp 0x8e10f addq $0x28, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq leaq 0x3ca0a3(%rip), %rdi # 0x4581de leaq 0x3cc019(%rip), %rsi # 0x45a15b leaq 0x3cbe43(%rip), %rdx # 0x459f8c leaq 0x3cc016(%rip), %rcx # 0x45a166 fstp %st(1) fstp %st(0) callq 0x2813f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
long double baryonyx::linearize<long, long double>(long, long double, long, long double, long)
constexpr Ytype linearize(Xtype p1x, Ytype p1y, Xtype p2x, Ytype p2y, Xtype value) noexcept { bx_expects(p1x - p2x != 0); auto m = static_cast<double>(p1y - p2y) / static_cast<double>(p1x - p2x); auto p = static_cast<double>(p2y) - m * static_cast<double>(p2x); return static_cast<Ytype>(std::ceil(m * static_cast<double>(value) + p)); }
subq $0x18, %rsp fldt 0x30(%rsp) fldt 0x20(%rsp) subq %rsi, %rdi je 0x8e1ac fsub %st(1), %st fstpl 0x8(%rsp) vcvtsi2sd %rdi, %xmm0, %xmm0 vmovsd 0x8(%rsp), %xmm1 fstpl 0x10(%rsp) vdivsd %xmm0, %xmm1, %xmm0 vcvtsi2sd %rsi, %xmm2, %xmm1 vfnmadd213sd 0x10(%rsp), %xmm0, %xmm1 # xmm1 = -(xmm0 * xmm1) + mem vcvtsi2sd %rdx, %xmm2, %xmm2 vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1 vroundsd $0xa, %xmm2, %xmm2, %xmm0 vmovsd %xmm0, (%rsp) fldl (%rsp) addq $0x18, %rsp retq leaq 0x3ca02b(%rip), %rdi # 0x4581de leaq 0x3cbfb0(%rip), %rsi # 0x45a16a leaq 0x3cbfb8(%rip), %rdx # 0x45a179 leaq 0x3cc008(%rip), %rcx # 0x45a1d0 fstp %st(1) fstp %st(0) callq 0x2813f nop
/quesnel[P]baryonyx/lib/src/utils.hpp
baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<long double>, long double, baryonyx::itm::maximize_tag>::mutation(baryonyx::itm::local_context&, baryonyx::bit_array&)
void mutation(local_context& ctx, bit_array& x) { if (ctx.value_p_dist.mean() == 0.0 && ctx.value_p_dist.stddev() == 0.0) return; double val_p, var_p; do var_p = ctx.variable_p_dist(ctx.rng); while (var_p <= 0.0 || var_p >= 1.0); do val_p = ctx.value_p_dist(ctx.rng); while (val_p < 0.0 || val_p > 1.0); to_log(stdout, 7u, "- mutation variables {}% with " " {}% of set\n", var_p, val_p); std::bernoulli_distribution dist_var_p(var_p); std::bernoulli_distribution dist_value_p(val_p); for (int i = 0, e = x.size(); i != e; ++i) { if (dist_var_p(ctx.rng)) { to_log(stdout, 9u, "- mutate variable {}\n", i); x.set(i, dist_value_p(ctx.rng)); } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp vmovsd 0x48(%rsi), %xmm0 vxorpd %xmm1, %xmm1, %xmm1 movq %rdx, %rbx movq %rsi, %r14 vucomisd %xmm1, %xmm0 jne 0x8f00e jp 0x8f00e vmovsd 0x50(%r14), %xmm0 vucomisd %xmm1, %xmm0 jne 0x8f00e jp 0x8f00e addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x48(%r14), %r15 leaq 0x28(%r14), %r12 movq %r12, %rdi movq %r14, %rsi callq 0x3c480 vxorpd %xmm1, %xmm1, %xmm1 vucomisd %xmm0, %xmm1 jae 0x8f016 vucomisd 0x3c5005(%rip), %xmm0 # 0x454038 jae 0x8f016 vmovsd %xmm0, 0x18(%rsp) movq %r15, %rdi movq %r14, %rsi callq 0x3c480 vxorpd %xmm1, %xmm1, %xmm1 vucomisd %xmm0, %xmm1 ja 0x8f03b vucomisd 0x3c4fe0(%rip), %xmm0 # 0x454038 ja 0x8f03b movq 0x5adf67(%rip), %rax # 0x63cfc8 leaq 0x20(%rsp), %r15 leaq 0x3cb3af(%rip), %rcx # 0x45a41c vmovsd %xmm0, (%r15) movq (%rax), %rdi pushq $0x7 popq %rsi pushq $0x2a popq %rdx leaq 0x18(%rsp), %r12 movq %r15, %r9 movq %r12, %r8 callq 0x3c5d8 vmovsd (%r12), %xmm0 vmovsd (%r15), %xmm1 leaq 0x4(%rsp), %rax andl $0x0, (%rax) xorl %eax, %eax movl (%rbx), %r15d vmovsd %xmm0, 0x10(%rsp) vmovsd %xmm1, 0x8(%rsp) pushq $0x9 popq %rbp pushq $0x15 popq %r13 cmpl %r15d, %eax je 0x8efff movq %r14, %rdi callq 0x36ac3 vmovsd 0x10(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x8f11a movq 0x5adeee(%rip), %rax # 0x63cfc8 leaq 0x3cb366(%rip), %rcx # 0x45a447 leaq 0x4(%rsp), %r8 movl %ebp, %esi movq %r13, %rdx movq (%rax), %rdi callq 0x3c631 movl 0x4(%rsp), %r12d movq %r14, %rdi callq 0x36ac3 vmovsd 0x8(%rsp), %xmm1 xorl %edx, %edx movq %rbx, %rdi movl %r12d, %esi vucomisd %xmm0, %xmm1 seta %dl callq 0x3c67e movl 0x4(%rsp), %eax incl %eax movl %eax, 0x4(%rsp) jmp 0x8f0b6
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::maximize_tag>::crossover(baryonyx::itm::local_context&, baryonyx::bit_array&)
void crossover(local_context& ctx, bit_array& x) { m_indices_reader lock(m_indices_mutex); if (ctx.crossover_bastert_insertion(ctx.rng)) { int first = m_indices[choose_a_solution(ctx)]; std::bernoulli_distribution b(0.5); if (b(ctx.rng)) { if (b(ctx.rng)) { crossover(ctx, x, m_data[first].x, m_bastert); to_log(stdout, 7u, "- crossover between {} ({}) and bastert\n", first, m_data[first].value); } else { m_data[first].x = m_bastert; } } else { init_with_random(m_random, ctx.rng, x.size(), 0.5); if (b(ctx.rng)) { crossover(ctx, x, m_data[first].x, m_random); to_log(stdout, 7u, "- crossover between {} ({}) and random\n", first, m_data[first].value); } else { m_data[first].x = m_random; } } } else { int first = m_indices[choose_a_solution(ctx)]; int second = m_indices[choose_a_solution(ctx)]; while (first == second) second = m_indices[choose_a_solution(ctx)]; crossover(ctx, x, m_data[first].x, m_data[second].x); to_log(stdout, 7u, "- crossover between {} ({}) and {} ({})\n", first, m_data[first].value, second, m_data[second].value); } }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x20, %rsp movq %rdi, 0x10(%rsp) movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx movb $0x1, 0x18(%rsp) callq 0x3c460 leaq 0x80(%r15), %rdi movq %r15, %rsi callq 0x36254 testb %al, %al je 0x8f1db movq %rbx, %rdi movq %r15, %rsi callq 0x8f35a movq 0x38(%rbx), %rcx cltq movl (%rcx,%rax,4), %eax movl %eax, 0x8(%rsp) movq %r15, %rdi callq 0x36ac3 vmovsd 0x3c97f2(%rip), %xmm1 # 0x458978 vucomisd %xmm0, %xmm1 jbe 0x8f27f movq %r15, %rdi callq 0x36ac3 vmovsd 0x3c97d8(%rip), %xmm1 # 0x458978 vucomisd %xmm0, %xmm1 jbe 0x8f303 movslq 0x8(%rsp), %rax leaq 0x68(%rbx), %r8 imulq $0x38, %rax, %rcx addq 0x50(%rbx), %rcx movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x8f39e addq $0x50, %rbx leaq 0x3cb1ce(%rip), %rcx # 0x45a3a2 pushq $0x28 jmp 0x8f2da movq %rbx, %rdi movq %r15, %rsi callq 0x8f35a movq 0x38(%rbx), %rcx cltq movslq (%rcx,%rax,4), %r12 movl %r12d, 0x8(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x8f35a movq 0x38(%rbx), %rcx cltq movslq (%rcx,%rax,4), %rax movl %eax, 0xc(%rsp) cmpl %eax, %r12d jne 0x8f220 movq %rbx, %rdi movq %r15, %rsi callq 0x8f35a jmp 0x8f200 movq 0x50(%rbx), %r8 imulq $0x38, %r12, %r12 imulq $0x38, %rax, %r13 leaq (%r8,%r12), %rcx addq %r13, %r8 movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x8f39e movq 0x5add80(%rip), %rax # 0x63cfc8 movq 0x50(%rbx), %rdx movq (%rax), %rdi leaq 0x10(%rdx,%r13), %rax leaq 0x10(%rdx,%r12), %r9 leaq 0xc(%rsp), %r10 leaq 0x3cb18e(%rip), %rcx # 0x45a3f3 pushq $0x7 popq %rsi pushq $0x28 popq %rdx leaq 0x8(%rsp), %r8 pushq %rax pushq %r10 callq 0x3c3e1 popq %rax popq %rcx jmp 0x8f322 movl (%r14), %edx leaq 0x78(%rbx), %r12 vmovsd 0x3c96ea(%rip), %xmm0 # 0x458978 movq %r12, %rdi movq %r15, %rsi callq 0x362ac movq %r15, %rdi callq 0x36ac3 vmovsd 0x3c96cf(%rip), %xmm1 # 0x458978 movslq 0x8(%rsp), %rax imulq $0x38, %rax, %rcx addq 0x50(%rbx), %rcx vucomisd %xmm0, %xmm1 jbe 0x8f317 movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx movq %r12, %r8 callq 0x8f39e addq $0x50, %rbx leaq 0x3cb0f3(%rip), %rcx # 0x45a3cb pushq $0x27 popq %rdx movq 0x5adce6(%rip), %rax # 0x63cfc8 leaq 0x8(%rsp), %r8 movq (%rbx), %rsi movslq (%r8), %r9 movq (%rax), %rdi imulq $0x38, %r9, %rax leaq 0x10(%rsi,%rax), %r9 pushq $0x7 popq %rsi callq 0x3c388 jmp 0x8f322 movslq 0x8(%rsp), %rax imulq $0x38, %rax, %rcx addq 0x50(%rbx), %rcx addq $0x68, %rbx movq %rbx, %r12 movq %rcx, %rdi movq %r12, %rsi callq 0x36a44 leaq 0x10(%rsp), %rdi callq 0x3c450 addq $0x20, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x8f344 jmp 0x8f344 jmp 0x8f344 jmp 0x8f344 jmp 0x8f344 movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x3c450 movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>> const, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>> const&, baryonyx::bit_array const&)
int infeasibility_local_compute_violated_constraints(Solver& solver, const Xtype& x) { m_order.clear(); for (int k = 0, e = solver.m; k != e; ++k) { sparse_matrix<int>::const_row_iterator it, et; std::tie(it, et) = solver.ap.row(k); int v = 0; for (; it != et; ++it) v += solver.factor(it->value) * x[it->column]; if (solver.bound_min(k) > v) m_order.push_back(std::make_pair(k, solver.bound_min(k) - v)); else if (solver.bound_max(k) < v) m_order.push_back(std::make_pair(k, v - solver.bound_max(k))); } return length(m_order); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movq 0x18(%rdi), %rax movq %rdx, %r14 movq %rsi, %r15 cmpq %rax, 0x20(%rdi) je 0x8f442 movq %rax, 0x20(%rdi) leaq 0x18(%rdi), %rax leaq 0x8(%r15), %rcx xorl %r12d, %r12d movq %rdi, 0x20(%rsp) movq %rax, 0x10(%rsp) movl 0x80(%r15), %eax movq %rcx, 0x18(%rsp) movq %rax, 0x28(%rsp) cmpq 0x28(%rsp), %r12 je 0x8f507 movq 0x18(%rsp), %rsi movq %rsp, %rdi movl %r12d, %edx movq %r12, 0x30(%rsp) callq 0x3c868 movq (%rsp), %r13 movq 0x8(%rsp), %r12 xorl %ebx, %ebx cmpq %r13, %r12 je 0x8f4bb movslq (%r12), %rax movq 0x48(%r15), %rcx movl 0x4(%r12), %esi movq %r14, %rdi movl (%rcx,%rax,4), %ebp callq 0x3664a imull %ebp, %eax addq $0x8, %r12 addl %eax, %ebx jmp 0x8f493 movq 0x30(%rsp), %r12 movq 0x58(%r15), %rcx imulq $0xc, %r12, %rdx movl (%rcx,%rdx), %eax subl %ebx, %eax jle 0x8f4dc shlq $0x20, %rax orq %r12, %rax movq %rax, (%rsp) jmp 0x8f4ed subl 0x4(%rcx,%rdx), %ebx jle 0x8f4fa shlq $0x20, %rbx orq %r12, %rbx movq %rbx, (%rsp) movq 0x10(%rsp), %rdi movq %rsp, %rsi callq 0x3c8c2 movq 0x20(%rsp), %rdi incq %r12 jmp 0x8f468 movq 0x20(%rdi), %rax subq 0x18(%rdi), %rax shrq $0x3, %rax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>> const&, baryonyx::bit_array const&, std::vector<int, std::allocator<int>>&)
int compute_violated_constraints(const Solver& slv, const Xtype& x, std::vector<int>& out) { out.clear(); for (int k = 0; k != slv.m; ++k) if (!is_valid_constraint(slv, k, x)) out.emplace_back(k); return length(out); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq (%rdx), %rax movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 cmpq %rax, 0x8(%rdx) je 0x8f540 movq %rax, 0x8(%rbx) leaq 0x4(%rsp), %r12 xorl %esi, %esi movl %esi, 0x4(%rsp) cmpl 0x80(%r15), %esi je 0x8f576 movq %r15, %rdi movq %r14, %rdx callq 0x8f58d testb %al, %al jne 0x8f56e movq %rbx, %rdi movq %r12, %rsi callq 0x31460 movl 0x4(%rsp), %esi incl %esi jmp 0x8f547 movq 0x8(%rbx), %rax subq (%rbx), %rax shrq $0x2, %rax addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>> const&, int, baryonyx::bit_array const&)
bool is_valid_constraint(const Solver& slv, int k, const Xtype& x) { typename sparse_matrix<int>::const_row_iterator it, et; std::tie(it, et) = slv.ap.row(k); int v = 0; for (; it != et; ++it) v += slv.factor(it->value) * x[it->column]; return slv.bound_min(k) <= v && v <= slv.bound_max(k); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rdx, %r14 movl %esi, %edx leaq 0x8(%rdi), %rsi leaq 0x8(%rsp), %r15 movq %rdi, %rbx movl %edx, 0x4(%rsp) movq %r15, %rdi callq 0x3c868 movq (%r15), %r12 movq 0x8(%r15), %r13 xorl %r15d, %r15d cmpq %r12, %r13 je 0x8f5ea movslq (%r13), %rax movq 0x48(%rbx), %rcx movl 0x4(%r13), %esi movq %r14, %rdi movl (%rcx,%rax,4), %ebp callq 0x3664a imull %ebp, %eax addq $0x8, %r13 addl %eax, %r15d jmp 0x8f5c2 movslq 0x4(%rsp), %rcx movq 0x58(%rbx), %rax imulq $0xc, %rcx, %rcx cmpl %r15d, (%rax,%rcx) jle 0x8f601 xorl %eax, %eax jmp 0x8f609 cmpl 0x4(%rax,%rcx), %r15d setle %al addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, long double, long double, long double)
bool compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta) { for (; first != last; ++first) { auto k = constraint(first); bx_expects(k < m); auto [row_begin, row_end] = ap.row(k); decrease_preference(row_begin, row_end, theta); int r_size = 0; for (auto it = row_begin; it != row_end; ++it, ++r_size) { Float sum_a_p = 0; auto [col_begin, col_end] = ap.column(it->column); for (; col_begin != col_end; ++col_begin) sum_a_p += static_cast<Float>(A[col_begin->value]) * P[col_begin->value]; R[r_size].id = r_size; R[r_size].a = A[it->value]; R[r_size].value = c(row_begin->column, x) - sum_a_p; } calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int value = 0; bool valid = b[k].min <= 0; int i = -1; // if (!valid) { // do { // ++i; // value += R[i].a; // valid = b[k].min <= value; // } while (!valid && i + 1 < r_size); // } // valid = b[k].min <= value && value <= b[k].max; // while (i + 1 < r_size && valid) { // ++i; // value += R[i].a; // valid = b[k].min <= value && value <= b[k].max; // } // std::uniform_real_distribution<Float> real_dist(Float{ 0 }, // Float{ 1 }); // auto selected = i; // auto d = delta; // if (selected < 0) { // d += (kappa / (one - kappa)) * (R[0].value / two); // d *= real_dist(rng); // for (i = 0; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 1); // P[var->value] += d; // } else { // x.set(var->column, 0); // P[var->value] -= d; // } // } // } else if (selected + 1 >= r_size) { // d += (kappa / (one - kappa)) * (R[selected].value * middle); // d *= real_dist(rng); // for (i = 0; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 0); // P[var->value] -= d; // } else { // x.set(var->column, 1); // P[var->value] += d; // } // } // } else { // d += (kappa / (one - kappa)) * // (R[selected + 1].value - R[selected].value); // d *= real_dist(rng); // for (i = 0; i <= selected; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 0); // P[var->value] -= d; // } else { // x.set(var->column, 1); // P[var->value] += d; // } // } // for (; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 1); // P[var->value] += d; // } else { // x.set(var->column, 0); // P[var->value] -= d; // } // } constexpr Float one{ 1 }; constexpr Float two{ 2 }; if (!valid) { do { ++i; value += R[i].a; valid = b[k].min <= value; auto var = row_begin + R[i].id; x.set(var->column); P[var->value] += delta + (kappa / (one - kappa)) * (R[i].value / two); } while (!valid && i + 1 < r_size); } valid = b[k].min <= value && value <= b[k].max; while (i + 1 < r_size && valid) { ++i; value += R[i].a; valid = b[k].min <= value && value <= b[k].max; auto var = row_begin + R[i].id; if (valid) valid = stop_iterating<Mode>(R[i].value, rng); if (valid) { x.set(var->column); P[var->value] += delta + (kappa / (one - kappa)) * (R[i].value / two); } else { x.unset(var->column); P[var->value] -= delta + (kappa / (one - kappa)) * (R[i].value / two); } } while (i + 1 < r_size) { ++i; auto var = row_begin + R[i].id; x.unset(var->column); P[var->value] -= delta + (kappa / (one - kappa)) * (R[i].value / two); } bx_expects(is_valid_constraint(*this, k, x)); } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xb8, %rsp movq %rcx, 0x90(%rsp) movq %rsi, 0x18(%rsp) leaq 0x8(%rdi), %r14 leaq 0x70(%rsp), %r15 movq %rdi, %r12 fldt 0x110(%rsp) fstpt 0xac(%rsp) fldt 0x100(%rsp) fstpt 0x50(%rsp) fldt 0xf0(%rsp) fld1 fsub %st(1), %st fdivrp %st, %st(1) fstpt 0x44(%rsp) movq %rdx, 0x88(%rsp) movq %rdi, 0x28(%rsp) movq %r14, 0x80(%rsp) movq (%rdx), %rax movq 0x90(%rsp), %rcx cmpq (%rcx), %rax je 0x8fa41 movslq -0x4(%rax), %r13 cmpl 0x80(%r12), %r13d jge 0x8fa55 leaq 0x30(%rsp), %rdi movq %r14, %rsi movl %r13d, %edx callq 0x3de66 movq 0x30(%rsp), %rdx movq 0x38(%rsp), %rsi fldt 0xac(%rsp) movq %r12, %rdi fstpt (%rsp) callq 0x90932 movq 0x38(%rsp), %rbx xorl %ebp, %ebp cmpq 0x30(%rsp), %rbx je 0x8f776 movl 0x4(%rbx), %edx movq %r15, %rdi movq %r14, %rsi callq 0x3dede movq 0x70(%rsp), %rcx movq 0x78(%rsp), %rdx movq 0x48(%r12), %rax movq 0x68(%r12), %rsi fldz cmpq %rcx, %rdx je 0x8f732 movslq (%rdx), %rdi addq $0x8, %rdx movl (%rax,%rdi,4), %r8d shlq $0x4, %rdi movl %r8d, 0x5c(%rsp) fldt (%rsi,%rdi) fimull 0x5c(%rsp) faddp %st, %st(1) movq %rdx, 0x78(%rsp) jmp 0x8f709 movq 0x50(%r12), %rcx movq %rbp, %rdx shlq $0x5, %rdx movl %ebp, 0x10(%rcx,%rdx) incq %rbp movslq (%rbx), %rsi addq $0x8, %rbx movl (%rax,%rsi,4), %eax movl %eax, 0x14(%rcx,%rdx) movq 0x38(%rsp), %rsi movq 0x70(%r12), %rax movslq 0x4(%rsi), %rsi movq 0x8(%rax), %rax shlq $0x4, %rsi fldt (%rax,%rsi) fsubp %st, %st(1) fstpt (%rcx,%rdx) jmp 0x8f6da movq 0x50(%r12), %rdi movq (%r12), %rdx movl %ebp, %esi shlq $0x5, %rsi addq %rdi, %rsi callq 0x90957 movq 0x58(%r12), %rax imulq $0xc, %r13, %rdx movq %r13, 0x60(%rsp) movq %rbp, 0x98(%rsp) movq %rdx, 0x68(%rsp) cmpl $0x0, (%rax,%rdx) jle 0x8f879 leal -0x2(%rbp), %eax movabsq $-0x100000000, %r15 # imm = 0xFFFFFFFF00000000 xorl %r14d, %r14d cltq movq %rax, 0xa0(%rsp) movq 0x50(%r12), %rax pushq $-0x1 popq %rbx xorl %ebp, %ebp movabsq $0x100000000, %rcx # imm = 0x100000000 movq 0x38(%rsp), %r13 movq 0x18(%rsp), %rdi addl 0x14(%rax,%r14), %ebp addq %rcx, %r15 movq 0x58(%r12), %rcx movslq 0x10(%rax,%r14), %r12 movl (%rcx,%rdx), %ecx movl 0x4(%r13,%r12,8), %esi movl %ecx, 0x20(%rsp) callq 0x369c8 movslq (%r13,%r12,8), %rcx movq 0x28(%rsp), %r12 movq 0x50(%r12), %rax movq 0x68(%r12), %rdx shlq $0x4, %rcx fldt (%rax,%r14) fmuls 0x3ca2a1(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) fldt (%rdx,%rcx) faddp %st, %st(1) fstpt (%rdx,%rcx) movq 0x68(%rsp), %rdx cmpl %ebp, 0x20(%rsp) jle 0x8f867 addq $0x20, %r14 leaq 0x1(%rbx), %rcx cmpq 0xa0(%rsp), %rbx movq %rcx, %rbx jl 0x8f7d6 movq 0x58(%r12), %rax sarq $0x20, %r15 cmpl %ebp, (%rax,%rdx) jle 0x8f87f xorl %eax, %eax jmp 0x8f886 xorl %ebp, %ebp pushq $-0x1 popq %r15 cmpl 0x4(%rax,%rdx), %ebp setle %al movslq 0x98(%rsp), %rcx movq %r15, %r14 shlq $0x5, %r14 leaq 0x1(%r15), %rbx movq %rcx, 0x20(%rsp) incq %r15 cmpq 0x20(%rsp), %r15 jae 0x8f998 testb $0x1, %al je 0x8f998 movq 0x50(%r12), %rax movq 0x58(%r12), %rcx addl 0x34(%rax,%r14), %ebp cmpl %ebp, (%rcx,%rdx) jle 0x8f8d8 movslq 0x30(%rax,%r14), %r13 shlq $0x3, %r13 addq 0x38(%rsp), %r13 jmp 0x8f946 movslq 0x30(%rax,%r14), %r13 addq %rdx, %rcx shlq $0x3, %r13 addq 0x38(%rsp), %r13 cmpl 0x4(%rcx), %ebp jg 0x8f946 fldt 0x20(%rax,%r14) movq (%r12), %rdi fstpt (%rsp) callq 0x9098a testb %al, %al je 0x8f946 movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x369c8 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3ca1aa(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r13), %rax shlq $0x4, %rax fldt (%rcx,%rax) faddp %st, %st(1) fstpt (%rcx,%rax) movb $0x1, %al jmp 0x8f987 movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x36a06 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3ca167(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r13), %rax shlq $0x4, %rax fldt (%rcx,%rax) fsubp %st, %st(1) fstpt (%rcx,%rax) xorl %eax, %eax movq 0x68(%rsp), %rdx addq $0x20, %r14 incq %rbx jmp 0x8f89e movq 0x60(%rsp), %r13 cmpq 0x20(%rsp), %rbx jae 0x8fa09 movq 0x50(%r12), %rax movq 0x38(%rsp), %r15 movq 0x18(%rsp), %rdi movslq 0x30(%rax,%r14), %r12 movl 0x4(%r15,%r12,8), %esi callq 0x36a06 movq 0x28(%rsp), %rax movq 0x28(%rsp), %rcx incq %rbx movq 0x50(%rax), %rax movq 0x68(%rcx), %rcx fldt 0x20(%rax,%r14) fmuls 0x3ca0ee(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r15,%r12,8), %rax movq 0x28(%rsp), %r12 addq $0x20, %r14 shlq $0x4, %rax fldt (%rcx,%rax) fsubp %st, %st(1) fstpt (%rcx,%rax) jmp 0x8f99d movq 0x18(%rsp), %rdx movq %r12, %rdi movl %r13d, %esi callq 0x8f58d testb %al, %al je 0x8fa76 movq 0x88(%rsp), %rcx movq 0x80(%rsp), %r14 leaq 0x70(%rsp), %r15 movq (%rcx), %rax addq $-0x4, %rax movq %rax, (%rcx) jmp 0x8f684 xorl %eax, %eax addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3c8782(%rip), %rdi # 0x4581de leaq 0x3caa17(%rip), %rsi # 0x45a47a leaq 0x3ca7dd(%rip), %rdx # 0x45a247 leaq 0x3caa0f(%rip), %rcx # 0x45a480 callq 0x2813f leaq 0x3c8761(%rip), %rdi # 0x4581de leaq 0x3caa00(%rip), %rsi # 0x45a484 leaq 0x3ca7bc(%rip), %rdx # 0x45a247 leaq 0x3caa13(%rip), %rcx # 0x45a4a5 callq 0x2813f nop
/quesnel[P]baryonyx/lib/src/random-solver.cpp
bool baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, long double, long double, long double)
bool compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta) { for (; first != last; ++first) { auto k = constraint(first); bx_expects(k < m); auto [row_begin, row_end] = ap.row(k); decrease_preference(row_begin, row_end, theta); int r_size = 0; for (auto it = row_begin; it != row_end; ++it, ++r_size) { Float sum_a_p = 0; auto [col_begin, col_end] = ap.column(it->column); for (; col_begin != col_end; ++col_begin) sum_a_p += static_cast<Float>(A[col_begin->value]) * P[col_begin->value]; R[r_size].id = r_size; R[r_size].a = A[it->value]; R[r_size].value = c(row_begin->column, x) - sum_a_p; } calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int value = 0; bool valid = b[k].min <= 0; int i = -1; // if (!valid) { // do { // ++i; // value += R[i].a; // valid = b[k].min <= value; // } while (!valid && i + 1 < r_size); // } // valid = b[k].min <= value && value <= b[k].max; // while (i + 1 < r_size && valid) { // ++i; // value += R[i].a; // valid = b[k].min <= value && value <= b[k].max; // } // std::uniform_real_distribution<Float> real_dist(Float{ 0 }, // Float{ 1 }); // auto selected = i; // auto d = delta; // if (selected < 0) { // d += (kappa / (one - kappa)) * (R[0].value / two); // d *= real_dist(rng); // for (i = 0; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 1); // P[var->value] += d; // } else { // x.set(var->column, 0); // P[var->value] -= d; // } // } // } else if (selected + 1 >= r_size) { // d += (kappa / (one - kappa)) * (R[selected].value * middle); // d *= real_dist(rng); // for (i = 0; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 0); // P[var->value] -= d; // } else { // x.set(var->column, 1); // P[var->value] += d; // } // } // } else { // d += (kappa / (one - kappa)) * // (R[selected + 1].value - R[selected].value); // d *= real_dist(rng); // for (i = 0; i <= selected; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 0); // P[var->value] -= d; // } else { // x.set(var->column, 1); // P[var->value] += d; // } // } // for (; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 1); // P[var->value] += d; // } else { // x.set(var->column, 0); // P[var->value] -= d; // } // } constexpr Float one{ 1 }; constexpr Float two{ 2 }; if (!valid) { do { ++i; value += R[i].a; valid = b[k].min <= value; auto var = row_begin + R[i].id; x.set(var->column); P[var->value] += delta + (kappa / (one - kappa)) * (R[i].value / two); } while (!valid && i + 1 < r_size); } valid = b[k].min <= value && value <= b[k].max; while (i + 1 < r_size && valid) { ++i; value += R[i].a; valid = b[k].min <= value && value <= b[k].max; auto var = row_begin + R[i].id; if (valid) valid = stop_iterating<Mode>(R[i].value, rng); if (valid) { x.set(var->column); P[var->value] += delta + (kappa / (one - kappa)) * (R[i].value / two); } else { x.unset(var->column); P[var->value] -= delta + (kappa / (one - kappa)) * (R[i].value / two); } } while (i + 1 < r_size) { ++i; auto var = row_begin + R[i].id; x.unset(var->column); P[var->value] -= delta + (kappa / (one - kappa)) * (R[i].value / two); } bx_expects(is_valid_constraint(*this, k, x)); } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xb8, %rsp movq %rcx, 0x88(%rsp) movq %rsi, 0x18(%rsp) leaq 0x8(%rdi), %r14 leaq 0x70(%rsp), %r15 movq %rdi, %r12 fldt 0x110(%rsp) fstpt 0xac(%rsp) fldt 0x100(%rsp) fstpt 0x50(%rsp) fldt 0xf0(%rsp) fld1 fsub %st(1), %st fdivrp %st, %st(1) fstpt 0x44(%rsp) movq %rdi, 0x28(%rsp) movq %r14, 0x80(%rsp) cmpq 0x88(%rsp), %rdx je 0x8feb4 movslq (%rdx), %r13 cmpl 0x80(%r12), %r13d jge 0x8fec8 leaq 0x30(%rsp), %rdi movq %rdx, 0x90(%rsp) movq %r14, %rsi movl %r13d, %edx callq 0x3de66 movq 0x30(%rsp), %rdx movq 0x38(%rsp), %rsi fldt 0xac(%rsp) movq %r12, %rdi fstpt (%rsp) callq 0x90932 movq 0x38(%rsp), %rbx xorl %ebp, %ebp cmpq 0x30(%rsp), %rbx je 0x8fbef movl 0x4(%rbx), %edx movq %r15, %rdi movq %r14, %rsi callq 0x3dede movq 0x70(%rsp), %rcx movq 0x78(%rsp), %rdx movq 0x48(%r12), %rax movq 0x68(%r12), %rsi fldz cmpq %rcx, %rdx je 0x8fbab movslq (%rdx), %rdi addq $0x8, %rdx movl (%rax,%rdi,4), %r8d shlq $0x4, %rdi movl %r8d, 0x5c(%rsp) fldt (%rsi,%rdi) fimull 0x5c(%rsp) faddp %st, %st(1) movq %rdx, 0x78(%rsp) jmp 0x8fb82 movq 0x50(%r12), %rcx movq %rbp, %rdx shlq $0x5, %rdx movl %ebp, 0x10(%rcx,%rdx) incq %rbp movslq (%rbx), %rsi addq $0x8, %rbx movl (%rax,%rsi,4), %eax movl %eax, 0x14(%rcx,%rdx) movq 0x38(%rsp), %rsi movq 0x70(%r12), %rax movslq 0x4(%rsi), %rsi movq 0x8(%rax), %rax shlq $0x4, %rsi fldt (%rax,%rsi) fsubp %st, %st(1) fstpt (%rcx,%rdx) jmp 0x8fb53 movq 0x50(%r12), %rdi movq (%r12), %rdx movl %ebp, %esi shlq $0x5, %rsi addq %rdi, %rsi callq 0x90957 movq 0x58(%r12), %rax imulq $0xc, %r13, %rdx movq %r13, 0x60(%rsp) movq %rbp, 0x98(%rsp) movq %rdx, 0x68(%rsp) cmpl $0x0, (%rax,%rdx) jle 0x8fcf2 leal -0x2(%rbp), %eax movabsq $-0x100000000, %r15 # imm = 0xFFFFFFFF00000000 xorl %r14d, %r14d cltq movq %rax, 0xa0(%rsp) movq 0x50(%r12), %rax pushq $-0x1 popq %rbx xorl %ebp, %ebp movabsq $0x100000000, %rcx # imm = 0x100000000 movq 0x38(%rsp), %r13 movq 0x18(%rsp), %rdi addl 0x14(%rax,%r14), %ebp addq %rcx, %r15 movq 0x58(%r12), %rcx movslq 0x10(%rax,%r14), %r12 movl (%rcx,%rdx), %ecx movl 0x4(%r13,%r12,8), %esi movl %ecx, 0x20(%rsp) callq 0x369c8 movslq (%r13,%r12,8), %rcx movq 0x28(%rsp), %r12 movq 0x50(%r12), %rax movq 0x68(%r12), %rdx shlq $0x4, %rcx fldt (%rax,%r14) fmuls 0x3c9e28(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) fldt (%rdx,%rcx) faddp %st, %st(1) fstpt (%rdx,%rcx) movq 0x68(%rsp), %rdx cmpl %ebp, 0x20(%rsp) jle 0x8fce0 addq $0x20, %r14 leaq 0x1(%rbx), %rcx cmpq 0xa0(%rsp), %rbx movq %rcx, %rbx jl 0x8fc4f movq 0x58(%r12), %rax sarq $0x20, %r15 cmpl %ebp, (%rax,%rdx) jle 0x8fcf8 xorl %eax, %eax jmp 0x8fcff xorl %ebp, %ebp pushq $-0x1 popq %r15 cmpl 0x4(%rax,%rdx), %ebp setle %al movslq 0x98(%rsp), %rcx movq %r15, %r14 shlq $0x5, %r14 leaq 0x1(%r15), %rbx movq %rcx, 0x20(%rsp) incq %r15 cmpq 0x20(%rsp), %r15 jae 0x8fe11 testb $0x1, %al je 0x8fe11 movq 0x50(%r12), %rax movq 0x58(%r12), %rcx addl 0x34(%rax,%r14), %ebp cmpl %ebp, (%rcx,%rdx) jle 0x8fd51 movslq 0x30(%rax,%r14), %r13 shlq $0x3, %r13 addq 0x38(%rsp), %r13 jmp 0x8fdbf movslq 0x30(%rax,%r14), %r13 addq %rdx, %rcx shlq $0x3, %r13 addq 0x38(%rsp), %r13 cmpl 0x4(%rcx), %ebp jg 0x8fdbf fldt 0x20(%rax,%r14) movq (%r12), %rdi fstpt (%rsp) callq 0x9098a testb %al, %al je 0x8fdbf movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x369c8 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3c9d31(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r13), %rax shlq $0x4, %rax fldt (%rcx,%rax) faddp %st, %st(1) fstpt (%rcx,%rax) movb $0x1, %al jmp 0x8fe00 movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x36a06 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3c9cee(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r13), %rax shlq $0x4, %rax fldt (%rcx,%rax) fsubp %st, %st(1) fstpt (%rcx,%rax) xorl %eax, %eax movq 0x68(%rsp), %rdx addq $0x20, %r14 incq %rbx jmp 0x8fd17 movq 0x60(%rsp), %r13 cmpq 0x20(%rsp), %rbx jae 0x8fe82 movq 0x50(%r12), %rax movq 0x38(%rsp), %r15 movq 0x18(%rsp), %rdi movslq 0x30(%rax,%r14), %r12 movl 0x4(%r15,%r12,8), %esi callq 0x36a06 movq 0x28(%rsp), %rax movq 0x28(%rsp), %rcx incq %rbx movq 0x50(%rax), %rax movq 0x68(%rcx), %rcx fldt 0x20(%rax,%r14) fmuls 0x3c9c75(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r15,%r12,8), %rax movq 0x28(%rsp), %r12 addq $0x20, %r14 shlq $0x4, %rax fldt (%rcx,%rax) fsubp %st, %st(1) fstpt (%rcx,%rax) jmp 0x8fe16 movq 0x18(%rsp), %rdx movq %r12, %rdi movl %r13d, %esi callq 0x8f58d testb %al, %al je 0x8fee9 movq 0x90(%rsp), %rdx movq 0x80(%rsp), %r14 leaq 0x70(%rsp), %r15 addq $0x4, %rdx jmp 0x8faf9 xorl %eax, %eax addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3c830f(%rip), %rdi # 0x4581de leaq 0x3ca5a4(%rip), %rsi # 0x45a47a leaq 0x3ca36a(%rip), %rdx # 0x45a247 leaq 0x3ca59c(%rip), %rcx # 0x45a480 callq 0x2813f leaq 0x3c82ee(%rip), %rdi # 0x4581de leaq 0x3ca58d(%rip), %rsi # 0x45a484 leaq 0x3ca349(%rip), %rdx # 0x45a247 leaq 0x3ca5a0(%rip), %rcx # 0x45a4a5 callq 0x2813f
/quesnel[P]baryonyx/lib/src/random-solver.cpp
bool baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, long double, long double, long double)
bool compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta) { for (; first != last; ++first) { auto k = constraint(first); bx_expects(k < m); auto [row_begin, row_end] = ap.row(k); decrease_preference(row_begin, row_end, theta); int r_size = 0; for (auto it = row_begin; it != row_end; ++it, ++r_size) { Float sum_a_p = 0; auto [col_begin, col_end] = ap.column(it->column); for (; col_begin != col_end; ++col_begin) sum_a_p += static_cast<Float>(A[col_begin->value]) * P[col_begin->value]; R[r_size].id = r_size; R[r_size].a = A[it->value]; R[r_size].value = c(row_begin->column, x) - sum_a_p; } calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int value = 0; bool valid = b[k].min <= 0; int i = -1; // if (!valid) { // do { // ++i; // value += R[i].a; // valid = b[k].min <= value; // } while (!valid && i + 1 < r_size); // } // valid = b[k].min <= value && value <= b[k].max; // while (i + 1 < r_size && valid) { // ++i; // value += R[i].a; // valid = b[k].min <= value && value <= b[k].max; // } // std::uniform_real_distribution<Float> real_dist(Float{ 0 }, // Float{ 1 }); // auto selected = i; // auto d = delta; // if (selected < 0) { // d += (kappa / (one - kappa)) * (R[0].value / two); // d *= real_dist(rng); // for (i = 0; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 1); // P[var->value] += d; // } else { // x.set(var->column, 0); // P[var->value] -= d; // } // } // } else if (selected + 1 >= r_size) { // d += (kappa / (one - kappa)) * (R[selected].value * middle); // d *= real_dist(rng); // for (i = 0; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 0); // P[var->value] -= d; // } else { // x.set(var->column, 1); // P[var->value] += d; // } // } // } else { // d += (kappa / (one - kappa)) * // (R[selected + 1].value - R[selected].value); // d *= real_dist(rng); // for (i = 0; i <= selected; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 0); // P[var->value] -= d; // } else { // x.set(var->column, 1); // P[var->value] += d; // } // } // for (; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 1); // P[var->value] += d; // } else { // x.set(var->column, 0); // P[var->value] -= d; // } // } constexpr Float one{ 1 }; constexpr Float two{ 2 }; if (!valid) { do { ++i; value += R[i].a; valid = b[k].min <= value; auto var = row_begin + R[i].id; x.set(var->column); P[var->value] += delta + (kappa / (one - kappa)) * (R[i].value / two); } while (!valid && i + 1 < r_size); } valid = b[k].min <= value && value <= b[k].max; while (i + 1 < r_size && valid) { ++i; value += R[i].a; valid = b[k].min <= value && value <= b[k].max; auto var = row_begin + R[i].id; if (valid) valid = stop_iterating<Mode>(R[i].value, rng); if (valid) { x.set(var->column); P[var->value] += delta + (kappa / (one - kappa)) * (R[i].value / two); } else { x.unset(var->column); P[var->value] -= delta + (kappa / (one - kappa)) * (R[i].value / two); } } while (i + 1 < r_size) { ++i; auto var = row_begin + R[i].id; x.unset(var->column); P[var->value] -= delta + (kappa / (one - kappa)) * (R[i].value / two); } bx_expects(is_valid_constraint(*this, k, x)); } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xb8, %rsp movq %rcx, 0x88(%rsp) movq %rsi, 0x18(%rsp) leaq 0x8(%rdi), %r14 leaq 0x70(%rsp), %r15 movq %rdi, %r12 fldt 0x110(%rsp) fstpt 0xac(%rsp) fldt 0x100(%rsp) fstpt 0x50(%rsp) fldt 0xf0(%rsp) fld1 fsub %st(1), %st fdivrp %st, %st(1) fstpt 0x44(%rsp) movq %rdi, 0x28(%rsp) movq %r14, 0x80(%rsp) cmpq 0x88(%rsp), %rdx je 0x90326 movslq (%rdx), %r13 cmpl 0x80(%r12), %r13d jge 0x9033a leaq 0x30(%rsp), %rdi movq %rdx, 0x90(%rsp) movq %r14, %rsi movl %r13d, %edx callq 0x3de66 movq 0x30(%rsp), %rdx movq 0x38(%rsp), %rsi fldt 0xac(%rsp) movq %r12, %rdi fstpt (%rsp) callq 0x90932 movq 0x38(%rsp), %rbx xorl %ebp, %ebp cmpq 0x30(%rsp), %rbx je 0x90061 movl 0x4(%rbx), %edx movq %r15, %rdi movq %r14, %rsi callq 0x3dede movq 0x70(%rsp), %rcx movq 0x78(%rsp), %rdx movq 0x48(%r12), %rax movq 0x68(%r12), %rsi fldz cmpq %rcx, %rdx je 0x9001d movslq (%rdx), %rdi addq $0x8, %rdx movl (%rax,%rdi,4), %r8d shlq $0x4, %rdi movl %r8d, 0x5c(%rsp) fldt (%rsi,%rdi) fimull 0x5c(%rsp) faddp %st, %st(1) movq %rdx, 0x78(%rsp) jmp 0x8fff4 movq 0x50(%r12), %rcx movq %rbp, %rdx shlq $0x5, %rdx movl %ebp, 0x10(%rcx,%rdx) incq %rbp movslq (%rbx), %rsi addq $0x8, %rbx movl (%rax,%rsi,4), %eax movl %eax, 0x14(%rcx,%rdx) movq 0x38(%rsp), %rsi movq 0x70(%r12), %rax movslq 0x4(%rsi), %rsi movq 0x8(%rax), %rax shlq $0x4, %rsi fldt (%rax,%rsi) fsubp %st, %st(1) fstpt (%rcx,%rdx) jmp 0x8ffc5 movq 0x50(%r12), %rdi movq (%r12), %rdx movl %ebp, %esi shlq $0x5, %rsi addq %rdi, %rsi callq 0x90957 movq 0x58(%r12), %rax imulq $0xc, %r13, %rdx movq %r13, 0x60(%rsp) movq %rbp, 0x98(%rsp) movq %rdx, 0x68(%rsp) cmpl $0x0, (%rax,%rdx) jle 0x90164 leal -0x2(%rbp), %eax movabsq $-0x100000000, %r15 # imm = 0xFFFFFFFF00000000 xorl %r14d, %r14d cltq movq %rax, 0xa0(%rsp) movq 0x50(%r12), %rax pushq $-0x1 popq %rbx xorl %ebp, %ebp movabsq $0x100000000, %rcx # imm = 0x100000000 movq 0x38(%rsp), %r13 movq 0x18(%rsp), %rdi addl 0x14(%rax,%r14), %ebp addq %rcx, %r15 movq 0x58(%r12), %rcx movslq 0x10(%rax,%r14), %r12 movl (%rcx,%rdx), %ecx movl 0x4(%r13,%r12,8), %esi movl %ecx, 0x20(%rsp) callq 0x369c8 movslq (%r13,%r12,8), %rcx movq 0x28(%rsp), %r12 movq 0x50(%r12), %rax movq 0x68(%r12), %rdx shlq $0x4, %rcx fldt (%rax,%r14) fmuls 0x3c99b6(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) fldt (%rdx,%rcx) faddp %st, %st(1) fstpt (%rdx,%rcx) movq 0x68(%rsp), %rdx cmpl %ebp, 0x20(%rsp) jle 0x90152 addq $0x20, %r14 leaq 0x1(%rbx), %rcx cmpq 0xa0(%rsp), %rbx movq %rcx, %rbx jl 0x900c1 movq 0x58(%r12), %rax sarq $0x20, %r15 cmpl %ebp, (%rax,%rdx) jle 0x9016a xorl %eax, %eax jmp 0x90171 xorl %ebp, %ebp pushq $-0x1 popq %r15 cmpl 0x4(%rax,%rdx), %ebp setle %al movslq 0x98(%rsp), %rcx movq %r15, %r14 shlq $0x5, %r14 leaq 0x1(%r15), %rbx movq %rcx, 0x20(%rsp) incq %r15 cmpq 0x20(%rsp), %r15 jae 0x90283 testb $0x1, %al je 0x90283 movq 0x50(%r12), %rax movq 0x58(%r12), %rcx addl 0x34(%rax,%r14), %ebp cmpl %ebp, (%rcx,%rdx) jle 0x901c3 movslq 0x30(%rax,%r14), %r13 shlq $0x3, %r13 addq 0x38(%rsp), %r13 jmp 0x90231 movslq 0x30(%rax,%r14), %r13 addq %rdx, %rcx shlq $0x3, %r13 addq 0x38(%rsp), %r13 cmpl 0x4(%rcx), %ebp jg 0x90231 fldt 0x20(%rax,%r14) movq (%r12), %rdi fstpt (%rsp) callq 0x9098a testb %al, %al je 0x90231 movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x369c8 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3c98bf(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r13), %rax shlq $0x4, %rax fldt (%rcx,%rax) faddp %st, %st(1) fstpt (%rcx,%rax) movb $0x1, %al jmp 0x90272 movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x36a06 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3c987c(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r13), %rax shlq $0x4, %rax fldt (%rcx,%rax) fsubp %st, %st(1) fstpt (%rcx,%rax) xorl %eax, %eax movq 0x68(%rsp), %rdx addq $0x20, %r14 incq %rbx jmp 0x90189 movq 0x60(%rsp), %r13 cmpq 0x20(%rsp), %rbx jae 0x902f4 movq 0x50(%r12), %rax movq 0x38(%rsp), %r15 movq 0x18(%rsp), %rdi movslq 0x30(%rax,%r14), %r12 movl 0x4(%r15,%r12,8), %esi callq 0x36a06 movq 0x28(%rsp), %rax movq 0x28(%rsp), %rcx incq %rbx movq 0x50(%rax), %rax movq 0x68(%rcx), %rcx fldt 0x20(%rax,%r14) fmuls 0x3c9803(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r15,%r12,8), %rax movq 0x28(%rsp), %r12 addq $0x20, %r14 shlq $0x4, %rax fldt (%rcx,%rax) fsubp %st, %st(1) fstpt (%rcx,%rax) jmp 0x90288 movq 0x18(%rsp), %rdx movq %r12, %rdi movl %r13d, %esi callq 0x8f58d testb %al, %al je 0x9035b movq 0x90(%rsp), %rdx movq 0x80(%rsp), %r14 leaq 0x70(%rsp), %r15 addq $0x8, %rdx jmp 0x8ff6b xorl %eax, %eax addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3c7e9d(%rip), %rdi # 0x4581de leaq 0x3ca132(%rip), %rsi # 0x45a47a leaq 0x3c9ef8(%rip), %rdx # 0x45a247 leaq 0x3ca12a(%rip), %rcx # 0x45a480 callq 0x2813f leaq 0x3c7e7c(%rip), %rdi # 0x4581de leaq 0x3ca11b(%rip), %rsi # 0x45a484 leaq 0x3c9ed7(%rip), %rdx # 0x45a247 leaq 0x3ca12e(%rip), %rcx # 0x45a4a5 callq 0x2813f
/quesnel[P]baryonyx/lib/src/random-solver.cpp
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>&, baryonyx::bit_array const&)
int infeasibility_local_compute_violated_constraints(Solver& solver, const Xtype& x) { m_order.clear(); for (int k = 0, e = solver.m; k != e; ++k) { sparse_matrix<int>::const_row_iterator it, et; std::tie(it, et) = solver.ap.row(k); int v = 0; for (; it != et; ++it) v += solver.factor(it->value) * x[it->column]; if (solver.bound_min(k) > v) m_order.push_back(std::make_pair(k, solver.bound_min(k) - v)); else if (solver.bound_max(k) < v) m_order.push_back(std::make_pair(k, v - solver.bound_max(k))); } return length(m_order); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movq 0x18(%rdi), %rax movq %rdx, %r14 movq %rsi, %r15 cmpq %rax, 0x20(%rdi) je 0x9039e movq %rax, 0x20(%rdi) leaq 0x18(%rdi), %rax leaq 0x8(%r15), %rcx xorl %r12d, %r12d movq %rdi, 0x20(%rsp) movq %rax, 0x10(%rsp) movl 0x80(%r15), %eax movq %rcx, 0x18(%rsp) movq %rax, 0x28(%rsp) cmpq 0x28(%rsp), %r12 je 0x90463 movq 0x18(%rsp), %rsi movq %rsp, %rdi movl %r12d, %edx movq %r12, 0x30(%rsp) callq 0x3de66 movq (%rsp), %r13 movq 0x8(%rsp), %r12 xorl %ebx, %ebx cmpq %r13, %r12 je 0x90417 movslq (%r12), %rax movq 0x48(%r15), %rcx movl 0x4(%r12), %esi movq %r14, %rdi movl (%rcx,%rax,4), %ebp callq 0x3664a imull %ebp, %eax addq $0x8, %r12 addl %eax, %ebx jmp 0x903ef movq 0x30(%rsp), %r12 movq 0x58(%r15), %rcx imulq $0xc, %r12, %rdx movl (%rcx,%rdx), %eax subl %ebx, %eax jle 0x90438 shlq $0x20, %rax orq %r12, %rax movq %rax, (%rsp) jmp 0x90449 subl 0x4(%rcx,%rdx), %ebx jle 0x90456 shlq $0x20, %rbx orq %r12, %rbx movq %rbx, (%rsp) movq 0x10(%rsp), %rdi movq %rsp, %rsi callq 0x3c8c2 movq 0x20(%rsp), %rdi incq %r12 jmp 0x903c4 movq 0x20(%rdi), %rax subq 0x18(%rdi), %rax shrq $0x3, %rax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, long double, long double, long double)
bool compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta) { for (; first != last; ++first) { auto k = constraint(first); bx_expects(k < m); auto [row_begin, row_end] = ap.row(k); decrease_preference(row_begin, row_end, theta); int r_size = 0; for (auto it = row_begin; it != row_end; ++it, ++r_size) { Float sum_a_p = 0; auto [col_begin, col_end] = ap.column(it->column); for (; col_begin != col_end; ++col_begin) sum_a_p += static_cast<Float>(A[col_begin->value]) * P[col_begin->value]; R[r_size].id = r_size; R[r_size].a = A[it->value]; R[r_size].value = c(row_begin->column, x) - sum_a_p; } calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int value = 0; bool valid = b[k].min <= 0; int i = -1; // if (!valid) { // do { // ++i; // value += R[i].a; // valid = b[k].min <= value; // } while (!valid && i + 1 < r_size); // } // valid = b[k].min <= value && value <= b[k].max; // while (i + 1 < r_size && valid) { // ++i; // value += R[i].a; // valid = b[k].min <= value && value <= b[k].max; // } // std::uniform_real_distribution<Float> real_dist(Float{ 0 }, // Float{ 1 }); // auto selected = i; // auto d = delta; // if (selected < 0) { // d += (kappa / (one - kappa)) * (R[0].value / two); // d *= real_dist(rng); // for (i = 0; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 1); // P[var->value] += d; // } else { // x.set(var->column, 0); // P[var->value] -= d; // } // } // } else if (selected + 1 >= r_size) { // d += (kappa / (one - kappa)) * (R[selected].value * middle); // d *= real_dist(rng); // for (i = 0; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 0); // P[var->value] -= d; // } else { // x.set(var->column, 1); // P[var->value] += d; // } // } // } else { // d += (kappa / (one - kappa)) * // (R[selected + 1].value - R[selected].value); // d *= real_dist(rng); // for (i = 0; i <= selected; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 0); // P[var->value] -= d; // } else { // x.set(var->column, 1); // P[var->value] += d; // } // } // for (; i != r_size; ++i) { // auto var = row_begin + R[i].id; // if (R[i].is_negative()) { // x.set(var->column, 1); // P[var->value] += d; // } else { // x.set(var->column, 0); // P[var->value] -= d; // } // } constexpr Float one{ 1 }; constexpr Float two{ 2 }; if (!valid) { do { ++i; value += R[i].a; valid = b[k].min <= value; auto var = row_begin + R[i].id; x.set(var->column); P[var->value] += delta + (kappa / (one - kappa)) * (R[i].value / two); } while (!valid && i + 1 < r_size); } valid = b[k].min <= value && value <= b[k].max; while (i + 1 < r_size && valid) { ++i; value += R[i].a; valid = b[k].min <= value && value <= b[k].max; auto var = row_begin + R[i].id; if (valid) valid = stop_iterating<Mode>(R[i].value, rng); if (valid) { x.set(var->column); P[var->value] += delta + (kappa / (one - kappa)) * (R[i].value / two); } else { x.unset(var->column); P[var->value] -= delta + (kappa / (one - kappa)) * (R[i].value / two); } } while (i + 1 < r_size) { ++i; auto var = row_begin + R[i].id; x.unset(var->column); P[var->value] -= delta + (kappa / (one - kappa)) * (R[i].value / two); } bx_expects(is_valid_constraint(*this, k, x)); } return false; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xb8, %rsp movq %rcx, 0x88(%rsp) movq %rsi, 0x18(%rsp) leaq 0x8(%rdi), %r14 leaq 0x70(%rsp), %r15 movq %rdi, %r12 fldt 0x110(%rsp) fstpt 0xac(%rsp) fldt 0x100(%rsp) fstpt 0x50(%rsp) fldt 0xf0(%rsp) fld1 fsub %st(1), %st fdivrp %st, %st(1) fstpt 0x44(%rsp) movq %rdi, 0x28(%rsp) movq %r14, 0x80(%rsp) cmpq 0x88(%rsp), %rdx je 0x9089a movslq (%rdx), %r13 cmpl 0x80(%r12), %r13d jge 0x908ae leaq 0x30(%rsp), %rdi movq %rdx, 0x90(%rsp) movq %r14, %rsi movl %r13d, %edx callq 0x3de66 movq 0x30(%rsp), %rdx movq 0x38(%rsp), %rsi fldt 0xac(%rsp) movq %r12, %rdi fstpt (%rsp) callq 0x90932 movq 0x38(%rsp), %rbx xorl %ebp, %ebp cmpq 0x30(%rsp), %rbx je 0x905d5 movl 0x4(%rbx), %edx movq %r15, %rdi movq %r14, %rsi callq 0x3dede movq 0x70(%rsp), %rcx movq 0x78(%rsp), %rdx movq 0x48(%r12), %rax movq 0x68(%r12), %rsi fldz cmpq %rcx, %rdx je 0x90591 movslq (%rdx), %rdi addq $0x8, %rdx movl (%rax,%rdi,4), %r8d shlq $0x4, %rdi movl %r8d, 0x5c(%rsp) fldt (%rsi,%rdi) fimull 0x5c(%rsp) faddp %st, %st(1) movq %rdx, 0x78(%rsp) jmp 0x90568 movq 0x50(%r12), %rcx movq %rbp, %rdx shlq $0x5, %rdx movl %ebp, 0x10(%rcx,%rdx) incq %rbp movslq (%rbx), %rsi addq $0x8, %rbx movl (%rax,%rsi,4), %eax movl %eax, 0x14(%rcx,%rdx) movq 0x38(%rsp), %rsi movq 0x70(%r12), %rax movslq 0x4(%rsi), %rsi movq 0x8(%rax), %rax shlq $0x4, %rsi fldt (%rax,%rsi) fsubp %st, %st(1) fstpt (%rcx,%rdx) jmp 0x90539 movq 0x50(%r12), %rdi movq (%r12), %rdx movl %ebp, %esi shlq $0x5, %rsi addq %rdi, %rsi callq 0x90957 movq 0x58(%r12), %rax imulq $0xc, %r13, %rdx movq %r13, 0x60(%rsp) movq %rbp, 0x98(%rsp) movq %rdx, 0x68(%rsp) cmpl $0x0, (%rax,%rdx) jle 0x906d8 leal -0x2(%rbp), %eax movabsq $-0x100000000, %r15 # imm = 0xFFFFFFFF00000000 xorl %r14d, %r14d cltq movq %rax, 0xa0(%rsp) movq 0x50(%r12), %rax pushq $-0x1 popq %rbx xorl %ebp, %ebp movabsq $0x100000000, %rcx # imm = 0x100000000 movq 0x38(%rsp), %r13 movq 0x18(%rsp), %rdi addl 0x14(%rax,%r14), %ebp addq %rcx, %r15 movq 0x58(%r12), %rcx movslq 0x10(%rax,%r14), %r12 movl (%rcx,%rdx), %ecx movl 0x4(%r13,%r12,8), %esi movl %ecx, 0x20(%rsp) callq 0x369c8 movslq (%r13,%r12,8), %rcx movq 0x28(%rsp), %r12 movq 0x50(%r12), %rax movq 0x68(%r12), %rdx shlq $0x4, %rcx fldt (%rax,%r14) fmuls 0x3c9442(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) fldt (%rdx,%rcx) faddp %st, %st(1) fstpt (%rdx,%rcx) movq 0x68(%rsp), %rdx cmpl %ebp, 0x20(%rsp) jle 0x906c6 addq $0x20, %r14 leaq 0x1(%rbx), %rcx cmpq 0xa0(%rsp), %rbx movq %rcx, %rbx jl 0x90635 movq 0x58(%r12), %rax sarq $0x20, %r15 cmpl %ebp, (%rax,%rdx) jle 0x906de xorl %eax, %eax jmp 0x906e5 xorl %ebp, %ebp pushq $-0x1 popq %r15 cmpl 0x4(%rax,%rdx), %ebp setle %al movslq 0x98(%rsp), %rcx movq %r15, %r14 shlq $0x5, %r14 leaq 0x1(%r15), %rbx movq %rcx, 0x20(%rsp) incq %r15 cmpq 0x20(%rsp), %r15 jae 0x907f7 testb $0x1, %al je 0x907f7 movq 0x50(%r12), %rax movq 0x58(%r12), %rcx addl 0x34(%rax,%r14), %ebp cmpl %ebp, (%rcx,%rdx) jle 0x90737 movslq 0x30(%rax,%r14), %r13 shlq $0x3, %r13 addq 0x38(%rsp), %r13 jmp 0x907a5 movslq 0x30(%rax,%r14), %r13 addq %rdx, %rcx shlq $0x3, %r13 addq 0x38(%rsp), %r13 cmpl 0x4(%rcx), %ebp jg 0x907a5 fldt 0x20(%rax,%r14) movq (%r12), %rdi fstpt (%rsp) callq 0x9098a testb %al, %al je 0x907a5 movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x369c8 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3c934b(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r13), %rax shlq $0x4, %rax fldt (%rcx,%rax) faddp %st, %st(1) fstpt (%rcx,%rax) movb $0x1, %al jmp 0x907e6 movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x36a06 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3c9308(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r13), %rax shlq $0x4, %rax fldt (%rcx,%rax) fsubp %st, %st(1) fstpt (%rcx,%rax) xorl %eax, %eax movq 0x68(%rsp), %rdx addq $0x20, %r14 incq %rbx jmp 0x906fd movq 0x60(%rsp), %r13 cmpq 0x20(%rsp), %rbx jae 0x90868 movq 0x50(%r12), %rax movq 0x38(%rsp), %r15 movq 0x18(%rsp), %rdi movslq 0x30(%rax,%r14), %r12 movl 0x4(%r15,%r12,8), %esi callq 0x36a06 movq 0x28(%rsp), %rax movq 0x28(%rsp), %rcx incq %rbx movq 0x50(%rax), %rax movq 0x68(%rcx), %rcx fldt 0x20(%rax,%r14) fmuls 0x3c928f(%rip) # 0x459ad0 fldt 0x44(%rsp) fmulp %st, %st(1) fldt 0x50(%rsp) faddp %st, %st(1) movslq (%r15,%r12,8), %rax movq 0x28(%rsp), %r12 addq $0x20, %r14 shlq $0x4, %rax fldt (%rcx,%rax) fsubp %st, %st(1) fstpt (%rcx,%rax) jmp 0x907fc movq 0x18(%rsp), %rdx movq %r12, %rdi movl %r13d, %esi callq 0x8f58d testb %al, %al je 0x908cf movq 0x90(%rsp), %rdx movq 0x80(%rsp), %r14 leaq 0x70(%rsp), %r15 addq $0x4, %rdx jmp 0x904df xorl %eax, %eax addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3c7929(%rip), %rdi # 0x4581de leaq 0x3c9bbe(%rip), %rsi # 0x45a47a leaq 0x3c9984(%rip), %rdx # 0x45a247 leaq 0x3c9bb6(%rip), %rcx # 0x45a480 callq 0x2813f leaq 0x3c7908(%rip), %rdi # 0x4581de leaq 0x3c9ba7(%rip), %rsi # 0x45a484 leaq 0x3c9963(%rip), %rdx # 0x45a247 leaq 0x3c9bba(%rip), %rcx # 0x45a4a5 callq 0x2813f
/quesnel[P]baryonyx/lib/src/random-solver.cpp
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>> const&, baryonyx::bit_array const&)
int local_compute_violated_constraints(const Solver& slv, const Xtype& x) { int remaining = 0; for (int k = 0; k != slv.m; ++k) if (!is_valid_constraint(slv, k, x)) ++remaining; return remaining; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rdx, %rbx movq %rsi, %r14 xorl %ebp, %ebp xorl %r15d, %r15d cmpl 0x80(%r14), %r15d je 0x90925 movq %r14, %rdi movl %r15d, %esi movq %rbx, %rdx callq 0x8f58d xorb $0x1, %al incl %r15d movzbl %al, %eax addl %eax, %ebp jmp 0x90902 movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>::decrease_preference(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, long double)
void decrease_preference(sparse_matrix<int>::row_iterator begin, sparse_matrix<int>::row_iterator end, Float theta) noexcept { for (; begin != end; ++begin) P[begin->value] *= theta; }
fldt 0x8(%rsp) movq 0x68(%rdi), %rax cmpq %rdx, %rsi je 0x90954 movslq (%rsi), %rcx addq $0x8, %rsi shlq $0x4, %rcx fldt (%rax,%rcx) fmul %st(1), %st fstpt (%rax,%rcx) jmp 0x9093a fstp %st(0) retq
/quesnel[P]baryonyx/lib/src/random-solver.cpp
bool baryonyx::itm::stop_iterating<baryonyx::itm::maximize_tag, long double>(long double, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&)
inline bool stop_iterating(Float value, random_engine& rng) noexcept { if (value == 0) { std::bernoulli_distribution d(0.5); return d(rng); } if constexpr (std::is_same_v<Mode, minimize_tag>) return value > 0; else return value < 0; }
pushq %rax fldt 0x10(%rsp) fldz fxch %st(1) fucomi %st(1), %st jne 0x909b0 jp 0x909b0 fstp %st(0) fstp %st(0) callq 0x36ac3 vmovsd 0x3c7fce(%rip), %xmm1 # 0x458978 vucomisd %xmm0, %xmm1 jmp 0x909b6 fxch %st(1) fucompi %st(1), %st fstp %st(0) seta %al popq %rcx retq movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>::rc_data*>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>::rc_data*, baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>::rc_data*, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&)
inline void random_shuffle_unique(iteratorT begin, iteratorT end, random_engine& rng) noexcept { auto ret = begin++; for (; begin != end; ++begin) { if (ret->value != begin->value) { std::shuffle(ret, begin, rng); ret = begin; } } std::shuffle(ret, begin, rng); }
pushq %r15 pushq %r14 pushq %rbx movq %rdx, %rbx movq %rsi, %r14 leaq 0x20(%rdi), %r15 cmpq %r14, %r15 je 0x909fe fldt (%rdi) fldt (%r15) addq $0x20, %r15 fxch %st(1) fucompi %st(1), %st fstp %st(0) jne 0x909ea jnp 0x909d2 addq $-0x20, %r15 movq %r15, %rsi movq %rbx, %rdx callq 0x90f7f movq %r15, %rdi jmp 0x909ce movq %r15, %rsi movq %rbx, %rdx callq 0x90f7f popq %rbx popq %r14 popq %r15 retq jmp 0x90a11 movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::maximize_tag>::can_be_inserted(unsigned long, double) const
bool can_be_inserted([[maybe_unused]] const std::size_t hash, const double value) const noexcept { m_indices_reader lock(m_indices_mutex); for (int i = 0; i != m_size; ++i) if (m_data[i].remaining_constraints == 0 && m_data[i].value == value && m_data[i].hash == hash) return false; return true; }
pushq %r14 pushq %rbx subq $0x18, %rsp movq %rdi, 0x8(%rsp) vmovsd %xmm0, (%rsp) movq %rsi, %rbx movq %rdi, %r14 movb $0x1, 0x10(%rsp) callq 0x3c460 movl 0x98(%r14), %eax vmovsd (%rsp), %xmm1 movq 0x50(%r14), %rcx xorl %edx, %edx imulq $0x38, %rax, %rax cmpq %rdx, %rax je 0x924e6 cmpl $0x0, 0x30(%rcx,%rdx) jne 0x924e0 vmovsd 0x10(%rcx,%rdx), %xmm0 vucomisd %xmm1, %xmm0 jne 0x924e0 jp 0x924e0 cmpq %rbx, 0x20(%rcx,%rdx) je 0x924e6 addq $0x38, %rdx jmp 0x924bf cmpq %rdx, %rax leaq 0x8(%rsp), %rdi sete %bl callq 0x3c450 movl %ebx, %eax addq $0x18, %rsp popq %rbx popq %r14 retq movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::maximize_tag>::replace_result(int, baryonyx::bit_array const&, double, double, unsigned long, long, int)
void replace_result(const int id, const bit_array& x, const double value, const double duration, const std::size_t hash, const long int loop, const int remaining_constraints) noexcept { m_indices_reader lock{ m_indices_mutex }; m_data[id].x = x; m_data[id].value = value; m_data[id].duration = duration; m_data[id].hash = hash; m_data[id].loop = loop; m_data[id].remaining_constraints = remaining_constraints; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rdi, 0x18(%rsp) movl %r9d, %ebx movq %r8, %r14 movq %rcx, %r15 vmovsd %xmm1, 0x10(%rsp) vmovsd %xmm0, 0x8(%rsp) movq %rdx, %r13 movl %esi, %ebp movq %rdi, %r12 movb $0x1, 0x20(%rsp) callq 0x3c460 movq 0x50(%r12), %rdi movslq %ebp, %rax imulq $0x38, %rax, %rbp addq %rbp, %rdi movq %r13, %rsi callq 0x36a44 vmovsd 0x8(%rsp), %xmm0 vmovsd 0x10(%rsp), %xmm1 movq 0x50(%r12), %rax leaq 0x18(%rsp), %rdi vmovsd %xmm0, 0x10(%rax,%rbp) vmovsd %xmm1, 0x18(%rax,%rbp) movq %r15, 0x20(%rax,%rbp) movq %r14, 0x28(%rax,%rbp) movl %ebx, 0x30(%rax,%rbp) callq 0x3c450 addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rdi callq 0xeb9f nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::maximize_tag>::can_be_inserted(unsigned long, int) const
bool can_be_inserted(const std::size_t hash, const int constraints) const noexcept { m_indices_reader lock(m_indices_mutex); for (int i = 0; i != m_size; ++i) if (m_data[i].remaining_constraints == constraints && m_data[i].hash == hash) return false; return true; }
pushq %r15 pushq %r14 pushq %rbx subq $0x10, %rsp movq %rdi, (%rsp) movl %edx, %ebx movq %rsi, %r14 movq %rdi, %r15 movb $0x1, 0x8(%rsp) callq 0x3c460 movl 0x98(%r15), %eax movq 0x50(%r15), %rcx xorl %edx, %edx imulq $0x38, %rax, %rax cmpq %rdx, %rax je 0x926d0 cmpl %ebx, 0x30(%rcx,%rdx) jne 0x926ca cmpq %r14, 0x20(%rcx,%rdx) je 0x926d0 addq $0x38, %rdx jmp 0x926b8 cmpq %rdx, %rax movq %rsp, %rdi sete %bl callq 0x3c450 movl %ebx, %eax addq $0x10, %rsp popq %rbx popq %r14 popq %r15 retq movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::maximize_tag>::insert(baryonyx::itm::local_context&, baryonyx::bit_array const&, unsigned long, int, double, long)
void insert(local_context& ctx, const bit_array& x, const std::size_t hash, const int remaining_constraints, const double duration, const long int loop) noexcept { to_log(stdout, 5u, "- insert advance {} (hash: {}) {}s in {} loops\n", remaining_constraints, hash, duration, loop); int id_to_delete = m_indices[choose_a_bad_solution(ctx)]; to_log(stdout, 5u, "- delete {} ({})\n", id_to_delete, m_data[id_to_delete].value); replace_result(id_to_delete, x, costs.results(x, cost_constant), duration, hash, loop, remaining_constraints); sort(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq 0x5aa8c1(%rip), %r12 # 0x63cfc8 movq %rdi, %rbx leaq 0x20(%rsp), %rax leaq 0xc(%rsp), %r10 leaq 0x18(%rsp), %r11 leaq 0x10(%rsp), %r13 movq %rdx, %r14 movq %rsi, %r15 movq %rcx, (%rax) movl %r8d, (%r10) vmovsd %xmm0, (%r11) movq %r9, (%r13) movq (%r12), %rdi leaq 0x3c7dcf(%rip), %rcx # 0x45a50d pushq $0x5 popq %rsi pushq $0x2f popq %rdx movq %r10, %r8 movq %rax, %r9 pushq %r13 pushq %r11 callq 0x3ff5c popq %rax popq %rcx leaq 0x68(%r15), %rdi movq %r15, %rsi callq 0x3fce2 movq 0x38(%rbx), %rcx cltq leaq 0x8(%rsp), %r8 movq (%r12), %rdi movslq (%rcx,%rax,4), %rax movl %eax, (%r8) imulq $0x38, %rax, %rax movq 0x50(%rbx), %rcx leaq 0x10(%rcx,%rax), %r9 leaq 0x3c7d70(%rip), %rcx # 0x45a4fb pushq $0x5 popq %rsi pushq $0x11 popq %rdx callq 0x3c388 vmovsd 0x90(%rbx), %xmm0 movl 0x8(%rsp), %ebp movq 0x88(%rbx), %rdi movq %r14, %rsi callq 0x8b74a vmovsd 0x18(%rsp), %xmm1 movq 0x20(%rsp), %rcx movq 0x10(%rsp), %r8 movl 0xc(%rsp), %r9d movq %rbx, %rdi movl %ebp, %esi movq %r14, %rdx callq 0x925ea movq %rbx, %rdi callq 0x8b7c0 addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::maximize_tag>::get_best(int&, double&, double&, long&) const
void get_best(int& constraints_remaining, double& value, double& duration, long int& loop) const noexcept { m_indices_reader lock(m_indices_mutex); int id = m_indices.front(); constraints_remaining = m_data[id].remaining_constraints; value = m_data[id].value; duration = m_data[id].duration; loop = m_data[id].loop; }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x10, %rsp movq %rdi, (%rsp) movq %r8, %rbx movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %r13 movb $0x1, 0x8(%rsp) callq 0x3c460 movq 0x38(%r13), %rax movq 0x50(%r13), %rcx movq %rsp, %rdi movslq (%rax), %rax imulq $0x38, %rax, %rax movl 0x30(%rcx,%rax), %edx movl %edx, (%r12) vmovsd 0x10(%rcx,%rax), %xmm0 vmovsd %xmm0, (%r15) vmovsd 0x18(%rcx,%rax), %xmm0 vmovsd %xmm0, (%r14) movq 0x28(%rcx,%rax), %rax movq %rax, (%rbx) callq 0x3c450 addq $0x10, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq movq %rax, %rdi callq 0xeb9f nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::maximize_tag>::show_population(baryonyx::context const&) const
void show_population(const context& ctx) const { info(ctx, " Population {}:\n", m_indices.size()); for (int i = 0; i != m_size; ++i) info(ctx, " - {}: value {} constraints {} hash {}\n", m_indices[i], m_data[m_indices[i]].value, m_data[m_indices[i]].remaining_constraints, m_data[m_indices[i]].hash); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x10, %rsp movq 0x40(%rdi), %rax movq %rsi, %rbx leaq 0x8(%rsp), %rdx leaq 0x3c68ab(%rip), %rsi # 0x45a53d movq %rdi, %r14 subq 0x38(%rdi), %rax movq %rbx, %rdi sarq $0x2, %rax movq %rax, (%rdx) callq 0x41545 leaq 0x3c689f(%rip), %r15 # 0x45a54e xorl %r12d, %r12d xorl %r13d, %r13d movl 0x98(%r14), %eax cmpq %rax, %r13 je 0x93cf7 movq 0x38(%r14), %rdx movq 0x50(%r14), %rax movq %rbx, %rdi movslq (%rdx,%r12), %rcx addq %r12, %rdx imulq $0x38, %rcx, %rsi leaq 0x10(%rax,%rsi), %rcx leaq 0x30(%rax,%rsi), %r8 leaq 0x20(%rax,%rsi), %r9 movq %r15, %rsi callq 0x41567 incq %r13 addq $0x4, %r12 jmp 0x93cb5 addq $0x10, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double)
result operator()(const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { result r; bit_array x(variables); int best_remaining = INT_MAX; auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const long int w_limit = static_cast<long int>(p.w); Solver slv( m_rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); { std::bernoulli_distribution choose_mutation( m_ctx.parameters.init_policy_random); bit_array empty_x; switch (p.init_policy) { case solver_parameters::init_policy_type::pessimistic_solve: init_with_pre_solve<Cost, Mode>( x, empty_x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::optimistic_solve: init_with_pre_solve<Cost, Mode>( empty_x, x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::bastert: init_with_bastert<Cost, Mode>(x, original_costs, variables, 0); break; } for (int i = 0, e = x.size(); i != e; ++i) if (choose_mutation(m_rng)) x.invert(i); } bool start_push = false; auto kappa = static_cast<Float>(p.kappa_min); Observer obs("img", slv.m, slv.n, p.limit); m_begin = std::chrono::steady_clock::now(); m_end = std::chrono::steady_clock::now(); compute.init(slv, x); for (long int i = 0; i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta); obs.make_observation(slv.ap, slv.P.get(), slv.pi.get()); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), i); best_remaining = remaining; start_push = true; break; } if (remaining < best_remaining) { store_if_better(x, remaining, i); best_remaining = remaining; } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) { r.status = result_status::kappa_max_reached; break; } if (is_timelimit_reached()) { r.status = result_status::time_limit_reached; break; } } if (!start_push) { r.status = result_status::limit_reached; } else { for (int push = 0; push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_rng, pushing_k_factor * kappa, delta, theta, pushing_objective_amplifier); if (remaining == 0) store_if_better(x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); if (is_timelimit_reached()) break; for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run(slv, x, m_rng, kappa, delta, theta); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; if (is_timelimit_reached()) break; } } } if (m_best.remaining_constraints == 0) r.status = result_status::success; if (!m_best.x.empty()) { r.solutions.resize(1); convert(m_best, r.solutions[0], variables); } return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x428, %rsp # imm = 0x428 vmovsd %xmm0, 0x80(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %r8, %r13 movl %ecx, %ebx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, 0x58(%rsp) vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) leaq 0x68(%rsp), %rdi movl %ecx, %esi vzeroupper callq 0x368ae movq 0x10(%r14), %r12 movq 0x18(%r14), %rcx leaq 0xb0(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x8d226 fldl 0x20(%r12) fstpt 0xd0(%rsp) vxorpd %xmm1, %xmm1, %xmm1 fldl 0x28(%r12) fstpt 0xdc(%rsp) fldl 0x30(%r12) fstpt 0xc4(%rsp) fldl 0x8(%r12) vmovsd 0x10(%r12), %xmm0 fld %st(0) fstpt 0x4c(%rsp) vucomisd %xmm0, %xmm1 jbe 0x93e14 movq 0x10(%r14), %rdi leaq 0xb0(%rsp), %rsi movl %ebx, %edx fstpt (%rsp) callq 0x8d304 fstpt 0x94(%rsp) jmp 0x93e2d fstp %st(0) vmovsd %xmm0, 0xf0(%rsp) fldl 0xf0(%rsp) fstpt 0x94(%rsp) fldl 0x38(%r12) fstpt 0x104(%rsp) fldl 0x40(%r12) fstpt 0xf8(%rsp) vcvttsd2si 0xa0(%r12), %rax movq 0x18(%r14), %rsi movq %rax, 0x88(%rsp) movq 0x8(%r15), %rax subq (%r15), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0x148(%rsp), %rdi leaq 0xb0(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0x8d378 movl 0xcc(%r12), %esi leaq 0x110(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x90(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0x1d0(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0x93f0f cmpl $0x1, %eax je 0x93ee9 cmpl $0x2, %eax jne 0x93f20 movq 0x18(%r14), %rdx leaq 0x1d0(%rsp), %rdi leaq 0x68(%rsp), %rsi jmp 0x93efa movq 0x18(%r14), %rdx leaq 0x68(%rsp), %rdi leaq 0x1d0(%rsp), %rsi vmovsd 0x3c0136(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x8b497 jmp 0x93f20 leaq 0x68(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0x8b41f leaq 0x68(%rsp), %r15 movq %r13, 0x78(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0x93f56 movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd 0x40(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x93f52 movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0x93f2f leaq 0x1d8(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 movl 0x1c8(%rsp), %ecx movl 0x1cc(%rsp), %r8d movq 0xb0(%r12), %r9 vmovsd %xmm0, 0x40(%rsp) leaq 0x3c65e9(%rip), %rdx # 0x45a577 leaq 0x1d0(%rsp), %rdi pushq $0x3 popq %rsi callq 0x42b5a callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0x110(%rsp), %rdi leaq 0x148(%rsp), %rsi leaq 0x68(%rsp), %rdx callq 0x8d6a0 vmovsd 0x40(%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x68(%rsp), %r13 xorl %r15d, %r15d vmovsd %xmm0, 0xe8(%rsp) fldl 0xe8(%rsp) fldt 0x4c(%rsp) cmpq 0xb0(%r12), %r15 je 0x940ff movq 0x18(%r14), %rcx fstpt 0x20(%rsp) leaq 0x110(%rsp), %rdi leaq 0x148(%rsp), %rsi movq %r13, %rdx fldt 0x94(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x40(%rsp) fstpt (%rsp) callq 0x8d6e2 movq 0x1b0(%rsp), %rdx movq 0x1a8(%rsp), %rcx movl %eax, %ebx leaq 0x1d0(%rsp), %rdi leaq 0x150(%rsp), %rsi callq 0x95274 testl %ebx, %ebx je 0x941b3 cmpl %ebp, %ebx jge 0x94077 movq %r14, %rdi movq %r13, %rsi movl %ebx, %edx movq %r15, %rcx callq 0x952fa movl %ebx, %ebp cmpq 0x88(%rsp), %r15 jle 0x940c8 movl %ebx, 0xa8(%rsp) fildl 0xa8(%rsp) movl 0x1c8(%rsp), %eax movl %eax, 0xac(%rsp) fidivl 0xac(%rsp) fldt 0xc4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xd0(%rsp) fmulp %st, %st(1) fldt 0x40(%rsp) faddp %st, %st(1) jmp 0x940cc fldt 0x40(%rsp) fldt 0xdc(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) fldz ja 0x940ff fstp %st(0) movq %r14, %rdi fstpt 0x40(%rsp) callq 0x95332 fldt 0x40(%rsp) fldt 0x4c(%rsp) testb %al, %al jne 0x940ff incq %r15 jmp 0x93ff0 fstp %st(0) fstp %st(0) movq 0x58(%rsp), %rax movl $0x5, 0xa0(%rax) fldz fldz fstp %st(1) fstp %st(0) cmpl $0x0, 0x50(%r14) jne 0x9412d movq 0x58(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0x9415e movq 0x58(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x90(%rsp), %edx movq %r14, %rdi callq 0x35781 leaq 0x1d0(%rsp), %rdi callq 0x42cbc leaq 0x110(%rsp), %rdi callq 0x393ac leaq 0x148(%rsp), %rdi callq 0x8dca8 leaq 0xb8(%rsp), %rdi callq 0x8affa leaq 0x70(%rsp), %rdi callq 0x357fe movq 0x58(%rsp), %rax addq $0x428, %rsp # imm = 0x428 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi leaq 0x68(%rsp), %rbx movq %rbx, %rsi callq 0x8b74a movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0x952b0 movl $0x0, 0x64(%rsp) leaq 0x148(%rsp), %r15 leaq 0x68(%rsp), %rbp xorl %ebx, %ebx fldt 0x4c(%rsp) fldt 0x40(%rsp) cmpl 0xbc(%r12), %ebx jge 0x94116 movq 0x18(%r14), %rcx fldt 0x104(%rsp) fld %st(1) fstpt 0x40(%rsp) fmulp %st, %st(1) fldt 0xf8(%rsp) fstpt 0x30(%rsp) fxch %st(1) fstpt 0x20(%rsp) leaq 0x110(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx fldt 0x94(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0x8da1c testl %eax, %eax jne 0x94283 vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi movq %rbp, %rsi callq 0x8b74a movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x952b0 movq %r14, %rdi callq 0x95332 fldt 0x4c(%rsp) fldt 0x40(%rsp) testb %al, %al jne 0x94116 movl %ebx, 0x88(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0x943c9 movq 0x18(%r14), %rcx fxch %st(1) fstpt 0x20(%rsp) leaq 0x110(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx fldt 0x94(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x40(%rsp) fstpt (%rsp) callq 0x8d6e2 testl %eax, %eax je 0x9437c vcvtsi2sd %r13d, %xmm1, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0x9434a movl %eax, 0xa0(%rsp) fildl 0xa0(%rsp) movl 0x1c8(%rsp), %eax movl %eax, 0xa4(%rsp) fidivl 0xa4(%rsp) fldt 0xc4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xd0(%rsp) fmulp %st, %st(1) fldt 0x40(%rsp) faddp %st, %st(1) jmp 0x9434e fldt 0x40(%rsp) fldt 0xdc(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) ja 0x943b9 movq %r14, %rdi fstpt 0x40(%rsp) callq 0x95332 testb %al, %al jne 0x943c1 fldt 0x4c(%rsp) fldt 0x40(%rsp) incl %ebx jmp 0x942a7 vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi movq %rbp, %rsi callq 0x8b74a movl 0xc0(%r12), %eax imull 0x64(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x952b0 fldt 0x4c(%rsp) fldt 0x40(%rsp) jmp 0x943c9 fldt 0x4c(%rsp) fxch %st(1) jmp 0x943c9 fldt 0x4c(%rsp) fldt 0x40(%rsp) movl 0x88(%rsp), %ebx decl 0x64(%rsp) incl %ebx jmp 0x941fb jmp 0x94416 jmp 0x943ef fstp %st(1) fstp %st(0) jmp 0x94416 movq %rax, %rbx jmp 0x94426 movq %rax, %rbx jmp 0x94433 movq %rax, %rbx jmp 0x94440 movq %rax, %rbx jmp 0x9444d movq %rax, %rbx jmp 0x94457 jmp 0x94416 jmp 0x94416 jmp 0x94416 leaq 0x1d8(%rsp), %rdi movq %rax, %rbx callq 0x357fe jmp 0x94426 leaq 0x1d0(%rsp), %rdi movq %rax, %rbx callq 0x42cbc leaq 0x110(%rsp), %rdi callq 0x393ac leaq 0x148(%rsp), %rdi callq 0x8dca8 leaq 0xb8(%rsp), %rdi callq 0x8affa leaq 0x70(%rsp), %rdi callq 0x357fe movq 0x58(%rsp), %rdi callq 0xea60 movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double)
result operator()(const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { result r; bit_array x(variables); int best_remaining = INT_MAX; auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const long int w_limit = static_cast<long int>(p.w); Solver slv( m_rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); { std::bernoulli_distribution choose_mutation( m_ctx.parameters.init_policy_random); bit_array empty_x; switch (p.init_policy) { case solver_parameters::init_policy_type::pessimistic_solve: init_with_pre_solve<Cost, Mode>( x, empty_x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::optimistic_solve: init_with_pre_solve<Cost, Mode>( empty_x, x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::bastert: init_with_bastert<Cost, Mode>(x, original_costs, variables, 0); break; } for (int i = 0, e = x.size(); i != e; ++i) if (choose_mutation(m_rng)) x.invert(i); } bool start_push = false; auto kappa = static_cast<Float>(p.kappa_min); Observer obs("img", slv.m, slv.n, p.limit); m_begin = std::chrono::steady_clock::now(); m_end = std::chrono::steady_clock::now(); compute.init(slv, x); for (long int i = 0; i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta); obs.make_observation(slv.ap, slv.P.get(), slv.pi.get()); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), i); best_remaining = remaining; start_push = true; break; } if (remaining < best_remaining) { store_if_better(x, remaining, i); best_remaining = remaining; } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) { r.status = result_status::kappa_max_reached; break; } if (is_timelimit_reached()) { r.status = result_status::time_limit_reached; break; } } if (!start_push) { r.status = result_status::limit_reached; } else { for (int push = 0; push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_rng, pushing_k_factor * kappa, delta, theta, pushing_objective_amplifier); if (remaining == 0) store_if_better(x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); if (is_timelimit_reached()) break; for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run(slv, x, m_rng, kappa, delta, theta); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; if (is_timelimit_reached()) break; } } } if (m_best.remaining_constraints == 0) r.status = result_status::success; if (!m_best.x.empty()) { r.solutions.resize(1); convert(m_best, r.solutions[0], variables); } return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x428, %rsp # imm = 0x428 vmovsd %xmm0, 0x80(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %r8, %r13 movl %ecx, %ebx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, 0x58(%rsp) vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) leaq 0x68(%rsp), %rdi movl %ecx, %esi vzeroupper callq 0x368ae movq 0x10(%r14), %r12 movq 0x18(%r14), %rcx leaq 0xb0(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x8d226 fldl 0x20(%r12) fstpt 0xd0(%rsp) vxorpd %xmm1, %xmm1, %xmm1 fldl 0x28(%r12) fstpt 0xdc(%rsp) fldl 0x30(%r12) fstpt 0xc4(%rsp) fldl 0x8(%r12) vmovsd 0x10(%r12), %xmm0 fld %st(0) fstpt 0x4c(%rsp) vucomisd %xmm0, %xmm1 jbe 0x94550 movq 0x10(%r14), %rdi leaq 0xb0(%rsp), %rsi movl %ebx, %edx fstpt (%rsp) callq 0x8d304 fstpt 0x94(%rsp) jmp 0x94569 fstp %st(0) vmovsd %xmm0, 0xf0(%rsp) fldl 0xf0(%rsp) fstpt 0x94(%rsp) fldl 0x38(%r12) fstpt 0x104(%rsp) fldl 0x40(%r12) fstpt 0xf8(%rsp) vcvttsd2si 0xa0(%r12), %rax movq 0x18(%r14), %rsi movq %rax, 0x88(%rsp) movq 0x8(%r15), %rax subq (%r15), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0x148(%rsp), %rdi leaq 0xb0(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0x8d378 movl 0xcc(%r12), %esi leaq 0x110(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x90(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0x1d0(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0x9464b cmpl $0x1, %eax je 0x94625 cmpl $0x2, %eax jne 0x9465c movq 0x18(%r14), %rdx leaq 0x1d0(%rsp), %rdi leaq 0x68(%rsp), %rsi jmp 0x94636 movq 0x18(%r14), %rdx leaq 0x68(%rsp), %rdi leaq 0x1d0(%rsp), %rsi vmovsd 0x3bf9fa(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x8b497 jmp 0x9465c leaq 0x68(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0x8b41f leaq 0x68(%rsp), %r15 movq %r13, 0x78(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0x94692 movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd 0x40(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x9468e movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0x9466b leaq 0x1d8(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 movl 0x1c8(%rsp), %ecx movl 0x1cc(%rsp), %r8d movq 0xb0(%r12), %r9 vmovsd %xmm0, 0x40(%rsp) leaq 0x3c5ead(%rip), %rdx # 0x45a577 leaq 0x1d0(%rsp), %rdi pushq $0x3 popq %rsi callq 0x4346e callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0x110(%rsp), %rdi leaq 0x148(%rsp), %rsi leaq 0x68(%rsp), %rdx callq 0x8d6a0 vmovsd 0x40(%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x68(%rsp), %r13 xorl %r15d, %r15d vmovsd %xmm0, 0xe8(%rsp) fldl 0xe8(%rsp) fldt 0x4c(%rsp) cmpq 0xb0(%r12), %r15 je 0x9483b movq 0x18(%r14), %rcx fstpt 0x20(%rsp) leaq 0x110(%rsp), %rdi leaq 0x148(%rsp), %rsi movq %r13, %rdx fldt 0x94(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x40(%rsp) fstpt (%rsp) callq 0x8d6e2 movq 0x1b0(%rsp), %rdx movq 0x1a8(%rsp), %rcx movl %eax, %ebx leaq 0x1d0(%rsp), %rdi leaq 0x150(%rsp), %rsi callq 0x95692 testl %ebx, %ebx je 0x948ef cmpl %ebp, %ebx jge 0x947b3 movq %r14, %rdi movq %r13, %rsi movl %ebx, %edx movq %r15, %rcx callq 0x95718 movl %ebx, %ebp cmpq 0x88(%rsp), %r15 jle 0x94804 movl %ebx, 0xa8(%rsp) fildl 0xa8(%rsp) movl 0x1c8(%rsp), %eax movl %eax, 0xac(%rsp) fidivl 0xac(%rsp) fldt 0xc4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xd0(%rsp) fmulp %st, %st(1) fldt 0x40(%rsp) faddp %st, %st(1) jmp 0x94808 fldt 0x40(%rsp) fldt 0xdc(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) fldz ja 0x9483b fstp %st(0) movq %r14, %rdi fstpt 0x40(%rsp) callq 0x95750 fldt 0x40(%rsp) fldt 0x4c(%rsp) testb %al, %al jne 0x9483b incq %r15 jmp 0x9472c fstp %st(0) fstp %st(0) movq 0x58(%rsp), %rax movl $0x5, 0xa0(%rax) fldz fldz fstp %st(1) fstp %st(0) cmpl $0x0, 0x50(%r14) jne 0x94869 movq 0x58(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0x9489a movq 0x58(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x90(%rsp), %edx movq %r14, %rdi callq 0x35781 leaq 0x1d0(%rsp), %rdi callq 0x435d0 leaq 0x110(%rsp), %rdi callq 0x393ac leaq 0x148(%rsp), %rdi callq 0x8dca8 leaq 0xb8(%rsp), %rdi callq 0x8affa leaq 0x70(%rsp), %rdi callq 0x357fe movq 0x58(%rsp), %rax addq $0x428, %rsp # imm = 0x428 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi leaq 0x68(%rsp), %rbx movq %rbx, %rsi callq 0x8b74a movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0x956ce movl $0x0, 0x64(%rsp) leaq 0x148(%rsp), %r15 leaq 0x68(%rsp), %rbp xorl %ebx, %ebx fldt 0x4c(%rsp) fldt 0x40(%rsp) cmpl 0xbc(%r12), %ebx jge 0x94852 movq 0x18(%r14), %rcx fldt 0x104(%rsp) fld %st(1) fstpt 0x40(%rsp) fmulp %st, %st(1) fldt 0xf8(%rsp) fstpt 0x30(%rsp) fxch %st(1) fstpt 0x20(%rsp) leaq 0x110(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx fldt 0x94(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0x8da1c testl %eax, %eax jne 0x949bf vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi movq %rbp, %rsi callq 0x8b74a movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x956ce movq %r14, %rdi callq 0x95750 fldt 0x4c(%rsp) fldt 0x40(%rsp) testb %al, %al jne 0x94852 movl %ebx, 0x88(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0x94b05 movq 0x18(%r14), %rcx fxch %st(1) fstpt 0x20(%rsp) leaq 0x110(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx fldt 0x94(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x40(%rsp) fstpt (%rsp) callq 0x8d6e2 testl %eax, %eax je 0x94ab8 vcvtsi2sd %r13d, %xmm1, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0x94a86 movl %eax, 0xa0(%rsp) fildl 0xa0(%rsp) movl 0x1c8(%rsp), %eax movl %eax, 0xa4(%rsp) fidivl 0xa4(%rsp) fldt 0xc4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xd0(%rsp) fmulp %st, %st(1) fldt 0x40(%rsp) faddp %st, %st(1) jmp 0x94a8a fldt 0x40(%rsp) fldt 0xdc(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) ja 0x94af5 movq %r14, %rdi fstpt 0x40(%rsp) callq 0x95750 testb %al, %al jne 0x94afd fldt 0x4c(%rsp) fldt 0x40(%rsp) incl %ebx jmp 0x949e3 vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi movq %rbp, %rsi callq 0x8b74a movl 0xc0(%r12), %eax imull 0x64(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x956ce fldt 0x4c(%rsp) fldt 0x40(%rsp) jmp 0x94b05 fldt 0x4c(%rsp) fxch %st(1) jmp 0x94b05 fldt 0x4c(%rsp) fldt 0x40(%rsp) movl 0x88(%rsp), %ebx decl 0x64(%rsp) incl %ebx jmp 0x94937 jmp 0x94b52 jmp 0x94b2b fstp %st(1) fstp %st(0) jmp 0x94b52 movq %rax, %rbx jmp 0x94b62 movq %rax, %rbx jmp 0x94b6f movq %rax, %rbx jmp 0x94b7c movq %rax, %rbx jmp 0x94b89 movq %rax, %rbx jmp 0x94b93 jmp 0x94b52 jmp 0x94b52 jmp 0x94b52 leaq 0x1d8(%rsp), %rdi movq %rax, %rbx callq 0x357fe jmp 0x94b62 leaq 0x1d0(%rsp), %rdi movq %rax, %rbx callq 0x435d0 leaq 0x110(%rsp), %rdi callq 0x393ac leaq 0x148(%rsp), %rdi callq 0x8dca8 leaq 0xb8(%rsp), %rdi callq 0x8affa leaq 0x70(%rsp), %rdi callq 0x357fe movq 0x58(%rsp), %rdi callq 0xea60 movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double)
result operator()(const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { result r; bit_array x(variables); int best_remaining = INT_MAX; auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const long int w_limit = static_cast<long int>(p.w); Solver slv( m_rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); { std::bernoulli_distribution choose_mutation( m_ctx.parameters.init_policy_random); bit_array empty_x; switch (p.init_policy) { case solver_parameters::init_policy_type::pessimistic_solve: init_with_pre_solve<Cost, Mode>( x, empty_x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::optimistic_solve: init_with_pre_solve<Cost, Mode>( empty_x, x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::bastert: init_with_bastert<Cost, Mode>(x, original_costs, variables, 0); break; } for (int i = 0, e = x.size(); i != e; ++i) if (choose_mutation(m_rng)) x.invert(i); } bool start_push = false; auto kappa = static_cast<Float>(p.kappa_min); Observer obs("img", slv.m, slv.n, p.limit); m_begin = std::chrono::steady_clock::now(); m_end = std::chrono::steady_clock::now(); compute.init(slv, x); for (long int i = 0; i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta); obs.make_observation(slv.ap, slv.P.get(), slv.pi.get()); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), i); best_remaining = remaining; start_push = true; break; } if (remaining < best_remaining) { store_if_better(x, remaining, i); best_remaining = remaining; } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) { r.status = result_status::kappa_max_reached; break; } if (is_timelimit_reached()) { r.status = result_status::time_limit_reached; break; } } if (!start_push) { r.status = result_status::limit_reached; } else { for (int push = 0; push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_rng, pushing_k_factor * kappa, delta, theta, pushing_objective_amplifier); if (remaining == 0) store_if_better(x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); if (is_timelimit_reached()) break; for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run(slv, x, m_rng, kappa, delta, theta); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; if (is_timelimit_reached()) break; } } } if (m_best.remaining_constraints == 0) r.status = result_status::success; if (!m_best.x.empty()) { r.solutions.resize(1); convert(m_best, r.solutions[0], variables); } return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1e8, %rsp # imm = 0x1E8 vmovsd %xmm0, 0x80(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %r8, %r13 movl %ecx, %ebx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, 0x58(%rsp) vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) leaq 0x68(%rsp), %rdi movl %ecx, %esi vzeroupper callq 0x368ae movq 0x10(%r14), %r12 movq 0x18(%r14), %rcx leaq 0xc8(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x8d226 fldl 0x20(%r12) fstpt 0xe8(%rsp) vxorpd %xmm1, %xmm1, %xmm1 fldl 0x28(%r12) fstpt 0xf4(%rsp) fldl 0x30(%r12) fstpt 0xdc(%rsp) fldl 0x8(%r12) vmovsd 0x10(%r12), %xmm0 fld %st(0) fstpt 0x4c(%rsp) vucomisd %xmm0, %xmm1 jbe 0x94c8c movq 0x10(%r14), %rdi leaq 0xc8(%rsp), %rsi movl %ebx, %edx fstpt (%rsp) callq 0x8d304 fstpt 0x94(%rsp) jmp 0x94ca5 fstp %st(0) vmovsd %xmm0, 0x108(%rsp) fldl 0x108(%rsp) fstpt 0x94(%rsp) fldl 0x38(%r12) fstpt 0x11c(%rsp) fldl 0x40(%r12) fstpt 0x110(%rsp) vcvttsd2si 0xa0(%r12), %rax movq 0x18(%r14), %rsi movq %rax, 0x88(%rsp) movq 0x8(%r15), %rax subq (%r15), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0x160(%rsp), %rdi leaq 0xc8(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0x8d378 movl 0xcc(%r12), %esi leaq 0x128(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x90(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0xb0(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0x94d87 cmpl $0x1, %eax je 0x94d61 cmpl $0x2, %eax jne 0x94d98 movq 0x18(%r14), %rdx leaq 0xb0(%rsp), %rdi leaq 0x68(%rsp), %rsi jmp 0x94d72 movq 0x18(%r14), %rdx leaq 0x68(%rsp), %rdi leaq 0xb0(%rsp), %rsi vmovsd 0x3bf2be(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x8b497 jmp 0x94d98 leaq 0x68(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0x8b41f leaq 0x68(%rsp), %r15 movq %r13, 0x78(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0x94dce movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd 0x40(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x94dca movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0x94da7 leaq 0xb8(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 vmovsd %xmm0, 0x40(%rsp) callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0x128(%rsp), %rdi leaq 0x160(%rsp), %rsi leaq 0x68(%rsp), %rdx callq 0x8d6a0 vmovsd 0x40(%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x68(%rsp), %rbx xorl %r15d, %r15d vmovsd %xmm0, 0x100(%rsp) fldl 0x100(%rsp) fldt 0x4c(%rsp) cmpq 0xb0(%r12), %r15 je 0x94f29 movq 0x18(%r14), %rcx fstpt 0x20(%rsp) leaq 0x128(%rsp), %rdi leaq 0x160(%rsp), %rsi movq %rbx, %rdx fldt 0x94(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x40(%rsp) fstpt (%rsp) callq 0x8d6e2 movl %eax, %r13d testl %eax, %eax je 0x94fd0 cmpl %ebp, %r13d jge 0x94ea0 movq %r14, %rdi movq %rbx, %rsi movl %r13d, %edx movq %r15, %rcx callq 0x95af4 movl %r13d, %ebp cmpq 0x88(%rsp), %r15 jle 0x94ef2 movl %r13d, 0xa8(%rsp) fildl 0xa8(%rsp) movl 0x1e0(%rsp), %eax movl %eax, 0xac(%rsp) fidivl 0xac(%rsp) fldt 0xdc(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xe8(%rsp) fmulp %st, %st(1) fldt 0x40(%rsp) faddp %st, %st(1) jmp 0x94ef6 fldt 0x40(%rsp) fldt 0xf4(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) fldz ja 0x94f29 fstp %st(0) movq %r14, %rdi fstpt 0x40(%rsp) callq 0x95b2c fldt 0x40(%rsp) fldt 0x4c(%rsp) testb %al, %al jne 0x94f29 incq %r15 jmp 0x94e3a fstp %st(0) fstp %st(0) movq 0x58(%rsp), %rax movl $0x5, 0xa0(%rax) fldz fldz fstp %st(1) fstp %st(0) cmpl $0x0, 0x50(%r14) jne 0x94f57 movq 0x58(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0x94f88 movq 0x58(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x90(%rsp), %edx movq %r14, %rdi callq 0x35781 leaq 0x128(%rsp), %rdi callq 0x393ac leaq 0x160(%rsp), %rdi callq 0x8dca8 leaq 0xd0(%rsp), %rdi callq 0x8affa leaq 0x70(%rsp), %rdi callq 0x357fe movq 0x58(%rsp), %rax addq $0x1e8, %rsp # imm = 0x1E8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi leaq 0x68(%rsp), %rbx movq %rbx, %rsi callq 0x8b74a movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0x95aaa movl $0x0, 0x64(%rsp) leaq 0x160(%rsp), %r15 leaq 0x68(%rsp), %rbp xorl %ebx, %ebx fldt 0x4c(%rsp) fldt 0x40(%rsp) cmpl 0xbc(%r12), %ebx jge 0x94f40 movq 0x18(%r14), %rcx fldt 0x11c(%rsp) fld %st(1) fstpt 0x40(%rsp) fmulp %st, %st(1) fldt 0x110(%rsp) fstpt 0x30(%rsp) fxch %st(1) fstpt 0x20(%rsp) leaq 0x128(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx fldt 0x94(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0x8da1c testl %eax, %eax jne 0x950a0 vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi movq %rbp, %rsi callq 0x8b74a movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x95aaa movq %r14, %rdi callq 0x95b2c fldt 0x4c(%rsp) fldt 0x40(%rsp) testb %al, %al jne 0x94f40 movl %ebx, 0x88(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0x951e6 movq 0x18(%r14), %rcx fxch %st(1) fstpt 0x20(%rsp) leaq 0x128(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx fldt 0x94(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x40(%rsp) fstpt (%rsp) callq 0x8d6e2 testl %eax, %eax je 0x95199 vcvtsi2sd %r13d, %xmm2, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0x95167 movl %eax, 0xa0(%rsp) fildl 0xa0(%rsp) movl 0x1e0(%rsp), %eax movl %eax, 0xa4(%rsp) fidivl 0xa4(%rsp) fldt 0xdc(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xe8(%rsp) fmulp %st, %st(1) fldt 0x40(%rsp) faddp %st, %st(1) jmp 0x9516b fldt 0x40(%rsp) fldt 0xf4(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) ja 0x951d6 movq %r14, %rdi fstpt 0x40(%rsp) callq 0x95b2c testb %al, %al jne 0x951de fldt 0x4c(%rsp) fldt 0x40(%rsp) incl %ebx jmp 0x950c4 vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi movq %rbp, %rsi callq 0x8b74a movl 0xc0(%r12), %eax imull 0x64(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0x95aaa fldt 0x4c(%rsp) fldt 0x40(%rsp) jmp 0x951e6 fldt 0x4c(%rsp) fxch %st(1) jmp 0x951e6 fldt 0x4c(%rsp) fldt 0x40(%rsp) movl 0x88(%rsp), %ebx decl 0x64(%rsp) incl %ebx jmp 0x95018 jmp 0x9522e jmp 0x95207 fstp %st(1) fstp %st(0) jmp 0x9522e movq %rax, %rbx jmp 0x9523e movq %rax, %rbx jmp 0x9524b movq %rax, %rbx jmp 0x95258 movq %rax, %rbx jmp 0x95262 jmp 0x9522e jmp 0x9522e jmp 0x9522e leaq 0xb8(%rsp), %rdi movq %rax, %rbx callq 0x357fe jmp 0x95231 movq %rax, %rbx leaq 0x128(%rsp), %rdi callq 0x393ac leaq 0x160(%rsp), %rdi callq 0x8dca8 leaq 0xd0(%rsp), %rdi callq 0x8affa leaq 0x70(%rsp), %rdi callq 0x357fe movq 0x58(%rsp), %rdi callq 0xea60 movq %rbx, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long)
inline bool is_better_solution(Float lhs, Float rhs) noexcept { if constexpr (std::is_same_v<Mode, minimize_tag>) return lhs < rhs; else return lhs > rhs; }
vucomisd 0x30(%rdi), %xmm0 jbe 0x952f8 pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0x95672 vmovsd (%rsp), %xmm1 vmovsd %xmm0, 0x38(%r14) movq %rbx, 0x48(%r14) andl $0x0, 0x50(%r14) vmovsd %xmm1, 0x30(%r14) addq $0x8, %rsp popq %rbx popq %r14 retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::pnm_observer>::is_timelimit_reached()
bool is_timelimit_reached() { m_end = std::chrono::steady_clock::now(); return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end); }
pushq %rbx movq %rdi, %rbx callq 0xb5a0 movq %rax, 0x8(%rbx) vxorpd %xmm2, %xmm2, %xmm2 movq 0x10(%rbx), %rcx subq (%rbx), %rax vmovsd (%rcx), %xmm0 vcvtsi2sd %rax, %xmm1, %xmm1 vdivsd 0x3c4725(%rip), %xmm1, %xmm1 # 0x459a80 vcmpnlepd %xmm2, %xmm0, %k1 vcmpltpd %xmm1, %xmm0, %k0 {%k1} kmovd %k0, %eax andb $0x1, %al popq %rbx retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
void baryonyx::details::pi_pnm_observer::make_observation<long double>(baryonyx::sparse_matrix<int> const&, long double const*, long double const*)
void make_observation(const sparse_matrix<int>& /*ap*/, const Float* /*P*/, const Float* pi) { static_assert(std::is_floating_point<Float>::value); auto it = m_pnm.begin(); colormap fct(-1.f, +1.f); for (int i = 0; i != constraints; ++i) *it = fct(pi[i]); m_pnm.flush(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp vmovsd 0x3c47a8(%rip), %xmm0 # 0x459b30 leaq 0x8(%rdi), %rax movq %rcx, %r14 leaq 0x18(%rsp), %rcx leaq 0x20(%rsp), %r13 movq %rdi, %r15 xorl %ebp, %ebp movq %rax, 0x10(%rsp) movq 0x8(%rdi), %rax movq %rax, (%rcx) vmovsd %xmm0, (%r13) movl (%r15), %eax cmpq %rax, %rbp je 0x953ec fldt (%r14) movq %r13, %rdi fstpt (%rsp) callq 0x9556a leaq 0x18(%rsp), %rdi movl %eax, %ebx movl %eax, %r12d shrl $0x10, %ebx callq 0x43224 movl %r12d, %ecx movb %cl, (%rax) movb %ch, 0x1(%rax) movb %bl, 0x2(%rax) incq %rbp addq $0x10, %r14 jmp 0x953b0 movq 0x10(%rsp), %rdi callq 0x43250 addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/observer.hpp
void baryonyx::details::ap_pnm_observer::make_observation<long double>(baryonyx::sparse_matrix<int> const&, long double const*, long double const*)
void make_observation(const sparse_matrix<int>& ap, const Float* P, const Float* /*pi*/) { static_assert(std::is_floating_point<Float>::value); colormap cm(-1.0f, 1.0f); pnm_array pnm(constraints, variables); if (!pnm) return; pnm.clear(); for (int k = 0; k != constraints; ++k) { auto [it, et] = ap.row(k); for (; it != et; ++it) { std::uint8_t* pointer = pnm(k, it->column); auto color_rgb = cm(P[it->value]); pointer[0] = color_rgb.red; pointer[1] = color_rgb.green; pointer[2] = color_rgb.blue; } } pnm(fmt::format("{}-P-{}.pnm", m_basename, m_frame++)); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp vmovsd 0x3c4714(%rip), %xmm0 # 0x459b30 movq %rdx, %r14 movq %rsi, 0x48(%rsp) leaq 0x10(%rsp), %rbx movq %rdi, %r15 vmovsd %xmm0, 0x50(%rsp) movl (%rdi), %esi movl 0x4(%rdi), %edx movq %rbx, %rdi callq 0x43284 movq (%rbx), %rdi testq %rdi, %rdi je 0x9553b movl 0x1c(%rsp), %eax imull 0x18(%rsp), %eax leal (%rax,%rax,2), %eax testl %eax, %eax je 0x95464 movl %eax, %edx xorl %esi, %esi callq 0xb1c0 leaq 0x10(%rsp), %rbp leaq 0x50(%rsp), %r13 xorl %r12d, %r12d movl (%r15), %eax cmpq %rax, %r12 je 0x954e4 movq 0x48(%rsp), %rsi leaq 0x20(%rsp), %rdi movl %r12d, %edx callq 0x3c868 movq 0x28(%rsp), %rax cmpq 0x20(%rsp), %rax je 0x954df movslq 0x4(%rax), %rdx movq %rbp, %rdi movq %r12, %rsi callq 0x432f6 movq %rax, %rbx movq 0x28(%rsp), %rax movq %r13, %rdi movslq (%rax), %rax shlq $0x4, %rax fldt (%r14,%rax) fstpt (%rsp) callq 0x9556a movb %al, (%rbx) movb %ah, 0x1(%rbx) shrl $0x10, %eax movb %al, 0x2(%rbx) movq 0x28(%rsp), %rax addq $0x8, %rax movq %rax, 0x28(%rsp) jmp 0x95490 incq %r12 jmp 0x95471 movl 0x8(%r15), %eax leal 0x1(%rax), %ecx movl %ecx, 0x8(%r15) vmovups 0x10(%r15), %xmm0 vmovaps %xmm0, 0x20(%rsp) movq %rax, 0x30(%rsp) leaq 0x3c50f5(%rip), %rdi # 0x45a5fc callq 0xf277 leaq 0x58(%rsp), %rdi pushq $0x1d popq %rcx leaq 0x20(%rsp), %r8 movq %rax, %rsi callq 0x1adbb leaq 0x58(%rsp), %rbx leaq 0x10(%rsp), %rdi movq %rbx, %rsi callq 0x4335a movq %rbx, %rdi callq 0xe956 leaq 0x10(%rsp), %rdi callq 0x42eac addq $0x78, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x10(%rsp), %rdi movq %rax, %rbx callq 0x42eac movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/observer.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::file_observer>::is_timelimit_reached()
bool is_timelimit_reached() { m_end = std::chrono::steady_clock::now(); return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end); }
pushq %rbx movq %rdi, %rbx callq 0xb5a0 movq %rax, 0x8(%rbx) vxorpd %xmm2, %xmm2, %xmm2 movq 0x10(%rbx), %rcx subq (%rbx), %rax vmovsd (%rcx), %xmm0 vcvtsi2sd %rax, %xmm1, %xmm1 vdivsd 0x3c4307(%rip), %xmm1, %xmm1 # 0x459a80 vcmpnlepd %xmm2, %xmm0, %k1 vcmpltpd %xmm1, %xmm0, %k0 {%k1} kmovd %k0, %eax andb $0x1, %al popq %rbx retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
void baryonyx::details::pi_file_observer::make_observation<long double>(baryonyx::sparse_matrix<int> const&, long double const*, long double const*)
void make_observation(const sparse_matrix<int>& /*ap*/, const Float* /*P*/, const Float* pi) { static_assert(std::is_floating_point<Float>::value); if (m_ofs) { if (m_len > 1) { m_ofs << pi[0]; for (int i = 1; i != constraints; ++i) m_ofs << ' ' << pi[i]; } else { m_ofs << pi[0]; } m_ofs << '\n'; } }
movq 0x8(%rdi), %rax movq -0x18(%rax), %rax testb $0x5, 0x28(%rdi,%rax) je 0x957a0 retq pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x10, %rsp movl 0x4(%rdi), %ebp leaq 0x8(%rdi), %r15 fldt (%rcx) movq %rdi, %r14 movq %rcx, %rbx fstpt (%rsp) movq %r15, %rdi callq 0xb0e0 cmpl $0x2, %ebp jl 0x957fe addq $0x10, %rbx pushq $0x1 popq %r12 pushq $0x20 popq %rbp movl (%r14), %eax cmpq %rax, %r12 je 0x957fe movq %r15, %rdi movl %ebp, %esi callq 0xb400 fldt (%rbx) movq %rax, %rdi fstpt (%rsp) callq 0xb0e0 incq %r12 addq $0x10, %rbx jmp 0x957d6 pushq $0xa popq %rsi movq %r15, %rdi addq $0x10, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp jmp 0xb400 nop
/quesnel[P]baryonyx/lib/src/observer.hpp
void baryonyx::details::ap_file_observer::make_observation<long double>(baryonyx::sparse_matrix<int> const&, long double const*, long double const*)
void make_observation(const sparse_matrix<int>& ap, const Float* P, const Float* /*pi*/) { static_assert(std::is_floating_point<Float>::value); std::ofstream ofs(fmt::format("{}-P-{}.txt", m_basename, m_frame++)); for (int k = 0; k != constraints; ++k) { std::fill_n(std::begin(m_value), variables, 0.0f); auto [it, et] = ap.row(k); for (; it != et; ++it) m_value[it->column] = static_cast<float>(P[it->value]); std::copy(m_value.begin(), m_value.end(), std::ostream_iterator<Float>(ofs, " ")); ofs << '\n'; } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x258, %rsp # imm = 0x258 movl 0x8(%rdi), %eax movq %rdi, %r15 movq %rdx, %rbx movq %rsi, %r14 movq %rsp, %r12 leal 0x1(%rax), %ecx movl %ecx, 0x8(%rdi) vmovups 0x10(%rdi), %xmm0 leaq 0x3c4def(%rip), %rdi # 0x45a637 vmovaps %xmm0, (%r12) movq %rax, 0x10(%r12) callq 0xf277 leaq 0x38(%rsp), %r13 pushq $0x1d popq %rcx movq %r13, %rdi movq %rax, %rsi movq %r12, %r8 callq 0x1adbb leaq 0x58(%rsp), %r12 pushq $0x10 popq %rdx movq %r12, %rdi movq %r13, %rsi callq 0xb120 leaq 0x38(%rsp), %rdi callq 0xe956 xorl %ebp, %ebp movq %rsp, %r13 cmpl (%r15), %ebp je 0x9591e movq 0x30(%r15), %rdi movl 0x4(%r15), %esi andl $0x0, (%rsp) movq %r13, %rdx callq 0x43a03 movq %r13, %rdi movq %r14, %rsi movl %ebp, %edx callq 0x3c868 movq (%rsp), %rax movq 0x8(%rsp), %rcx movq 0x30(%r15), %rsi cmpq %rax, %rcx je 0x958e8 movslq (%rcx), %rdx shlq $0x4, %rdx fldt (%rbx,%rdx) movslq 0x4(%rcx), %rdx addq $0x8, %rcx fstps (%rsi,%rdx,4) movq %rcx, 0x8(%rsp) jmp 0x958c7 movq 0x38(%r15), %rdx leaq 0x3cde52(%rip), %rax # 0x463745 movq %r12, 0x28(%rsp) movq %rax, 0x30(%rsp) leaq 0x38(%rsp), %rdi leaq 0x28(%rsp), %rcx callq 0x95962 movq %r12, %rdi pushq $0xa popq %rsi callq 0xb400 incl %ebp jmp 0x95890 leaq 0x58(%rsp), %rdi callq 0xb4d0 addq $0x258, %rsp # imm = 0x258 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x38(%rsp), %rdi movq %rax, %rbx callq 0xe956 jmp 0x9595a jmp 0x9594d jmp 0x9594d leaq 0x58(%rsp), %rdi movq %rax, %rbx callq 0xb4d0 movq %rbx, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/observer.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::store_if_better(baryonyx::bit_array const&, double, long)
inline bool is_better_solution(Float lhs, Float rhs) noexcept { if constexpr (std::is_same_v<Mode, minimize_tag>) return lhs < rhs; else return lhs > rhs; }
vucomisd 0x30(%rdi), %xmm0 jbe 0x95af2 pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0x95b6c vmovsd (%rsp), %xmm1 vmovsd %xmm0, 0x38(%r14) movq %rbx, 0x48(%r14) andl $0x0, 0x50(%r14) vmovsd %xmm1, 0x30(%r14) addq $0x8, %rsp popq %rbx popq %r14 retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::is_timelimit_reached()
bool is_timelimit_reached() { m_end = std::chrono::steady_clock::now(); return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end); }
pushq %rbx movq %rdi, %rbx callq 0xb5a0 movq %rax, 0x8(%rbx) vxorpd %xmm2, %xmm2, %xmm2 movq 0x10(%rbx), %rcx subq (%rbx), %rax vmovsd (%rcx), %xmm0 vcvtsi2sd %rax, %xmm1, %xmm1 vdivsd 0x3c3f2b(%rip), %xmm1, %xmm1 # 0x459a80 vcmpnlepd %xmm2, %xmm0, %k1 vcmpltpd %xmm1, %xmm0, %k0 {%k1} kmovd %k0, %eax andb $0x1, %al popq %rbx retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::result baryonyx::itm::optimize_problem<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&)
inline result optimize_problem(const context& ctx, const problem& pb) { result r; if (ctx.start) ctx.start(ctx.parameters); auto constraints{ make_merged_constraints(ctx, pb) }; if (constraints.empty() || pb.vars.values.empty()) { r.status = result_status::success; r.solutions.resize(1); r.solutions.back().value = pb.objective.value; r.strings = pb.strings; r.affected_vars = pb.affected_vars; r.variable_name = pb.vars.names; return r; } random_engine rng(init_random_generator_seed(ctx)); auto variables = length(pb.vars.values); auto cost = Cost(pb.objective, variables); auto cost_constant = pb.objective.value; const auto thread = get_thread_number(ctx); std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors; std::vector<std::thread> pool(thread); best_solution_recorder<Cost, Float, Mode> best_recorder( rng, thread, cost, cost_constant, variables, constraints, ctx.parameters.init_population_size); auto seeds = generate_seed(rng, thread); std::atomic_bool stop_task; stop_task.store(false); for (unsigned i = 0u; i != thread; ++i) functors.emplace_back(ctx, i, seeds[i]); for (unsigned i = 0u; i != thread; ++i) pool[i] = std::thread(std::ref(functors[i]), std::ref(stop_task), std::ref(best_recorder), std::cref(constraints), variables, std::cref(cost), cost_constant); const auto start = std::chrono::steady_clock::now(); auto end = start; do { std::this_thread::sleep_for(std::chrono::seconds{ 1L }); if (ctx.update) { auto call_number = 0L; for (auto i = 0u; i != thread; ++i) call_number += functors[i].m_call_number; int constraints_remaining; long int loop; double value; double duration; best_recorder.get_best( constraints_remaining, value, duration, loop); ctx.update( constraints_remaining, value, loop, duration, call_number); } end = std::chrono::steady_clock::now(); } while (!is_time_limit(ctx.parameters.time_limit, start, end)); stop_task.store(true); for (auto& t : pool) t.join(); r.strings = pb.strings; r.affected_vars = pb.affected_vars; r.variable_name = pb.vars.names; r.variables = variables; r.constraints = length(constraints); const auto& first = best_recorder.get_best(0); if (!first.is_solution()) r.status = result_status::time_limit_reached; else r.status = result_status::success; r.duration = first.duration; r.loop = first.loop; r.remaining_constraints = first.remaining_constraints; switch (ctx.parameters.storage) { case solver_parameters::storage_type::one: { r.solutions.resize(1); convert(first, r.solutions[0], variables); } break; case solver_parameters::storage_type::bound: { r.solutions.resize(2); convert(first, r.solutions[0], variables); convert(best_recorder.get_worst(), r.solutions[1], variables); } break; case solver_parameters::storage_type::five: { r.solutions.resize(5); for (int i = 0; i != 5; ++i) convert(best_recorder.get_best(i), r.solutions[i], variables); } break; } best_recorder.show_population(ctx); if (ctx.finish) ctx.finish(r); return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 vxorpd %xmm0, %xmm0, %xmm0 movq %rdx, %r13 movq %rsi, %r15 movq %rdi, %r12 vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) cmpq $0x0, 0x128(%rsi) je 0x95bf1 leaq 0x118(%r15), %rdi movq %r15, %rsi vzeroupper callq 0x3527e leaq 0x48(%rsp), %rdi movq %r15, %rsi movq %r13, %rdx vzeroupper callq 0x450078 movq 0x48(%rsp), %rax cmpq 0x50(%rsp), %rax je 0x95d50 movq 0xa8(%r13), %rax cmpq 0xb0(%r13), %rax je 0x95d50 movq %r15, %rdi callq 0x353ba movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF xorl %edx, %edx divq %rcx cmpq $0x1, %rdx adcq $0x0, %rdx movq %rdx, 0x40(%rsp) movq 0xb0(%r13), %rax subq 0xa8(%r13), %rax pushq $0xc popq %rcx cqto leaq 0x10(%r13), %rsi idivq %rcx movl %eax, 0x4(%rsp) leaq 0xb8(%rsp), %rdi movl %eax, %edx movq %r12, 0x10(%rsp) callq 0x9650c vmovsd 0x40(%r13), %xmm0 vmovsd %xmm0, 0x38(%rsp) movq %r15, %rdi callq 0x35447 andq $0x0, 0x70(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movl %eax, %ebp vmovapd %xmm0, 0x60(%rsp) leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rdx movq %rbp, %rsi callq 0x35462 vmovsd 0x38(%rsp), %xmm0 movl 0xc4(%r15), %eax movl 0x4(%rsp), %r8d subq $0x8, %rsp movl %ebp, %edx leaq 0xe0(%rsp), %rdi leaq 0x48(%rsp), %rsi leaq 0xc0(%rsp), %rcx leaq 0x50(%rsp), %r9 pushq %rax callq 0x96720 popq %rax popq %rcx leaq 0x30(%rsp), %rdi leaq 0x40(%rsp), %rsi movl %ebp, %edx callq 0x3551c xorl %eax, %eax movb %al, 0x3(%rsp) xorl %ecx, %ecx leaq 0x60(%rsp), %rbx leaq 0x8(%rsp), %r14 xchgb %cl, 0x3(%rsp) leaq 0x90(%r13), %rcx movq %rcx, 0x88(%rsp) movl %eax, 0x8(%rsp) cmpl %ebp, %eax je 0x95dab movl %eax, %ecx shlq $0x3, %rcx addq 0x30(%rsp), %rcx movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x96786 movl 0x8(%rsp), %eax incl %eax jmp 0x95d27 andl $0x0, 0xa0(%r12) leaq 0x68(%r12), %rdi pushq $0x1 popq %rsi callq 0x35292 vmovsd 0x40(%r13), %xmm0 movq 0x70(%r12), %rax vmovsd %xmm0, -0x8(%rax) movq %r12, %rdi movq %r13, %rsi callq 0x31d28 leaq 0xc0(%r13), %rsi leaq 0x20(%r12), %rdi callq 0x352c2 addq $0x90, %r13 leaq 0x50(%r12), %rdi movq %r13, %rsi callq 0x352ec jmp 0x96146 movq %r13, 0x80(%rsp) movq %r15, %r13 leaq 0x8(%rsp), %r15 leaq 0x98(%rsp), %r14 leaq 0x4(%rsp), %rbx xorl %r12d, %r12d cmpq %rbp, %r12 je 0x95e6f imulq $0xc0, %r12, %rax addq 0x60(%rsp), %rax leaq 0x3(%rsp), %r10 leaq 0xd8(%rsp), %r11 movq %r10, 0x20(%rsp) leaq 0x48(%rsp), %r10 movq %r11, 0x18(%rsp) movq %r10, 0x98(%rsp) movq %rax, 0x28(%rsp) leaq 0xb8(%rsp), %rax movq %rax, 0x90(%rsp) leaq 0x20(%rsp), %rdx leaq 0x38(%rsp), %rax movq %r15, %rdi leaq 0x28(%rsp), %rsi leaq 0x18(%rsp), %rcx movq %r14, %r8 movq %rbx, %r9 pushq %rax leaq 0x98(%rsp), %rax pushq %rax callq 0x967d2 popq %rax popq %rcx leaq (,%r12,8), %rdi addq 0xa0(%rsp), %rdi movq %r15, %rsi callq 0x356d6 movq %r15, %rdi callq 0x356f0 incq %r12 jmp 0x95dcb callq 0xb5a0 imulq $0xc0, %rbp, %r15 leaq 0x138(%r13), %r12 leaq 0x8(%rsp), %rbp movq %rax, %rbx movq $0x1, 0x8(%rsp) movq %rbp, %rdi callq 0x356fd cmpq $0x0, 0x148(%r13) je 0x95f04 movq 0x60(%rsp), %rax xorl %ecx, %ecx xorl %r14d, %r14d cmpq %rcx, %r15 je 0x95ec5 addq 0xb0(%rax,%rcx), %r14 addq $0xc0, %rcx jmp 0x95eaf leaq 0xe0(%rsp), %rdi leaq 0x18(%rsp), %rsi leaq 0x28(%rsp), %rdx leaq 0x20(%rsp), %rcx movq %rbp, %r8 callq 0x9f4ce vmovsd 0x28(%rsp), %xmm0 vmovsd 0x20(%rsp), %xmm1 movq 0x8(%rsp), %rdx movl 0x18(%rsp), %esi movq %r12, %rdi movq %r14, %rcx callq 0x35736 callq 0xb5a0 vmovsd (%r13), %xmm0 subq %rbx, %rax vxorpd %xmm1, %xmm1, %xmm1 vucomisd %xmm0, %xmm1 vcvtsi2sd %rax, %xmm2, %xmm1 vdivsd 0x3c3b59(%rip), %xmm1, %xmm1 # 0x459a80 jae 0x95e8a vucomisd %xmm0, %xmm1 jbe 0x95e8a movb $0x1, %al xchgb %al, 0x3(%rsp) movq 0xa0(%rsp), %rbx movq 0xa8(%rsp), %r14 movq 0x10(%rsp), %r12 cmpq %r14, %rbx je 0x95f65 movq %rbx, %rdi callq 0xb1a0 addq $0x8, %rbx jmp 0x95f52 movq 0x80(%rsp), %rbx movq %r12, %rdi movq %rbx, %rsi callq 0x31d28 addq $0xc0, %rbx leaq 0x20(%r12), %rdi movq %rbx, %rsi callq 0x352c2 leaq 0x50(%r12), %rdi movq 0x88(%rsp), %rsi callq 0x352ec movl 0x4(%rsp), %eax movl %eax, 0x90(%r12) movq 0x50(%rsp), %rax subq 0x48(%rsp), %rax pushq $0x28 popq %rcx cqto xorl %esi, %esi idivq %rcx movq 0x118(%rsp), %rdi movq 0x130(%rsp), %rcx movl %eax, 0x94(%r12) movslq (%rdi), %rax imulq $0x38, %rax, %rax movl 0x30(%rcx,%rax), %edx leaq (%rcx,%rax), %rbx testl %edx, %edx setne %sil leal (%rsi,%rsi,2), %esi movl %esi, 0xa0(%r12) vmovsd 0x18(%rcx,%rax), %xmm0 vmovsd %xmm0, 0x80(%r12) movq 0x28(%rcx,%rax), %rax movq %rax, 0x88(%r12) movl %edx, 0x98(%r12) movl 0xe8(%r13), %eax testl %eax, %eax je 0x960c0 cmpl $0x1, %eax je 0x96088 cmpl $0x2, %eax jne 0x960df leaq 0x68(%r12), %rbx pushq $0x5 popq %rsi movq %rbx, %rdi callq 0x35292 xorl %r14d, %r14d xorl %r15d, %r15d cmpq $0x5, %r15 je 0x960df movq 0x118(%rsp), %rax movq (%rbx), %rsi movl 0x4(%rsp), %edx movslq (%rax,%r15,4), %rax addq %r14, %rsi imulq $0x38, %rax, %rdi addq 0x130(%rsp), %rdi callq 0x35781 incq %r15 addq $0x20, %r14 jmp 0x9604e leaq 0x68(%r12), %r14 pushq $0x2 popq %rsi movq %r14, %rdi callq 0x35292 movl 0x4(%rsp), %edx movq (%r14), %rsi movq %rbx, %rdi callq 0x35781 leaq 0xe0(%rsp), %rdi callq 0x9f54c movq (%r14), %rsi movq %rax, %rbx addq $0x20, %rsi jmp 0x960d3 leaq 0x68(%r12), %r14 pushq $0x1 popq %rsi movq %r14, %rdi callq 0x35292 movq (%r14), %rsi movl 0x4(%rsp), %edx movq %rbx, %rdi callq 0x35781 leaq 0xd8(%rsp), %rdi movq %r13, %rsi callq 0x96884 cmpq $0x0, 0x168(%r13) je 0x9610b addq $0x158, %r13 # imm = 0x158 movq %r13, %rdi movq %r12, %rsi callq 0x357ea leaq 0x30(%rsp), %rdi callq 0x357fe leaq 0xd8(%rsp), %rdi callq 0x96898 leaq 0xa0(%rsp), %rdi callq 0x35836 leaq 0x60(%rsp), %rdi callq 0x9f62c leaq 0xb8(%rsp), %rdi callq 0x968b6 leaq 0x48(%rsp), %rdi callq 0x35858 movq %r12, %rax addq $0x198, %rsp # imm = 0x198 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx jmp 0x961a7 movq %rax, %rbx jmp 0x961b4 movq %rax, %rbx jmp 0x961c1 jmp 0x9618b jmp 0x9617c jmp 0x9619a jmp 0x9619a movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0x961e2 movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0x961d8 jmp 0x9619a jmp 0x9619a jmp 0x9619a jmp 0x9619a jmp 0x9619a movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x357fe leaq 0xd8(%rsp), %rdi callq 0x96898 leaq 0xa0(%rsp), %rdi callq 0x35836 leaq 0x60(%rsp), %rdi callq 0x9f62c leaq 0xb8(%rsp), %rdi callq 0x968b6 leaq 0x48(%rsp), %rdi callq 0x35858 movq 0x10(%rsp), %rdi callq 0xea60 movq %rbx, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::result baryonyx::itm::solve_problem<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&)
inline result solve_problem(const context& ctx, const problem& pb) { if (ctx.start) ctx.start(ctx.parameters); result ret; auto variables = length(pb.vars.values); auto constraints{ make_merged_constraints(ctx, pb) }; if (!constraints.empty() && !pb.vars.values.empty()) { random_engine rng(init_random_generator_seed(ctx)); auto cost = Cost(pb.objective, variables); auto cost_constant = pb.objective.value; switch (ctx.parameters.observer) { case solver_parameters::observer_type::pnm: { using obs = pnm_observer; solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng); ret = slv(constraints, variables, cost, cost_constant); } break; case solver_parameters::observer_type::file: { using obs = file_observer; solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng); ret = slv(constraints, variables, cost, cost_constant); } break; default: { using obs = none_observer; solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng); ret = slv(constraints, variables, cost, cost_constant); break; } } } else { ret.status = result_status::success; ret.solutions.resize(1); ret.solutions.back().value = pb.objective.value; } ret.strings = pb.strings; ret.variable_name = std::move(pb.vars.names); ret.affected_vars = std::move(pb.affected_vars); ret.variables = variables; ret.constraints = length(constraints); if (ctx.finish) ctx.finish(ret); return ret; }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x140, %rsp # imm = 0x140 cmpq $0x0, 0x128(%rsi) movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx je 0x96226 leaq 0x118(%r14), %rdi movq %r14, %rsi callq 0x3527e vxorps %xmm0, %xmm0, %xmm0 vmovups %zmm0, 0x58(%rbx) vmovups %zmm0, 0x40(%rbx) vmovups %zmm0, (%rbx) movq $0x7fffffff, 0x98(%rbx) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rbx) movq 0xb0(%r15), %rax subq 0xa8(%r15), %rax pushq $0xc popq %rcx cqto idivq %rcx movq %rax, %r12 leaq 0x8(%rsp), %rdi movq %r14, %rsi movq %r15, %rdx vzeroupper callq 0x450078 movq 0x8(%rsp), %rax cmpq 0x10(%rsp), %rax je 0x9634f movq 0xa8(%r15), %rax cmpq 0xb0(%r15), %rax je 0x9634f movq %r14, %rdi callq 0x353ba movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF xorl %edx, %edx leaq 0x10(%r15), %rsi divq %rcx cmpq $0x1, %rdx adcq $0x0, %rdx movq %rdx, (%rsp) leaq 0x20(%rsp), %rdi movl %r12d, %edx callq 0x9650c vmovsd 0x40(%r15), %xmm0 movl 0xe4(%r14), %eax vxorps %xmm1, %xmm1, %xmm1 leaq 0x40(%rsp), %rsi cmpl $0x1, %eax je 0x96376 cmpl $0x2, %eax jne 0x963c5 movabsq $-0x10000000000000, %r9 # imm = 0xFFF0000000000000 vmovaps %xmm1, (%rsi) movq %r14, 0x10(%rsi) movq %rsp, %rax movq %rax, 0x18(%rsi) vmovaps %xmm1, 0x20(%rsi) movq %r9, 0x30(%rsi) andq $0x0, 0x48(%rsi) vmovups %xmm1, 0x38(%rsi) movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF leaq 0x98(%rsp), %rdi leaq 0x8(%rsp), %rdx leaq 0x20(%rsp), %r8 movl %r12d, %ecx callq 0x9fd90 jmp 0x96412 andl $0x0, 0xa0(%rbx) leaq 0x68(%rbx), %rdi pushq $0x1 popq %rsi callq 0x35292 vmovsd 0x40(%r15), %xmm0 movq 0x70(%rbx), %rax vmovsd %xmm0, -0x8(%rax) jmp 0x96441 movabsq $-0x10000000000000, %r9 # imm = 0xFFF0000000000000 vmovaps %xmm1, (%rsi) movq %r14, 0x10(%rsi) movq %rsp, %rax movq %rax, 0x18(%rsi) vmovaps %xmm1, 0x20(%rsi) movq %r9, 0x30(%rsi) andq $0x0, 0x48(%rsi) vmovups %xmm1, 0x38(%rsi) movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF leaq 0x98(%rsp), %rdi leaq 0x8(%rsp), %rdx leaq 0x20(%rsp), %r8 movl %r12d, %ecx callq 0x9f654 jmp 0x96412 movabsq $-0x10000000000000, %r9 # imm = 0xFFF0000000000000 vmovaps %xmm1, (%rsi) movq %r14, 0x10(%rsi) movq %rsp, %rax movq %rax, 0x18(%rsi) vmovaps %xmm1, 0x20(%rsi) movq %r9, 0x30(%rsi) andq $0x0, 0x48(%rsi) vmovups %xmm1, 0x38(%rsi) movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF leaq 0x98(%rsp), %rdi leaq 0x8(%rsp), %rdx leaq 0x20(%rsp), %r8 movl %r12d, %ecx callq 0xa04cc leaq 0x98(%rsp), %r13 movq %rbx, %rdi movq %r13, %rsi callq 0x41d9e movq %r13, %rdi callq 0xea60 leaq 0x68(%rsp), %rdi callq 0x357fe leaq 0x20(%rsp), %rdi callq 0x968b6 leaq 0x90(%r15), %r13 movq %rbx, %rdi movq %r15, %rsi callq 0x31d28 leaq 0x50(%rbx), %rdi movq %r13, %rsi callq 0x352ec addq $0xc0, %r15 leaq 0x20(%rbx), %rdi movq %r15, %rsi callq 0x352c2 movq 0x10(%rsp), %rax movl %r12d, 0x90(%rbx) subq 0x8(%rsp), %rax pushq $0x28 popq %rcx cqto idivq %rcx movl %eax, 0x94(%rbx) cmpq $0x0, 0x168(%r14) je 0x964ad addq $0x158, %r14 # imm = 0x158 movq %r14, %rdi movq %rbx, %rsi callq 0x357ea leaq 0x8(%rsp), %rdi callq 0x35858 movq %rbx, %rax addq $0x140, %rsp # imm = 0x140 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x964cf jmp 0x964cf leaq 0x68(%rsp), %rdi movq %rax, %r14 callq 0x357fe leaq 0x20(%rsp), %rdi callq 0x968b6 jmp 0x964f2 jmp 0x964ef movq %rax, %r14 jmp 0x964fc movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x35858 movq %rbx, %rdi callq 0xea60 movq %r14, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::quadratic_cost_type<long double>::quadratic_cost_type(baryonyx::objective_function const&, int)
quadratic_cost_type(const objective_function& obj_, int n) : obj(obj_) , linear_elements(std::make_unique<Float[]>(n)) , quadratic_elements( std::make_unique<quad[]>(2 * obj.qelements.size() + 1)) , indices(std::make_unique<int[]>(n + 1)) { for (int i = 0, e = length(obj.elements); i != e; ++i) { bx_ensures(0 <= obj.elements[i].variable_index && obj.elements[i].variable_index < n); linear_elements[obj.elements[i].variable_index] += static_cast<Float>(obj.elements[i].factor); } indices[0] = 0; for (int var = 0; var != n; ++var) { indices[var + 1] = indices[var]; for (int i = 0, e = length(obj.qelements); i != e; ++i) { bx_ensures(0 <= obj.qelements[i].variable_index_a && obj.qelements[i].variable_index_a < n); bx_ensures(0 <= obj.qelements[i].variable_index_b && obj.qelements[i].variable_index_b < n); if (var == obj.qelements[i].variable_index_a || var == obj.qelements[i].variable_index_b) ++indices[var + 1]; } } for (int id = 0, var = 0; var != n; ++var) { for (int i = 0, e = length(obj.qelements); i != e; ++i) { const bool is_a = obj.qelements[i].variable_index_a == var; const bool is_b = obj.qelements[i].variable_index_b == var; if (is_a || is_b) { quadratic_elements[id].factor = static_cast<Float>(obj.qelements[i].factor); quadratic_elements[id].id = is_a ? obj.qelements[i].variable_index_b : obj.qelements[i].variable_index_a; ++id; } } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rsi, (%rdi) leaq 0x8(%rdi), %r15 movslq %edx, %rsi movq %rdi, %r13 movl %edx, %ebx movq %r15, %rdi callq 0x8afb9 movq (%r13), %rax leaq 0x10(%r13), %r14 movq 0x20(%rax), %rsi subq 0x18(%rax), %rsi sarq $0x3, %rsi orq $0x1, %rsi movq %r14, %rdi callq 0x968d9 leal 0x1(%rbx), %eax leaq 0x18(%r13), %r12 movslq %eax, %rsi movq %r12, %rdi callq 0x28eb6 movq (%r13), %rax movq 0x8(%r13), %rdx movabsq $0xffffffff0, %rcx # imm = 0xFFFFFFFF0 xorl %r8d, %r8d movq (%rax), %rsi movq 0x8(%rax), %rdi subq %rsi, %rdi andq %rcx, %rdi cmpq %r8, %rdi je 0x965b4 movslq 0x8(%rsi,%r8), %r9 testq %r9, %r9 js 0x966de cmpl %ebx, %r9d jge 0x966de shlq $0x4, %r9 fldt (%rdx,%r9) faddl (%rsi,%r8) fstpt (%rdx,%r9) addq $0x10, %r8 jmp 0x96582 movq (%r12), %rdx movl %ebx, %esi xorl %edi, %edi xorl %r8d, %r8d andl $0x0, (%rdx) cmpq %rsi, %r8 je 0x9662f movl %edi, 0x4(%rdx,%r8,4) leaq 0x1(%r8), %r9 xorl %r15d, %r15d movq 0x18(%rax), %r10 movq 0x20(%rax), %r11 subq %r10, %r11 andq %rcx, %r11 cmpq %r15, %r11 je 0x9662a movslq 0x8(%r10,%r15), %r12 testq %r12, %r12 js 0x9669c cmpl %ebx, %r12d jge 0x9669c movslq 0xc(%r10,%r15), %r13 testq %r13, %r13 js 0x966bd cmpl %ebx, %r13d jae 0x966bd cmpq %r12, %r8 je 0x9661e cmpq %r13, %r8 jne 0x96624 incl %edi movl %edi, (%rdx,%r9,4) addq $0x10, %r15 jmp 0x965e1 movq %r9, %r8 jmp 0x965c2 xorl %edx, %edx xorl %esi, %esi cmpl %ebx, %esi je 0x9668d movq 0x18(%rax), %rdi movq 0x20(%rax), %r8 movq (%r14), %r9 xorl %r10d, %r10d subq %rdi, %r8 andq %rcx, %r8 cmpq %r10, %r8 je 0x96689 movl 0x8(%rdi,%r10), %r11d movl 0xc(%rdi,%r10), %ebp cmpl %esi, %r11d je 0x96663 cmpl %esi, %ebp jne 0x96683 movslq %edx, %rdx fldl (%rdi,%r10) movq %rdx, %r15 shlq $0x5, %r15 cmpl %esi, %r11d cmovnel %r11d, %ebp incl %edx fstpt (%r9,%r15) movl %ebp, 0x10(%r9,%r15) addq $0x10, %r10 jmp 0x9664b incl %esi jmp 0x96633 addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3c1d87(%rip), %rdi # 0x45842a leaq 0x3c3fe8(%rip), %rsi # 0x45a692 leaq 0x3c38db(%rip), %rdx # 0x459f8c leaq 0x3c402a(%rip), %rcx # 0x45a6e2 callq 0x2813f leaq 0x3c1d66(%rip), %rdi # 0x45842a leaq 0x3c401c(%rip), %rsi # 0x45a6e7 leaq 0x3c38ba(%rip), %rdx # 0x459f8c leaq 0x3c405e(%rip), %rcx # 0x45a737 callq 0x2813f leaq 0x3c1d45(%rip), %rdi # 0x45842a leaq 0x3c3f57(%rip), %rsi # 0x45a643 leaq 0x3c3899(%rip), %rdx # 0x459f8c leaq 0x3c3f93(%rip), %rcx # 0x45a68d callq 0x2813f movq %r14, %rdi movq %rax, %rbx callq 0x9691a jmp 0x9670f movq %rax, %rbx movq %r15, %rdi callq 0x8affa movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<long double>, baryonyx::itm::maximize_tag>::storage(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, baryonyx::itm::quadratic_cost_type<long double> const&, double, int, int, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&)
storage(random_engine& rng, const Cost& costs_, const double cost_constant_, const int population_size, const int variables, const std::vector<merged_constraint>& constraints_) : m_indices(population_size) , m_data(population_size) , m_bastert(variables) , m_random(variables) , costs(costs_) , cost_constant(cost_constant_) , m_size(population_size) { for (auto& elem : m_data) elem.x = bit_array(variables); init_with_bastert<Cost, Mode>(m_bastert, costs_, variables, 0); for (int i = 0, e = m_size / 2; i != e; ++i) { m_data[i].x = m_bastert; std::bernoulli_distribution dist( std::clamp(static_cast<double>(i) / (5 * e), 0.0, 1.0)); for (int v = 0; v != variables; ++v) if (dist(rng)) m_data[i].x.invert(v); } for (int i = m_size / 2, e = m_size; i + 1 < e; i += 2) { init_with_random(m_data[i].x, rng, variables, 0.2); init_with_random(m_data[i + 1].x, rng, variables, 0.8); init_with_pre_solve<Cost, Mode>( m_data[i].x, m_data[i + 1].x, rng, costs_, constraints_, std::clamp(static_cast<double>(i) / (5 * e), 0.0, 1.0)); } for (int i = 0, e = m_size; i != e; ++i) { m_data[i].make_hash(); m_data[i].value = costs.results(m_data[i].x, cost_constant_); m_data[i].remaining_constraints = 0; for (int k = 0, end_k = length(constraints_); k != end_k; ++k) { int sum = 0; for (const auto& elem : constraints_[k].elements) { if (m_data[i].x[elem.variable_index]) sum += elem.factor; } if (!(constraints_[k].min <= sum && sum <= constraints_[k].max)) ++m_data[i].remaining_constraints; } } std::iota(std::begin(m_indices), std::end(m_indices), 0); sort(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %rdx, 0x18(%rsp) movq %rdi, %r15 movslq %ecx, %r12 leaq 0x58(%rsp), %rdx movq %rsi, %r13 movq %r9, 0x28(%rsp) movl %r8d, %ebp movl %ecx, %ebx vmovupd %ymm0, 0x18(%rdi) vmovupd %ymm0, (%rdi) addq $0x38, %rdi movq %r12, %rsi movq %rdi, 0x48(%rsp) vzeroupper callq 0x3140c leaq 0x50(%r15), %r14 leaq 0x58(%rsp), %rdx movq %r14, %rdi movq %r12, %rsi callq 0x36194 leaq 0x68(%r15), %rdi movl %ebp, %esi movq %rdi, 0x10(%rsp) callq 0x368ae leaq 0x78(%r15), %rdi movl %ebp, %esi callq 0x368ae vmovsd 0x40(%rsp), %xmm0 movq 0x18(%rsp), %rax movq %r15, 0x8(%rsp) leaq 0x58(%rsp), %r12 movq %rax, 0x88(%r15) vmovsd %xmm0, 0x90(%r15) movl %ebx, 0x98(%r15) movq 0x50(%r15), %rbx movq 0x58(%r15), %r15 cmpq %r15, %rbx je 0x96a21 movq %r12, %rdi movl %ebp, %esi callq 0x368ae movq %rbx, %rdi movq %r12, %rsi callq 0x3696c leaq 0x60(%rsp), %rdi callq 0x357fe addq $0x38, %rbx jmp 0x969f7 movq 0x10(%rsp), %rdi movq 0x18(%rsp), %rsi xorl %r15d, %r15d movl %ebp, %edx xorl %ecx, %ecx callq 0x96d3f movq 0x8(%rsp), %rax movl 0x98(%rax), %eax pushq $0x2 popq %rcx cltd idivl %ecx movq %rax, 0x20(%rsp) leal (%rax,%rax,4), %eax vcvtsi2sd %eax, %xmm1, %xmm0 vmovsd %xmm0, 0x50(%rsp) cmpq 0x20(%rsp), %r15 je 0x96ad3 movq (%r14), %rdi imulq $0x38, %r15, %r12 addq %r12, %rdi movq 0x10(%rsp), %rsi callq 0x36a44 vcvtsi2sd %r15d, %xmm3, %xmm0 vdivsd 0x50(%rsp), %xmm0, %xmm0 vmovsd 0x3bd5b0(%rip), %xmm1 # 0x454038 xorl %ebx, %ebx vminsd %xmm0, %xmm1, %xmm2 vxorpd %xmm1, %xmm1, %xmm1 vcmpltsd %xmm1, %xmm0, %k1 vmovsd %xmm1, %xmm2, %xmm2 {%k1} vmovapd %xmm2, 0x30(%rsp) cmpl %ebx, %ebp je 0x96ace movq %r13, %rdi callq 0x36ac3 vmovapd 0x30(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x96aca movq (%r14), %rdi movl %ebx, %esi addq %r12, %rdi callq 0x3626e incl %ebx jmp 0x96aa5 incq %r15 jmp 0x96a5a movq 0x8(%rsp), %rax movslq 0x98(%rax), %rsi movl %esi, %eax cltd pushq $0x2 popq %rcx idivl %ecx leal (%rsi,%rsi,4), %ecx movq %rsi, 0x30(%rsp) vcvtsi2sd %ecx, %xmm3, %xmm0 vmovsd %xmm0, 0x10(%rsp) movslq %eax, %r12 movl %eax, %r15d imulq $0x38, %r12, %rbx incq %r12 cmpq 0x30(%rsp), %r12 jge 0x96b99 vmovsd 0x3c2f6f(%rip), %xmm0 # 0x459a88 movq (%r14), %rdi movq %r13, %rsi movl %ebp, %edx addq %rbx, %rdi callq 0x362ac vmovsd 0x3c2f5f(%rip), %xmm0 # 0x459a90 movq (%r14), %rax movq %r13, %rsi movl %ebp, %edx leaq 0x38(%rax,%rbx), %rdi callq 0x362ac vcvtsi2sd %r15d, %xmm3, %xmm0 vdivsd 0x10(%rsp), %xmm0, %xmm1 vmovsd 0x3bd4e2(%rip), %xmm0 # 0x454038 movq (%r14), %rdi movq 0x18(%rsp), %rcx movq 0x28(%rsp), %r8 vxorpd %xmm2, %xmm2, %xmm2 movq %r13, %rdx leaq 0x38(%rdi,%rbx), %rsi addq %rbx, %rdi vcmpltsd %xmm2, %xmm1, %k1 vminsd %xmm1, %xmm0, %xmm0 vmovsd %xmm2, %xmm0, %xmm0 {%k1} callq 0x96db2 addl $0x2, %r15d addq $0x70, %rbx addq $0x2, %r12 jmp 0x96b06 movq 0x8(%rsp), %rax movl 0x98(%rax), %eax movq %rax, 0x20(%rsp) xorl %eax, %eax cmpq 0x20(%rsp), %rax je 0x96c90 movq 0x8(%rsp), %rbx imulq $0x38, %rax, %rbp movq %rax, 0x10(%rsp) movq 0x50(%rbx), %rdi addq %rbp, %rdi callq 0x365b4 vmovsd 0x40(%rsp), %xmm0 movq 0x50(%rbx), %rsi movq 0x88(%rbx), %rdi addq %rbp, %rsi callq 0x9706e movq 0x50(%rbx), %rax vmovsd %xmm0, 0x10(%rax,%rbp) andl $0x0, 0x30(%rax,%rbp) movq 0x28(%rsp), %rax movq (%rax), %rcx movq 0x8(%rax), %rax subq %rcx, %rax cqto pushq $0x28 popq %rsi idivq %rsi movl %eax, %eax movq %rax, 0x18(%rsp) xorl %eax, %eax cmpq 0x18(%rsp), %rax je 0x96c83 imulq $0x28, %rax, %r12 movq %rax, 0x30(%rsp) xorl %r15d, %r15d movq (%rcx,%r12), %r13 movq 0x8(%rcx,%r12), %rbx cmpq %rbx, %r13 je 0x96c59 movq (%r14), %rdi movl 0x4(%r13), %esi addq %rbp, %rdi callq 0x3664a testl %eax, %eax je 0x96c50 movl (%r13), %eax addl %eax, %r15d addq $0x8, %r13 jmp 0x96c34 movq 0x28(%rsp), %rax movq (%rax), %rcx cmpl %r15d, 0x18(%rcx,%r12) jg 0x96c72 addq %rcx, %r12 cmpl 0x1c(%r12), %r15d jle 0x96c79 movq (%r14), %rax incl 0x30(%rax,%rbp) movq 0x30(%rsp), %rax incq %rax jmp 0x96c18 movq 0x10(%rsp), %rax incq %rax jmp 0x96bab movq 0x8(%rsp), %rdi xorl %edx, %edx movq 0x38(%rdi), %rax movq 0x40(%rdi), %rcx cmpq %rcx, %rax je 0x96cae movl %edx, (%rax) incl %edx addq $0x4, %rax jmp 0x96c9f callq 0x97152 addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx jmp 0x96ce9 movq %rax, %rbx jmp 0x96cf5 movq %rax, %rbx jmp 0x96cfd jmp 0x96cd5 jmp 0x96cd5 movq 0x8(%rsp), %r15 movq %rax, %rbx leaq 0x80(%r15), %rdi callq 0x357fe addq $0x70, %r15 movq %r15, %rdi callq 0x357fe movq %r14, %rdi callq 0x36742 movq 0x48(%rsp), %rdi callq 0x26a34 movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
void baryonyx::itm::init_with_bastert<baryonyx::itm::quadratic_cost_type<long double>, baryonyx::itm::maximize_tag>(baryonyx::bit_array&, baryonyx::itm::quadratic_cost_type<long double> const&, int, int)
void init_with_bastert(bit_array& x, const Cost& c, const int variables, const int value_if_0) noexcept { for (int i = 0; i != variables; ++i) if (init_x<Mode>(c[i], value_if_0)) x.set(i); else x.unset(i); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %ecx, %ebx movl %edx, %ebp movq %rsi, %r14 movq %rdi, %r15 xorl %r12d, %r12d cmpl %r12d, %ebp je 0x96da3 testl %ebx, %ebx movq %r14, %rdi movl %r12d, %esi setne %r13b callq 0x9722e fldz fxch %st(1) fucomi %st(1), %st setnp %cl sete %al fucompi %st(1), %st fstp %st(0) ja 0x96d93 andb %cl, %al andb %al, %r13b jne 0x96d93 movq %r15, %rdi movl %r12d, %esi callq 0x36a06 jmp 0x96d9e movq %r15, %rdi movl %r12d, %esi callq 0x369c8 incl %r12d jmp 0x96d57 addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
void baryonyx::itm::init_with_pre_solve<baryonyx::itm::quadratic_cost_type<long double>, baryonyx::itm::maximize_tag>(baryonyx::bit_array&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, baryonyx::itm::quadratic_cost_type<long double> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, double)
void init_with_pre_solve(bit_array& x_pessimistic, bit_array& x_optimistic, random_engine& rng, const Cost& c, const std::vector<merged_constraint>& constraints, const double init_random) noexcept { int max_length = 0; for (const auto& cst : constraints) if (length(cst.elements) > max_length) max_length = length(cst.elements); struct reduced_cost { float value; int factor; int id; }; std::vector<reduced_cost> R(max_length); std::bernoulli_distribution dist(init_random); for (const auto& cst : constraints) { if (!dist(rng)) continue; R.resize(cst.elements.size()); const int r_size = length(cst.elements); for (int i = 0; i != r_size; ++i) { R[i].value = static_cast<float>(c[cst.elements[i].variable_index]); R[i].factor = cst.elements[i].factor; R[i].id = cst.elements[i].variable_index; } std::shuffle(std::begin(R), std::end(R), rng); std::sort( std::begin(R), std::end(R), [](const auto& lhs, const auto& rhs) { return is_better_solution<Mode>(lhs.value, rhs.value); }); if (!x_pessimistic.empty()) { int sum = 0; int best = -2; for (int i = -1; i < r_size; ++i) { if (cst.min <= sum && sum <= cst.max) { best = i; break; } if (i + 1 < r_size) sum += R[i + 1].factor; } int i = 0; for (; i <= best; ++i) x_pessimistic.set(R[i].id); for (; i != r_size; ++i) { x_pessimistic.unset(R[i].id); } } if (!x_optimistic.empty()) { int sum = 0; int best = -2; for (int i = -1; i < r_size; ++i) { if (cst.min <= sum && sum <= cst.max) best = i; if (best != -2 && i + 1 < r_size && stop_iterating<Mode>(R[i + 1].value)) break; if (i + 1 < r_size) sum += R[i + 1].factor; } int i = 0; for (; i <= best; ++i) x_optimistic.set(R[i].id); for (; i != r_size; ++i) x_optimistic.unset(R[i].id); } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rcx, 0x30(%rsp) movq (%r8), %rax movq 0x8(%r8), %rcx movq %rdx, %r12 vmovsd %xmm0, 0x48(%rsp) movq %r8, %r13 xorl %edx, %edx movq %rsi, 0x28(%rsp) movq %rdi, 0x20(%rsp) cmpq %rcx, %rax je 0x96e01 movq 0x8(%rax), %rsi subq (%rax), %rsi shrq $0x3, %rsi cmpl %esi, %edx cmovgl %edx, %esi addq $0x28, %rax movl %esi, %edx jmp 0x96de4 movl %edx, %esi leaq 0x8(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0x97266 movq 0x8(%r13), %rax movq (%r13), %rbp movq 0x30(%rsp), %r13 movq %r12, 0x38(%rsp) movq %rax, 0x50(%rsp) cmpq 0x50(%rsp), %rbp je 0x9704b movq %r12, %rdi callq 0x36ac3 vmovsd 0x48(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x97042 movq 0x8(%rbp), %rsi subq (%rbp), %rsi sarq $0x3, %rsi leaq 0x8(%rsp), %rdi callq 0x972ba movq (%rbp), %rax movq 0x8(%rbp), %rdx movl $0x2003, %ecx # imm = 0x2003 subq %rax, %rdx bextrq %rcx, %rdx, %r14 movq %rdx, 0x40(%rsp) pushq $0x4 popq %rbx xorl %r15d, %r15d cmpq %r15, %r14 je 0x96eb2 movl 0x4(%rax,%r15,8), %esi movq %r13, %rdi callq 0x9722e movq 0x8(%rsp), %rcx fstps -0x4(%rcx,%rbx) movq (%rbp), %rax movq (%rax,%r15,8), %rdx incq %r15 movq %rdx, (%rcx,%rbx) addq $0xc, %rbx jmp 0x96e82 movq 0x8(%rsp), %rdi movq 0x10(%rsp), %rsi movq %r12, %rdx callq 0x972f2 movq 0x8(%rsp), %rdi movq 0x10(%rsp), %rsi callq 0x97755 movq 0x20(%rsp), %rax cmpq $0x0, 0x8(%rax) je 0x96f78 movq 0x40(%rsp), %rcx movq 0x8(%rsp), %rax xorl %esi, %esi shrq $0x3, %rcx addq $0x4, %rax movslq %ecx, %rdx pushq $-0x1 popq %rcx imulq $0xc, %rcx, %rdi addq %rax, %rdi cmpq %rdx, %rcx jge 0x96f23 cmpl %esi, 0x18(%rbp) jg 0x96f13 cmpl 0x1c(%rbp), %esi jle 0x96f26 incq %rcx addq $0xc, %rdi cmpq %rdx, %rcx jge 0x96f04 addl (%rdi), %esi jmp 0x96efd pushq $-0x2 popq %rcx movslq %ecx, %r15 movq %r14, %r13 pushq $0x8 popq %rbx xorl %r12d, %r12d cmpq %r15, %r12 jg 0x96f55 movq 0x8(%rsp), %rax movq 0x20(%rsp), %rdi movl (%rax,%rbx), %esi callq 0x369c8 incq %r12 addq $0xc, %rbx decq %r13 jmp 0x96f32 movq 0x38(%rsp), %r12 subq $0x1, %r13 jb 0x96f78 movq 0x8(%rsp), %rax movq 0x20(%rsp), %rdi movl (%rax,%rbx), %esi callq 0x36a06 addq $0xc, %rbx jmp 0x96f5a movq 0x28(%rsp), %rax movq 0x30(%rsp), %r13 cmpq $0x0, 0x8(%rax) je 0x97042 movq 0x40(%rsp), %rcx movq 0x8(%rsp), %rax xorl %edx, %edx shrq $0x3, %rcx addq $0xc, %rax movslq %ecx, %rcx pushq $-0x1 popq %rsi pushq $-0x2 popq %rdi imulq $0xc, %rsi, %r8 addq %rax, %r8 movl %edi, %r9d cmpq %rcx, %rsi jge 0x96ff3 cmpl 0x1c(%rbp), %edx movl %esi, %edi cmovgl %r9d, %edi cmpl %edx, 0x18(%rbp) cmovgl %r9d, %edi incq %rsi cmpl $-0x2, %edi je 0x96fe1 cmpq %rcx, %rsi jge 0x96fe1 vxorpd %xmm0, %xmm0, %xmm0 vucomiss (%r8), %xmm0 ja 0x96ff0 addq $0xc, %r8 cmpq %rcx, %rsi jge 0x96fb1 addl -0x8(%r8), %edx jmp 0x96faa movl %edi, %r9d movslq %r9d, %r15 pushq $0x8 popq %rbx xorl %r12d, %r12d cmpq %r15, %r12 jg 0x9701f movq 0x8(%rsp), %rax movq 0x28(%rsp), %rdi movl (%rax,%rbx), %esi callq 0x369c8 incq %r12 addq $0xc, %rbx decq %r14 jmp 0x96ffc movq 0x38(%rsp), %r12 subq $0x1, %r14 jb 0x97042 movq 0x8(%rsp), %rax movq 0x28(%rsp), %rdi movl (%rax,%rbx), %esi callq 0x36a06 addq $0xc, %rbx jmp 0x97024 addq $0x28, %rbp jmp 0x96e29 leaq 0x8(%rsp), %rdi callq 0x974fe addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x97066 movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::quadratic_cost_type<long double>::results(baryonyx::bit_array const&, double) const
double results(const bit_array& x, double cost_constant) const noexcept { for (int i = 0, e = length(obj.elements); i != e; ++i) if (x[obj.elements[i].variable_index]) cost_constant += obj.elements[i].factor; for (int i = 0, e = length(obj.qelements); i != e; ++i) if (x[obj.qelements[i].variable_index_a] && x[obj.qelements[i].variable_index_b]) cost_constant += obj.qelements[i].factor; return cost_constant; }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x10, %rsp movq (%rdi), %rax movabsq $0xffffffff0, %r12 # imm = 0xFFFFFFFF0 vmovsd %xmm0, 0x8(%rsp) movq %rsi, %rbx movq %rdi, %r14 xorl %r13d, %r13d movq 0x8(%rax), %r15 subq (%rax), %r15 andq %r12, %r15 movq (%r14), %rax cmpq %r13, %r15 je 0x970db movq (%rax), %rax movq %rbx, %rdi movl 0x8(%rax,%r13), %esi callq 0x3664a testl %eax, %eax je 0x970d5 movq (%r14), %rax vmovsd 0x8(%rsp), %xmm0 movq (%rax), %rax vaddsd (%rax,%r13), %xmm0, %xmm0 vmovsd %xmm0, 0x8(%rsp) addq $0x10, %r13 jmp 0x970a1 movq 0x20(%rax), %r15 subq 0x18(%rax), %r15 andq %r12, %r15 xorl %r12d, %r12d cmpq %r12, %r15 je 0x9713d movq (%r14), %rax movq %rbx, %rdi movq 0x18(%rax), %rax movl 0x8(%rax,%r12), %esi callq 0x3664a testl %eax, %eax je 0x97137 movq (%r14), %rax movq %rbx, %rdi movq 0x18(%rax), %rax movl 0xc(%rax,%r12), %esi callq 0x3664a testl %eax, %eax je 0x97137 movq (%r14), %rax vmovsd 0x8(%rsp), %xmm0 movq 0x18(%rax), %rax vaddsd (%rax,%r12), %xmm0, %xmm0 vmovsd %xmm0, 0x8(%rsp) addq $0x10, %r12 jmp 0x970e9 vmovsd 0x8(%rsp), %xmm0 addq $0x10, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<long double>, baryonyx::itm::maximize_tag>::sort()
void sort() noexcept { m_indices_writer lock{ m_indices_mutex }; std::sort( std::begin(m_indices), std::end(m_indices), [this](int i1, int i2) { const int cst_1 = this->m_data[i1].remaining_constraints; const int cst_2 = this->m_data[i2].remaining_constraints; const double value_1 = this->m_data[i1].value; const double value_2 = this->m_data[i2].value; if (cst_1 < cst_2) return true; if (cst_1 == cst_2) return is_better_solution<Mode>(value_1, value_2); return false; }); #ifdef BARYONYX_ENABLE_DEBUG to_log(stdout, 3u, "- Solutions init population:\n"); for (int i = 0; i != m_size; ++i) { to_log(stdout, 5u, "- {} id {} value {} constraint {} hash {}\n", i, m_indices[i], m_data[m_indices[i]].value, m_data[m_indices[i]].remaining_constraints, m_data[m_indices[i]].hash); } #endif }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rdi, %rbx leaq 0x8(%rsp), %rdi movq %rbx, %rsi callq 0x377e6 movq 0x38(%rbx), %rdi movq 0x40(%rbx), %rsi movq %rbx, %rdx callq 0x97cd3 movq 0x5a5e41(%rip), %r13 # 0x63cfc8 movq (%r13), %rdi leaq 0x3c2f06(%rip), %rcx # 0x45a098 pushq $0x3 popq %rsi pushq $0x1d popq %rdx callq 0x377fc leaq 0x3c2f12(%rip), %r14 # 0x45a0b6 xorl %eax, %eax pushq $0x5 popq %rbp pushq $0x2a popq %r15 leaq 0x4(%rsp), %r12 movl %eax, 0x4(%rsp) cmpl 0x98(%rbx), %eax je 0x9720b movq 0x38(%rbx), %rcx cltq movq 0x50(%rbx), %rdx movq (%r13), %rdi leaq (%rcx,%rax,4), %r9 movslq (%r9), %rax imulq $0x38, %rax, %rax leaq 0x10(%rdx,%rax), %r10 leaq 0x30(%rdx,%rax), %r11 leaq 0x20(%rdx,%rax), %rax subq $0x8, %rsp movq %r15, %rdx movl %ebp, %esi movq %r14, %rcx movq %r12, %r8 pushq %rax pushq %r11 pushq %r10 callq 0x3783f addq $0x20, %rsp movl 0x4(%rsp), %eax incl %eax jmp 0x971b2 leaq 0x8(%rsp), %rdi callq 0x378b4 addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x97226 movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::optimize_functor<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<long double>, long double, baryonyx::itm::maximize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<long double> const&, double)
void operator()(const std::atomic_bool& stop_task, best_solution_recorder<Cost, Float, Mode>& best_recorder, const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { bit_array x(variables); auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_local_ctx.rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const auto w_limit = static_cast<long int>(p.w); Solver slv(m_local_ctx.rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); bool is_a_solution = false; while (!stop_task.load()) { ++m_call_number; const auto kappa_start = static_cast<Float>(best_recorder.reinit( m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x)); auto kappa = kappa_start; compute.init(slv, x); auto best_remaining = INT_MAX; is_a_solution = false; for (long int i = 0; !stop_task.load() && i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta); if (remaining == 0) { best_recorder.try_update( m_local_ctx, x, original_costs.results(x, cost_constant), i); best_remaining = 0; is_a_solution = true; break; } else { best_remaining = std::min(remaining, best_remaining); } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; } if (best_remaining > 0) { best_recorder.try_advance( m_local_ctx, x, best_remaining, p.limit); continue; } for (int push = 0; !stop_task.load() && push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_local_ctx.rng, pushing_k_factor, delta, theta, pushing_objective_amplifier); if (remaining == 0) { best_recorder.try_update( m_local_ctx, x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); is_a_solution = true; } kappa = kappa_start; for (int iter = 0; !stop_task.load() && iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run( slv, x, m_local_ctx.rng, kappa, delta, theta); if (remaining == 0) { best_recorder.try_update( m_local_ctx, x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); is_a_solution = true; break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; } } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1f8, %rsp # imm = 0x1F8 movq %rdi, %rbp leaq 0x58(%rsp), %rdi movq %rsi, %r15 movl %r8d, %esi vmovsd %xmm0, 0x88(%rsp) movq %r9, %r12 movl %r8d, %ebx movq %rcx, %r14 movq %rdx, 0x68(%rsp) callq 0x368ae movq (%rbp), %r13 movq %rbp, 0xb0(%rsp) addq $0x8, %rbp leaq 0x118(%rsp), %rdi movq %r13, %rsi movq %r12, 0x80(%rsp) movq %r12, %rdx movq %rbp, %rcx movl %ebx, %r8d callq 0x98bf0 fldl 0x20(%r13) fstpt 0xd0(%rsp) vxorpd %xmm1, %xmm1, %xmm1 fldl 0x28(%r13) fstpt 0xdc(%rsp) fldl 0x30(%r13) fstpt 0xc4(%rsp) fldl 0x8(%r13) vmovsd 0x10(%r13), %xmm0 fld %st(0) fstpt 0x44(%rsp) vucomisd %xmm0, %xmm1 jbe 0x9870b movq 0xb0(%rsp), %rax movq (%rax), %rdi leaq 0x118(%rsp), %rsi movl %ebx, %edx fstpt (%rsp) callq 0x98cca fstpt 0x94(%rsp) jmp 0x98724 fstp %st(0) vmovsd %xmm0, 0xf8(%rsp) fldl 0xf8(%rsp) fstpt 0x94(%rsp) fldl 0x38(%r13) fstpt 0x10c(%rsp) fldl 0x40(%r13) fstpt 0x100(%rsp) vcvttsd2si 0xa0(%r13), %rax movq %rax, 0xe8(%rsp) movq 0x8(%r14), %rax subq (%r14), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0x170(%rsp), %rdi leaq 0x118(%rsp), %r8 movq %rbp, %rsi movl %eax, %edx movl %ebx, %ecx movq %r14, %r9 callq 0x98d3e movl 0xcc(%r13), %esi leaq 0x138(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq $0x0, 0x50(%rsp) movb (%r15), %al testb $0x1, %al jne 0x98b58 movq 0xb0(%rsp), %rax incq 0xb0(%rax) vmovsd 0x18(%r13), %xmm0 vmovsd 0x28(%r13), %xmm1 movzbl 0x50(%rsp), %edx movq 0x68(%rsp), %rdi leaq 0x58(%rsp), %rbx movq %rbp, %rsi movq %rbx, %rcx andl $0x1, %edx callq 0x98f66 vmovsd %xmm0, 0xf0(%rsp) fldl 0xf0(%rsp) fstpt 0xb8(%rsp) leaq 0x138(%rsp), %rdi leaq 0x170(%rsp), %rsi movq %rbx, %rdx callq 0x99066 fldt 0xb8(%rsp) fldt 0x44(%rsp) movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF xorl %r14d, %r14d movb (%r15), %al testb $0x1, %al jne 0x988ed cmpq 0xb0(%r13), %r14 je 0x988ed fstpt 0x20(%rsp) leaq 0x138(%rsp), %rdi leaq 0x170(%rsp), %rsi leaq 0x58(%rsp), %rdx movq %rbp, %rcx fldt 0x94(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x74(%rsp) fstpt (%rsp) callq 0x990a8 testl %eax, %eax je 0x98907 cmpl %eax, %ebx cmovgel %eax, %ebx cmpq 0xe8(%rsp), %r14 jle 0x988cc movl %eax, 0xa8(%rsp) fildl 0xa8(%rsp) movl 0x1f0(%rsp), %eax movl %eax, 0xac(%rsp) fidivl 0xac(%rsp) fldt 0xc4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xd0(%rsp) fmulp %st, %st(1) fldt 0x74(%rsp) faddp %st, %st(1) fldt 0x44(%rsp) jmp 0x988d6 fldt 0x44(%rsp) fldt 0x74(%rsp) fxch %st(1) fldt 0xdc(%rsp) fxch %st(2) fucomi %st(2), %st fstp %st(2) ja 0x988ed incq %r14 jmp 0x9881d fstp %st(1) testl %ebx, %ebx jg 0x98b36 movq $0x0, 0x50(%rsp) leaq 0x58(%rsp), %rbx jmp 0x98943 vmovsd 0x88(%rsp), %xmm0 movq 0x80(%rsp), %rdi leaq 0x58(%rsp), %rbx movq %rbx, %rsi callq 0x9706e movq 0x68(%rsp), %rdi movq %rbp, %rsi movq %rbx, %rdx movq %r14, %rcx callq 0x992d8 movb $0x1, %al movq %rax, 0x50(%rsp) fldt 0x44(%rsp) xorl %r14d, %r14d movl $0x0, 0x70(%rsp) movb (%r15), %al testb $0x1, %al jne 0x98b2f cmpl 0xbc(%r13), %r14d jge 0x98b2f fldt 0x100(%rsp) fstpt 0x30(%rsp) fstpt 0x20(%rsp) leaq 0x138(%rsp), %rdi leaq 0x170(%rsp), %rsi movq %rbx, %rdx movq %rbp, %rcx fldt 0x94(%rsp) fstpt 0x10(%rsp) fldt 0x10c(%rsp) fstpt (%rsp) callq 0x993e2 testl %eax, %eax jne 0x989e9 vmovsd 0x88(%rsp), %xmm0 movq 0x80(%rsp), %rdi movq %rbx, %rsi callq 0x9706e movl 0xc0(%r13), %eax movq 0x68(%rsp), %rdi movq %rbp, %rsi movq %rbx, %rdx imull %r14d, %eax notl %eax movslq %eax, %rcx callq 0x992d8 movb $0x1, %al movq %rax, 0x50(%rsp) pushq $0x1 popq %rax fldt 0xb8(%rsp) fldt 0x44(%rsp) movl %eax, %ebx movb (%r15), %al testb $0x1, %al jne 0x98acd leal -0x1(%rbx), %r12d cmpl 0xc0(%r13), %r12d jge 0x98acd fstpt 0x20(%rsp) leaq 0x138(%rsp), %rdi leaq 0x170(%rsp), %rsi leaq 0x58(%rsp), %rdx movq %rbp, %rcx fldt 0x94(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x74(%rsp) fstpt (%rsp) callq 0x990a8 testl %eax, %eax je 0x98ad6 vcvtsi2sd %r12d, %xmm2, %xmm0 vucomisd 0xa0(%r13), %xmm0 jbe 0x98aad movl %eax, 0xa0(%rsp) fildl 0xa0(%rsp) movl 0x1f0(%rsp), %eax movl %eax, 0xa4(%rsp) fidivl 0xa4(%rsp) fldt 0xc4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xd0(%rsp) fmulp %st, %st(1) fldt 0x74(%rsp) faddp %st, %st(1) fldt 0x44(%rsp) jmp 0x98ab7 fldt 0x44(%rsp) fldt 0x74(%rsp) fxch %st(1) fldt 0xdc(%rsp) fxch %st(2) fucomi %st(2), %st fstp %st(2) ja 0x98acd incl %ebx jmp 0x989f9 fstp %st(1) leaq 0x58(%rsp), %rbx jmp 0x98b23 vmovsd 0x88(%rsp), %xmm0 movq 0x80(%rsp), %rdi leaq 0x58(%rsp), %r12 movq %r12, %rsi callq 0x9706e movl 0xc0(%r13), %eax movq 0x68(%rsp), %rdi movq %rbp, %rsi movq %r12, %rdx imull 0x70(%rsp), %eax subl %ebx, %eax movq %r12, %rbx movslq %eax, %rcx callq 0x992d8 movb $0x1, %al movq %rax, 0x50(%rsp) fldt 0x44(%rsp) decl 0x70(%rsp) incl %r14d jmp 0x9894e fstp %st(0) jmp 0x98798 fstp %st(0) movq 0xb0(%r13), %r8 movq 0x68(%rsp), %rdi leaq 0x58(%rsp), %rdx movq %rbp, %rsi movl %ebx, %ecx callq 0x99360 jmp 0x9878f leaq 0x138(%rsp), %rdi callq 0x393ac leaq 0x170(%rsp), %rdi callq 0x9966e leaq 0x118(%rsp), %rdi callq 0x968b6 leaq 0x60(%rsp), %rdi callq 0x357fe addq $0x1f8, %rsp # imm = 0x1F8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x98ba2 movq %rax, %rbx jmp 0x98bc4 movq %rax, %rbx jmp 0x98bd1 movq %rax, %rbx jmp 0x98bde jmp 0x98bb4 jmp 0x98bb4 jmp 0x98bb4 jmp 0x98bb4 leaq 0x138(%rsp), %rdi movq %rax, %rbx callq 0x393ac leaq 0x170(%rsp), %rdi callq 0x9966e leaq 0x118(%rsp), %rdi callq 0x968b6 leaq 0x60(%rsp), %rdi callq 0x357fe movq %rbx, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::quadratic_cost_type<long double> baryonyx::itm::normalize_costs<long double, baryonyx::itm::quadratic_cost_type<long double>>(baryonyx::context const&, baryonyx::itm::quadratic_cost_type<long double> const&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int)
inline Cost normalize_costs(const context& ctx, const Cost& c, random_engine& rng, int n) { Cost ret(c, n); switch (ctx.parameters.cost_norm) { case solver_parameters::cost_norm_type::none: info(ctx, " - No norm"); return ret; case solver_parameters::cost_norm_type::random: info(ctx, " - Compute random norm\n"); ret.make_random_norm(n, rng); return ret; case solver_parameters::cost_norm_type::l1: info(ctx, " - Compute l1 norm\n"); ret.make_l1_norm(n); return ret; case solver_parameters::cost_norm_type::l2: info(ctx, " - Compute l2 norm\n"); ret.make_l2_norm(n); return ret; default: info(ctx, " - Compute infinity-norm (default)\n"); ret.make_loo_norm(n); return ret; } }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rsi, %r14 movq %rdx, %rsi movl %r8d, %edx movl %r8d, %ebp movq %rcx, %r15 movq %rdi, %rbx callq 0x996ac movl 0xd8(%r14), %eax cmpq $0x3, %rax ja 0x98c90 leaq 0x3c112e(%rip), %rcx # 0x459d50 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax leaq 0x3c14b5(%rip), %rsi # 0x45a0e7 movq %r14, %rdi callq 0x348e9 jmp 0x98ca9 leaq 0x3c14c9(%rip), %rsi # 0x45a10c movq %r14, %rdi callq 0x348e9 movq %rbx, %rdi movl %ebp, %esi callq 0x9997e jmp 0x98ca9 leaq 0x3c14c3(%rip), %rsi # 0x45a121 movq %r14, %rdi callq 0x348e9 movq %rbx, %rdi movl %ebp, %esi callq 0x99a2e jmp 0x98ca9 leaq 0x3c147a(%rip), %rsi # 0x45a0f3 movq %r14, %rdi callq 0x348e9 movq %rbx, %rdi movl %ebp, %esi movq %r15, %rdx callq 0x9978e jmp 0x98ca9 leaq 0x3c149f(%rip), %rsi # 0x45a136 movq %r14, %rdi callq 0x348e9 movq %rbx, %rdi movl %ebp, %esi callq 0x99ade movq %rbx, %rax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq movq %rbx, %rdi movq %rax, %r14 callq 0x968b6 movq %r14, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-common.hpp
long double baryonyx::itm::compute_delta<long double, baryonyx::itm::quadratic_cost_type<long double>>(baryonyx::context const&, baryonyx::itm::quadratic_cost_type<long double> const&, long double, int)
inline Float compute_delta(const context& ctx, const Cost& c, Float theta, int n) { info(ctx, " - delta not defined, compute it:\n"); const auto mini = c.min(n); const auto ret = mini - theta * mini; info(ctx, " - delta={} (min normalized cost:{} / theta: {})\n", ret, mini, theta); return ret; }
pushq %r15 pushq %r14 pushq %rbx subq $0x40, %rsp movq %rsi, %r14 leaq 0x3c14f7(%rip), %rsi # 0x45a1d4 fldt 0x60(%rsp) fld %st(0) fstpt 0x4(%rsp) movl %edx, %ebx movq %rdi, %r15 fstpt 0x30(%rsp) callq 0x348e9 movq %r14, %rdi movl %ebx, %esi callq 0x9a70e fld %st(0) fstpt 0x20(%rsp) leaq 0x3c14ec(%rip), %rsi # 0x45a1f8 leaq 0x10(%rsp), %rdx leaq 0x20(%rsp), %rcx leaq 0x30(%rsp), %r8 movq %r15, %rdi fldt 0x4(%rsp) fmul %st(1), %st fsubrp %st, %st(1) fstpt 0x10(%rsp) callq 0x8ee71 fldt 0x10(%rsp) addq $0x40, %rsp popq %rbx popq %r14 popq %r15 retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>::solver_random_inequalities_101coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::quadratic_cost_type<long double> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&)
solver_random_inequalities_101coeff( random_engine& rng_, int m_, int n_, const cost_type& c_, const std::vector<merged_constraint>& csts) : rng(rng_) , ap(csts, m_, n_) , A(std::make_unique<int[]>(ap.size())) , R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts))) , b(std::make_unique<bound_factor[]>(m_)) , pi(std::make_unique<Float[]>(m_)) , P(std::make_unique<Float[]>(ap.size())) , c(c_) , dist(0.5) , m(m_) , n(n_) { int id = 0; for (int i = 0, e = length(csts); i != e; ++i) { int lower = 0, upper = 0; for (const auto& cst : csts[i].elements) { bx_ensures(std::abs(cst.factor) == 1); A[id++] = cst.factor; if (cst.factor > 0) upper++; else lower++; } if (csts[i].min == csts[i].max) { b[i].min = csts[i].min; b[i].max = csts[i].max; } else { b[i].min = std::max(-lower, csts[i].min); b[i].max = std::min(upper, csts[i].max); } bx_ensures(b[i].min <= b[i].max); } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp leaq 0x8(%rdi), %r13 movq %rsi, (%rdi) movq %rdi, %r15 movq %r9, %r12 movq %r8, 0x20(%rsp) movl %edx, %r14d movq %r9, %rsi movl %ecx, 0x4(%rsp) movq %r13, %rdi callq 0x3a4ca movl 0x30(%r15), %esi leaq 0x48(%r15), %rbx movq %rbx, %rdi movq %r13, 0x18(%rsp) callq 0x28eb6 movq %r12, %rdi leaq 0x50(%r15), %rbp callq 0x3a89d movq %rbp, 0x10(%rsp) movq %rbp, %rdi movq %rax, %rsi callq 0x9a78d movslq %r14d, %rbp leaq 0x58(%r15), %rdi movq %rbp, %rsi movq %rdi, 0x8(%rsp) callq 0x9a7cd leaq 0x60(%r15), %r13 movq %r13, %rdi movq %rbp, %rsi callq 0x8afb9 movl 0x30(%r15), %esi leaq 0x68(%r15), %rdi callq 0x8afb9 movq 0x20(%rsp), %rax movq %rax, 0x70(%r15) movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000 movq %rax, 0x78(%r15) movl 0x4(%rsp), %eax movl %r14d, 0x80(%r15) movl %eax, 0x84(%r15) movq (%r12), %rcx movq 0x8(%r12), %rax subq %rcx, %rax pushq $0x28 popq %rsi cqto xorl %edi, %edi idivq %rsi movq 0x58(%r15), %rdx xorl %esi, %esi movl %eax, %eax cmpq %rax, %rsi je 0x98ee8 imulq $0x28, %rsi, %r8 movq (%rbx), %r15 movslq %edi, %rdi xorl %r10d, %r10d movq (%rcx,%r8), %r11 movq 0x8(%rcx,%r8), %r14 leaq (%rcx,%r8), %r9 xorl %r8d, %r8d cmpq %r14, %r11 je 0x98e7b movl (%r11), %r12d leal 0x1(%r12), %ebp testl $0xfffffffd, %ebp # imm = 0xFFFFFFFD jne 0x98ef7 movl %r12d, (%r15,%rdi,4) incq %rdi xorl %ebp, %ebp xorl %r12d, %r12d cmpl $0x0, (%r11) setle %bpl setg %r12b addq $0x8, %r11 addl %r12d, %r10d addl %ebp, %r8d jmp 0x98e3e movl 0x18(%r9), %r11d cmpl 0x1c(%r9), %r11d jne 0x98e92 imulq $0xc, %rsi, %r8 movl %r11d, (%rdx,%r8) movl %r11d, %r8d jmp 0x98eb2 negl %r8d cmpl %r8d, %r11d cmovgl %r11d, %r8d imulq $0xc, %rsi, %r11 movl %r8d, (%rdx,%r11) movl 0x1c(%r9), %r9d cmpl %r10d, %r9d cmovll %r9d, %r10d movl %r10d, %r11d imulq $0xc, %rsi, %r9 incq %rsi movl %r11d, 0x4(%rdx,%r9) cmpl %r11d, %r8d jle 0x98e18 leaq 0x3bf55c(%rip), %rdi # 0x45842a leaq 0x3c13d4(%rip), %rsi # 0x45a2a9 leaq 0x3c136b(%rip), %rdx # 0x45a247 leaq 0x3c13db(%rip), %rcx # 0x45a2be callq 0x2813f addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3bf52c(%rip), %rdi # 0x45842a leaq 0x3c1328(%rip), %rsi # 0x45a22d leaq 0x3c133b(%rip), %rdx # 0x45a247 leaq 0x3c1393(%rip), %rcx # 0x45a2a6 callq 0x2813f movq %r13, %rdi movq %rax, %r14 callq 0x8affa jmp 0x98f28 movq %rax, %r14 movq 0x8(%rsp), %rdi callq 0x9a80a jmp 0x98f37 movq %rax, %r14 movq 0x10(%rsp), %rdi callq 0x9a824 jmp 0x98f46 movq %rax, %r14 movq %rbx, %rdi callq 0x28fb6 jmp 0x98f53 movq %rax, %r14 movq 0x18(%rsp), %rdi callq 0x3a954 movq %r14, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/random-solver.cpp
baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<long double>, long double, baryonyx::itm::maximize_tag>::reinit(baryonyx::itm::local_context&, bool, double, double, baryonyx::bit_array&)
double reinit(local_context& ctx, const bool /*is_solution*/, const double kappa_min, const double kappa_max, bit_array& x) { to_log(stdout, 3u, "- reinitinialization thread {}.\n", ctx.thread_id); double kappa = kappa_min; if (m_kappa_append[ctx.thread_id] < ctx.init_kappa_improve_stop) { m_kappa_append[ctx.thread_id] += ctx.init_kappa_improve_increase; kappa = kappa_min + (kappa_max - kappa_min) * m_kappa_append[ctx.thread_id]; to_log(stdout, 5u, "- improve with kappa {}\n", kappa); } else { m_kappa_append[ctx.thread_id] = ctx.init_kappa_improve_start; crossover(ctx, x); to_log(stdout, 5u, "- crossover\n"); } mutation(ctx, x); return kappa; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x18, %rsp movq 0x5a4050(%rip), %r12 # 0x63cfc8 movq %rdi, %r15 movq %rcx, %rbx leaq 0x3c13d6(%rip), %rcx # 0x45a35b vmovsd %xmm1, 0x8(%rsp) vmovsd %xmm0, 0x10(%rsp) movq %rsi, %r14 leaq 0xa0(%rsi), %r8 movq (%r12), %rdi pushq $0x3 popq %rsi pushq $0x20 popq %rdx callq 0x3be57 vmovsd 0x10(%rsp), %xmm2 vmovsd %xmm2, (%rsp) movl 0xa0(%r14), %eax movq 0xa8(%r15), %rcx vmovsd 0x98(%r14), %xmm1 vmovsd (%rcx,%rax,8), %xmm0 vucomisd %xmm0, %xmm1 jbe 0x99014 vaddsd 0x90(%r14), %xmm0, %xmm0 vmovsd 0x8(%rsp), %xmm1 movq %rsp, %r8 vsubsd %xmm2, %xmm1, %xmm1 vmovsd %xmm0, (%rcx,%rax,8) leaq 0x3c1383(%rip), %rcx # 0x45a37c vfmadd213sd %xmm2, %xmm0, %xmm1 # xmm1 = (xmm0 * xmm1) + xmm2 movq (%r12), %rdi vmovsd %xmm1, (%r8) pushq $0x5 popq %rsi pushq $0x18 popq %rdx callq 0x3bea4 jmp 0x99047 vmovsd 0x88(%r14), %xmm0 leaq 0x8(%r15), %rdi movq %r14, %rsi movq %rbx, %rdx vmovsd %xmm0, (%rcx,%rax,8) callq 0x9a9b4 movq (%r12), %rdi leaq 0x3c1359(%rip), %rcx # 0x45a395 pushq $0x5 popq %rsi pushq $0xc popq %rdx callq 0x377fc movq %r15, %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x9a85a vmovsd (%rsp), %xmm0 addq $0x18, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>> const&, baryonyx::bit_array const&)
void init(const Solver& s, const Xtype& x) { switch (order) { case solver_parameters::constraint_order::infeasibility_decr: case solver_parameters::constraint_order::infeasibility_incr: infeasibility_local_compute_violated_constraints(s, x); break; case solver_parameters::constraint_order::pi_sign_change: std::iota(R.begin(), R.end(), 0); break; case solver_parameters::constraint_order::none: case solver_parameters::constraint_order::reversing: case solver_parameters::constraint_order::random_sorting: case solver_parameters::constraint_order::lagrangian_decr: case solver_parameters::constraint_order::lagrangian_incr: default: compute_violated_constraints(s, x, R); break; } }
movl 0x30(%rdi), %ecx movq %rdi, %rax leal -0x3(%rcx), %edi cmpl $0x2, %edi jae 0x9907c movq %rax, %rdi jmp 0x9acae cmpl $0x7, %ecx jne 0x99099 movq (%rax), %rcx movq 0x8(%rax), %rax xorl %edx, %edx cmpq %rax, %rcx je 0x990a7 movl %edx, (%rcx) incl %edx addq $0x4, %rcx jmp 0x9908a movq %rsi, %rdi movq %rdx, %rsi movq %rax, %rdx jmp 0x9adb0 retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>, baryonyx::bit_array, long double>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double)
int run(Solver& solver, Xtype& x, random_engine& rng, Float kappa, Float delta, Float theta) { bool pi_changed = false; int remaining = 0; switch (order) { case solver_parameters::constraint_order::reversing: solver.compute_update_row( x, R.crbegin(), R.crend(), kappa, delta, theta); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::random_sorting: std::shuffle(R.begin(), R.end(), rng); solver.compute_update_row( x, R.begin(), R.end(), kappa, delta, theta); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::infeasibility_decr: std::sort(m_order.begin(), m_order.end(), [](const auto& lhs, const auto& rhs) { return rhs.second < lhs.second; }); solver.compute_update_row( x, m_order.cbegin(), m_order.cend(), kappa, delta, theta); return infeasibility_local_compute_violated_constraints(solver, x); case solver_parameters::constraint_order::infeasibility_incr: std::sort(m_order.begin(), m_order.end(), [](const auto& lhs, const auto& rhs) { return lhs.second < rhs.second; }); solver.compute_update_row( x, m_order.cbegin(), m_order.cend(), kappa, delta, theta); return infeasibility_local_compute_violated_constraints(solver, x); case solver_parameters::constraint_order::lagrangian_decr: std::sort( R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) { return solver.pi[rhs] < solver.pi[lhs]; }); solver.compute_update_row( x, R.cbegin(), R.cend(), kappa, delta, theta); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::lagrangian_incr: std::sort( R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) { return solver.pi[lhs] < solver.pi[rhs]; }); solver.compute_update_row( x, R.cbegin(), R.cend(), kappa, delta, theta); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::pi_sign_change: std::shuffle(R.begin(), R.end(), rng); pi_changed = solver.compute_update_row( x, R.begin(), R.end(), kappa, delta, theta); remaining = local_compute_violated_constraints(solver, x); if (!pi_changed && remaining == 0) return 0; return remaining; case solver_parameters::constraint_order::none: default: solver.compute_update_row( x, R.begin(), R.end(), kappa, delta, theta); return compute_violated_constraints(solver, x, R); } }
pushq %r15 pushq %r14 pushq %rbx subq $0x70, %rsp fldt 0xb0(%rsp) fldt 0xa0(%rsp) fldt 0x90(%rsp) movl 0x30(%rdi), %eax movq %rdx, %rbx movq %rsi, %r15 movq %rdi, %r14 decl %eax cmpl $0x6, %eax ja 0x991c9 leaq 0x3c0c7c(%rip), %rdx # 0x459d60 movslq (%rdx,%rax,4), %rax addq %rdx, %rax jmpq *%rax movq 0x8(%r14), %rax leaq 0x68(%rsp), %rdx leaq 0x60(%rsp), %rcx movq %r15, %rdi movq %rbx, %rsi movq %rax, (%rdx) movq (%r14), %rax movq %rax, (%rcx) fxch %st(2) fstpt 0x20(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0x9aea6 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0x9adb0 addq $0x70, %rsp popq %rbx popq %r14 popq %r15 retq movq (%r14), %rdi movq 0x8(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) movq %r15, %rdx fstpt 0x3c(%rsp) callq 0x9d309 jmp 0x9923d movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) fstpt 0x3c(%rsp) callq 0x9ca33 jmp 0x99188 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) fstpt 0x3c(%rsp) callq 0x9ce9e movq 0x18(%r14), %rdx movq 0x20(%r14), %rcx fldt 0x3c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x48(%rsp) fstpt 0x10(%rsp) fldt 0x54(%rsp) fstpt (%rsp) callq 0x9b7c2 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0x9bc4a movq (%r14), %rdx movq 0x8(%r14), %rcx fxch %st(2) fstpt 0x20(%rsp) fstpt 0x10(%rsp) jmp 0x99212 movq (%r14), %rdi movq 0x8(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) movq %rcx, %rdx fstpt 0x3c(%rsp) callq 0x3ceed movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x3c(%rsp) fstpt 0x20(%rsp) fldt 0x48(%rsp) fstpt 0x10(%rsp) fldt 0x54(%rsp) fstpt (%rsp) movq %r15, %rdi movq %rbx, %rsi callq 0x9b33a jmp 0x99266 movq (%r14), %rdi movq 0x8(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) movq %r15, %rdx fstpt 0x3c(%rsp) callq 0x9d85d movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x3c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x48(%rsp) fstpt 0x10(%rsp) fldt 0x54(%rsp) fstpt (%rsp) callq 0x9bd4c movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0x9adb0 movq (%r14), %rdi movq 0x8(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) movq %rcx, %rdx fstpt 0x3c(%rsp) callq 0x3ceed movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x3c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x48(%rsp) fstpt 0x10(%rsp) fldt 0x54(%rsp) fstpt (%rsp) callq 0x9b33a movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0x9c1d4
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<long double>, long double, baryonyx::itm::maximize_tag>::try_update(baryonyx::itm::local_context&, baryonyx::bit_array const&, double, long)
void try_update(local_context& ctx, const bit_array& solution, const double value, const long int loop) { auto hash = bit_array_hash()(solution); if (m_storage.can_be_inserted(hash, value)) { const auto end = std::chrono::steady_clock::now(); const auto duration = compute_duration(m_start, end); m_storage.insert(ctx, solution, hash, value, duration, loop); } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rdi, %r13 leaq 0xf(%rsp), %rdi movq %rsi, %r15 movq %rdx, %rsi movq %rcx, %rbx vmovsd %xmm0, 0x10(%rsp) movq %rdx, %r14 callq 0x3775a vmovsd 0x10(%rsp), %xmm0 leaq 0x8(%r13), %rbp movq %rax, %r12 movq %rax, %rsi movq %rbp, %rdi callq 0x9ddae testb %al, %al je 0x99351 callq 0xb5a0 subq (%r13), %rax movq %rbp, %rdi movq %r15, %rsi movq %r14, %rdx movq %r12, %rcx movq %rbx, %r8 vcvtsi2sd %rax, %xmm1, %xmm0 vdivsd 0x3c073a(%rip), %xmm0, %xmm1 # 0x459a80 vmovsd 0x10(%rsp), %xmm0 callq 0x9de2e addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<long double>, long double, baryonyx::itm::maximize_tag>::try_advance(baryonyx::itm::local_context&, baryonyx::bit_array const&, int, long)
void try_advance(local_context& ctx, const bit_array& solution, const int remaining_constraints, const long int loop) { auto hash = bit_array_hash()(solution); if (m_storage.can_be_inserted(hash, remaining_constraints)) { const auto end = std::chrono::steady_clock::now(); const auto duration = compute_duration(m_start, end); m_storage.insert( ctx, solution, hash, remaining_constraints, duration, loop); } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rdi, %r13 leaq 0xf(%rsp), %rdi movq %rsi, %r15 movq %rdx, %rsi movq %r8, 0x10(%rsp) movl %ecx, %ebp movq %rdx, %r14 callq 0x3775a leaq 0x8(%r13), %rbx movq %rax, %r12 movq %rax, %rsi movl %ebp, %edx movq %rbx, %rdi callq 0x9dfae testb %al, %al je 0x993d2 callq 0xb5a0 subq (%r13), %rax movq 0x10(%rsp), %r9 movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx movq %r12, %rcx movl %ebp, %r8d vcvtsi2sd %rax, %xmm0, %xmm0 vdivsd 0x3c06b3(%rip), %xmm0, %xmm0 # 0x459a80 callq 0x9e018 addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>, baryonyx::bit_array, long double>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double, long double)
int push_and_run(Solver& solver, Xtype& x, random_engine& rng, Float kappa, Float delta, Float theta, Float objective_amplifier) { bool pi_changed = 0; int remaining = 0; if (use_cycle) order = next_state(order); switch (order) { case solver_parameters::constraint_order::reversing: solver.push_and_compute_update_row(x, R.crbegin(), R.crend(), kappa, delta, theta, objective_amplifier); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::random_sorting: std::shuffle(R.begin(), R.end(), rng); solver.push_and_compute_update_row( x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::infeasibility_decr: std::sort(m_order.begin(), m_order.end(), [](const auto& lhs, const auto& rhs) { return rhs.second < lhs.second; }); solver.push_and_compute_update_row(x, m_order.cbegin(), m_order.cend(), kappa, delta, theta, objective_amplifier); return infeasibility_local_compute_violated_constraints(solver, x); case solver_parameters::constraint_order::infeasibility_incr: std::sort(m_order.begin(), m_order.end(), [](const auto& lhs, const auto& rhs) { return lhs.second < rhs.second; }); solver.push_and_compute_update_row(x, m_order.cbegin(), m_order.cend(), kappa, delta, theta, objective_amplifier); return infeasibility_local_compute_violated_constraints(solver, x); case solver_parameters::constraint_order::lagrangian_decr: std::sort( R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) { return solver.pi[rhs] < solver.pi[lhs]; }); solver.push_and_compute_update_row(x, R.cbegin(), R.cend(), kappa, delta, theta, objective_amplifier); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::lagrangian_incr: std::sort( R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) { return solver.pi[lhs] < solver.pi[rhs]; }); solver.push_and_compute_update_row(x, R.cbegin(), R.cend(), kappa, delta, theta, objective_amplifier); return compute_violated_constraints(solver, x, R); case solver_parameters::constraint_order::pi_sign_change: std::shuffle(R.begin(), R.end(), rng); pi_changed = solver.push_and_compute_update_row( x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier); remaining = local_compute_violated_constraints(solver, x); if (!pi_changed && remaining == 0) return 0; return remaining; case solver_parameters::constraint_order::none: default: solver.push_and_compute_update_row(x, R.cbegin(), R.cend(), kappa, delta, theta, objective_amplifier); return compute_violated_constraints(solver, x, R); } }
pushq %r15 pushq %r14 pushq %rbx subq $0x80, %rsp fldt 0xd0(%rsp) fldt 0xc0(%rsp) fldt 0xb0(%rsp) fldt 0xa0(%rsp) movl 0x30(%rdi), %eax cmpb $0x1, 0x34(%rdi) movq %rdx, %rbx movq %rsi, %r15 movq %rdi, %r14 jne 0x9942d xorl %esi, %esi leal 0x1(%rax), %edx cmpl $0x7, %eax cmovll %edx, %esi movl %esi, %eax movl %esi, 0x30(%r14) decl %eax cmpl $0x6, %eax ja 0x99542 leaq 0x3c093d(%rip), %rdx # 0x459d7c movslq (%rdx,%rax,4), %rax addq %rdx, %rax jmpq *%rax movq 0x8(%r14), %rax leaq 0x78(%rsp), %rdx leaq 0x70(%rsp), %rcx movq %r15, %rdi movq %rbx, %rsi movq %rax, (%rdx) movq (%r14), %rax movq %rax, (%rcx) fxch %st(3) fstpt 0x30(%rsp) fxch %st(1) fstpt 0x20(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0x9e118 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0x9adb0 addq $0x80, %rsp popq %rbx popq %r14 popq %r15 retq fstp %st(3) movq (%r14), %rdi movq 0x8(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) movq %r15, %rdx fstpt 0x4c(%rsp) callq 0x9ea29 jmp 0x995c7 fstp %st(3) movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) fstpt 0x4c(%rsp) callq 0x9e153 jmp 0x994fe fstp %st(3) movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) fstpt 0x4c(%rsp) callq 0x9e5be movq 0x18(%r14), %rdx movq 0x20(%r14), %rcx fldt 0x4c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x58(%rsp) fstpt 0x10(%rsp) fldt 0x64(%rsp) fstpt (%rsp) callq 0x9b7c2 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x80, %rsp popq %rbx popq %r14 popq %r15 jmp 0x9bc4a fstp %st(3) movq (%r14), %rdx movq 0x8(%r14), %rcx fxch %st(1) fstpt 0x20(%rsp) fstpt 0x10(%rsp) jmp 0x995e2 fstp %st(3) movq (%r14), %rdi movq 0x8(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) movq %rcx, %rdx fstpt 0x4c(%rsp) callq 0x3ceed movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x4c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x58(%rsp) fstpt 0x10(%rsp) fldt 0x64(%rsp) fstpt (%rsp) callq 0x9b33a jmp 0x995f0 fstp %st(3) movq (%r14), %rdi movq 0x8(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) movq %r15, %rdx fstpt 0x4c(%rsp) callq 0x9ef7d movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x4c(%rsp) fstpt 0x20(%rsp) fldt 0x58(%rsp) fstpt 0x10(%rsp) fldt 0x64(%rsp) fstpt (%rsp) movq %r15, %rdi movq %rbx, %rsi callq 0x9bd4c movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x80, %rsp popq %rbx popq %r14 popq %r15 jmp 0x9adb0 fstp %st(3) movq (%r14), %rdi movq 0x8(%r14), %rsi fxch %st(2) fstpt 0x64(%rsp) fxch %st(1) fstpt 0x58(%rsp) movq %rcx, %rdx fstpt 0x4c(%rsp) callq 0x3ceed movq (%r14), %rdx movq 0x8(%r14), %rcx fldt 0x4c(%rsp) fstpt 0x20(%rsp) movq %r15, %rdi movq %rbx, %rsi fldt 0x58(%rsp) fstpt 0x10(%rsp) fldt 0x64(%rsp) fstpt (%rsp) callq 0x9b33a movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x80, %rsp popq %rbx popq %r14 popq %r15 jmp 0x9c1d4
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::quadratic_cost_type<long double>::quadratic_cost_type(baryonyx::itm::quadratic_cost_type<long double> const&, int)
quadratic_cost_type(const quadratic_cost_type& other, int n) : obj(other.obj) , linear_elements(std::make_unique<Float[]>(n)) , quadratic_elements(std::make_unique<quad[]>(other.indices[n])) , indices(std::make_unique<int[]>(n + 1)) { std::copy_n(other.linear_elements.get(), n, linear_elements.get()); std::copy_n(other.indices.get(), n + 1, indices.get()); std::copy_n(other.quadratic_elements.get(), other.indices[n], quadratic_elements.get()); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq (%rsi), %rax leaq 0x8(%rdi), %r13 movslq %edx, %r15 movq %rsi, %rbx movl %edx, %ebp movq %rdi, %r12 movq %r15, %rsi movq %rax, (%rdi) movq %r13, %rdi callq 0x8afb9 movq 0x18(%rbx), %rax leaq 0x10(%r12), %rdi movslq (%rax,%r15,4), %rsi movq %rdi, (%rsp) callq 0x968d9 leal 0x1(%rbp), %r14d addq $0x18, %r12 movslq %r14d, %rsi movq %r12, %rdi callq 0x28eb6 testl %ebp, %ebp jle 0x99719 movq (%r13), %rdi movq 0x8(%rbx), %rsi movl %ebp, %edx shlq $0x4, %rdx callq 0xb140 jmp 0x9971b js 0x9972f movq 0x18(%rbx), %rsi movq (%r12), %rdi movl %r14d, %edx shlq $0x2, %rdx callq 0xb140 movq 0x18(%rbx), %rax movslq (%rax,%r15,4), %rdx testq %rdx, %rdx jle 0x9975e movq (%rsp), %rax movq 0x10(%rbx), %rsi shlq $0x5, %rdx movq (%rax), %rdi addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0xb140 addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq (%rsp), %rdi movq %rax, %rbx callq 0x9691a jmp 0x9977e movq %rax, %rbx movq %r13, %rdi callq 0x8affa movq %rbx, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-common.hpp
void baryonyx::itm::quadratic_cost_type<long double>::make_random_norm<std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>>(int, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&)
void make_random_norm(int n, Random& rng) { std::vector<std::pair<Float, int>> r(n); std::vector<std::pair<quad, int>> q(indices[n]); for (int i = 0; i != n; ++i) r[i] = { linear_elements[i], i }; std::sort(r.begin(), r.end(), [](const auto& lhs, const auto& rhs) { return lhs.first < rhs.first; }); { auto begin = r.begin(); auto end = r.end(); auto next = r.begin()++; for (; next != end; ++next) { if (next->first != begin->first) { if (std::distance(begin, next) > 1) random_epsilon_unique( begin, next, rng, begin->first, next->first); begin = next; } } if (std::distance(begin, end) > 1) { if (begin == r.begin()) { random_epsilon_unique( begin, end, rng, begin->first, begin->first + 1); } else { auto value = linearize(std::ptrdiff_t(0), r.front().first, std::distance(r.begin(), begin), begin->first, std::distance(r.begin(), r.end())); random_epsilon_unique( begin, end, rng, begin->first, value); } } // Reorder the vector according to the variable index, so, // it restores the initial order. std::sort( r.begin(), r.end(), [](const auto& lhs, const auto& rhs) { return lhs.second < rhs.second; }); } { // auto begin = q.begin(); // auto end = q.end(); // auto next = q.begin()++; // for (; next != end; ++next) { // if (next->first != begin->first) { // if (std::distance(begin, next) > 1) // random_epsilon_unique( // begin, next, rng, begin->first, // next->first); // begin = next; // } // } // if (std::distance(begin, end) > 1) { // if (begin == q.begin()) { // random_epsilon_unique( // begin, end, rng, begin->first, begin->first + // 1); // } else { // auto value = linearize(std::ptrdiff_t(0), // q.front().first, // std::distance(q.begin(), // begin), begin->first, // std::distance(q.begin(), // q.end())); // random_epsilon_unique( // begin, end, rng, begin->first, value); // } // } // Reorder the vector according to the variable index, so, // it restores the initial order. // std::sort( // q.begin(), q.end(), [](const auto& lhs, const auto& // rhs) { // return lhs.second < rhs.second; // }); } for (int i = 0; i != n; ++i) linear_elements[i] = r[i].first; // for (int i = 0; i != n; ++i) { // quadratic_elements[i].factor = r[i].first.factor; // Finally we compute the l+oo norm. make_loo_norm(n); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movq %rdx, %r15 movq %rdi, %rbx movslq %esi, %r14 leaq 0x30(%rsp), %rdi leaq 0x50(%rsp), %rdx movl %esi, %ebp movq %r14, %rsi callq 0x8e090 movq 0x18(%rbx), %rax movslq (%rax,%r14,4), %rsi leaq 0x50(%rsp), %rdi leaq 0x2f(%rsp), %rdx callq 0x99b9c movq 0x8(%rbx), %rax movq 0x30(%rsp), %rcx movl %ebp, %r14d pushq $0x8 popq %rdx xorl %esi, %esi cmpq %rsi, %r14 je 0x997fa fldt -0x8(%rax,%rdx) fstpt -0x10(%rcx,%rdx,2) movl %esi, (%rcx,%rdx,2) incq %rsi addq $0x10, %rdx jmp 0x997e1 movq 0x30(%rsp), %rdi movq 0x38(%rsp), %rsi movq %rbx, 0x48(%rsp) callq 0x99cef movq 0x30(%rsp), %r13 movq 0x38(%rsp), %r12 movq %r13, %rbp movq %r13, %rbx cmpq %r12, %rbp je 0x9987d fldt (%rbp) fldt (%rbx) fxch %st(1) fucomi %st(1), %st jne 0x99830 jnp 0x9985f movq %r13, %rcx subq %rbx, %rcx movq %rbp, %rax cmpq $0x21, %rcx jl 0x9986c fstpt 0x10(%rsp) fstpt (%rsp) movq %rbx, %rdi movq %rbp, %rsi movq %r15, %rdx callq 0x8e0e3 fldz fldz movq %rbp, %rax fxch %st(1) jmp 0x9986c fstp %st(0) fstp %st(0) fldz fldz movq %rbx, %rax fxch %st(1) fstp %st(0) fstp %st(0) addq $0x20, %rbp addq $0x20, %r13 movq %rax, %rbx jmp 0x9981e movq %r12, %rax subq %rbx, %rax cmpq $0x21, %rax jl 0x998ee movq 0x30(%rsp), %rax movq %rbx, %rsi subq %rax, %rsi je 0x998d3 fldt (%rax) fldt (%rbx) movq 0x38(%rsp), %rdx sarq $0x5, %rsi fstpt 0x10(%rsp) fstpt (%rsp) xorl %edi, %edi subq %rax, %rdx sarq $0x5, %rdx callq 0x8e159 fldt (%rbx) fxch %st(1) fstpt 0x10(%rsp) fstpt (%rsp) movq %rbx, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x8e0e3 jmp 0x998ee fldt (%rbx) fld1 fadd %st(1), %st fstpt 0x10(%rsp) fstpt (%rsp) movq %rbx, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x8e0e3 movq 0x30(%rsp), %rdi movq 0x38(%rsp), %rsi callq 0x9a20a movq 0x48(%rsp), %rdi movq 0x30(%rsp), %rax movq %r14, %rdx shlq $0x4, %rdx xorl %esi, %esi movq 0x8(%rdi), %rcx cmpq %rsi, %rdx je 0x99925 fldt (%rax,%rsi,2) fstpt (%rcx,%rsi) addq $0x10, %rsi jmp 0x99914 movl %r14d, %esi callq 0x99ade leaq 0x50(%rsp), %rdi callq 0x99c22 leaq 0x30(%rsp), %rdi callq 0x8e1fe addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x9995f movq %rax, %rbx jmp 0x9996c jmp 0x9995f jmp 0x9995f fstp %st(0) fstp %st(0) leaq 0x50(%rsp), %rdi movq %rax, %rbx callq 0x99c22 leaq 0x30(%rsp), %rdi callq 0x8e1fe movq %rbx, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::quadratic_cost_type<long double>::make_l2_norm(int)
void make_l2_norm(int n) { Float div = { 0 }; for (int i = 0; i != n; ++i) div += linear_elements[i] * linear_elements[i]; ; for (int i = 0, e = indices[n]; i != e; ++i) div += quadratic_elements[i].factor * quadratic_elements[i].factor; if (std::isnormal(div)) { for (int i = 0; i != n; ++i) linear_elements[i] /= div; for (int i = 0, e = indices[n]; i != e; ++i) quadratic_elements[i].factor /= div; } }
movq 0x8(%rdi), %rax movl %esi, %ecx shlq $0x4, %rcx xorl %edx, %edx fldz cmpq %rdx, %rcx je 0x99a4e fldt (%rax,%rdx) fmul %st, %st(0) faddp %st, %st(1) addq $0x10, %rdx jmp 0x99a3c movq 0x18(%rdi), %r8 movslq %esi, %rdx movq 0x10(%rdi), %rsi movl (%r8,%rdx,4), %edx xorl %r8d, %r8d shlq $0x5, %rdx cmpq %r8, %rdx je 0x99a77 fldt (%rsi,%r8) fmul %st, %st(0) faddp %st, %st(1) addq $0x20, %r8 jmp 0x99a64 fld %st(0) fstpt -0x18(%rsp) btq $0x3f, -0x18(%rsp) movzwl -0x10(%rsp), %r8d setae %sil andl $0x7fff, %r8d # imm = 0x7FFF decl %r8d movzwl %r8w, %r8d cmpl $0x7ffe, %r8d # imm = 0x7FFE setae %r8b orb %sil, %r8b jne 0x99ada xorl %esi, %esi cmpq %rsi, %rcx je 0x99ac1 fldt (%rax,%rsi) fdiv %st(1), %st fstpt (%rax,%rsi) addq $0x10, %rsi jmp 0x99aae movq 0x10(%rdi), %rax xorl %ecx, %ecx cmpq %rcx, %rdx je 0x99ada fldt (%rax,%rcx) fdiv %st(1), %st fstpt (%rax,%rcx) addq $0x20, %rcx jmp 0x99ac7 fstp %st(0) retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::quadratic_cost_type<long double>::make_loo_norm(int)
void make_loo_norm(int n) { Float div = *std::max_element(linear_elements.get(), linear_elements.get() + n); for (int i = 0, e = indices[n]; i != e; ++i) div = std::max(quadratic_elements[i].factor, div); if (std::isnormal(div)) { for (int i = 0; i != n; ++i) linear_elements[i] /= div; for (int i = 0, e = indices[n]; i != e; ++i) quadratic_elements[i].factor /= div; } }
pushq %rbp pushq %r14 pushq %rbx subq $0x10, %rsp movq %rdi, %rbx movq 0x8(%rdi), %rdi movslq %esi, %r14 movl %esi, %ebp movq %r14, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0x8ee05 fldt (%rax) movq 0x18(%rbx), %rax movq 0x10(%rbx), %rcx xorl %edx, %edx movl (%rax,%r14,4), %eax shlq $0x5, %rax cmpq %rdx, %rax je 0x99b2d fldt (%rcx,%rdx) fxch %st(1) fucomi %st(1), %st fxch %st(1) fcmovnbe %st(1), %st fstp %st(1) addq $0x20, %rdx jmp 0x99b15 fld %st(0) fstpt (%rsp) btq $0x3f, (%rsp) movzwl 0x8(%rsp), %edx setae %cl andl $0x7fff, %edx # imm = 0x7FFF decl %edx movzwl %dx, %edx cmpl $0x7ffe, %edx # imm = 0x7FFE setae %dl orb %cl, %dl jne 0x99b90 movq 0x8(%rbx), %rcx movl %ebp, %edx shlq $0x4, %rdx xorl %esi, %esi cmpq %rsi, %rdx je 0x99b77 fldt (%rcx,%rsi) fdiv %st(1), %st fstpt (%rcx,%rsi) addq $0x10, %rsi jmp 0x99b64 movq 0x10(%rbx), %rcx xorl %edx, %edx cmpq %rdx, %rax je 0x99b90 fldt (%rcx,%rdx) fdiv %st(1), %st fstpt (%rcx,%rdx) addq $0x20, %rdx jmp 0x99b7d fstp %st(0) addq $0x10, %rsp popq %rbx popq %r14 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<long double>, long double, baryonyx::itm::maximize_tag>::mutation(baryonyx::itm::local_context&, baryonyx::bit_array&)
void mutation(local_context& ctx, bit_array& x) { if (ctx.value_p_dist.mean() == 0.0 && ctx.value_p_dist.stddev() == 0.0) return; double val_p, var_p; do var_p = ctx.variable_p_dist(ctx.rng); while (var_p <= 0.0 || var_p >= 1.0); do val_p = ctx.value_p_dist(ctx.rng); while (val_p < 0.0 || val_p > 1.0); to_log(stdout, 7u, "- mutation variables {}% with " " {}% of set\n", var_p, val_p); std::bernoulli_distribution dist_var_p(var_p); std::bernoulli_distribution dist_value_p(val_p); for (int i = 0, e = x.size(); i != e; ++i) { if (dist_var_p(ctx.rng)) { to_log(stdout, 9u, "- mutate variable {}\n", i); x.set(i, dist_value_p(ctx.rng)); } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp vmovsd 0x48(%rsi), %xmm0 vxorpd %xmm1, %xmm1, %xmm1 movq %rdx, %rbx movq %rsi, %r14 vucomisd %xmm1, %xmm0 jne 0x9a89c jp 0x9a89c vmovsd 0x50(%r14), %xmm0 vucomisd %xmm1, %xmm0 jne 0x9a89c jp 0x9a89c addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x48(%r14), %r15 leaq 0x28(%r14), %r12 movq %r12, %rdi movq %r14, %rsi callq 0x3c480 vxorpd %xmm1, %xmm1, %xmm1 vucomisd %xmm0, %xmm1 jae 0x9a8a4 vucomisd 0x3b9777(%rip), %xmm0 # 0x454038 jae 0x9a8a4 vmovsd %xmm0, 0x18(%rsp) movq %r15, %rdi movq %r14, %rsi callq 0x3c480 vxorpd %xmm1, %xmm1, %xmm1 vucomisd %xmm0, %xmm1 ja 0x9a8c9 vucomisd 0x3b9752(%rip), %xmm0 # 0x454038 ja 0x9a8c9 movq 0x5a26d9(%rip), %rax # 0x63cfc8 leaq 0x20(%rsp), %r15 leaq 0x3bfb21(%rip), %rcx # 0x45a41c vmovsd %xmm0, (%r15) movq (%rax), %rdi pushq $0x7 popq %rsi pushq $0x2a popq %rdx leaq 0x18(%rsp), %r12 movq %r15, %r9 movq %r12, %r8 callq 0x3c5d8 vmovsd (%r12), %xmm0 vmovsd (%r15), %xmm1 leaq 0x4(%rsp), %rax andl $0x0, (%rax) xorl %eax, %eax movl (%rbx), %r15d vmovsd %xmm0, 0x10(%rsp) vmovsd %xmm1, 0x8(%rsp) pushq $0x9 popq %rbp pushq $0x15 popq %r13 cmpl %r15d, %eax je 0x9a88d movq %r14, %rdi callq 0x36ac3 vmovsd 0x10(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x9a9a8 movq 0x5a2660(%rip), %rax # 0x63cfc8 leaq 0x3bfad8(%rip), %rcx # 0x45a447 leaq 0x4(%rsp), %r8 movl %ebp, %esi movq %r13, %rdx movq (%rax), %rdi callq 0x3c631 movl 0x4(%rsp), %r12d movq %r14, %rdi callq 0x36ac3 vmovsd 0x8(%rsp), %xmm1 xorl %edx, %edx movq %rbx, %rdi movl %r12d, %esi vucomisd %xmm0, %xmm1 seta %dl callq 0x3c67e movl 0x4(%rsp), %eax incl %eax movl %eax, 0x4(%rsp) jmp 0x9a944
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<long double>, baryonyx::itm::maximize_tag>::crossover(baryonyx::itm::local_context&, baryonyx::bit_array&)
void crossover(local_context& ctx, bit_array& x) { m_indices_reader lock(m_indices_mutex); if (ctx.crossover_bastert_insertion(ctx.rng)) { int first = m_indices[choose_a_solution(ctx)]; std::bernoulli_distribution b(0.5); if (b(ctx.rng)) { if (b(ctx.rng)) { crossover(ctx, x, m_data[first].x, m_bastert); to_log(stdout, 7u, "- crossover between {} ({}) and bastert\n", first, m_data[first].value); } else { m_data[first].x = m_bastert; } } else { init_with_random(m_random, ctx.rng, x.size(), 0.5); if (b(ctx.rng)) { crossover(ctx, x, m_data[first].x, m_random); to_log(stdout, 7u, "- crossover between {} ({}) and random\n", first, m_data[first].value); } else { m_data[first].x = m_random; } } } else { int first = m_indices[choose_a_solution(ctx)]; int second = m_indices[choose_a_solution(ctx)]; while (first == second) second = m_indices[choose_a_solution(ctx)]; crossover(ctx, x, m_data[first].x, m_data[second].x); to_log(stdout, 7u, "- crossover between {} ({}) and {} ({})\n", first, m_data[first].value, second, m_data[second].value); } }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x20, %rsp movq %rdi, 0x10(%rsp) movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx movb $0x1, 0x18(%rsp) callq 0x3c460 leaq 0x80(%r15), %rdi movq %r15, %rsi callq 0x36254 testb %al, %al je 0x9aa69 movq %rbx, %rdi movq %r15, %rsi callq 0x9abe8 movq 0x38(%rbx), %rcx cltq movl (%rcx,%rax,4), %eax movl %eax, 0x8(%rsp) movq %r15, %rdi callq 0x36ac3 vmovsd 0x3bdf64(%rip), %xmm1 # 0x458978 vucomisd %xmm0, %xmm1 jbe 0x9ab0d movq %r15, %rdi callq 0x36ac3 vmovsd 0x3bdf4a(%rip), %xmm1 # 0x458978 vucomisd %xmm0, %xmm1 jbe 0x9ab91 movslq 0x8(%rsp), %rax leaq 0x68(%rbx), %r8 imulq $0x38, %rax, %rcx addq 0x50(%rbx), %rcx movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x9ac2c addq $0x50, %rbx leaq 0x3bf940(%rip), %rcx # 0x45a3a2 pushq $0x28 jmp 0x9ab68 movq %rbx, %rdi movq %r15, %rsi callq 0x9abe8 movq 0x38(%rbx), %rcx cltq movslq (%rcx,%rax,4), %r12 movl %r12d, 0x8(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0x9abe8 movq 0x38(%rbx), %rcx cltq movslq (%rcx,%rax,4), %rax movl %eax, 0xc(%rsp) cmpl %eax, %r12d jne 0x9aaae movq %rbx, %rdi movq %r15, %rsi callq 0x9abe8 jmp 0x9aa8e movq 0x50(%rbx), %r8 imulq $0x38, %r12, %r12 imulq $0x38, %rax, %r13 leaq (%r8,%r12), %rcx addq %r13, %r8 movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x9ac2c movq 0x5a24f2(%rip), %rax # 0x63cfc8 movq 0x50(%rbx), %rdx movq (%rax), %rdi leaq 0x10(%rdx,%r13), %rax leaq 0x10(%rdx,%r12), %r9 leaq 0xc(%rsp), %r10 leaq 0x3bf900(%rip), %rcx # 0x45a3f3 pushq $0x7 popq %rsi pushq $0x28 popq %rdx leaq 0x8(%rsp), %r8 pushq %rax pushq %r10 callq 0x3c3e1 popq %rax popq %rcx jmp 0x9abb0 movl (%r14), %edx leaq 0x78(%rbx), %r12 vmovsd 0x3bde5c(%rip), %xmm0 # 0x458978 movq %r12, %rdi movq %r15, %rsi callq 0x362ac movq %r15, %rdi callq 0x36ac3 vmovsd 0x3bde41(%rip), %xmm1 # 0x458978 movslq 0x8(%rsp), %rax imulq $0x38, %rax, %rcx addq 0x50(%rbx), %rcx vucomisd %xmm0, %xmm1 jbe 0x9aba5 movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx movq %r12, %r8 callq 0x9ac2c addq $0x50, %rbx leaq 0x3bf865(%rip), %rcx # 0x45a3cb pushq $0x27 popq %rdx movq 0x5a2458(%rip), %rax # 0x63cfc8 leaq 0x8(%rsp), %r8 movq (%rbx), %rsi movslq (%r8), %r9 movq (%rax), %rdi imulq $0x38, %r9, %rax leaq 0x10(%rsi,%rax), %r9 pushq $0x7 popq %rsi callq 0x3c388 jmp 0x9abb0 movslq 0x8(%rsp), %rax imulq $0x38, %rax, %rcx addq 0x50(%rbx), %rcx addq $0x68, %rbx movq %rbx, %r12 movq %rcx, %rdi movq %r12, %rsi callq 0x36a44 leaq 0x10(%rsp), %rdi callq 0x3c450 addq $0x20, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq jmp 0x9abd2 jmp 0x9abd2 jmp 0x9abd2 jmp 0x9abd2 jmp 0x9abd2 movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x3c450 movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<long double>, baryonyx::itm::maximize_tag>::crossover(baryonyx::itm::local_context&, baryonyx::bit_array&, baryonyx::bit_array const&, baryonyx::bit_array const&)
void crossover(local_context& ctx, bit_array& x, const bit_array& first, const bit_array& second) { const auto block_size = x.block_size(); for (int i = 0; i != block_size; ++i) { const auto x1 = first.block(i); const auto x2 = second.block(i); x.set_block(i, ((x1 ^ x2) & ctx.crossover_dist(ctx.rng)) ^ x1); } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movl 0x4(%rdx), %r15d leaq 0x70(%rsi), %r13 movq %r8, 0x10(%rsp) movq %rcx, 0x8(%rsp) movq %rsi, %r12 xorl %ebp, %ebp movq %rdx, (%rsp) cmpq %rbp, %r15 je 0x9ac9f movq 0x8(%rsp), %rdi movl %ebp, %esi callq 0x377b0 movq 0x10(%rsp), %rdi movl %ebp, %esi movq %rax, %rbx callq 0x377b0 movq %rax, %r14 movq %r13, %rdi movq %r12, %rsi callq 0x3709a andnq %rbx, %rax, %rcx andq %rax, %r14 orq %rcx, %r14 movq (%rsp), %rcx movq 0x8(%rcx), %rax movq %r14, (%rax,%rbp,8) incq %rbp jmp 0x9ac55 addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>> const&, baryonyx::bit_array const&, std::vector<int, std::allocator<int>>&)
int compute_violated_constraints(const Solver& slv, const Xtype& x, std::vector<int>& out) { out.clear(); for (int k = 0; k != slv.m; ++k) if (!is_valid_constraint(slv, k, x)) out.emplace_back(k); return length(out); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq (%rdx), %rax movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 cmpq %rax, 0x8(%rdx) je 0x9adce movq %rax, 0x8(%rbx) leaq 0x4(%rsp), %r12 xorl %esi, %esi movl %esi, 0x4(%rsp) cmpl 0x80(%r15), %esi je 0x9ae04 movq %r15, %rdi movq %r14, %rdx callq 0x9ae1b testb %al, %al jne 0x9adfc movq %rbx, %rdi movq %r12, %rsi callq 0x31460 movl 0x4(%rsp), %esi incl %esi jmp 0x9add5 movq 0x8(%rbx), %rax subq (%rbx), %rax shrq $0x2, %rax addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>> const&, int, baryonyx::bit_array const&)
bool is_valid_constraint(const Solver& slv, int k, const Xtype& x) { typename sparse_matrix<int>::const_row_iterator it, et; std::tie(it, et) = slv.ap.row(k); int v = 0; for (; it != et; ++it) v += slv.factor(it->value) * x[it->column]; return slv.bound_min(k) <= v && v <= slv.bound_max(k); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rdx, %r14 movl %esi, %edx leaq 0x8(%rdi), %rsi leaq 0x8(%rsp), %r15 movq %rdi, %rbx movl %edx, 0x4(%rsp) movq %r15, %rdi callq 0x3c868 movq (%r15), %r12 movq 0x8(%r15), %r13 xorl %r15d, %r15d cmpq %r12, %r13 je 0x9ae78 movslq (%r13), %rax movq 0x48(%rbx), %rcx movl 0x4(%r13), %esi movq %r14, %rdi movl (%rcx,%rax,4), %ebp callq 0x3664a imull %ebp, %eax addq $0x8, %r13 addl %eax, %r15d jmp 0x9ae50 movslq 0x4(%rsp), %rcx movq 0x58(%rbx), %rax imulq $0xc, %rcx, %rcx cmpl %r15d, (%rax,%rcx) jle 0x9ae8f xorl %eax, %eax jmp 0x9ae97 cmpl 0x4(%rax,%rcx), %r15d setle %al addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>::decrease_preference(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, long double)
void decrease_preference(sparse_matrix<int>::row_iterator begin, sparse_matrix<int>::row_iterator end, Float theta) noexcept { for (; begin != end; ++begin) P[begin->value] *= theta; }
fldt 0x8(%rsp) movq 0x68(%rdi), %rax cmpq %rdx, %rsi je 0x9c238 movslq (%rsi), %rcx addq $0x8, %rsi shlq $0x4, %rcx fldt (%rax,%rcx) fmul %st(1), %st fstpt (%rax,%rcx) jmp 0x9c21e fstp %st(0) retq nop
/quesnel[P]baryonyx/lib/src/random-solver.cpp
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>::rc_data*>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>::rc_data*, baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>::rc_data*, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&)
inline void random_shuffle_unique(iteratorT begin, iteratorT end, random_engine& rng) noexcept { auto ret = begin++; for (; begin != end; ++begin) { if (ret->value != begin->value) { std::shuffle(ret, begin, rng); ret = begin; } } std::shuffle(ret, begin, rng); }
pushq %r15 pushq %r14 pushq %rbx movq %rdx, %rbx movq %rsi, %r14 leaq 0x20(%rdi), %r15 cmpq %r14, %r15 je 0x9c324 fldt (%rdi) fldt (%r15) addq $0x20, %r15 fxch %st(1) fucompi %st(1), %st fstp %st(0) jne 0x9c310 jnp 0x9c2f8 addq $-0x20, %r15 movq %r15, %rsi movq %rbx, %rdx callq 0x9c8a5 movq %r15, %rdi jmp 0x9c2f4 movq %r15, %rsi movq %rbx, %rdx callq 0x9c8a5 popq %rbx popq %r14 popq %r15 retq jmp 0x9c337 movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-common.hpp