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<long double>, baryonyx::itm::maximize_tag>::insert(baryonyx::itm::local_context&, baryonyx::bit_array const&, unsigned long, double, double, long)
void insert(local_context& ctx, const bit_array& x, const std::size_t hash, const double value, const double duration, const long int loop) noexcept { to_log(stdout, 5u, "- insert solution {} (hash: {}) {}s in {} loops\n", value, 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, value, duration, hash, loop, 0); sort(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x28, %rsp movq 0x59f188(%rip), %r12 # 0x63cfc8 movq %rdi, %rbx leaq 0x20(%rsp), %r9 leaq 0x18(%rsp), %rax leaq 0x10(%rsp), %r10 leaq 0x8(%rsp), %r11 movq %rdx, %r14 movq %rsi, %r15 movq %rcx, (%r9) vmovsd %xmm0, (%rax) vmovsd %xmm1, (%r10) movq %r8, (%r11) movq (%r12), %rdi leaq 0x3bc653(%rip), %rcx # 0x45a4ca pushq $0x5 popq %rsi pushq $0x30 popq %rdx movq %rax, %r8 pushq %r11 pushq %r10 callq 0x3fb9e popq %rax popq %rcx leaq 0x68(%r15), %rdi movq %r15, %rsi callq 0x3fce2 movq 0x38(%rbx), %rcx cltq leaq 0x4(%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 0x3bc63a(%rip), %rcx # 0x45a4fb pushq $0x5 popq %rsi pushq $0x11 popq %rdx callq 0x3c388 vmovsd 0x18(%rsp), %xmm0 vmovsd 0x10(%rsp), %xmm1 movl 0x4(%rsp), %esi movq 0x20(%rsp), %rcx movq 0x8(%rsp), %r8 movq %rbx, %rdi movq %r14, %rdx xorl %r9d, %r9d callq 0x9df10 movq %rbx, %rdi callq 0x97152 addq $0x28, %rsp popq %rbx popq %r12 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<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 0x9dff6 cmpl %ebx, 0x30(%rcx,%rdx) jne 0x9dff0 cmpq %r14, 0x20(%rcx,%rdx) je 0x9dff6 addq $0x38, %rdx jmp 0x9dfde 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<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::solver_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>, baryonyx::file_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 0xa0cc4 pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xa0d3e 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::quadratic_cost_type<long double>>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_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 0x3b8d59(%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::solve_problem<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::minimize_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 0xa14ce 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 0xa15f7 movq 0xa8(%r15), %rax cmpq 0xb0(%r15), %rax je 0xa15f7 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 0xa161e cmpl $0x2, %eax jne 0xa166d movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000 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 0xa99aa jmp 0xa16ba 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 0xa16e9 movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000 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 0xa926e jmp 0xa16ba movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000 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 0xaa0e6 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 0xa1755 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 0xa1777 jmp 0xa1777 leaq 0x58(%rsp), %rdi movq %rax, %r14 callq 0x357fe leaq 0x28(%rsp), %rdi callq 0x8affa jmp 0xa179a jmp 0xa1797 movq %rax, %r14 jmp 0xa17a4 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::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::minimize_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 0x4f90a 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 0xa1a29 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 0xa19ff movq 0x10(%rsp), %rdi movq 0x18(%rsp), %rsi xorl %r15d, %r15d movl %ebp, %edx xorl %ecx, %ecx callq 0xa1d47 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 0xa1adb 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 0x3b25a8(%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 0xa1ad6 movq %r13, %rdi callq 0x36ac3 vmovapd 0x30(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xa1ad2 movq (%r14), %rdi movl %ebx, %esi addq %r12, %rdi callq 0x3626e incl %ebx jmp 0xa1aad incq %r15 jmp 0xa1a62 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 0xa1ba1 vmovsd 0x3b7f67(%rip), %xmm0 # 0x459a88 movq (%r14), %rdi movq %r13, %rsi movl %ebp, %edx addq %rbx, %rdi callq 0x362ac vmovsd 0x3b7f57(%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 0x3b24da(%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 0xa1dbd addl $0x2, %r15d addq $0x70, %rbx addq $0x2, %r12 jmp 0xa1b0e movq 0x8(%rsp), %rax movl 0x98(%rax), %eax movq %rax, 0x20(%rsp) xorl %eax, %eax cmpq 0x20(%rsp), %rax je 0xa1c98 movq 0x8(%rsp), %rbx imulq $0x38, %rax, %rbp movq %rax, 0x10(%rsp) movq 0x50(%rbx), %rdi addq %rbp, %rdi callq 0x4fc80 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 0xa1c8b imulq $0x28, %rax, %r12 movq %rax, 0x30(%rsp) xorl %r15d, %r15d movq (%rcx,%r12), %r13 movq 0x8(%rcx,%r12), %rbx cmpq %rbx, %r13 je 0xa1c61 movq (%r14), %rdi movl 0x4(%r13), %esi addq %rbp, %rdi callq 0x3664a testl %eax, %eax je 0xa1c58 movl (%r13), %eax addl %eax, %r15d addq $0x8, %r13 jmp 0xa1c3c movq 0x28(%rsp), %rax movq (%rax), %rcx cmpl %r15d, 0x18(%rcx,%r12) jg 0xa1c7a addq %rcx, %r12 cmpl 0x1c(%r12), %r15d jle 0xa1c81 movq (%r14), %rax incl 0x30(%rax,%rbp) movq 0x30(%rsp), %rax incq %rax jmp 0xa1c20 movq 0x10(%rsp), %rax incq %rax jmp 0xa1bb3 movq 0x8(%rsp), %rdi xorl %edx, %edx movq 0x38(%rdi), %rax movq 0x40(%rdi), %rcx cmpq %rcx, %rax je 0xa1cb6 movl %edx, (%rax) incl %edx addq $0x4, %rax jmp 0xa1ca7 callq 0xa2074 addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx jmp 0xa1cf1 movq %rax, %rbx jmp 0xa1cfd movq %rax, %rbx jmp 0xa1d05 jmp 0xa1cdd jmp 0xa1cdd 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 0x4fd7c 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::minimize_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 0xa1dae movq 0x8(%r14), %rcx testl %ebx, %ebx setne %al fldt (%rcx,%rbp) fldz fucomi %st(1), %st setnp %dl sete %cl fucompi %st(1), %st fstp %st(0) ja 0xa1d9a andb %dl, %cl andb %cl, %al jne 0xa1d9a movq %r15, %rdi movl %r12d, %esi callq 0x36a06 jmp 0xa1da5 movq %r15, %rdi movl %r12d, %esi callq 0x369c8 addq $0x10, %rbp incl %r12d jmp 0xa1d66 addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::minimize_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 0xa2bbd movq 0x59af1f(%rip), %r13 # 0x63cfc8 movq (%r13), %rdi leaq 0x3b7fe4(%rip), %rcx # 0x45a098 pushq $0x3 popq %rsi pushq $0x1d popq %rdx callq 0x377fc leaq 0x3b7ff0(%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 0xa212d 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 0xa20d4 leaq 0x8(%rsp), %rdi callq 0x378b4 addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0xa2148 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::minimize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::minimize_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::minimize_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 0xa35f5 movq 0xb0(%rsp), %rax movq (%rax), %rdi leaq 0xb8(%rsp), %rsi movl %ebx, %edx fstpt (%rsp) callq 0x8d304 fstpt 0x94(%rsp) jmp 0xa360e 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 0xa3ada movl 0xcc(%r13), %esi leaq 0x128(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq $0x0, 0x50(%rsp) movb (%r15), %al testb $0x1, %al jne 0xa3a42 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 0xa3d02 vmovsd %xmm0, 0x100(%rsp) fldl 0x100(%rsp) fstpt 0xc8(%rsp) leaq 0x128(%rsp), %rdi leaq 0x160(%rsp), %rsi movq %rbx, %rdx callq 0xa3e02 fldt 0xc8(%rsp) fldt 0x44(%rsp) movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF xorl %r14d, %r14d movb (%r15), %al testb $0x1, %al jne 0xa37d7 cmpq 0xb0(%r13), %r14 je 0xa37d7 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 0xa3e44 testl %eax, %eax je 0xa37f1 cmpl %eax, %ebx cmovgel %eax, %ebx cmpq 0xf8(%rsp), %r14 jle 0xa37b6 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 0xa37c0 fldt 0x44(%rsp) fldt 0x74(%rsp) fxch %st(1) fldt 0xec(%rsp) fxch %st(2) fucomi %st(2), %st fstp %st(2) ja 0xa37d7 incq %r14 jmp 0xa3707 fstp %st(1) testl %ebx, %ebx jg 0xa3a20 movq $0x0, 0x50(%rsp) leaq 0x58(%rsp), %rbx jmp 0xa382d 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 0xa4074 movb $0x1, %al movq %rax, 0x50(%rsp) fldt 0x44(%rsp) xorl %r14d, %r14d movl $0x0, 0x70(%rsp) movb (%r15), %al testb $0x1, %al jne 0xa3a19 cmpl 0xbc(%r13), %r14d jge 0xa3a19 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 0xa417e testl %eax, %eax jne 0xa38d3 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 0xa4074 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 0xa39b7 leal -0x1(%rbx), %r12d cmpl 0xc0(%r13), %r12d jge 0xa39b7 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 0xa3e44 testl %eax, %eax je 0xa39c0 vcvtsi2sd %r12d, %xmm2, %xmm0 vucomisd 0xa0(%r13), %xmm0 jbe 0xa3997 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 0xa39a1 fldt 0x44(%rsp) fldt 0x74(%rsp) fxch %st(1) fldt 0xec(%rsp) fxch %st(2) fucomi %st(2), %st fstp %st(2) ja 0xa39b7 incl %ebx jmp 0xa38e3 fstp %st(1) leaq 0x58(%rsp), %rbx jmp 0xa3a0d 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 0xa4074 movb $0x1, %al movq %rax, 0x50(%rsp) fldt 0x44(%rsp) decl 0x70(%rsp) incl %r14d jmp 0xa3838 fstp %st(0) jmp 0xa3682 fstp %st(0) movq 0xb0(%r13), %r8 movq 0x68(%rsp), %rdi leaq 0x58(%rsp), %rdx movq %rbp, %rsi movl %ebx, %ecx callq 0xa40fc jmp 0xa3679 leaq 0x128(%rsp), %rdi callq 0x393ac leaq 0x160(%rsp), %rdi callq 0xa440a 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 0xa3a8c movq %rax, %rbx jmp 0xa3aae movq %rax, %rbx jmp 0xa3abb movq %rax, %rbx jmp 0xa3ac8 jmp 0xa3a9e jmp 0xa3a9e jmp 0xa3a9e jmp 0xa3a9e leaq 0x128(%rsp), %rdi movq %rax, %rbx callq 0x393ac leaq 0x160(%rsp), %rdi callq 0xa440a 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::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xa4448 movslq %r14d, %rbp leaq 0x58(%r15), %rdi movq %rbp, %rsi movq %rdi, 0x8(%rsp) callq 0xa4488 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 0xa3c84 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 0xa3c17 movl (%r11), %r12d leal 0x1(%r12), %ebp testl $0xfffffffd, %ebp # imm = 0xFFFFFFFD jne 0xa3c93 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 0xa3bda movl 0x18(%r9), %r11d cmpl 0x1c(%r9), %r11d jne 0xa3c2e imulq $0xc, %rsi, %r8 movl %r11d, (%rdx,%r8) movl %r11d, %r8d jmp 0xa3c4e 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 0xa3bb4 leaq 0x3b47c0(%rip), %rdi # 0x45842a leaq 0x3b6638(%rip), %rsi # 0x45a2a9 leaq 0x3b65cf(%rip), %rdx # 0x45a247 leaq 0x3b663f(%rip), %rcx # 0x45a2be callq 0x2813f addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3b4790(%rip), %rdi # 0x45842a leaq 0x3b658c(%rip), %rsi # 0x45a22d leaq 0x3b659f(%rip), %rdx # 0x45a247 leaq 0x3b65f7(%rip), %rcx # 0x45a2a6 callq 0x2813f movq %r13, %rdi movq %rax, %r14 callq 0x8affa jmp 0xa3cc4 movq %rax, %r14 movq 0x8(%rsp), %rdi callq 0xa44c6 jmp 0xa3cd3 movq %rax, %r14 movq 0x10(%rsp), %rdi callq 0xa44e0 jmp 0xa3ce2 movq %rax, %r14 movq %rbx, %rdi callq 0x28fb6 jmp 0xa3cef 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::minimize_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 0x5992b4(%rip), %r12 # 0x63cfc8 movq %rdi, %r15 movq %rcx, %rbx leaq 0x3b663a(%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 0xa3db0 vaddsd 0x90(%r14), %xmm0, %xmm0 vmovsd 0x8(%rsp), %xmm1 movq %rsp, %r8 vsubsd %xmm2, %xmm1, %xmm1 vmovsd %xmm0, (%rcx,%rax,8) leaq 0x3b65e7(%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 0xa3de3 vmovsd 0x88(%r14), %xmm0 leaq 0x8(%r15), %rdi movq %r14, %rsi movq %rbx, %rdx vmovsd %xmm0, (%rcx,%rax,8) callq 0xa4670 movq (%r12), %rdi leaq 0x3b65bd(%rip), %rcx # 0x45a395 pushq $0x5 popq %rsi pushq $0xc popq %rdx callq 0x377fc movq %r15, %rdi movq %r14, %rsi movq %rbx, %rdx callq 0xa4516 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::minimize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xa3e18 movq %rax, %rdi jmp 0xa496a cmpl $0x7, %ecx jne 0xa3e35 movq (%rax), %rcx movq 0x8(%rax), %rax xorl %edx, %edx cmpq %rax, %rcx je 0xa3e43 movl %edx, (%rcx) incl %edx addq $0x4, %rcx jmp 0xa3e26 movq %rsi, %rdi movq %rdx, %rsi movq %rax, %rdx jmp 0xa4a6c 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::minimize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array, long double>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xa3f65 leaq 0x3b5f18(%rip), %rdx # 0x459d98 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 0xa4b62 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0xa4a6c 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 0xa6f23 jmp 0xa3fd9 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) fstpt 0x3c(%rsp) callq 0xa664d jmp 0xa3f24 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) fstpt 0x3c(%rsp) callq 0xa6ab8 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 0xa5454 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0xa58c6 movq (%r14), %rdx movq 0x8(%r14), %rcx fxch %st(2) fstpt 0x20(%rsp) fstpt 0x10(%rsp) jmp 0xa3fae 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 0xa4fe2 jmp 0xa4002 movq (%r14), %rdi movq 0x8(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) movq %r15, %rdx fstpt 0x3c(%rsp) callq 0xa7477 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 0xa59c8 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0xa4a6c 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 0xa4fe2 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0xa5e3a
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<long double>, long double, baryonyx::itm::minimize_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 0xa79c8 testb %al, %al je 0xa40ed 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 0x3b599e(%rip), %xmm0, %xmm1 # 0x459a80 vmovsd 0x10(%rsp), %xmm0 callq 0xa7a48 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::minimize_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 0xa7bc8 testb %al, %al je 0xa416e 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 0x3b5917(%rip), %xmm0, %xmm0 # 0x459a80 callq 0xa7c32 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::minimize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array, long double>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xa41c9 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 0xa42de leaq 0x3b5bd9(%rip), %rdx # 0x459db4 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 0xa7d32 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0xa4a6c 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 0xa8643 jmp 0xa4363 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 0xa7d6d jmp 0xa429a 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 0xa81d8 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 0xa5454 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x80, %rsp popq %rbx popq %r14 popq %r15 jmp 0xa58c6 fstp %st(3) movq (%r14), %rdx movq 0x8(%r14), %rcx fxch %st(1) fstpt 0x20(%rsp) fstpt 0x10(%rsp) jmp 0xa437e 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 0xa4fe2 jmp 0xa438c 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 0xa8b97 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 0xa59c8 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x80, %rsp popq %rbx popq %r14 popq %r15 jmp 0xa4a6c 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 0xa4fe2 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x80, %rsp popq %rbx popq %r14 popq %r15 jmp 0xa5e3a
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<long double>, long double, baryonyx::itm::minimize_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 0xa4558 jp 0xa4558 vmovsd 0x50(%r14), %xmm0 vucomisd %xmm1, %xmm0 jne 0xa4558 jp 0xa4558 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 0xa4560 vucomisd 0x3afabb(%rip), %xmm0 # 0x454038 jae 0xa4560 vmovsd %xmm0, 0x18(%rsp) movq %r15, %rdi movq %r14, %rsi callq 0x3c480 vxorpd %xmm1, %xmm1, %xmm1 vucomisd %xmm0, %xmm1 ja 0xa4585 vucomisd 0x3afa96(%rip), %xmm0 # 0x454038 ja 0xa4585 movq 0x598a1d(%rip), %rax # 0x63cfc8 leaq 0x20(%rsp), %r15 leaq 0x3b5e65(%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 0xa4549 movq %r14, %rdi callq 0x36ac3 vmovsd 0x10(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xa4664 movq 0x5989a4(%rip), %rax # 0x63cfc8 leaq 0x3b5e1c(%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 0xa4600
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::default_cost_type<long double>, baryonyx::itm::minimize_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 0xa4725 movq %rbx, %rdi movq %r15, %rsi callq 0xa48a4 movq 0x38(%rbx), %rcx cltq movl (%rcx,%rax,4), %eax movl %eax, 0x8(%rsp) movq %r15, %rdi callq 0x36ac3 vmovsd 0x3b42a8(%rip), %xmm1 # 0x458978 vucomisd %xmm0, %xmm1 jbe 0xa47c9 movq %r15, %rdi callq 0x36ac3 vmovsd 0x3b428e(%rip), %xmm1 # 0x458978 vucomisd %xmm0, %xmm1 jbe 0xa484d 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 0xa48e8 addq $0x50, %rbx leaq 0x3b5c84(%rip), %rcx # 0x45a3a2 pushq $0x28 jmp 0xa4824 movq %rbx, %rdi movq %r15, %rsi callq 0xa48a4 movq 0x38(%rbx), %rcx cltq movslq (%rcx,%rax,4), %r12 movl %r12d, 0x8(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0xa48a4 movq 0x38(%rbx), %rcx cltq movslq (%rcx,%rax,4), %rax movl %eax, 0xc(%rsp) cmpl %eax, %r12d jne 0xa476a movq %rbx, %rdi movq %r15, %rsi callq 0xa48a4 jmp 0xa474a 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 0xa48e8 movq 0x598836(%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 0x3b5c44(%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 0xa486c movl (%r14), %edx leaq 0x78(%rbx), %r12 vmovsd 0x3b41a0(%rip), %xmm0 # 0x458978 movq %r12, %rdi movq %r15, %rsi callq 0x362ac movq %r15, %rdi callq 0x36ac3 vmovsd 0x3b4185(%rip), %xmm1 # 0x458978 movslq 0x8(%rsp), %rax imulq $0x38, %rax, %rcx addq 0x50(%rbx), %rcx vucomisd %xmm0, %xmm1 jbe 0xa4861 movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx movq %r12, %r8 callq 0xa48e8 addq $0x50, %rbx leaq 0x3b5ba9(%rip), %rcx # 0x45a3cb pushq $0x27 popq %rdx movq 0x59879c(%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 0xa486c 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 0xa488e jmp 0xa488e jmp 0xa488e jmp 0xa488e jmp 0xa488e 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::default_cost_type<long double>, baryonyx::itm::minimize_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 0xa495b 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 0xa4911 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_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>> const, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xa498c 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 0xa4a51 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 0xa4a05 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 0xa49dd movq 0x30(%rsp), %r12 movq 0x58(%r15), %rcx imulq $0xc, %r12, %rdx movl (%rcx,%rdx), %eax subl %ebx, %eax jle 0xa4a26 shlq $0x20, %rax orq %r12, %rax movq %rax, (%rsp) jmp 0xa4a37 subl 0x4(%rcx,%rdx), %ebx jle 0xa4a44 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 0xa49b2 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::minimize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xa4a8a movq %rax, 0x8(%rbx) leaq 0x4(%rsp), %r12 xorl %esi, %esi movl %esi, 0x4(%rsp) cmpl 0x80(%r15), %esi je 0xa4ac0 movq %r15, %rdi movq %r14, %rdx callq 0xa4ad7 testb %al, %al jne 0xa4ab8 movq %rbx, %rdi movq %r12, %rsi callq 0x31460 movl 0x4(%rsp), %esi incl %esi jmp 0xa4a91 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::minimize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xa4b34 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 0xa4b0c movslq 0x4(%rsp), %rcx movq 0x58(%rbx), %rax imulq $0xc, %rcx, %rcx cmpl %r15d, (%rax,%rcx) jle 0xa4b4b xorl %eax, %eax jmp 0xa4b53 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::minimize_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 0xa4f8b movslq -0x4(%rax), %r13 cmpl 0x80(%r12), %r13d jge 0xa4f9f 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 0xa5e7c movq 0x38(%rsp), %rbx xorl %ebp, %ebp cmpq 0x30(%rsp), %rbx je 0xa4cc0 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 0xa4c7c 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 0xa4c53 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 0xa4c24 movq 0x50(%r12), %rdi movq (%r12), %rdx movl %ebp, %esi shlq $0x5, %rsi addq %rdi, %rsi callq 0xa5ea1 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 0xa4dc3 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 0x3b4d57(%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 0xa4db1 addq $0x20, %r14 leaq 0x1(%rbx), %rcx cmpq 0xa0(%rsp), %rbx movq %rcx, %rbx jl 0xa4d20 movq 0x58(%r12), %rax sarq $0x20, %r15 cmpl %ebp, (%rax,%rdx) jle 0xa4dc9 xorl %eax, %eax jmp 0xa4dd0 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 0xa4ee2 testb $0x1, %al je 0xa4ee2 movq 0x50(%r12), %rax movq 0x58(%r12), %rcx addl 0x34(%rax,%r14), %ebp cmpl %ebp, (%rcx,%rdx) jle 0xa4e22 movslq 0x30(%rax,%r14), %r13 shlq $0x3, %r13 addq 0x38(%rsp), %r13 jmp 0xa4e90 movslq 0x30(%rax,%r14), %r13 addq %rdx, %rcx shlq $0x3, %r13 addq 0x38(%rsp), %r13 cmpl 0x4(%rcx), %ebp jg 0xa4e90 fldt 0x20(%rax,%r14) movq (%r12), %rdi fstpt (%rsp) callq 0xa5ed4 testb %al, %al je 0xa4e90 movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x369c8 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3b4c60(%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 0xa4ed1 movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x36a06 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3b4c1d(%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 0xa4de8 movq 0x60(%rsp), %r13 cmpq 0x20(%rsp), %rbx jae 0xa4f53 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 0x3b4ba4(%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 0xa4ee7 movq 0x18(%rsp), %rdx movq %r12, %rdi movl %r13d, %esi callq 0xa4ad7 testb %al, %al je 0xa4fc0 movq 0x88(%rsp), %rcx movq 0x80(%rsp), %r14 leaq 0x70(%rsp), %r15 movq (%rcx), %rax addq $-0x4, %rax movq %rax, (%rcx) jmp 0xa4bce xorl %eax, %eax addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3b3238(%rip), %rdi # 0x4581de leaq 0x3b54cd(%rip), %rsi # 0x45a47a leaq 0x3b5293(%rip), %rdx # 0x45a247 leaq 0x3b54c5(%rip), %rcx # 0x45a480 callq 0x2813f leaq 0x3b3217(%rip), %rdi # 0x4581de leaq 0x3b54b6(%rip), %rsi # 0x45a484 leaq 0x3b5272(%rip), %rdx # 0x45a247 leaq 0x3b54c9(%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::minimize_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 0xa53fe movslq (%rdx), %r13 cmpl 0x80(%r12), %r13d jge 0xa5412 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 0xa5e7c movq 0x38(%rsp), %rbx xorl %ebp, %ebp cmpq 0x30(%rsp), %rbx je 0xa5139 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 0xa50f5 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 0xa50cc 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 0xa509d movq 0x50(%r12), %rdi movq (%r12), %rdx movl %ebp, %esi shlq $0x5, %rsi addq %rdi, %rsi callq 0xa5ea1 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 0xa523c 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 0x3b48de(%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 0xa522a addq $0x20, %r14 leaq 0x1(%rbx), %rcx cmpq 0xa0(%rsp), %rbx movq %rcx, %rbx jl 0xa5199 movq 0x58(%r12), %rax sarq $0x20, %r15 cmpl %ebp, (%rax,%rdx) jle 0xa5242 xorl %eax, %eax jmp 0xa5249 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 0xa535b testb $0x1, %al je 0xa535b movq 0x50(%r12), %rax movq 0x58(%r12), %rcx addl 0x34(%rax,%r14), %ebp cmpl %ebp, (%rcx,%rdx) jle 0xa529b movslq 0x30(%rax,%r14), %r13 shlq $0x3, %r13 addq 0x38(%rsp), %r13 jmp 0xa5309 movslq 0x30(%rax,%r14), %r13 addq %rdx, %rcx shlq $0x3, %r13 addq 0x38(%rsp), %r13 cmpl 0x4(%rcx), %ebp jg 0xa5309 fldt 0x20(%rax,%r14) movq (%r12), %rdi fstpt (%rsp) callq 0xa5ed4 testb %al, %al je 0xa5309 movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x369c8 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3b47e7(%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 0xa534a movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x36a06 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3b47a4(%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 0xa5261 movq 0x60(%rsp), %r13 cmpq 0x20(%rsp), %rbx jae 0xa53cc 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 0x3b472b(%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 0xa5360 movq 0x18(%rsp), %rdx movq %r12, %rdi movl %r13d, %esi callq 0xa4ad7 testb %al, %al je 0xa5433 movq 0x90(%rsp), %rdx movq 0x80(%rsp), %r14 leaq 0x70(%rsp), %r15 addq $0x4, %rdx jmp 0xa5043 xorl %eax, %eax addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3b2dc5(%rip), %rdi # 0x4581de leaq 0x3b505a(%rip), %rsi # 0x45a47a leaq 0x3b4e20(%rip), %rdx # 0x45a247 leaq 0x3b5052(%rip), %rcx # 0x45a480 callq 0x2813f leaq 0x3b2da4(%rip), %rdi # 0x4581de leaq 0x3b5043(%rip), %rsi # 0x45a484 leaq 0x3b4dff(%rip), %rdx # 0x45a247 leaq 0x3b5056(%rip), %rcx # 0x45a4a5 callq 0x2813f
/quesnel[P]baryonyx/lib/src/random-solver.cpp
bool baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xa5870 movslq (%rdx), %r13 cmpl 0x80(%r12), %r13d jge 0xa5884 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 0xa5e7c movq 0x38(%rsp), %rbx xorl %ebp, %ebp cmpq 0x30(%rsp), %rbx je 0xa55ab 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 0xa5567 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 0xa553e 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 0xa550f movq 0x50(%r12), %rdi movq (%r12), %rdx movl %ebp, %esi shlq $0x5, %rsi addq %rdi, %rsi callq 0xa5ea1 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 0xa56ae 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 0x3b446c(%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 0xa569c addq $0x20, %r14 leaq 0x1(%rbx), %rcx cmpq 0xa0(%rsp), %rbx movq %rcx, %rbx jl 0xa560b movq 0x58(%r12), %rax sarq $0x20, %r15 cmpl %ebp, (%rax,%rdx) jle 0xa56b4 xorl %eax, %eax jmp 0xa56bb 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 0xa57cd testb $0x1, %al je 0xa57cd movq 0x50(%r12), %rax movq 0x58(%r12), %rcx addl 0x34(%rax,%r14), %ebp cmpl %ebp, (%rcx,%rdx) jle 0xa570d movslq 0x30(%rax,%r14), %r13 shlq $0x3, %r13 addq 0x38(%rsp), %r13 jmp 0xa577b movslq 0x30(%rax,%r14), %r13 addq %rdx, %rcx shlq $0x3, %r13 addq 0x38(%rsp), %r13 cmpl 0x4(%rcx), %ebp jg 0xa577b fldt 0x20(%rax,%r14) movq (%r12), %rdi fstpt (%rsp) callq 0xa5ed4 testb %al, %al je 0xa577b movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x369c8 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3b4375(%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 0xa57bc movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x36a06 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3b4332(%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 0xa56d3 movq 0x60(%rsp), %r13 cmpq 0x20(%rsp), %rbx jae 0xa583e 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 0x3b42b9(%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 0xa57d2 movq 0x18(%rsp), %rdx movq %r12, %rdi movl %r13d, %esi callq 0xa4ad7 testb %al, %al je 0xa58a5 movq 0x90(%rsp), %rdx movq 0x80(%rsp), %r14 leaq 0x70(%rsp), %r15 addq $0x8, %rdx jmp 0xa54b5 xorl %eax, %eax addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3b2953(%rip), %rdi # 0x4581de leaq 0x3b4be8(%rip), %rsi # 0x45a47a leaq 0x3b49ae(%rip), %rdx # 0x45a247 leaq 0x3b4be0(%rip), %rcx # 0x45a480 callq 0x2813f leaq 0x3b2932(%rip), %rdi # 0x4581de leaq 0x3b4bd1(%rip), %rsi # 0x45a484 leaq 0x3b498d(%rip), %rdx # 0x45a247 leaq 0x3b4be4(%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::minimize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xa58e8 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 0xa59ad 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 0xa5961 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 0xa5939 movq 0x30(%rsp), %r12 movq 0x58(%r15), %rcx imulq $0xc, %r12, %rdx movl (%rcx,%rdx), %eax subl %ebx, %eax jle 0xa5982 shlq $0x20, %rax orq %r12, %rax movq %rax, (%rsp) jmp 0xa5993 subl 0x4(%rcx,%rdx), %ebx jle 0xa59a0 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 0xa590e 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::minimize_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 0xa5de4 movslq (%rdx), %r13 cmpl 0x80(%r12), %r13d jge 0xa5df8 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 0xa5e7c movq 0x38(%rsp), %rbx xorl %ebp, %ebp cmpq 0x30(%rsp), %rbx je 0xa5b1f 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 0xa5adb 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 0xa5ab2 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 0xa5a83 movq 0x50(%r12), %rdi movq (%r12), %rdx movl %ebp, %esi shlq $0x5, %rsi addq %rdi, %rsi callq 0xa5ea1 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 0xa5c22 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 0x3b3ef8(%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 0xa5c10 addq $0x20, %r14 leaq 0x1(%rbx), %rcx cmpq 0xa0(%rsp), %rbx movq %rcx, %rbx jl 0xa5b7f movq 0x58(%r12), %rax sarq $0x20, %r15 cmpl %ebp, (%rax,%rdx) jle 0xa5c28 xorl %eax, %eax jmp 0xa5c2f 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 0xa5d41 testb $0x1, %al je 0xa5d41 movq 0x50(%r12), %rax movq 0x58(%r12), %rcx addl 0x34(%rax,%r14), %ebp cmpl %ebp, (%rcx,%rdx) jle 0xa5c81 movslq 0x30(%rax,%r14), %r13 shlq $0x3, %r13 addq 0x38(%rsp), %r13 jmp 0xa5cef movslq 0x30(%rax,%r14), %r13 addq %rdx, %rcx shlq $0x3, %r13 addq 0x38(%rsp), %r13 cmpl 0x4(%rcx), %ebp jg 0xa5cef fldt 0x20(%rax,%r14) movq (%r12), %rdi fstpt (%rsp) callq 0xa5ed4 testb %al, %al je 0xa5cef movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x369c8 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3b3e01(%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 0xa5d30 movl 0x4(%r13), %esi movq 0x18(%rsp), %rdi callq 0x36a06 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3b3dbe(%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 0xa5c47 movq 0x60(%rsp), %r13 cmpq 0x20(%rsp), %rbx jae 0xa5db2 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 0x3b3d45(%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 0xa5d46 movq 0x18(%rsp), %rdx movq %r12, %rdi movl %r13d, %esi callq 0xa4ad7 testb %al, %al je 0xa5e19 movq 0x90(%rsp), %rdx movq 0x80(%rsp), %r14 leaq 0x70(%rsp), %r15 addq $0x4, %rdx jmp 0xa5a29 xorl %eax, %eax addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3b23df(%rip), %rdi # 0x4581de leaq 0x3b4674(%rip), %rsi # 0x45a47a leaq 0x3b443a(%rip), %rdx # 0x45a247 leaq 0x3b466c(%rip), %rcx # 0x45a480 callq 0x2813f leaq 0x3b23be(%rip), %rdi # 0x4581de leaq 0x3b465d(%rip), %rsi # 0x45a484 leaq 0x3b4419(%rip), %rdx # 0x45a247 leaq 0x3b4670(%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::minimize_tag, baryonyx::itm::default_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xa5e6f movq %r14, %rdi movl %r15d, %esi movq %rbx, %rdx callq 0xa4ad7 xorb $0x1, %al incl %r15d movzbl %al, %eax addl %eax, %ebp jmp 0xa5e4c 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::minimize_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 0xa5e9e movslq (%rsi), %rcx addq $0x8, %rsi shlq $0x4, %rcx fldt (%rax,%rcx) fmul %st(1), %st fstpt (%rax,%rcx) jmp 0xa5e84 fstp %st(0) retq
/quesnel[P]baryonyx/lib/src/random-solver.cpp
bool baryonyx::itm::stop_iterating<baryonyx::itm::minimize_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) fucompi %st(1), %st fstp %st(0) jne 0xa5ef6 jp 0xa5ef6 callq 0x36ac3 vmovsd 0x3b2a86(%rip), %xmm1 # 0x458978 vucomisd %xmm0, %xmm1 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::minimize_tag, baryonyx::itm::default_cost_type<long double>>::rc_data*>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>>::rc_data*, baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xa5f3e fldt (%rdi) fldt (%r15) addq $0x20, %r15 fxch %st(1) fucompi %st(1), %st fstp %st(0) jne 0xa5f2a jnp 0xa5f12 addq $-0x20, %r15 movq %r15, %rsi movq %rbx, %rdx callq 0xa64bf movq %r15, %rdi jmp 0xa5f0e movq %r15, %rsi movq %rbx, %rdx callq 0xa64bf popq %rbx popq %r14 popq %r15 retq jmp 0xa5f51 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::minimize_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 0xa7a26 cmpl $0x0, 0x30(%rcx,%rdx) jne 0xa7a20 vmovsd 0x10(%rcx,%rdx), %xmm0 vucomisd %xmm1, %xmm0 jne 0xa7a20 jp 0xa7a20 cmpq %rbx, 0x20(%rcx,%rdx) je 0xa7a26 addq $0x38, %rdx jmp 0xa79ff 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::minimize_tag>::insert(baryonyx::itm::local_context&, baryonyx::bit_array const&, unsigned long, double, double, long)
void insert(local_context& ctx, const bit_array& x, const std::size_t hash, const double value, const double duration, const long int loop) noexcept { to_log(stdout, 5u, "- insert solution {} (hash: {}) {}s in {} loops\n", value, 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, value, duration, hash, loop, 0); sort(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x28, %rsp movq 0x59556e(%rip), %r12 # 0x63cfc8 movq %rdi, %rbx leaq 0x20(%rsp), %r9 leaq 0x18(%rsp), %rax leaq 0x10(%rsp), %r10 leaq 0x8(%rsp), %r11 movq %rdx, %r14 movq %rsi, %r15 movq %rcx, (%r9) vmovsd %xmm0, (%rax) vmovsd %xmm1, (%r10) movq %r8, (%r11) movq (%r12), %rdi leaq 0x3b2a39(%rip), %rcx # 0x45a4ca pushq $0x5 popq %rsi pushq $0x30 popq %rdx movq %rax, %r8 pushq %r11 pushq %r10 callq 0x3fb9e popq %rax popq %rcx leaq 0x68(%r15), %rdi movq %r15, %rsi callq 0x3fce2 movq 0x38(%rbx), %rcx cltq leaq 0x4(%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 0x3b2a20(%rip), %rcx # 0x45a4fb pushq $0x5 popq %rsi pushq $0x11 popq %rdx callq 0x3c388 vmovsd 0x18(%rsp), %xmm0 vmovsd 0x10(%rsp), %xmm1 movl 0x4(%rsp), %esi movq 0x20(%rsp), %rcx movq 0x8(%rsp), %r8 movq %rbx, %rdi movq %r14, %rdx xorl %r9d, %r9d callq 0xa7b2a movq %rbx, %rdi callq 0xa2074 addq $0x28, %rsp popq %rbx popq %r12 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::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::default_cost_type<long 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 0xa7c10 cmpl %ebx, 0x30(%rcx,%rdx) jne 0xa7c0a cmpq %r14, 0x20(%rcx,%rdx) je 0xa7c10 addq $0x38, %rdx jmp 0xa7bf8 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::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 0x595381(%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 0x3b288f(%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 0x3b2830(%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 0xa7b2a movq %rbx, %rdi callq 0xa2074 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::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::default_cost_type<long 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 0x3b136b(%rip), %rsi # 0x45a53d movq %rdi, %r14 subq 0x38(%rdi), %rax movq %rbx, %rdi sarq $0x2, %rax movq %rax, (%rdx) callq 0x41545 leaq 0x3b135f(%rip), %r15 # 0x45a54e xorl %r12d, %r12d xorl %r13d, %r13d movl 0x98(%r14), %eax cmpq %rax, %r13 je 0xa9237 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 0xa91f5 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::minimize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::minimize_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 0xa9a90 movq 0x10(%r14), %rdi leaq 0xb0(%rsp), %rsi movl %ebx, %edx fstpt (%rsp) callq 0x8d304 fstpt 0x94(%rsp) jmp 0xa9aa9 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 0xa3ada 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 0xa9b8b cmpl $0x1, %eax je 0xa9b65 cmpl $0x2, %eax jne 0xa9b9c movq 0x18(%r14), %rdx leaq 0x1d0(%rsp), %rdi leaq 0x68(%rsp), %rsi jmp 0xa9b76 movq 0x18(%r14), %rdx leaq 0x68(%rsp), %rdi leaq 0x1d0(%rsp), %rsi vmovsd 0x3aa4ba(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0xa1dbd jmp 0xa9b9c leaq 0x68(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0xa1d47 leaq 0x68(%rsp), %r15 movq %r13, 0x78(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0xa9bd2 movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd 0x40(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xa9bce movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0xa9bab 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 0x3b096d(%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 0xa3e02 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 0xa9d7b 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 0xa3e44 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 0xa9e2f cmpl %ebp, %ebx jge 0xa9cf3 movq %r14, %rdi movq %r13, %rsi movl %ebx, %edx movq %r15, %rcx callq 0xaa8e8 movl %ebx, %ebp cmpq 0x88(%rsp), %r15 jle 0xa9d44 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 0xa9d48 fldt 0x40(%rsp) fldt 0xdc(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) fldz ja 0xa9d7b fstp %st(0) movq %r14, %rdi fstpt 0x40(%rsp) callq 0xaa920 fldt 0x40(%rsp) fldt 0x4c(%rsp) testb %al, %al jne 0xa9d7b incq %r15 jmp 0xa9c6c 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 0xa9da9 movq 0x58(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0xa9dda 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 0x4f485 leaq 0x1d0(%rsp), %rdi callq 0x435d0 leaq 0x110(%rsp), %rdi callq 0x393ac leaq 0x148(%rsp), %rdi callq 0xa440a 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 0xaa89a 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 0xa9d92 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 0xa417e testl %eax, %eax jne 0xa9eff 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 0xaa89a movq %r14, %rdi callq 0xaa920 fldt 0x4c(%rsp) fldt 0x40(%rsp) testb %al, %al jne 0xa9d92 movl %ebx, 0x88(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0xaa045 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 0xa3e44 testl %eax, %eax je 0xa9ff8 vcvtsi2sd %r13d, %xmm1, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0xa9fc6 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 0xa9fca fldt 0x40(%rsp) fldt 0xdc(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) ja 0xaa035 movq %r14, %rdi fstpt 0x40(%rsp) callq 0xaa920 testb %al, %al jne 0xaa03d fldt 0x4c(%rsp) fldt 0x40(%rsp) incl %ebx jmp 0xa9f23 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 0xaa89a fldt 0x4c(%rsp) fldt 0x40(%rsp) jmp 0xaa045 fldt 0x4c(%rsp) fxch %st(1) jmp 0xaa045 fldt 0x4c(%rsp) fldt 0x40(%rsp) movl 0x88(%rsp), %ebx decl 0x64(%rsp) incl %ebx jmp 0xa9e77 jmp 0xaa092 jmp 0xaa06b fstp %st(1) fstp %st(0) jmp 0xaa092 movq %rax, %rbx jmp 0xaa0a2 movq %rax, %rbx jmp 0xaa0af movq %rax, %rbx jmp 0xaa0bc movq %rax, %rbx jmp 0xaa0c9 movq %rax, %rbx jmp 0xaa0d3 jmp 0xaa092 jmp 0xaa092 jmp 0xaa092 leaq 0x1d8(%rsp), %rdi movq %rax, %rbx callq 0x357fe jmp 0xaa0a2 leaq 0x1d0(%rsp), %rdi movq %rax, %rbx callq 0x435d0 leaq 0x110(%rsp), %rdi callq 0x393ac leaq 0x148(%rsp), %rdi callq 0xa440a 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::minimize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long 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 0xaa800 pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xaa87a 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<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long 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 0xaa8e6 pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xaa960 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<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::minimize_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 0x3af137(%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<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>>, long double, baryonyx::itm::minimize_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 0x3af051(%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::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, long double, baryonyx::itm::minimize_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 0xaaacb 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 0xaac2a movq 0xa8(%r13), %rax cmpq 0xb0(%r13), %rax je 0xaac2a 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 0xab3e6 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 0xaac85 movl %eax, %ecx shlq $0x3, %rcx addq 0x30(%rsp), %rcx movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0xab44c movl 0x8(%rsp), %eax incl %eax jmp 0xaac01 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 0xab020 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 0xaad49 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 0xab498 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 0xaaca5 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 0xaadde movq 0x60(%rsp), %rax xorl %ecx, %ecx xorl %r14d, %r14d cmpq %rcx, %r15 je 0xaad9f addq 0xb0(%rax,%rcx), %r14 addq $0xc0, %rcx jmp 0xaad89 leaq 0xe0(%rsp), %rdi leaq 0x18(%rsp), %rsi leaq 0x28(%rsp), %rdx leaq 0x20(%rsp), %rcx movq %rbp, %r8 callq 0xb2d48 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 0x3aec7f(%rip), %xmm1, %xmm1 # 0x459a80 jae 0xaad64 vucomisd %xmm0, %xmm1 jbe 0xaad64 movb $0x1, %al xchgb %al, 0x3(%rsp) movq 0xa0(%rsp), %rbx movq 0xa8(%rsp), %r14 movq 0x10(%rsp), %r12 cmpq %r14, %rbx je 0xaae3f movq %rbx, %rdi callq 0xb1a0 addq $0x8, %rbx jmp 0xaae2c 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 0xaaf9a cmpl $0x1, %eax je 0xaaf62 cmpl $0x2, %eax jne 0xaafb9 leaq 0x68(%r12), %rbx pushq $0x5 popq %rsi movq %rbx, %rdi callq 0x35292 xorl %r14d, %r14d xorl %r15d, %r15d cmpq $0x5, %r15 je 0xaafb9 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 0x4f485 incq %r15 addq $0x20, %r14 jmp 0xaaf28 leaq 0x68(%r12), %r14 pushq $0x2 popq %rsi movq %r14, %rdi callq 0x35292 movl 0x4(%rsp), %edx movq (%r14), %rsi movq %rbx, %rdi callq 0x4f485 leaq 0xe0(%rsp), %rdi callq 0xb2dc6 movq (%r14), %rsi movq %rax, %rbx addq $0x20, %rsi jmp 0xaafad leaq 0x68(%r12), %r14 pushq $0x1 popq %rsi movq %r14, %rdi callq 0x35292 movq (%r14), %rsi movl 0x4(%rsp), %edx movq %rbx, %rdi callq 0x4f485 leaq 0xd8(%rsp), %rdi movq %r13, %rsi callq 0xab54a cmpq $0x0, 0x168(%r13) je 0xaafe5 addq $0x158, %r13 # imm = 0x158 movq %r13, %rdi movq %r12, %rsi callq 0x357ea leaq 0x30(%rsp), %rdi callq 0x357fe leaq 0xd8(%rsp), %rdi callq 0xab55e leaq 0xa0(%rsp), %rdi callq 0x35836 leaq 0x60(%rsp), %rdi callq 0xb2ea6 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 0xab081 movq %rax, %rbx jmp 0xab08e movq %rax, %rbx jmp 0xab09b jmp 0xab065 jmp 0xab056 jmp 0xab074 jmp 0xab074 movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0xab0bc movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0xab0b2 jmp 0xab074 jmp 0xab074 jmp 0xab074 jmp 0xab074 jmp 0xab074 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x357fe leaq 0xd8(%rsp), %rdi callq 0xab55e leaq 0xa0(%rsp), %rdi callq 0x35836 leaq 0x60(%rsp), %rdi callq 0xb2ea6 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::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, long double, baryonyx::itm::minimize_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 0xab100 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 0xab229 movq 0xa8(%r15), %rax cmpq 0xb0(%r15), %rax je 0xab229 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 0xab250 cmpl $0x2, %eax jne 0xab29f movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000 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 0xb360a jmp 0xab2ec 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 0xab31b movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000 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 0xb2ece jmp 0xab2ec movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000 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 0xb3d46 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 0xab387 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 0xab3a9 jmp 0xab3a9 leaq 0x68(%rsp), %rdi movq %rax, %r14 callq 0x357fe leaq 0x20(%rsp), %rdi callq 0x968b6 jmp 0xab3cc jmp 0xab3c9 movq %rax, %r14 jmp 0xab3d6 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::storage<baryonyx::itm::quadratic_cost_type<long double>, baryonyx::itm::minimize_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 0x4f90a 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 0xab65b 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 0xab631 movq 0x10(%rsp), %rdi movq 0x18(%rsp), %rsi xorl %r15d, %r15d movl %ebp, %edx xorl %ecx, %ecx callq 0xab979 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 0xab70d 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 0x3a8976(%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 0xab708 movq %r13, %rdi callq 0x36ac3 vmovapd 0x30(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xab704 movq (%r14), %rdi movl %ebx, %esi addq %r12, %rdi callq 0x3626e incl %ebx jmp 0xab6df incq %r15 jmp 0xab694 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 0xab7d3 vmovsd 0x3ae335(%rip), %xmm0 # 0x459a88 movq (%r14), %rdi movq %r13, %rsi movl %ebp, %edx addq %rbx, %rdi callq 0x362ac vmovsd 0x3ae325(%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 0x3a88a8(%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 0xab9ee addl $0x2, %r15d addq $0x70, %rbx addq $0x2, %r12 jmp 0xab740 movq 0x8(%rsp), %rax movl 0x98(%rax), %eax movq %rax, 0x20(%rsp) xorl %eax, %eax cmpq 0x20(%rsp), %rax je 0xab8ca movq 0x8(%rsp), %rbx imulq $0x38, %rax, %rbp movq %rax, 0x10(%rsp) movq 0x50(%rbx), %rdi addq %rbp, %rdi callq 0x4fc80 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 0xab8bd imulq $0x28, %rax, %r12 movq %rax, 0x30(%rsp) xorl %r15d, %r15d movq (%rcx,%r12), %r13 movq 0x8(%rcx,%r12), %rbx cmpq %rbx, %r13 je 0xab893 movq (%r14), %rdi movl 0x4(%r13), %esi addq %rbp, %rdi callq 0x3664a testl %eax, %eax je 0xab88a movl (%r13), %eax addl %eax, %r15d addq $0x8, %r13 jmp 0xab86e movq 0x28(%rsp), %rax movq (%rax), %rcx cmpl %r15d, 0x18(%rcx,%r12) jg 0xab8ac addq %rcx, %r12 cmpl 0x1c(%r12), %r15d jle 0xab8b3 movq (%r14), %rax incl 0x30(%rax,%rbp) movq 0x30(%rsp), %rax incq %rax jmp 0xab852 movq 0x10(%rsp), %rax incq %rax jmp 0xab7e5 movq 0x8(%rsp), %rdi xorl %edx, %edx movq 0x38(%rdi), %rax movq 0x40(%rdi), %rcx cmpq %rcx, %rax je 0xab8e8 movl %edx, (%rax) incl %edx addq $0x4, %rax jmp 0xab8d9 callq 0xabcae addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %rbx jmp 0xab923 movq %rax, %rbx jmp 0xab92f movq %rax, %rbx jmp 0xab937 jmp 0xab90f jmp 0xab90f 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 0x4fd7c 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::minimize_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 0xab9df testl %ebx, %ebx movq %r14, %rdi movl %r12d, %esi setne %r13b callq 0x9722e fldz fxch %st(1) fucomi %st(1), %st fxch %st(1) setnp %cl sete %al fucompi %st(1), %st fstp %st(0) ja 0xab9cf andb %cl, %al andb %al, %r13b jne 0xab9cf movq %r15, %rdi movl %r12d, %esi callq 0x36a06 jmp 0xab9da movq %r15, %rdi movl %r12d, %esi callq 0x369c8 incl %r12d jmp 0xab991 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::minimize_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 0xaba3d movq 0x8(%rax), %rsi subq (%rax), %rsi shrq $0x3, %rsi cmpl %esi, %edx cmovgl %edx, %esi addq $0x28, %rax movl %esi, %edx jmp 0xaba20 movl %edx, %esi leaq 0x8(%rsp), %rdi leaq 0x7(%rsp), %rdx callq 0xabd8a movq 0x8(%r13), %rax movq (%r13), %rbp movq 0x30(%rsp), %r13 movq %r12, 0x38(%rsp) movq %rax, 0x50(%rsp) cmpq 0x50(%rsp), %rbp je 0xabc8b movq %r12, %rdi callq 0x36ac3 vmovsd 0x48(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xabc82 movq 0x8(%rbp), %rsi subq (%rbp), %rsi sarq $0x3, %rsi leaq 0x8(%rsp), %rdi callq 0xabdde 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 0xabaee 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 0xababe movq 0x8(%rsp), %rdi movq 0x10(%rsp), %rsi movq %r12, %rdx callq 0xabe16 movq 0x8(%rsp), %rdi movq 0x10(%rsp), %rsi callq 0xac279 movq 0x20(%rsp), %rax cmpq $0x0, 0x8(%rax) je 0xabbb4 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 0xabb5f cmpl %esi, 0x18(%rbp) jg 0xabb4f cmpl 0x1c(%rbp), %esi jle 0xabb62 incq %rcx addq $0xc, %rdi cmpq %rdx, %rcx jge 0xabb40 addl (%rdi), %esi jmp 0xabb39 pushq $-0x2 popq %rcx movslq %ecx, %r15 movq %r14, %r13 pushq $0x8 popq %rbx xorl %r12d, %r12d cmpq %r15, %r12 jg 0xabb91 movq 0x8(%rsp), %rax movq 0x20(%rsp), %rdi movl (%rax,%rbx), %esi callq 0x369c8 incq %r12 addq $0xc, %rbx decq %r13 jmp 0xabb6e movq 0x38(%rsp), %r12 subq $0x1, %r13 jb 0xabbb4 movq 0x8(%rsp), %rax movq 0x20(%rsp), %rdi movl (%rax,%rbx), %esi callq 0x36a06 addq $0xc, %rbx jmp 0xabb96 movq 0x28(%rsp), %rax movq 0x30(%rsp), %r13 cmpq $0x0, 0x8(%rax) je 0xabc82 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 0xabc33 cmpl 0x1c(%rbp), %edx movl %esi, %edi cmovgl %r9d, %edi cmpl %edx, 0x18(%rbp) cmovgl %r9d, %edi incq %rsi cmpl $-0x2, %edi je 0xabc21 cmpq %rcx, %rsi jge 0xabc21 vmovss (%r8), %xmm0 vucomiss 0x3ade99(%rip), %xmm0 # 0x459ab8 ja 0xabc30 addq $0xc, %r8 cmpq %rcx, %rsi jge 0xabbed addl -0x8(%r8), %edx jmp 0xabbe6 movl %edi, %r9d movslq %r9d, %r15 pushq $0x8 popq %rbx xorl %r12d, %r12d cmpq %r15, %r12 jg 0xabc5f movq 0x8(%rsp), %rax movq 0x28(%rsp), %rdi movl (%rax,%rbx), %esi callq 0x369c8 incq %r12 addq $0xc, %rbx decq %r14 jmp 0xabc3c movq 0x38(%rsp), %r12 subq $0x1, %r14 jb 0xabc82 movq 0x8(%rsp), %rax movq 0x28(%rsp), %rdi movl (%rax,%rbx), %esi callq 0x36a06 addq $0xc, %rbx jmp 0xabc64 addq $0x28, %rbp jmp 0xaba65 leaq 0x8(%rsp), %rdi callq 0xac022 addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0xabca6 movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<long double>, baryonyx::itm::minimize_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 0xac7f7 movq 0x5912e5(%rip), %r13 # 0x63cfc8 movq (%r13), %rdi leaq 0x3ae3aa(%rip), %rcx # 0x45a098 pushq $0x3 popq %rsi pushq $0x1d popq %rdx callq 0x377fc leaq 0x3ae3b6(%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 0xabd67 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 0xabd0e leaq 0x8(%rsp), %rdi callq 0x378b4 addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0xabd82 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::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, long double, baryonyx::itm::minimize_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::minimize_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 0xad22f movq 0xb0(%rsp), %rax movq (%rax), %rdi leaq 0x118(%rsp), %rsi movl %ebx, %edx fstpt (%rsp) callq 0x98cca fstpt 0x94(%rsp) jmp 0xad248 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 0xad714 movl 0xcc(%r13), %esi leaq 0x138(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq $0x0, 0x50(%rsp) movb (%r15), %al testb $0x1, %al jne 0xad67c 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 0xad93c vmovsd %xmm0, 0xf0(%rsp) fldl 0xf0(%rsp) fstpt 0xb8(%rsp) leaq 0x138(%rsp), %rdi leaq 0x170(%rsp), %rsi movq %rbx, %rdx callq 0xada3c fldt 0xb8(%rsp) fldt 0x44(%rsp) movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF xorl %r14d, %r14d movb (%r15), %al testb $0x1, %al jne 0xad411 cmpq 0xb0(%r13), %r14 je 0xad411 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 0xada7e testl %eax, %eax je 0xad42b cmpl %eax, %ebx cmovgel %eax, %ebx cmpq 0xe8(%rsp), %r14 jle 0xad3f0 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 0xad3fa fldt 0x44(%rsp) fldt 0x74(%rsp) fxch %st(1) fldt 0xdc(%rsp) fxch %st(2) fucomi %st(2), %st fstp %st(2) ja 0xad411 incq %r14 jmp 0xad341 fstp %st(1) testl %ebx, %ebx jg 0xad65a movq $0x0, 0x50(%rsp) leaq 0x58(%rsp), %rbx jmp 0xad467 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 0xadcae movb $0x1, %al movq %rax, 0x50(%rsp) fldt 0x44(%rsp) xorl %r14d, %r14d movl $0x0, 0x70(%rsp) movb (%r15), %al testb $0x1, %al jne 0xad653 cmpl 0xbc(%r13), %r14d jge 0xad653 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 0xaddb8 testl %eax, %eax jne 0xad50d 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 0xadcae 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 0xad5f1 leal -0x1(%rbx), %r12d cmpl 0xc0(%r13), %r12d jge 0xad5f1 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 0xada7e testl %eax, %eax je 0xad5fa vcvtsi2sd %r12d, %xmm2, %xmm0 vucomisd 0xa0(%r13), %xmm0 jbe 0xad5d1 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 0xad5db fldt 0x44(%rsp) fldt 0x74(%rsp) fxch %st(1) fldt 0xdc(%rsp) fxch %st(2) fucomi %st(2), %st fstp %st(2) ja 0xad5f1 incl %ebx jmp 0xad51d fstp %st(1) leaq 0x58(%rsp), %rbx jmp 0xad647 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 0xadcae movb $0x1, %al movq %rax, 0x50(%rsp) fldt 0x44(%rsp) decl 0x70(%rsp) incl %r14d jmp 0xad472 fstp %st(0) jmp 0xad2bc fstp %st(0) movq 0xb0(%r13), %r8 movq 0x68(%rsp), %rdi leaq 0x58(%rsp), %rdx movq %rbp, %rsi movl %ebx, %ecx callq 0xadd36 jmp 0xad2b3 leaq 0x138(%rsp), %rdi callq 0x393ac leaq 0x170(%rsp), %rdi callq 0xae044 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 0xad6c6 movq %rax, %rbx jmp 0xad6e8 movq %rax, %rbx jmp 0xad6f5 movq %rax, %rbx jmp 0xad702 jmp 0xad6d8 jmp 0xad6d8 jmp 0xad6d8 jmp 0xad6d8 leaq 0x138(%rsp), %rdi movq %rax, %rbx callq 0x393ac leaq 0x170(%rsp), %rdi callq 0xae044 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::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xae082 movslq %r14d, %rbp leaq 0x58(%r15), %rdi movq %rbp, %rsi movq %rdi, 0x8(%rsp) callq 0xae0c2 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 0xad8be 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 0xad851 movl (%r11), %r12d leal 0x1(%r12), %ebp testl $0xfffffffd, %ebp # imm = 0xFFFFFFFD jne 0xad8cd 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 0xad814 movl 0x18(%r9), %r11d cmpl 0x1c(%r9), %r11d jne 0xad868 imulq $0xc, %rsi, %r8 movl %r11d, (%rdx,%r8) movl %r11d, %r8d jmp 0xad888 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 0xad7ee leaq 0x3aab86(%rip), %rdi # 0x45842a leaq 0x3ac9fe(%rip), %rsi # 0x45a2a9 leaq 0x3ac995(%rip), %rdx # 0x45a247 leaq 0x3aca05(%rip), %rcx # 0x45a2be callq 0x2813f addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3aab56(%rip), %rdi # 0x45842a leaq 0x3ac952(%rip), %rsi # 0x45a22d leaq 0x3ac965(%rip), %rdx # 0x45a247 leaq 0x3ac9bd(%rip), %rcx # 0x45a2a6 callq 0x2813f movq %r13, %rdi movq %rax, %r14 callq 0x8affa jmp 0xad8fe movq %rax, %r14 movq 0x8(%rsp), %rdi callq 0xae100 jmp 0xad90d movq %rax, %r14 movq 0x10(%rsp), %rdi callq 0xae11a jmp 0xad91c movq %rax, %r14 movq %rbx, %rdi callq 0x28fb6 jmp 0xad929 movq %rax, %r14 movq 0x18(%rsp), %rdi callq 0x3a954 movq %r14, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/random-solver.cpp
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xada52 movq %rax, %rdi jmp 0xae5a4 cmpl $0x7, %ecx jne 0xada6f movq (%rax), %rcx movq 0x8(%rax), %rax xorl %edx, %edx cmpq %rax, %rcx je 0xada7d movl %edx, (%rcx) incl %edx addq $0x4, %rcx jmp 0xada60 movq %rsi, %rdi movq %rdx, %rsi movq %rax, %rdx jmp 0xae6a6 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::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, baryonyx::bit_array, long double>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xadb9f leaq 0x3ac316(%rip), %rdx # 0x459dd0 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 0xae79c movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0xae6a6 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 0xb0b84 jmp 0xadc13 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) fstpt 0x3c(%rsp) callq 0xb02ae jmp 0xadb5e movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) fstpt 0x3c(%rsp) callq 0xb0719 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 0xaf0b8 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0xaf540 movq (%r14), %rdx movq 0x8(%r14), %rcx fxch %st(2) fstpt 0x20(%rsp) fstpt 0x10(%rsp) jmp 0xadbe8 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 0xaec30 jmp 0xadc3c movq (%r14), %rdi movq 0x8(%r14), %rsi fstpt 0x54(%rsp) fstpt 0x48(%rsp) movq %r15, %rdx fstpt 0x3c(%rsp) callq 0xb10d8 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 0xaf642 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0xae6a6 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 0xaec30 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x70, %rsp popq %rbx popq %r14 popq %r15 jmp 0xafaca
/quesnel[P]baryonyx/lib/src/itm-common.hpp
baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<long double>, long double, baryonyx::itm::minimize_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 0xb1628 testb %al, %al je 0xadd27 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 0x3abd64(%rip), %xmm0, %xmm1 # 0x459a80 vmovsd 0x10(%rsp), %xmm0 callq 0xb16a8 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::minimize_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 0xae192 jp 0xae192 vmovsd 0x50(%r14), %xmm0 vucomisd %xmm1, %xmm0 jne 0xae192 jp 0xae192 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 0xae19a vucomisd 0x3a5e81(%rip), %xmm0 # 0x454038 jae 0xae19a vmovsd %xmm0, 0x18(%rsp) movq %r15, %rdi movq %r14, %rsi callq 0x3c480 vxorpd %xmm1, %xmm1, %xmm1 vucomisd %xmm0, %xmm1 ja 0xae1bf vucomisd 0x3a5e5c(%rip), %xmm0 # 0x454038 ja 0xae1bf movq 0x58ede3(%rip), %rax # 0x63cfc8 leaq 0x20(%rsp), %r15 leaq 0x3ac22b(%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 0xae183 movq %r14, %rdi callq 0x36ac3 vmovsd 0x10(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xae29e movq 0x58ed6a(%rip), %rax # 0x63cfc8 leaq 0x3ac1e2(%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 0xae23a
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<long double>, baryonyx::itm::minimize_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 0xae35f movq %rbx, %rdi movq %r15, %rsi callq 0xae4de movq 0x38(%rbx), %rcx cltq movl (%rcx,%rax,4), %eax movl %eax, 0x8(%rsp) movq %r15, %rdi callq 0x36ac3 vmovsd 0x3aa66e(%rip), %xmm1 # 0x458978 vucomisd %xmm0, %xmm1 jbe 0xae403 movq %r15, %rdi callq 0x36ac3 vmovsd 0x3aa654(%rip), %xmm1 # 0x458978 vucomisd %xmm0, %xmm1 jbe 0xae487 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 0xae522 addq $0x50, %rbx leaq 0x3ac04a(%rip), %rcx # 0x45a3a2 pushq $0x28 jmp 0xae45e movq %rbx, %rdi movq %r15, %rsi callq 0xae4de movq 0x38(%rbx), %rcx cltq movslq (%rcx,%rax,4), %r12 movl %r12d, 0x8(%rsp) movq %rbx, %rdi movq %r15, %rsi callq 0xae4de movq 0x38(%rbx), %rcx cltq movslq (%rcx,%rax,4), %rax movl %eax, 0xc(%rsp) cmpl %eax, %r12d jne 0xae3a4 movq %rbx, %rdi movq %r15, %rsi callq 0xae4de jmp 0xae384 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 0xae522 movq 0x58ebfc(%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 0x3ac00a(%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 0xae4a6 movl (%r14), %edx leaq 0x78(%rbx), %r12 vmovsd 0x3aa566(%rip), %xmm0 # 0x458978 movq %r12, %rdi movq %r15, %rsi callq 0x362ac movq %r15, %rdi callq 0x36ac3 vmovsd 0x3aa54b(%rip), %xmm1 # 0x458978 movslq 0x8(%rsp), %rax imulq $0x38, %rax, %rcx addq 0x50(%rbx), %rcx vucomisd %xmm0, %xmm1 jbe 0xae49b movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx movq %r12, %r8 callq 0xae522 addq $0x50, %rbx leaq 0x3abf6f(%rip), %rcx # 0x45a3cb pushq $0x27 popq %rdx movq 0x58eb62(%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 0xae4a6 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 0xae4c8 jmp 0xae4c8 jmp 0xae4c8 jmp 0xae4c8 jmp 0xae4c8 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::minimize_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 0xae595 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 0xae54b 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::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_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 0xae6c4 movq %rax, 0x8(%rbx) leaq 0x4(%rsp), %r12 xorl %esi, %esi movl %esi, 0x4(%rsp) cmpl 0x80(%r15), %esi je 0xae6fa movq %r15, %rdi movq %r14, %rdx callq 0xae711 testb %al, %al jne 0xae6f2 movq %rbx, %rdi movq %r12, %rsi callq 0x31460 movl 0x4(%rsp), %esi incl %esi jmp 0xae6cb 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
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_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 0xaf562 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 0xaf627 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 0xaf5db 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 0xaf5b3 movq 0x30(%rsp), %r12 movq 0x58(%r15), %rcx imulq $0xc, %r12, %rdx movl (%rcx,%rdx), %eax subl %ebx, %eax jle 0xaf5fc shlq $0x20, %rax orq %r12, %rax movq %rax, (%rsp) jmp 0xaf60d subl 0x4(%rcx,%rdx), %ebx jle 0xaf61a 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 0xaf588 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::minimize_tag, baryonyx::itm::quadratic_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, 0x80(%rsp) leaq 0x8(%rdi), %r15 movq %rsi, %r13 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 %rsi, 0x10(%rsp) movq %r15, 0x78(%rsp) cmpq 0x80(%rsp), %rdx je 0xafa74 movslq (%rdx), %rax cmpl 0x80(%r12), %eax jge 0xafa88 leaq 0x30(%rsp), %rdi movq %rdx, 0x88(%rsp) movq %r15, %rsi movl %eax, %edx movq %rax, 0x68(%rsp) callq 0x3de66 movq 0x30(%rsp), %rdx movq 0x38(%rsp), %rsi fldt 0xac(%rsp) movq %r12, %rdi fstpt (%rsp) callq 0xafb0c movq 0x38(%rsp), %rbx xorl %r14d, %r14d cmpq 0x30(%rsp), %rbx je 0xaf7b6 movl 0x4(%rbx), %edx leaq 0x98(%rsp), %rdi movq %r15, %rsi callq 0x3dede movq 0x98(%rsp), %rcx movq 0xa0(%rsp), %rdx movq 0x48(%r12), %rax movq 0x68(%r12), %rsi fldz cmpq %rcx, %rdx je 0xaf763 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, 0xa0(%rsp) jmp 0xaf737 movq 0x50(%r12), %rcx movq %r14, %rbp shlq $0x5, %r14 movl %ebp, 0x10(%rcx,%r14) movslq (%rbx), %rdx movl (%rax,%rdx,4), %eax movq %r13, %rdx movl %eax, 0x14(%rcx,%r14) movq 0x38(%rsp), %rax movq 0x70(%r12), %rdi movl 0x4(%rax), %esi fstpt 0x18(%rsp) callq 0x9c23c fldt 0x18(%rsp) fsubrp %st, %st(1) movq 0x50(%r12), %rax addq $0x8, %rbx fstpt (%rax,%r14) movq %rbp, %r14 incq %r14 jmp 0xaf6fd movq 0x50(%r12), %rdi movq (%r12), %rdx movl %r14d, %esi shlq $0x5, %rsi addq %rdi, %rsi callq 0xafb31 imulq $0xc, 0x68(%rsp), %rdx movq 0x58(%r12), %rax cmpl $0x0, (%rax,%rdx) movq %rdx, 0x70(%rsp) jle 0xaf8ba leal -0x2(%r14), %eax movabsq $-0x100000000, %r15 # imm = 0xFFFFFFFF00000000 movq %r14, 0x60(%rsp) xorl %r14d, %r14d cltq movq %rax, 0x90(%rsp) movq 0x50(%r12), %rax pushq $-0x1 popq %rbx xorl %ebp, %ebp movabsq $0x100000000, %rcx # imm = 0x100000000 movq 0x38(%rsp), %r13 movq 0x10(%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, 0x18(%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 0x3aa265(%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 0x70(%rsp), %rdx cmpl %ebp, 0x18(%rsp) jle 0xaf8a3 addq $0x20, %r14 leaq 0x1(%rbx), %rcx cmpq 0x90(%rsp), %rbx movq %rcx, %rbx jl 0xaf812 movq 0x58(%r12), %rax sarq $0x20, %r15 cmpl %ebp, (%rax,%rdx) jle 0xaf8c2 movq 0x60(%rsp), %r14 xorl %eax, %eax jmp 0xaf8ce xorl %ebp, %ebp pushq $-0x1 popq %r15 jmp 0xaf8c7 movq 0x60(%rsp), %r14 cmpl 0x4(%rax,%rdx), %ebp setle %al movslq %r14d, %rcx movq %r15, %r14 shlq $0x5, %r14 leaq 0x1(%r15), %rbx movq %rcx, 0x18(%rsp) incq %r15 cmpq 0x18(%rsp), %r15 jae 0xaf9db testb $0x1, %al je 0xaf9db movq 0x50(%r12), %rax movq 0x58(%r12), %rcx addl 0x34(%rax,%r14), %ebp cmpl %ebp, (%rcx,%rdx) jle 0xaf91b movslq 0x30(%rax,%r14), %r13 shlq $0x3, %r13 addq 0x38(%rsp), %r13 jmp 0xaf989 movslq 0x30(%rax,%r14), %r13 addq %rdx, %rcx shlq $0x3, %r13 addq 0x38(%rsp), %r13 cmpl 0x4(%rcx), %ebp jg 0xaf989 fldt 0x20(%rax,%r14) movq (%r12), %rdi fstpt (%rsp) callq 0xa5ed4 testb %al, %al je 0xaf989 movl 0x4(%r13), %esi movq 0x10(%rsp), %rdi callq 0x369c8 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3aa167(%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 0xaf9ca movl 0x4(%r13), %esi movq 0x10(%rsp), %rdi callq 0x36a06 movq 0x50(%r12), %rax movq 0x68(%r12), %rcx fldt 0x20(%rax,%r14) fmuls 0x3aa124(%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 0x70(%rsp), %rdx addq $0x20, %r14 incq %rbx jmp 0xaf8e1 movq 0x10(%rsp), %r13 cmpq 0x18(%rsp), %rbx jae 0xafa4a movq 0x50(%r12), %rax movq 0x38(%rsp), %r15 movq %r13, %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 0x3aa0ad(%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 0xaf9e0 movq 0x68(%rsp), %rsi movq %r12, %rdi movq %r13, %rdx callq 0xae711 testb %al, %al je 0xafaa9 movq 0x88(%rsp), %rdx movq 0x78(%rsp), %r15 addq $0x4, %rdx jmp 0xaf69e xorl %eax, %eax addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x3a874f(%rip), %rdi # 0x4581de leaq 0x3aa9e4(%rip), %rsi # 0x45a47a leaq 0x3aa7aa(%rip), %rdx # 0x45a247 leaq 0x3aa9dc(%rip), %rcx # 0x45a480 callq 0x2813f leaq 0x3a872e(%rip), %rdi # 0x4581de leaq 0x3aa9cd(%rip), %rsi # 0x45a484 leaq 0x3aa789(%rip), %rdx # 0x45a247 leaq 0x3aa9e0(%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::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, baryonyx::bit_array>(baryonyx::itm::solver_random_inequalities_101coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_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 0xafaff movq %r14, %rdi movl %r15d, %esi movq %rbx, %rdx callq 0xae711 xorb $0x1, %al incl %r15d movzbl %al, %eax addl %eax, %ebp jmp 0xafadc 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::minimize_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 0xafb2e movslq (%rsi), %rcx addq $0x8, %rsi shlq $0x4, %rcx fldt (%rax,%rcx) fmul %st(1), %st fstpt (%rax,%rcx) jmp 0xafb14 fstp %st(0) retq
/quesnel[P]baryonyx/lib/src/random-solver.cpp
baryonyx::itm::storage<baryonyx::itm::quadratic_cost_type<long double>, baryonyx::itm::minimize_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 0xb1686 cmpl $0x0, 0x30(%rcx,%rdx) jne 0xb1680 vmovsd 0x10(%rcx,%rdx), %xmm0 vucomisd %xmm1, %xmm0 jne 0xb1680 jp 0xb1680 cmpq %rbx, 0x20(%rcx,%rdx) je 0xb1686 addq $0x38, %rdx jmp 0xb165f 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::quadratic_cost_type<long 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<long 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 0x3a770b(%rip), %rsi # 0x45a53d movq %rdi, %r14 subq 0x38(%rdi), %rax movq %rbx, %rdi sarq $0x2, %rax movq %rax, (%rdx) callq 0x41545 leaq 0x3a76ff(%rip), %r15 # 0x45a54e xorl %r12d, %r12d xorl %r13d, %r13d movl 0x98(%r14), %eax cmpq %rax, %r13 je 0xb2e97 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 0xb2e55 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::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_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 $0x438, %rsp # imm = 0x438 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 0x100(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x98bf0 fldl 0x20(%r12) fstpt 0xc0(%rsp) vxorpd %xmm1, %xmm1, %xmm1 fldl 0x28(%r12) fstpt 0xcc(%rsp) fldl 0x30(%r12) fstpt 0xb4(%rsp) fldl 0x8(%r12) vmovsd 0x10(%r12), %xmm0 fld %st(0) fstpt 0x4c(%rsp) vucomisd %xmm0, %xmm1 jbe 0xb2fb4 movq 0x10(%r14), %rdi leaq 0x100(%rsp), %rsi movl %ebx, %edx fstpt (%rsp) callq 0x98cca fstpt 0x98(%rsp) jmp 0xb2fcd fstp %st(0) vmovsd %xmm0, 0xe0(%rsp) fldl 0xe0(%rsp) fstpt 0x98(%rsp) fldl 0x38(%r12) fstpt 0xf4(%rsp) fldl 0x40(%r12) fstpt 0xe8(%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 0x158(%rsp), %rdi leaq 0x100(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0xad714 movl 0xcc(%r12), %esi leaq 0x120(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x94(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0x1e0(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0xb30af cmpl $0x1, %eax je 0xb3089 cmpl $0x2, %eax jne 0xb30c0 movq 0x18(%r14), %rdx leaq 0x1e0(%rsp), %rdi leaq 0x68(%rsp), %rsi jmp 0xb309a movq 0x18(%r14), %rdx leaq 0x68(%rsp), %rdi leaq 0x1e0(%rsp), %rsi vmovsd 0x3a0f96(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0xab9ee jmp 0xb30c0 leaq 0x68(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0xab979 leaq 0x68(%rsp), %r15 movq %r13, 0x78(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0xb30f6 movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd 0x40(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xb30f2 movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0xb30cf leaq 0x1e8(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 movl 0x1d8(%rsp), %ecx movl 0x1dc(%rsp), %r8d movq 0xb0(%r12), %r9 vmovsd %xmm0, 0x40(%rsp) leaq 0x3a7449(%rip), %rdx # 0x45a577 leaq 0x1e0(%rsp), %rdi pushq $0x3 popq %rsi callq 0x42b5a callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0x120(%rsp), %rdi leaq 0x158(%rsp), %rsi leaq 0x68(%rsp), %rdx callq 0xada3c vmovsd 0x40(%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x68(%rsp), %r13 xorl %r15d, %r15d vmovsd %xmm0, 0xd8(%rsp) fldl 0xd8(%rsp) fldt 0x4c(%rsp) cmpq 0xb0(%r12), %r15 je 0xb329f movq 0x18(%r14), %rcx fstpt 0x20(%rsp) leaq 0x120(%rsp), %rdi leaq 0x158(%rsp), %rsi movq %r13, %rdx fldt 0x98(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x40(%rsp) fstpt (%rsp) callq 0xada7e movq 0x1c0(%rsp), %rdx movq 0x1b8(%rsp), %rcx movl %eax, %ebx leaq 0x1e0(%rsp), %rdi leaq 0x160(%rsp), %rsi callq 0x95274 testl %ebx, %ebx je 0xb3353 cmpl %ebp, %ebx jge 0xb3217 movq %r14, %rdi movq %r13, %rsi movl %ebx, %edx movq %r15, %rcx callq 0xb4462 movl %ebx, %ebp cmpq 0x88(%rsp), %r15 jle 0xb3268 movl %ebx, 0xac(%rsp) fildl 0xac(%rsp) movl 0x1d8(%rsp), %eax movl %eax, 0xb0(%rsp) fidivl 0xb0(%rsp) fldt 0xb4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xc0(%rsp) fmulp %st, %st(1) fldt 0x40(%rsp) faddp %st, %st(1) jmp 0xb326c fldt 0x40(%rsp) fldt 0xcc(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) fldz ja 0xb329f fstp %st(0) movq %r14, %rdi fstpt 0x40(%rsp) callq 0xb449a fldt 0x40(%rsp) fldt 0x4c(%rsp) testb %al, %al jne 0xb329f incq %r15 jmp 0xb3190 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 0xb32cd movq 0x58(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0xb32fe movq 0x58(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x94(%rsp), %edx movq %r14, %rdi callq 0x4f485 leaq 0x1e0(%rsp), %rdi callq 0x42cbc leaq 0x120(%rsp), %rdi callq 0x393ac leaq 0x158(%rsp), %rdi callq 0xae044 leaq 0x100(%rsp), %rdi callq 0x968b6 leaq 0x70(%rsp), %rdi callq 0x357fe movq 0x58(%rsp), %rax addq $0x438, %rsp # imm = 0x438 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 0x9706e movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0xb4414 movl $0x0, 0x64(%rsp) leaq 0x158(%rsp), %r15 leaq 0x68(%rsp), %rbp xorl %ebx, %ebx fldt 0x4c(%rsp) fldt 0x40(%rsp) cmpl 0xbc(%r12), %ebx jge 0xb32b6 movq 0x18(%r14), %rcx fldt 0xf4(%rsp) fld %st(1) fstpt 0x40(%rsp) fmulp %st, %st(1) fldt 0xe8(%rsp) fstpt 0x30(%rsp) fxch %st(1) fstpt 0x20(%rsp) leaq 0x120(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx fldt 0x98(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xaddb8 testl %eax, %eax jne 0xb3423 vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi movq %rbp, %rsi callq 0x9706e movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xb4414 movq %r14, %rdi callq 0xb449a fldt 0x4c(%rsp) fldt 0x40(%rsp) testb %al, %al jne 0xb32b6 movl %ebx, 0x88(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0xb3569 movq 0x18(%r14), %rcx fxch %st(1) fstpt 0x20(%rsp) leaq 0x120(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx fldt 0x98(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x40(%rsp) fstpt (%rsp) callq 0xada7e testl %eax, %eax je 0xb351c vcvtsi2sd %r13d, %xmm1, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0xb34ea movl %eax, 0xa4(%rsp) fildl 0xa4(%rsp) movl 0x1d8(%rsp), %eax movl %eax, 0xa8(%rsp) fidivl 0xa8(%rsp) fldt 0xb4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xc0(%rsp) fmulp %st, %st(1) fldt 0x40(%rsp) faddp %st, %st(1) jmp 0xb34ee fldt 0x40(%rsp) fldt 0xcc(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) ja 0xb3559 movq %r14, %rdi fstpt 0x40(%rsp) callq 0xb449a testb %al, %al jne 0xb3561 fldt 0x4c(%rsp) fldt 0x40(%rsp) incl %ebx jmp 0xb3447 vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi movq %rbp, %rsi callq 0x9706e movl 0xc0(%r12), %eax imull 0x64(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xb4414 fldt 0x4c(%rsp) fldt 0x40(%rsp) jmp 0xb3569 fldt 0x4c(%rsp) fxch %st(1) jmp 0xb3569 fldt 0x4c(%rsp) fldt 0x40(%rsp) movl 0x88(%rsp), %ebx decl 0x64(%rsp) incl %ebx jmp 0xb339b jmp 0xb35b6 jmp 0xb358f fstp %st(1) fstp %st(0) jmp 0xb35b6 movq %rax, %rbx jmp 0xb35c6 movq %rax, %rbx jmp 0xb35d3 movq %rax, %rbx jmp 0xb35e0 movq %rax, %rbx jmp 0xb35ed movq %rax, %rbx jmp 0xb35f7 jmp 0xb35b6 jmp 0xb35b6 jmp 0xb35b6 leaq 0x1e8(%rsp), %rdi movq %rax, %rbx callq 0x357fe jmp 0xb35c6 leaq 0x1e0(%rsp), %rdi movq %rax, %rbx callq 0x42cbc leaq 0x120(%rsp), %rdi callq 0x393ac leaq 0x158(%rsp), %rdi callq 0xae044 leaq 0x100(%rsp), %rdi callq 0x968b6 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::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_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 $0x438, %rsp # imm = 0x438 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 0x100(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x98bf0 fldl 0x20(%r12) fstpt 0xc0(%rsp) vxorpd %xmm1, %xmm1, %xmm1 fldl 0x28(%r12) fstpt 0xcc(%rsp) fldl 0x30(%r12) fstpt 0xb4(%rsp) fldl 0x8(%r12) vmovsd 0x10(%r12), %xmm0 fld %st(0) fstpt 0x4c(%rsp) vucomisd %xmm0, %xmm1 jbe 0xb36f0 movq 0x10(%r14), %rdi leaq 0x100(%rsp), %rsi movl %ebx, %edx fstpt (%rsp) callq 0x98cca fstpt 0x98(%rsp) jmp 0xb3709 fstp %st(0) vmovsd %xmm0, 0xe0(%rsp) fldl 0xe0(%rsp) fstpt 0x98(%rsp) fldl 0x38(%r12) fstpt 0xf4(%rsp) fldl 0x40(%r12) fstpt 0xe8(%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 0x158(%rsp), %rdi leaq 0x100(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0xad714 movl 0xcc(%r12), %esi leaq 0x120(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x94(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0x1e0(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0xb37eb cmpl $0x1, %eax je 0xb37c5 cmpl $0x2, %eax jne 0xb37fc movq 0x18(%r14), %rdx leaq 0x1e0(%rsp), %rdi leaq 0x68(%rsp), %rsi jmp 0xb37d6 movq 0x18(%r14), %rdx leaq 0x68(%rsp), %rdi leaq 0x1e0(%rsp), %rsi vmovsd 0x3a085a(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0xab9ee jmp 0xb37fc leaq 0x68(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0xab979 leaq 0x68(%rsp), %r15 movq %r13, 0x78(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0xb3832 movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd 0x40(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xb382e movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0xb380b leaq 0x1e8(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 movl 0x1d8(%rsp), %ecx movl 0x1dc(%rsp), %r8d movq 0xb0(%r12), %r9 vmovsd %xmm0, 0x40(%rsp) leaq 0x3a6d0d(%rip), %rdx # 0x45a577 leaq 0x1e0(%rsp), %rdi pushq $0x3 popq %rsi callq 0x4346e callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0x120(%rsp), %rdi leaq 0x158(%rsp), %rsi leaq 0x68(%rsp), %rdx callq 0xada3c vmovsd 0x40(%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x68(%rsp), %r13 xorl %r15d, %r15d vmovsd %xmm0, 0xd8(%rsp) fldl 0xd8(%rsp) fldt 0x4c(%rsp) cmpq 0xb0(%r12), %r15 je 0xb39db movq 0x18(%r14), %rcx fstpt 0x20(%rsp) leaq 0x120(%rsp), %rdi leaq 0x158(%rsp), %rsi movq %r13, %rdx fldt 0x98(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x40(%rsp) fstpt (%rsp) callq 0xada7e movq 0x1c0(%rsp), %rdx movq 0x1b8(%rsp), %rcx movl %eax, %ebx leaq 0x1e0(%rsp), %rdi leaq 0x160(%rsp), %rsi callq 0x95692 testl %ebx, %ebx je 0xb3a8f cmpl %ebp, %ebx jge 0xb3953 movq %r14, %rdi movq %r13, %rsi movl %ebx, %edx movq %r15, %rcx callq 0xb4548 movl %ebx, %ebp cmpq 0x88(%rsp), %r15 jle 0xb39a4 movl %ebx, 0xac(%rsp) fildl 0xac(%rsp) movl 0x1d8(%rsp), %eax movl %eax, 0xb0(%rsp) fidivl 0xb0(%rsp) fldt 0xb4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xc0(%rsp) fmulp %st, %st(1) fldt 0x40(%rsp) faddp %st, %st(1) jmp 0xb39a8 fldt 0x40(%rsp) fldt 0xcc(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) fldz ja 0xb39db fstp %st(0) movq %r14, %rdi fstpt 0x40(%rsp) callq 0xb4580 fldt 0x40(%rsp) fldt 0x4c(%rsp) testb %al, %al jne 0xb39db incq %r15 jmp 0xb38cc 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 0xb3a09 movq 0x58(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0xb3a3a movq 0x58(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x94(%rsp), %edx movq %r14, %rdi callq 0x4f485 leaq 0x1e0(%rsp), %rdi callq 0x435d0 leaq 0x120(%rsp), %rdi callq 0x393ac leaq 0x158(%rsp), %rdi callq 0xae044 leaq 0x100(%rsp), %rdi callq 0x968b6 leaq 0x70(%rsp), %rdi callq 0x357fe movq 0x58(%rsp), %rax addq $0x438, %rsp # imm = 0x438 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 0x9706e movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0xb44fa movl $0x0, 0x64(%rsp) leaq 0x158(%rsp), %r15 leaq 0x68(%rsp), %rbp xorl %ebx, %ebx fldt 0x4c(%rsp) fldt 0x40(%rsp) cmpl 0xbc(%r12), %ebx jge 0xb39f2 movq 0x18(%r14), %rcx fldt 0xf4(%rsp) fld %st(1) fstpt 0x40(%rsp) fmulp %st, %st(1) fldt 0xe8(%rsp) fstpt 0x30(%rsp) fxch %st(1) fstpt 0x20(%rsp) leaq 0x120(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx fldt 0x98(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xaddb8 testl %eax, %eax jne 0xb3b5f vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi movq %rbp, %rsi callq 0x9706e movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xb44fa movq %r14, %rdi callq 0xb4580 fldt 0x4c(%rsp) fldt 0x40(%rsp) testb %al, %al jne 0xb39f2 movl %ebx, 0x88(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0xb3ca5 movq 0x18(%r14), %rcx fxch %st(1) fstpt 0x20(%rsp) leaq 0x120(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx fldt 0x98(%rsp) fstpt 0x10(%rsp) fld %st(0) fstpt 0x40(%rsp) fstpt (%rsp) callq 0xada7e testl %eax, %eax je 0xb3c58 vcvtsi2sd %r13d, %xmm1, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0xb3c26 movl %eax, 0xa4(%rsp) fildl 0xa4(%rsp) movl 0x1d8(%rsp), %eax movl %eax, 0xa8(%rsp) fidivl 0xa8(%rsp) fldt 0xb4(%rsp) fstpt 0x10(%rsp) fstpt (%rsp) callq 0xb110 fldt 0xc0(%rsp) fmulp %st, %st(1) fldt 0x40(%rsp) faddp %st, %st(1) jmp 0xb3c2a fldt 0x40(%rsp) fldt 0xcc(%rsp) fxch %st(1) fucomi %st(1), %st fstp %st(1) ja 0xb3c95 movq %r14, %rdi fstpt 0x40(%rsp) callq 0xb4580 testb %al, %al jne 0xb3c9d fldt 0x4c(%rsp) fldt 0x40(%rsp) incl %ebx jmp 0xb3b83 vmovsd 0x80(%rsp), %xmm0 movq 0x78(%rsp), %rdi movq %rbp, %rsi callq 0x9706e movl 0xc0(%r12), %eax imull 0x64(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xb44fa fldt 0x4c(%rsp) fldt 0x40(%rsp) jmp 0xb3ca5 fldt 0x4c(%rsp) fxch %st(1) jmp 0xb3ca5 fldt 0x4c(%rsp) fldt 0x40(%rsp) movl 0x88(%rsp), %ebx decl 0x64(%rsp) incl %ebx jmp 0xb3ad7 jmp 0xb3cf2 jmp 0xb3ccb fstp %st(1) fstp %st(0) jmp 0xb3cf2 movq %rax, %rbx jmp 0xb3d02 movq %rax, %rbx jmp 0xb3d0f movq %rax, %rbx jmp 0xb3d1c movq %rax, %rbx jmp 0xb3d29 movq %rax, %rbx jmp 0xb3d33 jmp 0xb3cf2 jmp 0xb3cf2 jmp 0xb3cf2 leaq 0x1e8(%rsp), %rdi movq %rax, %rbx callq 0x357fe jmp 0xb3d02 leaq 0x1e0(%rsp), %rdi movq %rax, %rbx callq 0x435d0 leaq 0x120(%rsp), %rdi callq 0x393ac leaq 0x158(%rsp), %rdi callq 0xae044 leaq 0x100(%rsp), %rdi callq 0x968b6 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::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long 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 0xb4546 pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xb45c0 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<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_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 0x3a54d7(%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::debug_logger<true>::debug_logger(std::basic_string_view<char, std::char_traits<char>>)
debug_logger(const std::string_view name) noexcept { if constexpr (debug) { char buffer[512] = { '\0' }; auto written = fmt::format_to_n( buffer, 511, "{}-{}.log", name, std::hash<std::thread::id>{}(std::this_thread::get_id())); buffer[written.size] = '\0'; ofs = std::fopen(buffer, "w"); } else { (void)name; ofs = nullptr; } }
pushq %r15 pushq %r14 pushq %rbx subq $0x230, %rsp # imm = 0x230 leaq 0x20(%rsp), %r14 vxorps %xmm0, %xmm0, %xmm0 leaq 0x30(%rsp), %r15 movq %rdi, %rbx movq %rsi, (%r14) movq %rdx, 0x8(%r14) andq $0x0, (%rdi) vmovups %zmm0, 0x1c0(%r15) vmovups %zmm0, 0x180(%r15) vmovups %zmm0, 0x140(%r15) vmovups %zmm0, 0x100(%r15) vmovups %zmm0, 0xc0(%r15) vmovups %zmm0, 0x80(%r15) vmovups %zmm0, 0x40(%r15) vmovups %zmm0, (%r15) vzeroupper callq 0xb410 leaq 0x10(%rsp), %rsi leaq 0xf(%rsp), %rdi movq %rax, (%rsi) callq 0xb8598 leaq 0x18(%rsp), %r8 movq %rax, (%r8) leaq 0x3a3e53(%rip), %rdx # 0x45c2f3 movl $0x1ff, %esi # imm = 0x1FF movq %r15, %rdi movq %r14, %rcx callq 0xb8547 leaq 0x39d5fe(%rip), %rsi # 0x455ab5 leaq 0x30(%rsp), %rdi movb $0x0, 0x30(%rsp,%rdx) callq 0xb740 movq %rax, (%rbx) addq $0x230, %rsp # imm = 0x230 popq %rbx popq %r14 popq %r15 retq movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
fmt::v7::format_to_n_result<char*> fmt::v7::vformat_to_n<char*, char, 0>(char*, unsigned long, fmt::v7::basic_string_view<char>, fmt::v7::basic_format_args<fmt::v7::basic_format_context<fmt::v7::detail::buffer_appender<fmt::v7::type_identity<char>::type>, fmt::v7::type_identity<char>::type>>)
explicit iterator_buffer(OutputIt out, size_t n = buffer_size) : Traits(n), buffer<T>(data_, 0, buffer_size), out_(out) {}
pushq %r14 pushq %rbx subq $0x138, %rsp # imm = 0x138 leaq 0x38(%rsp), %rax andq $0x0, -0x18(%rax) movq %rsi, -0x10(%rax) movq %rax, -0x30(%rax) andq $0x0, -0x28(%rax) leaq 0x58294d(%rip), %rsi # 0x63af20 movq $0x100, -0x20(%rax) # imm = 0x100 movq %rsi, -0x38(%rax) movq %rdi, -0x8(%rax) movq %rdx, %rsi movq %rcx, %rdx movq %r8, %rcx movq %r9, %r8 movq %rsp, %rdi xorl %r9d, %r9d callq 0xf2fe movq %rsp, %rdi callq 0xb863a movq %rsp, %rdi movq 0x10(%rdi), %r14 movq %rax, %rbx addq 0x20(%rdi), %r14 callq 0xb864a movq %rbx, %rax movq %r14, %rdx addq $0x138, %rsp # imm = 0x138 popq %rbx popq %r14 retq movq %rsp, %rdi movq %rax, %rbx callq 0xb864a movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/external/fmt/include/fmt/core.h
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, true>::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>>>, float, float, float)
bool compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta) { auto at_least_one_pi_changed{ false }; logger::log("update-row {} {} {}\n", kappa, delta, theta); for (; first != last; ++first) { auto k = constraint(first); const auto it = ap.row(k); decrease_preference(std::get<0>(it), std::get<1>(it), theta); const auto r_size = compute_reduced_costs(std::get<0>(it), std::get<1>(it), x); calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int selected = select_variables(r_size, b[k]); logger::log("constraints {}: {} = ", k, b[k]); for (int i = 0; i < r_size; ++i) logger::log("{} ({}) ", R[i].value, R[i].id); logger::log(" => Selected: {}\n", selected); auto pi_change = affect( *this, x, std::get<0>(it), k, selected, r_size, kappa, delta); at_least_one_pi_changed = at_least_one_pi_changed || pi_change; } return at_least_one_pi_changed; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rcx, 0x40(%rsp) leaq 0x1c(%rsp), %rcx leaq 0x18(%rsp), %r8 leaq 0x14(%rsp), %r9 movq %rdx, %r14 movq %rsi, %r13 movq %rdi, %r12 leaq 0x3a38c4(%rip), %rdx # 0x45c344 vmovss %xmm0, (%rcx) vmovss %xmm1, (%r8) vmovss %xmm2, (%r9) pushq $0x14 popq %rsi callq 0xb907e leaq 0x10(%r12), %rax leaq 0x3a3871(%rip), %rbx # 0x45c313 movq %rax, 0x30(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x38(%rsp) cmpq 0x40(%rsp), %r14 je 0xb8beb movl (%r14), %edx movq 0x30(%rsp), %rsi leaq 0x20(%rsp), %rdi movq %rax, 0x48(%rsp) movq %r14, 0x50(%rsp) movl %edx, 0xc(%rsp) callq 0x3de66 vmovss 0x14(%rsp), %xmm0 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi callq 0xb90b0 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0xb90ce movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r14 movl %eax, %r15d leaq (%rdi,%r14,8), %rsi callq 0xb918e movslq 0xc(%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r14d cmovll %r14d, %eax decl %eax movl %eax, 0x10(%rsp) pushq $0x15 popq %rsi leaq 0x3a37b0(%rip), %rdx # 0x45c2fd leaq 0xc(%rsp), %rcx callq 0xb91c2 movl %r14d, %eax sarl $0x1f, %eax andnl %r14d, %eax, %r13d xorl %r14d, %r14d shlq $0x3, %r13 cmpq %r14, %r13 je 0xb8b8f movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x4(%rcx,%r14), %r8 addq %r14, %rcx callq 0xb91f0 addq $0x8, %r14 jmp 0xb8b69 movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x3a84c5(%rip), %rdx # 0x461061 leaq 0x10(%rsp), %rcx callq 0xb921e vmovss 0x1c(%rsp), %xmm0 vmovss 0x18(%rsp), %xmm1 movq 0x38(%rsp), %r13 movq 0x28(%rsp), %rdx movl 0xc(%rsp), %ecx movl 0x10(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r13, %rsi callq 0xb9249 movq 0x48(%rsp), %rcx movq 0x50(%rsp), %r14 orb %al, %cl addq $0x4, %r14 movq %rcx, %rax jmp 0xb8ab1 andb $0x1, %al addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<float> 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 $0x158, %rsp # imm = 0x158 vmovsd %xmm0, 0x58(%rsp) vxorps %xmm0, %xmm0, %xmm0 movq %r8, %r13 movl %ecx, %ebx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, 0x18(%rsp) vmovups %zmm0, 0x58(%rdi) vmovups %zmm0, 0x40(%rdi) vmovups %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) leaq 0x28(%rsp), %rdi movl %ecx, %esi vzeroupper callq 0x368ae movq 0x10(%r14), %r12 movq 0x18(%r14), %rcx leaq 0x90(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x38959 vmovsd 0x20(%r12), %xmm0 vmovsd 0x10(%r12), %xmm2 vxorpd %xmm1, %xmm1, %xmm1 vmovsd %xmm0, 0x48(%rsp) vmovsd 0x28(%r12), %xmm0 vucomisd %xmm2, %xmm1 vmovsd %xmm0, 0x40(%rsp) vmovsd 0x30(%r12), %xmm0 vmovsd %xmm0, 0x38(%rsp) vcvtsd2ss 0x8(%r12), %xmm3, %xmm0 vmovss %xmm0, 0x4(%rsp) jbe 0xbd6c8 movq 0x10(%r14), %rdi leaq 0x90(%rsp), %rsi movl %ebx, %edx callq 0x38a37 vmovss %xmm0, 0x14(%rsp) jmp 0xbd6d2 vcvtsd2ss %xmm2, %xmm2, %xmm0 vmovss %xmm0, 0x14(%rsp) vcvttsd2si 0xa0(%r12), %rax vmovsd 0x38(%r12), %xmm0 vmovsd 0x40(%r12), %xmm1 movq 0x18(%r14), %rsi movq %rax, 0x70(%rsp) movq 0x8(%r15), %rax vmovsd %xmm0, 0x68(%rsp) vmovsd %xmm1, 0x60(%rsp) subq (%r15), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0xd8(%rsp), %rdi leaq 0x90(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0xb7dac movl 0xcc(%r12), %esi leaq 0xa0(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x7c(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, 0x8(%rsp) vxorps %xmm0, %xmm0, %xmm0 vmovaps %xmm0, 0x80(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0xbd7b0 cmpl $0x1, %eax je 0xbd78a cmpl $0x2, %eax jne 0xbd7c1 movq 0x18(%r14), %rdx leaq 0x80(%rsp), %rdi leaq 0x28(%rsp), %rsi jmp 0xbd79b movq 0x18(%r14), %rdx leaq 0x28(%rsp), %rdi leaq 0x80(%rsp), %rsi vmovsd 0x396895(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x36301 jmp 0xbd7c1 leaq 0x28(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0x361e7 vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0 leaq 0x28(%rsp), %r15 movq %r13, 0x50(%rsp) xorl %ebx, %ebx movl (%r15), %ebp vmovss %xmm0, 0x24(%rsp) vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0 vmovss %xmm0, 0x48(%rsp) vcvtsd2ss 0x38(%rsp), %xmm3, %xmm0 vmovss %xmm0, 0x40(%rsp) vcvtsd2ss 0x68(%rsp), %xmm3, %xmm0 vmovss %xmm0, 0x68(%rsp) vcvtsd2ss 0x60(%rsp), %xmm3, %xmm0 vmovss %xmm0, 0x60(%rsp) cmpl %ebx, %ebp je 0xbd833 movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd 0x8(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xbd82f movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0xbd80c leaq 0x88(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 vmovsd %xmm0, 0x8(%rsp) callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi leaq 0x28(%rsp), %rdx callq 0xb7f3c vcvtsd2ss 0x8(%rsp), %xmm3, %xmm0 vmovss 0x4(%rsp), %xmm2 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x28(%rsp), %rbx xorl %r15d, %r15d cmpq 0xb0(%r12), %r15 je 0xbd956 movq 0x18(%r14), %rcx vmovss 0x14(%rsp), %xmm1 leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi movq %rbx, %rdx vmovss %xmm0, 0x8(%rsp) callq 0xb7f7e movl %eax, %r13d testl %eax, %eax je 0xbd9ee cmpl %ebp, %r13d jge 0xbd8eb movq %r14, %rdi movq %rbx, %rsi movl %r13d, %edx movq %r15, %rcx callq 0xbde62 movl %r13d, %ebp cmpq 0x70(%rsp), %r15 jle 0xbd922 vcvtsi2ss %r13d, %xmm3, %xmm0 vcvtsi2ssl 0x150(%rsp), %xmm3, %xmm1 vdivss %xmm1, %xmm0, %xmm0 vmovss 0x40(%rsp), %xmm1 callq 0xb530 vmovss 0x8(%rsp), %xmm1 vfmadd231ss 0x24(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovaps %xmm1, %xmm0 jmp 0xbd928 vmovss 0x8(%rsp), %xmm0 vucomiss 0x48(%rsp), %xmm0 ja 0xbd956 movq %r14, %rdi vmovss %xmm0, 0x8(%rsp) callq 0xbde9a vmovss 0x8(%rsp), %xmm0 vmovss 0x4(%rsp), %xmm2 testb %al, %al jne 0xbd956 incq %r15 jmp 0xbd891 movq 0x18(%rsp), %rax movl $0x5, 0xa0(%rax) cmpl $0x0, 0x50(%r14) jne 0xbd978 movq 0x18(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0xbd9a6 movq 0x18(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x7c(%rsp), %edx movq %r14, %rdi callq 0x35781 leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xb83de leaq 0x98(%rsp), %rdi callq 0x35c1a leaq 0x30(%rsp), %rdi callq 0x357fe movq 0x18(%rsp), %rax addq $0x158, %rsp # imm = 0x158 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq vmovsd 0x58(%rsp), %xmm0 movq 0x50(%rsp), %rdi leaq 0x28(%rsp), %rbx movq %rbx, %rsi callq 0x365d4 movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0xbde18 vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 leaq 0xd8(%rsp), %r15 leaq 0x28(%rsp), %rbp xorl %ebx, %ebx movl $0x0, 0x38(%rsp) cmpl 0xbc(%r12), %ebx jge 0xbd965 vmovss %xmm0, 0x8(%rsp) vmulss 0x68(%rsp), %xmm0, %xmm0 movq 0x18(%r14), %rcx vmovss 0x14(%rsp), %xmm1 vmovss 0x60(%rsp), %xmm3 leaq 0xa0(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx callq 0xb818a testl %eax, %eax jne 0xbdaa6 vmovsd 0x58(%rsp), %xmm0 movq 0x50(%rsp), %rdi movq %rbp, %rsi callq 0x365d4 movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xbde18 movq %r14, %rdi callq 0xbde9a vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 testb %al, %al jne 0xbd965 movl %ebx, 0x70(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0xbdbcd movq 0x18(%r14), %rcx vmovss 0x14(%rsp), %xmm1 leaq 0xa0(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx vmovss %xmm0, 0x8(%rsp) callq 0xb7f7e testl %eax, %eax je 0xbdb83 vcvtsi2sd %r13d, %xmm4, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0xbdb4a vcvtsi2ss %eax, %xmm4, %xmm0 vcvtsi2ssl 0x150(%rsp), %xmm4, %xmm1 vdivss %xmm1, %xmm0, %xmm0 vmovss 0x40(%rsp), %xmm1 callq 0xb530 vmovss 0x8(%rsp), %xmm1 vmovss 0x4(%rsp), %xmm2 vfmadd231ss 0x24(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovaps %xmm1, %xmm0 jmp 0xbdb56 vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 vucomiss 0x48(%rsp), %xmm0 ja 0xbdbcd movq %r14, %rdi vmovss %xmm0, 0x8(%rsp) callq 0xbde9a testb %al, %al jne 0xbdbc1 vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 incl %ebx jmp 0xbdacb vmovsd 0x58(%rsp), %xmm0 movq 0x50(%rsp), %rdi movq %rbp, %rsi callq 0x365d4 movl 0xc0(%r12), %eax imull 0x38(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xbde18 vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 jmp 0xbdbcd vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 movl 0x70(%rsp), %ebx decl 0x38(%rsp) incl %ebx jmp 0xbda37 jmp 0xbdc0e jmp 0xbdbe7 jmp 0xbdc0e movq %rax, %r14 jmp 0xbdc1e movq %rax, %r14 jmp 0xbdc2b movq %rax, %r14 jmp 0xbdc38 movq %rax, %r14 jmp 0xbdc42 jmp 0xbdc0e jmp 0xbdc0e jmp 0xbdc0e leaq 0x88(%rsp), %rdi movq %rax, %r14 callq 0x357fe jmp 0xbdc11 movq %rax, %r14 leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xb83de leaq 0x98(%rsp), %rdi callq 0x35c1a leaq 0x30(%rsp), %rdi callq 0x357fe movq 0x18(%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_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, 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 0x39bd81(%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_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::file_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 0xbdd7e pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xbddf8 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
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false> const, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false> 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, 0x20(%rsp) cmpq %rax, 0x20(%rdi) je 0xbeef8 movq %rax, 0x20(%rdi) movq 0x20(%rsp), %rcx leaq 0x18(%rdi), %rax movq %rdi, 0x28(%rsp) xorl %ebp, %ebp movq %rax, 0x18(%rsp) movl 0x78(%rcx), %r12d leaq 0x10(%rcx), %rax movq %rax, 0x30(%rsp) cmpq %r12, %rbp je 0xbef99 movq 0x30(%rsp), %rsi leaq 0x8(%rsp), %rdi movl %ebp, %edx callq 0x3c868 movq 0x8(%rsp), %r15 movq 0x10(%rsp), %r13 xorl %ebx, %ebx cmpq %r15, %r13 je 0xbef55 movl 0x4(%r13), %esi movq %r14, %rdi callq 0x3664a addl %eax, %ebx addq $0x8, %r13 jmp 0xbef3c movq 0x20(%rsp), %rax movq 0x60(%rax), %rax movl (%rax,%rbp,4), %eax movl %eax, %ecx subl %ebx, %ecx jle 0xbef75 shlq $0x20, %rcx orq %rbp, %rcx movq %rcx, 0x8(%rsp) jmp 0xbef85 jge 0xbef94 subl %eax, %ebx shlq $0x20, %rbx orq %rbp, %rbx movq %rbx, 0x8(%rsp) movq 0x18(%rsp), %rdi leaq 0x8(%rsp), %rsi callq 0x3c8c2 incq %rbp jmp 0xbef1a movq 0x28(%rsp), %rcx movq 0x20(%rcx), %rax subq 0x18(%rcx), %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_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false> 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 0xbefd7 movq %rax, 0x8(%rbx) leaq 0x4(%rsp), %r12 xorl %esi, %esi movl %esi, 0x4(%rsp) cmpl 0x78(%r15), %esi je 0xbf00a movq %r15, %rdi movq %r14, %rdx callq 0xbf021 testb %al, %al jne 0xbf002 movq %rbx, %rdi movq %r12, %rsi callq 0x31460 movl 0x4(%rsp), %esi incl %esi jmp 0xbefde 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::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>::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>>>, float, float, float)
bool compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta) { auto at_least_one_pi_changed{ false }; logger::log("update-row {} {} {}\n", kappa, delta, theta); for (; first != last; ++first) { auto k = constraint(first); const auto it = ap.row(k); decrease_preference(std::get<0>(it), std::get<1>(it), theta); const auto r_size = compute_reduced_costs(std::get<0>(it), std::get<1>(it), x); calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int selected = select_variables(r_size, b[k]); logger::log("constraints {}: {} = ", k, b[k]); for (int i = 0; i < r_size; ++i) logger::log("{} ({}) ", R[i].value, R[i].id); logger::log(" => Selected: {}\n", selected); auto pi_change = affect( *this, x, std::get<0>(it), k, selected, r_size, kappa, delta); at_least_one_pi_changed = at_least_one_pi_changed || pi_change; } return at_least_one_pi_changed; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp leaq 0x10(%rdi), %rax vmovss %xmm2, 0x14(%rsp) vmovss %xmm1, 0x10(%rsp) vmovss %xmm0, 0xc(%rsp) movq %rcx, 0x30(%rsp) movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 xorl %ebp, %ebp movq %rax, 0x28(%rsp) cmpq 0x30(%rsp), %r14 je 0xbf265 movslq (%r14), %rbx movq 0x28(%rsp), %rsi leaq 0x18(%rsp), %rdi movl %ebx, %edx callq 0x3de66 vmovss 0x14(%rsp), %xmm0 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi callq 0xbf580 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0xbf59e movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 leaq (%rdi,%r13,8), %rsi callq 0xbf65e movq 0x60(%r12), %rax vmovss 0xc(%rsp), %xmm0 vmovss 0x10(%rsp), %xmm1 movq 0x20(%rsp), %rdx movq %r12, %rdi movq %r15, %rsi movl %ebx, %ecx movl %r13d, %r9d movl (%rax,%rbx,4), %r8d cmpl %r8d, %r13d cmovll %r13d, %r8d decl %r8d callq 0xbf691 orb %al, %bpl addq $0x4, %r14 jmp 0xbf1c3 andb $0x1, %bpl movl %ebp, %eax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>&, 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, 0x20(%rsp) cmpq %rax, 0x20(%rdi) je 0xbf38e movq %rax, 0x20(%rdi) movq 0x20(%rsp), %rcx leaq 0x18(%rdi), %rax movq %rdi, 0x28(%rsp) xorl %ebp, %ebp movq %rax, 0x18(%rsp) movl 0x78(%rcx), %r12d leaq 0x10(%rcx), %rax movq %rax, 0x30(%rsp) cmpq %r12, %rbp je 0xbf42f movq 0x30(%rsp), %rsi leaq 0x8(%rsp), %rdi movl %ebp, %edx callq 0x3de66 movq 0x8(%rsp), %r15 movq 0x10(%rsp), %r13 xorl %ebx, %ebx cmpq %r15, %r13 je 0xbf3eb movl 0x4(%r13), %esi movq %r14, %rdi callq 0x3664a addl %eax, %ebx addq $0x8, %r13 jmp 0xbf3d2 movq 0x20(%rsp), %rax movq 0x60(%rax), %rax movl (%rax,%rbp,4), %eax movl %eax, %ecx subl %ebx, %ecx jle 0xbf40b shlq $0x20, %rcx orq %rbp, %rcx movq %rcx, 0x8(%rsp) jmp 0xbf41b jge 0xbf42a subl %eax, %ebx shlq $0x20, %rbx orq %rbp, %rbx movq %rbx, 0x8(%rsp) movq 0x18(%rsp), %rdi leaq 0x8(%rsp), %rsi callq 0x3c8c2 incq %rbp jmp 0xbf3b0 movq 0x28(%rsp), %rcx movq 0x20(%rcx), %rax subq 0x18(%rcx), %rax shrq $0x3, %rax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>::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>>>, float, float, float)
bool compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta) { auto at_least_one_pi_changed{ false }; logger::log("update-row {} {} {}\n", kappa, delta, theta); for (; first != last; ++first) { auto k = constraint(first); const auto it = ap.row(k); decrease_preference(std::get<0>(it), std::get<1>(it), theta); const auto r_size = compute_reduced_costs(std::get<0>(it), std::get<1>(it), x); calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int selected = select_variables(r_size, b[k]); logger::log("constraints {}: {} = ", k, b[k]); for (int i = 0; i < r_size; ++i) logger::log("{} ({}) ", R[i].value, R[i].id); logger::log(" => Selected: {}\n", selected); auto pi_change = affect( *this, x, std::get<0>(it), k, selected, r_size, kappa, delta); at_least_one_pi_changed = at_least_one_pi_changed || pi_change; } return at_least_one_pi_changed; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp leaq 0x10(%rdi), %rax vmovss %xmm2, 0x14(%rsp) vmovss %xmm1, 0x10(%rsp) vmovss %xmm0, 0xc(%rsp) movq %rcx, 0x30(%rsp) movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 xorl %ebp, %ebp movq %rax, 0x28(%rsp) cmpq 0x30(%rsp), %r14 je 0xbf52b movslq (%r14), %rbx movq 0x28(%rsp), %rsi leaq 0x18(%rsp), %rdi movl %ebx, %edx callq 0x3de66 vmovss 0x14(%rsp), %xmm0 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi callq 0xbf580 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0xbf59e movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 leaq (%rdi,%r13,8), %rsi callq 0xbf65e movq 0x60(%r12), %rax vmovss 0xc(%rsp), %xmm0 vmovss 0x10(%rsp), %xmm1 movq 0x20(%rsp), %rdx movq %r12, %rdi movq %r15, %rsi movl %ebx, %ecx movl %r13d, %r9d movl (%rax,%rbx,4), %r8d cmpl %r8d, %r13d cmovll %r13d, %r8d decl %r8d callq 0xbf691 orb %al, %bpl addq $0x4, %r14 jmp 0xbf489 andb $0x1, %bpl movl %ebp, %eax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false> 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 0x78(%r14), %r15d je 0xbf572 movq %r14, %rdi movl %r15d, %esi movq %rbx, %rdx callq 0xbf021 xorb $0x1, %al incl %r15d movzbl %al, %eax addl %eax, %ebp jmp 0xbf552 movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>::push_and_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>>>, float, float, float, float)
bool push_and_compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta, Float objective_amplifier) { auto at_least_one_pi_changed{ false }; logger::log("push-update-row {} {} {}\n", kappa, delta, theta); for (; first != last; ++first) { auto k = constraint(first); const auto it = ap.row(k); decrease_preference(std::get<0>(it), std::get<1>(it), theta); const auto r_size = compute_reduced_costs(std::get<0>(it), std::get<1>(it), x); // Before sort and select variables, we apply the push method: for // each reduces cost, we had the cost multiply with an objective // amplifier. for (int i = 0; i != r_size; ++i) R[i].value += objective_amplifier * c(R[i].id, x); calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int selected = select_variables(r_size, b[k]); logger::log("constraints {}: {} = ", k, b[k]); for (int i = 0; i < r_size; ++i) logger::log("{} ({}) ", R[i].value, R[i].id); logger::log(" => Selected: {}\n", selected); auto pi_change = affect( *this, x, std::get<0>(it), k, selected, r_size, kappa, delta); at_least_one_pi_changed = at_least_one_pi_changed || pi_change; } return at_least_one_pi_changed; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp leaq 0x10(%rdi), %rax vmovss %xmm3, 0x14(%rsp) vmovss %xmm2, 0x10(%rsp) vmovss %xmm1, 0xc(%rsp) vmovss %xmm0, 0x8(%rsp) movq %rcx, 0x30(%rsp) movq %rdx, %r14 movq %rsi, %r12 movq %rdi, %r13 xorl %r15d, %r15d movq %rax, 0x28(%rsp) cmpq 0x30(%rsp), %r14 je 0xc13b0 movl (%r14), %eax movq 0x28(%rsp), %rsi leaq 0x18(%rsp), %rdi movslq %eax, %rbp movl %ebp, %edx callq 0x3de66 vmovss 0x10(%rsp), %xmm0 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r13, %rdi callq 0xbf580 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r13, %rdi movq %r12, %rcx callq 0xbf59e vmovss 0x14(%rsp), %xmm1 movq 0x58(%r13), %rdi movq 0x70(%r13), %rcx movl %eax, %eax xorl %edx, %edx cmpq %rdx, %rax je 0xc1361 movslq 0x4(%rdi,%rdx,8), %rsi movq 0x8(%rcx), %r8 vmovss (%r8,%rsi,4), %xmm0 vfmadd213ss (%rdi,%rdx,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovss %xmm0, (%rdi,%rdx,8) incq %rdx jmp 0xc133d movq 0x8(%r13), %rdx movslq %eax, %rbx leaq (%rdi,%rbx,8), %rsi callq 0xbf65e movq 0x60(%r13), %rax vmovss 0x8(%rsp), %xmm0 vmovss 0xc(%rsp), %xmm1 movq 0x20(%rsp), %rdx movq %r13, %rdi movq %r12, %rsi movl %ebp, %ecx movl %ebx, %r9d movl (%rax,%rbp,4), %r8d cmpl %r8d, %ebx cmovll %ebx, %r8d decl %r8d callq 0xbf691 orb %al, %r15b addq $0x4, %r14 jmp 0xc12dc andb $0x1, %r15b movl %r15d, %eax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>::push_and_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>>>>, float, float, float, float)
bool push_and_compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta, Float objective_amplifier) { auto at_least_one_pi_changed{ false }; logger::log("push-update-row {} {} {}\n", kappa, delta, theta); for (; first != last; ++first) { auto k = constraint(first); const auto it = ap.row(k); decrease_preference(std::get<0>(it), std::get<1>(it), theta); const auto r_size = compute_reduced_costs(std::get<0>(it), std::get<1>(it), x); // Before sort and select variables, we apply the push method: for // each reduces cost, we had the cost multiply with an objective // amplifier. for (int i = 0; i != r_size; ++i) R[i].value += objective_amplifier * c(R[i].id, x); calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int selected = select_variables(r_size, b[k]); logger::log("constraints {}: {} = ", k, b[k]); for (int i = 0; i < r_size; ++i) logger::log("{} ({}) ", R[i].value, R[i].id); logger::log(" => Selected: {}\n", selected); auto pi_change = affect( *this, x, std::get<0>(it), k, selected, r_size, kappa, delta); at_least_one_pi_changed = at_least_one_pi_changed || pi_change; } return at_least_one_pi_changed; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp leaq 0x10(%rdi), %rax vmovss %xmm3, 0x14(%rsp) vmovss %xmm2, 0x10(%rsp) vmovss %xmm1, 0xc(%rsp) vmovss %xmm0, 0x8(%rsp) movq %rcx, 0x30(%rsp) movq %rdx, %r14 movq %rsi, %r12 movq %rdi, %r13 xorl %r15d, %r15d movq %rax, 0x28(%rsp) cmpq 0x30(%rsp), %r14 je 0xc14da movl (%r14), %eax movq 0x28(%rsp), %rsi leaq 0x18(%rsp), %rdi movslq %eax, %rbp movl %ebp, %edx callq 0x3de66 vmovss 0x10(%rsp), %xmm0 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r13, %rdi callq 0xbf580 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r13, %rdi movq %r12, %rcx callq 0xbf59e vmovss 0x14(%rsp), %xmm1 movq 0x58(%r13), %rdi movq 0x70(%r13), %rcx movl %eax, %eax xorl %edx, %edx cmpq %rdx, %rax je 0xc148b movslq 0x4(%rdi,%rdx,8), %rsi movq 0x8(%rcx), %r8 vmovss (%r8,%rsi,4), %xmm0 vfmadd213ss (%rdi,%rdx,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovss %xmm0, (%rdi,%rdx,8) incq %rdx jmp 0xc1467 movq 0x8(%r13), %rdx movslq %eax, %rbx leaq (%rdi,%rbx,8), %rsi callq 0xbf65e movq 0x60(%r13), %rax vmovss 0x8(%rsp), %xmm0 vmovss 0xc(%rsp), %xmm1 movq 0x20(%rsp), %rdx movq %r13, %rdi movq %r12, %rsi movl %ebp, %ecx movl %ebx, %r9d movl (%rax,%rbp,4), %r8d cmpl %r8d, %ebx cmovll %ebx, %r8d decl %r8d callq 0xbf691 orb %al, %r15b addq $0x8, %r14 jmp 0xc1406 andb $0x1, %r15b movl %r15d, %eax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, 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 0xc3f44 pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xc3fbe 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_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, 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 0x395ad9(%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::solve_problem<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>>(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 0xc4678 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 0xc47a1 movq 0xa8(%r15), %rax cmpq 0xb0(%r15), %rax je 0xc47a1 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 0x445b4 vmovsd 0x40(%r15), %xmm0 movl 0xe4(%r14), %eax vxorps %xmm1, %xmm1, %xmm1 leaq 0x40(%rsp), %rsi cmpl $0x1, %eax je 0xc47c8 cmpl $0x2, %eax jne 0xc4817 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 0xca9b2 jmp 0xc4864 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 0xc4893 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 0xca2ce jmp 0xc4864 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 0xcb096 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 0x4495c 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 0xc48ff 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 0xc4921 jmp 0xc4921 leaq 0x68(%rsp), %rdi movq %rax, %r14 callq 0x357fe leaq 0x20(%rsp), %rdi callq 0x4495c jmp 0xc4944 jmp 0xc4941 movq %rax, %r14 jmp 0xc494e 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::result baryonyx::itm::optimize_problem<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>>(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 0xc49c4 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 0xc4b23 movq 0xa8(%r13), %rax cmpq 0xb0(%r13), %rax je 0xc4b23 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 0x445b4 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 0x447c6 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 0xc4b7e movl %eax, %ecx shlq $0x3, %rcx addq 0x30(%rsp), %rcx movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0xcb9ac movl 0x8(%rsp), %eax incl %eax jmp 0xc4afa 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 0xc4f19 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 0xc4c42 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 0xcb9f8 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 0xc4b9e 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 0xc4cd7 movq 0x60(%rsp), %rax xorl %ecx, %ecx xorl %r14d, %r14d cmpq %rcx, %r15 je 0xc4c98 addq 0xb0(%rax,%rcx), %r14 addq $0xc0, %rcx jmp 0xc4c82 leaq 0xe0(%rsp), %rdi leaq 0x18(%rsp), %rsi leaq 0x28(%rsp), %rdx leaq 0x20(%rsp), %rcx movq %rbp, %r8 callq 0x4d156 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 0x394d86(%rip), %xmm1, %xmm1 # 0x459a80 jae 0xc4c5d vucomisd %xmm0, %xmm1 jbe 0xc4c5d movb $0x1, %al xchgb %al, 0x3(%rsp) movq 0xa0(%rsp), %rbx movq 0xa8(%rsp), %r14 movq 0x10(%rsp), %r12 cmpq %r14, %rbx je 0xc4d38 movq %rbx, %rdi callq 0xb1a0 addq $0x8, %rbx jmp 0xc4d25 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 0xc4e93 cmpl $0x1, %eax je 0xc4e5b cmpl $0x2, %eax jne 0xc4eb2 leaq 0x68(%r12), %rbx pushq $0x5 popq %rsi movq %rbx, %rdi callq 0x35292 xorl %r14d, %r14d xorl %r15d, %r15d cmpq $0x5, %r15 je 0xc4eb2 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 0xc4e21 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 0x4d1d4 movq (%r14), %rsi movq %rax, %rbx addq $0x20, %rsi jmp 0xc4ea6 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 0x4492a cmpq $0x0, 0x168(%r13) je 0xc4ede addq $0x158, %r13 # imm = 0x158 movq %r13, %rdi movq %r12, %rsi callq 0x357ea leaq 0x30(%rsp), %rdi callq 0x357fe leaq 0xd8(%rsp), %rdi callq 0x4493e leaq 0xa0(%rsp), %rdi callq 0x35836 leaq 0x60(%rsp), %rdi callq 0xd03ce leaq 0xb8(%rsp), %rdi callq 0x4495c 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 0xc4f7a movq %rax, %rbx jmp 0xc4f87 movq %rax, %rbx jmp 0xc4f94 jmp 0xc4f5e jmp 0xc4f4f jmp 0xc4f6d jmp 0xc4f6d movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0xc4fb5 movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0xc4fab jmp 0xc4f6d jmp 0xc4f6d jmp 0xc4f6d jmp 0xc4f6d jmp 0xc4f6d movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x357fe leaq 0xd8(%rsp), %rdi callq 0x4493e leaq 0xa0(%rsp), %rdi callq 0x35836 leaq 0x60(%rsp), %rdi callq 0xd03ce leaq 0xb8(%rsp), %rdi callq 0x4495c 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_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>>(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 0xc4ff9 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 0xc5122 movq 0xa8(%r15), %rax cmpq 0xb0(%r15), %rax je 0xc5122 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 0x445b4 vmovsd 0x40(%r15), %xmm0 movl 0xe4(%r14), %eax vxorps %xmm1, %xmm1, %xmm1 leaq 0x40(%rsp), %rsi cmpl $0x1, %eax je 0xc5149 cmpl $0x2, %eax jne 0xc5198 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 0xd0ada jmp 0xc51e5 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 0xc5214 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 0xd03f6 jmp 0xc51e5 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 0xd11be 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 0x4495c 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 0xc5280 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 0xc52a2 jmp 0xc52a2 leaq 0x68(%rsp), %rdi movq %rax, %r14 callq 0x357fe leaq 0x20(%rsp), %rdi callq 0x4495c jmp 0xc52c5 jmp 0xc52c2 movq %rax, %r14 jmp 0xc52cf movq %rax, %r14 leaq 0x8(%rsp), %rdi callq 0x35858 movq %rbx, %rdi callq 0xea60 movq %r14, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::optimize_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<float>, float, baryonyx::itm::maximize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<float> 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 $0x158, %rsp # imm = 0x158 movq %rdi, %rbp leaq 0x18(%rsp), %rdi movq %rsi, %r15 movl %r8d, %esi vmovsd %xmm0, 0x58(%rsp) movq %r9, %r12 movl %r8d, %ebx movq %rcx, %r14 movq %rdx, 0x28(%rsp) callq 0x368ae movq (%rbp), %r13 movq %rbp, 0x70(%rsp) addq $0x8, %rbp leaq 0x80(%rsp), %rdi movq %r13, %rsi movq %r12, 0x50(%rsp) movq %r12, %rdx movq %rbp, %rcx movl %ebx, %r8d callq 0x46c07 vmovsd 0x20(%r13), %xmm0 vmovsd 0x10(%r13), %xmm2 vxorpd %xmm1, %xmm1, %xmm1 vmovsd %xmm0, (%rsp) vmovsd 0x28(%r13), %xmm0 vucomisd %xmm2, %xmm1 vmovsd %xmm0, 0x48(%rsp) vmovsd 0x30(%r13), %xmm0 vmovsd %xmm0, 0x40(%rsp) vcvtsd2ss 0x8(%r13), %xmm3, %xmm0 vmovss %xmm0, 0xc(%rsp) jbe 0xc57b5 movq 0x70(%rsp), %rax movq (%rax), %rdi leaq 0x80(%rsp), %rsi movl %ebx, %edx callq 0x46ce1 vmovss %xmm0, 0x8(%rsp) jmp 0xc57bf vcvtsd2ss %xmm2, %xmm2, %xmm0 vmovss %xmm0, 0x8(%rsp) vcvttsd2si 0xa0(%r13), %rax vmovsd 0x38(%r13), %xmm0 vmovsd 0x40(%r13), %xmm1 movq %rax, 0x78(%rsp) movq 0x8(%r14), %rax vmovsd %xmm0, 0x38(%rsp) vmovsd %xmm1, 0x60(%rsp) subq (%r14), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0xd8(%rsp), %rdi leaq 0x80(%rsp), %r8 movq %rbp, %rsi movl %eax, %edx movl %ebx, %ecx movq %r14, %r9 callq 0xc5c0e movl 0xcc(%r13), %esi leaq 0xa0(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 vcvtsd2ss (%rsp), %xmm3, %xmm0 vmovss %xmm0, 0x34(%rsp) vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0 vmovss %xmm0, 0x48(%rsp) vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0 vmovss %xmm0, 0x40(%rsp) vcvtsd2ss 0x38(%rsp), %xmm3, %xmm0 vmovss %xmm0, 0x6c(%rsp) vcvtsd2ss 0x60(%rsp), %xmm3, %xmm0 vmovss %xmm0, 0x68(%rsp) movq $0x0, 0x10(%rsp) movb (%r15), %al testb $0x1, %al jne 0xc5b75 movq 0x70(%rsp), %rax incq 0xb0(%rax) vmovsd 0x18(%r13), %xmm0 vmovsd 0x28(%r13), %xmm1 movzbl 0x10(%rsp), %edx movq 0x28(%rsp), %rdi leaq 0x18(%rsp), %rbx movq %rbp, %rsi movq %rbx, %rcx andl $0x1, %edx callq 0x46f82 vmovsd %xmm0, (%rsp) leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi movq %rbx, %rdx callq 0xc5d9e vcvtsd2ss (%rsp), %xmm3, %xmm0 movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF xorl %r14d, %r14d vmovss %xmm0, 0x60(%rsp) movb (%r15), %al testb $0x1, %al jne 0xc5976 cmpq 0xb0(%r13), %r14 je 0xc5976 vmovss 0x8(%rsp), %xmm1 vmovss 0xc(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi leaq 0x18(%rsp), %rdx movq %rbp, %rcx vmovss %xmm0, (%rsp) callq 0xc5de0 testl %eax, %eax je 0xc598e cmpl %eax, %ebx cmovgel %eax, %ebx cmpq 0x78(%rsp), %r14 jle 0xc5961 vcvtsi2ss %eax, %xmm3, %xmm0 vcvtsi2ssl 0x150(%rsp), %xmm3, %xmm1 vdivss %xmm1, %xmm0, %xmm0 vmovss 0x40(%rsp), %xmm1 callq 0xb530 vmovss (%rsp), %xmm1 vfmadd231ss 0x34(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovaps %xmm1, %xmm0 jmp 0xc5966 vmovss (%rsp), %xmm0 vucomiss 0x48(%rsp), %xmm0 ja 0xc5976 incq %r14 jmp 0xc58dd testl %ebx, %ebx jg 0xc5b55 leaq 0x18(%rsp), %rbx movq $0x0, 0x10(%rsp) jmp 0xc59c0 vmovsd 0x58(%rsp), %xmm0 movq 0x50(%rsp), %rdi leaq 0x18(%rsp), %rbx movq %rbx, %rsi callq 0x45118 movq 0x28(%rsp), %rdi movq %rbp, %rsi movq %rbx, %rdx movq %r14, %rcx callq 0x472d0 movb $0x1, %al movq %rax, 0x10(%rsp) xorl %r14d, %r14d movl $0x0, 0x38(%rsp) movb (%r15), %al testb $0x1, %al jne 0xc586d cmpl 0xbc(%r13), %r14d jge 0xc586d vmovss 0x6c(%rsp), %xmm0 vmovss 0x8(%rsp), %xmm1 vmovss 0xc(%rsp), %xmm2 vmovss 0x68(%rsp), %xmm3 leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi movq %rbx, %rdx movq %rbp, %rcx callq 0xc5fec testl %eax, %eax jne 0xc5a54 vmovsd 0x58(%rsp), %xmm0 movq 0x50(%rsp), %rdi movq %rbx, %rsi callq 0x45118 movl 0xc0(%r13), %eax movq 0x28(%rsp), %rdi movq %rbp, %rsi movq %rbx, %rdx imull %r14d, %eax notl %eax movslq %eax, %rcx callq 0x472d0 movb $0x1, %al movq %rax, 0x10(%rsp) pushq $0x1 popq %rax vmovss 0x60(%rsp), %xmm0 movl %eax, %ebx movb (%r15), %al testb $0x1, %al jne 0xc5aff leal -0x1(%rbx), %r12d cmpl 0xc0(%r13), %r12d jge 0xc5aff vmovss 0x8(%rsp), %xmm1 vmovss 0xc(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi leaq 0x18(%rsp), %rdx movq %rbp, %rcx vmovss %xmm0, (%rsp) callq 0xc5de0 testl %eax, %eax je 0xc5b06 vcvtsi2sd %r12d, %xmm4, %xmm0 vucomisd 0xa0(%r13), %xmm0 jbe 0xc5aeb vcvtsi2ss %eax, %xmm4, %xmm0 vcvtsi2ssl 0x150(%rsp), %xmm4, %xmm1 vdivss %xmm1, %xmm0, %xmm0 vmovss 0x40(%rsp), %xmm1 callq 0xb530 vmovss (%rsp), %xmm1 vfmadd231ss 0x34(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovaps %xmm1, %xmm0 jmp 0xc5af0 vmovss (%rsp), %xmm0 vucomiss 0x48(%rsp), %xmm0 ja 0xc5aff incl %ebx jmp 0xc5a5f leaq 0x18(%rsp), %rbx jmp 0xc5b49 vmovsd 0x58(%rsp), %xmm0 movq 0x50(%rsp), %rdi leaq 0x18(%rsp), %r12 movq %r12, %rsi callq 0x45118 movl 0xc0(%r13), %eax movq 0x28(%rsp), %rdi movq %rbp, %rsi movq %r12, %rdx imull 0x38(%rsp), %eax subl %ebx, %eax movq %r12, %rbx movslq %eax, %rcx callq 0x472d0 movb $0x1, %al movq %rax, 0x10(%rsp) decl 0x38(%rsp) incl %r14d jmp 0xc59cb movq 0xb0(%r13), %r8 movq 0x28(%rsp), %rdi leaq 0x18(%rsp), %rdx movq %rbp, %rsi movl %ebx, %ecx callq 0x47358 jmp 0xc5864 leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xc6240 leaq 0x80(%rsp), %rdi callq 0x4495c leaq 0x20(%rsp), %rdi callq 0x357fe addq $0x158, %rsp # imm = 0x158 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0xc5bbf movq %rax, %rbx jmp 0xc5be1 movq %rax, %rbx jmp 0xc5bee movq %rax, %rbx jmp 0xc5bfb jmp 0xc5bd1 jmp 0xc5bd1 jmp 0xc5bd1 jmp 0xc5bd1 leaq 0xa0(%rsp), %rdi movq %rax, %rbx callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xc6240 leaq 0x80(%rsp), %rdi callq 0x4495c leaq 0x20(%rsp), %rdi callq 0x357fe movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::solver_equalities_01coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::quadratic_cost_type<float> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&)
solver_equalities_01coeff(random_engine& rng_, int m_, int n_, const cost_type& c_, const std::vector<merged_constraint>& csts) : logger("solver_equalities_01coeff") , rng(rng_) , ap(csts, m_, n_) , P(std::make_unique<Float[]>(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_)) , c(c_) , m(m_) , n(n_) { for (int i = 0; i != m; ++i) { #if !defined(BARYONYX_FULL_OPTIMIZATION) // mscv 15.9.6 fail to build this line: // for ([[maybe_unused]] const auto& cst : csts[i].elements) // bx_ensures(cst.factor == 1); for (const auto& cst : csts[i].elements) bx_ensures(cst.factor == 1); #endif bx_ensures(csts[i].min == csts[i].max); b[i] = csts[i].min; } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movl %edx, %ebp leaq 0x39661c(%rip), %rdx # 0x45c241 movq %r9, %r12 movq %r8, 0x20(%rsp) movl %ecx, %r13d movq %rsi, %r14 movq %rdi, %rbx pushq $0x19 popq %rsi callq 0xb8418 movq %r14, 0x8(%rbx) leaq 0x10(%rbx), %r14 movq %r14, %rdi movq %r12, %rsi movl %ebp, %edx movl %r13d, %ecx callq 0x3a4ca movl 0x38(%rbx), %esi leaq 0x50(%rbx), %r15 movq %r15, %rdi movq %r14, 0x18(%rsp) callq 0x35bd8 movq %r12, %rdi movq %r15, 0x10(%rsp) leaq 0x58(%rbx), %r14 callq 0x3a89d movq %r14, 0x8(%rsp) movq %r14, %rdi movq %rax, %rsi callq 0xc627a leaq 0x60(%rbx), %r14 movslq %ebp, %r15 movq %r14, %rdi movq %r15, %rsi callq 0x28eb6 leaq 0x68(%rbx), %rdi movq %r15, %rsi callq 0x35bd8 movq 0x20(%rsp), %rax xorl %edx, %edx movq %rax, 0x70(%rbx) movl %ebp, 0x78(%rbx) movl %r13d, 0x7c(%rbx) movq (%r12), %rax movq 0x60(%rbx), %rcx movl %ebp, %esi cmpq %rsi, %rdx je 0xc5cff imulq $0x28, %rdx, %rdi leaq (%rax,%rdi), %rsi movq (%rax,%rdi), %r8 movq 0x8(%rax,%rdi), %rdi cmpq %rdi, %r8 je 0xc5cec cmpl $0x1, (%r8) leaq 0x8(%r8), %r8 je 0xc5cdb jmp 0xc5d0e movl 0x18(%rsi), %edi cmpl 0x1c(%rsi), %edi jne 0xc5d2f movl %edi, (%rcx,%rdx,4) incq %rdx movl 0x78(%rbx), %ebp jmp 0xc5cc3 addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x392715(%rip), %rdi # 0x45842a leaq 0x39653f(%rip), %rsi # 0x45c25b leaq 0x396548(%rip), %rdx # 0x45c26b leaq 0x394780(%rip), %rcx # 0x45a4aa callq 0x2813f leaq 0x3926f4(%rip), %rdi # 0x45842a leaq 0x396598(%rip), %rsi # 0x45c2d5 leaq 0x396527(%rip), %rdx # 0x45c26b leaq 0x3965a5(%rip), %rcx # 0x45c2f0 callq 0x2813f movq %r14, %rdi movq %rax, %r12 callq 0x28fb6 jmp 0xc5d60 movq %rax, %r12 movq 0x8(%rsp), %rdi callq 0xc62bc jmp 0xc5d6f movq %rax, %r12 movq 0x10(%rsp), %rdi callq 0x35c1a jmp 0xc5d7e movq %rax, %r12 movq 0x18(%rsp), %rdi callq 0x3a954 jmp 0xc5d8d movq %rax, %r12 movq %rbx, %rdi callq 0xb853a movq %r12, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float)
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 $0x20, %rsp movl 0x30(%rdi), %eax movq %rdx, %rbx movq %rsi, %r15 movq %rdi, %r14 decl %eax cmpl $0x6, %eax ja 0xc5f1f leaq 0x395f35(%rip), %rdx # 0x45bd3c movslq (%rdx,%rax,4), %rax addq %rdx, %rax jmpq *%rax movq 0x8(%r14), %rax leaq 0x18(%rsp), %rdx leaq 0x10(%rsp), %rcx movq %r15, %rdi movq %rbx, %rsi movq %rax, (%rdx) movq (%r14), %rax movq %rax, (%rcx) callq 0xc649c movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0xc63c9 addq $0x20, %rsp popq %rbx popq %r14 popq %r15 retq movq (%r14), %rdi movq 0x8(%r14), %rsi movq %r15, %rdx vmovss %xmm2, 0xc(%rsp) vmovss %xmm1, 0x8(%rsp) vmovss %xmm0, 0x4(%rsp) callq 0xc7e91 jmp 0xc5f54 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovss %xmm2, 0xc(%rsp) vmovss %xmm1, 0x8(%rsp) vmovss %xmm0, 0x4(%rsp) callq 0xc75bb jmp 0xc5eb0 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovss %xmm2, 0xc(%rsp) vmovss %xmm1, 0x8(%rsp) vmovss %xmm0, 0x4(%rsp) callq 0xc7a26 vmovss 0x4(%rsp), %xmm0 vmovss 0x8(%rsp), %xmm1 vmovss 0xc(%rsp), %xmm2 movq 0x18(%r14), %rdx movq 0x20(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xc6804 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0xc69b2 movq (%r14), %rdi movq 0x8(%r14), %rsi movq %rcx, %rdx vmovss %xmm2, 0xc(%rsp) vmovss %xmm1, 0x8(%rsp) vmovss %xmm0, 0x4(%rsp) callq 0x3ceed vmovss 0x4(%rsp), %xmm0 vmovss 0x8(%rsp), %xmm1 vmovss 0xc(%rsp), %xmm2 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xc6656 jmp 0xc5f78 movq (%r14), %rdi movq 0x8(%r14), %rsi movq %r15, %rdx vmovss %xmm2, 0xc(%rsp) vmovss %xmm1, 0x8(%rsp) vmovss %xmm0, 0x4(%rsp) callq 0xc8383 vmovss 0x4(%rsp), %xmm0 vmovss 0x8(%rsp), %xmm1 vmovss 0xc(%rsp), %xmm2 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xc6a98 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0xc63c9 movq (%r14), %rdi movq 0x8(%r14), %rsi movq %rcx, %rdx vmovss %xmm2, 0xc(%rsp) vmovss %xmm1, 0x8(%rsp) vmovss %xmm0, 0x4(%rsp) callq 0x3ceed vmovss 0x4(%rsp), %xmm0 vmovss 0x8(%rsp), %xmm1 vmovss 0xc(%rsp), %xmm2 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xc6656 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0xc6c46 nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float, float)
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 $0x20, %rsp movl 0x30(%rdi), %eax cmpb $0x1, 0x34(%rdi) movq %rdx, %rbx movq %rsi, %r15 movq %rdi, %r14 jne 0xc6018 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 0xc61b1 leaq 0x395d2e(%rip), %rdx # 0x45bd58 movslq (%rdx,%rax,4), %rax addq %rdx, %rax jmpq *%rax movq 0x8(%r14), %rax leaq 0x18(%rsp), %rdx leaq 0x10(%rsp), %rcx movq %r15, %rdi movq %rbx, %rsi movq %rax, (%rdx) movq (%r14), %rax movq %rax, (%rcx) callq 0xc887a movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0xc63c9 addq $0x20, %rsp popq %rbx popq %r14 popq %r15 retq movq (%r14), %rdi movq 0x8(%r14), %rsi movq %r15, %rdx vmovss %xmm3, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) callq 0xc98be jmp 0xc619a movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovss %xmm3, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) callq 0xc8fe8 jmp 0xc60e2 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovss %xmm3, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) callq 0xc9453 vmovss (%rsp), %xmm0 vmovss 0x4(%rsp), %xmm1 vmovss 0x8(%rsp), %xmm2 vmovss 0xc(%rsp), %xmm3 movq 0x18(%r14), %rdx movq 0x20(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xc8c38 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0xc69b2 movq (%r14), %rdi movq 0x8(%r14), %rsi movq %rcx, %rdx vmovss %xmm3, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) callq 0x3ceed vmovss (%rsp), %xmm0 vmovss 0x4(%rsp), %xmm1 vmovss 0x8(%rsp), %xmm2 vmovss 0xc(%rsp), %xmm3 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xc8a60 jmp 0xc61c3 movq (%r14), %rdi movq 0x8(%r14), %rsi movq %r15, %rdx vmovss %xmm3, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) callq 0xc9db0 vmovss (%rsp), %xmm0 vmovss 0x4(%rsp), %xmm1 vmovss 0x8(%rsp), %xmm2 vmovss 0xc(%rsp), %xmm3 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xc8e10 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0xc63c9 movq (%r14), %rdi movq 0x8(%r14), %rsi movq %rcx, %rdx vmovss %xmm3, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) callq 0x3ceed vmovss (%rsp), %xmm0 vmovss 0x4(%rsp), %xmm1 vmovss 0x8(%rsp), %xmm2 vmovss 0xc(%rsp), %xmm3 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xc8a60 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0xc6c46
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::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>>>>, float, float, float)
bool compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta) { auto at_least_one_pi_changed{ false }; logger::log("update-row {} {} {}\n", kappa, delta, theta); for (; first != last; ++first) { auto k = constraint(first); const auto it = ap.row(k); decrease_preference(std::get<0>(it), std::get<1>(it), theta); const auto r_size = compute_reduced_costs(std::get<0>(it), std::get<1>(it), x); calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int selected = select_variables(r_size, b[k]); logger::log("constraints {}: {} = ", k, b[k]); for (int i = 0; i < r_size; ++i) logger::log("{} ({}) ", R[i].value, R[i].id); logger::log(" => Selected: {}\n", selected); auto pi_change = affect( *this, x, std::get<0>(it), k, selected, r_size, kappa, delta); at_least_one_pi_changed = at_least_one_pi_changed || pi_change; } return at_least_one_pi_changed; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rcx, 0x48(%rsp) movq %rdx, %rbx leaq 0x1c(%rsp), %rcx leaq 0x18(%rsp), %r8 leaq 0x14(%rsp), %r9 leaq 0x395e7c(%rip), %rdx # 0x45c344 movq %rsi, %r14 movq %rdi, %r12 vmovss %xmm0, (%rcx) vmovss %xmm1, (%r8) vmovss %xmm2, (%r9) pushq $0x14 popq %rsi callq 0xb907e leaq 0x10(%r12), %rax movq %rbx, 0x40(%rsp) xorl %edx, %edx movq %rax, 0x30(%rsp) movq (%rbx), %rax leaq 0x395e14(%rip), %rbx # 0x45c313 pushq $0x8 popq %rbp movq %r14, 0x38(%rsp) movq 0x48(%rsp), %rcx cmpq (%rcx), %rax je 0xc6642 movq %rdx, 0x50(%rsp) movl -0x4(%rax), %edx movq 0x30(%rsp), %rsi leaq 0x20(%rsp), %rdi movl %edx, 0xc(%rsp) callq 0x3de66 vmovss 0x14(%rsp), %xmm0 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi callq 0xc6c86 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi movq %r14, %rcx callq 0xc6ca4 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r14 movl %eax, %r15d leaq (%rdi,%r14,8), %rsi callq 0xc6d71 movslq 0xc(%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r14d cmovll %r14d, %eax decl %eax movl %eax, 0x10(%rsp) pushq $0x15 popq %rsi leaq 0x395d5c(%rip), %rdx # 0x45c2fd leaq 0xc(%rsp), %rcx callq 0xb91c2 movl %r14d, %eax sarl $0x1f, %eax xorl %r13d, %r13d andnl %r14d, %eax, %r14d shlq $0x3, %r14 cmpq %r13, %r14 je 0xc65e3 movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x4(%rcx,%r13), %r8 addq %r13, %rcx callq 0xb91f0 addq $0x8, %r13 jmp 0xc65bd movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x39aa71(%rip), %rdx # 0x461061 leaq 0x10(%rsp), %rcx callq 0xb921e vmovss 0x1c(%rsp), %xmm0 vmovss 0x18(%rsp), %xmm1 movq 0x38(%rsp), %r14 movq 0x28(%rsp), %rdx movl 0xc(%rsp), %ecx movl 0x10(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r14, %rsi callq 0xc6da4 movq 0x50(%rsp), %rdx movq 0x40(%rsp), %rcx orb %al, %dl movq (%rcx), %rax addq $-0x4, %rax movq %rax, (%rcx) jmp 0xc6507 andb $0x1, %dl movl %edx, %eax addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::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>>>, float, float, float)
bool compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta) { auto at_least_one_pi_changed{ false }; logger::log("update-row {} {} {}\n", kappa, delta, theta); for (; first != last; ++first) { auto k = constraint(first); const auto it = ap.row(k); decrease_preference(std::get<0>(it), std::get<1>(it), theta); const auto r_size = compute_reduced_costs(std::get<0>(it), std::get<1>(it), x); calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int selected = select_variables(r_size, b[k]); logger::log("constraints {}: {} = ", k, b[k]); for (int i = 0; i < r_size; ++i) logger::log("{} ({}) ", R[i].value, R[i].id); logger::log(" => Selected: {}\n", selected); auto pi_change = affect( *this, x, std::get<0>(it), k, selected, r_size, kappa, delta); at_least_one_pi_changed = at_least_one_pi_changed || pi_change; } return at_least_one_pi_changed; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rcx, 0x40(%rsp) leaq 0x1c(%rsp), %rcx leaq 0x18(%rsp), %r8 leaq 0x14(%rsp), %r9 movq %rdx, %r14 movq %rsi, %r13 movq %rdi, %r12 leaq 0x395cbc(%rip), %rdx # 0x45c344 vmovss %xmm0, (%rcx) vmovss %xmm1, (%r8) vmovss %xmm2, (%r9) pushq $0x14 popq %rsi callq 0xb907e leaq 0x10(%r12), %rax leaq 0x395c69(%rip), %rbx # 0x45c313 movq %rax, 0x30(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x38(%rsp) cmpq 0x40(%rsp), %r14 je 0xc67f3 movl (%r14), %edx movq 0x30(%rsp), %rsi leaq 0x20(%rsp), %rdi movq %rax, 0x48(%rsp) movq %r14, 0x50(%rsp) movl %edx, 0xc(%rsp) callq 0x3de66 vmovss 0x14(%rsp), %xmm0 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi callq 0xc6c86 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0xc6ca4 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r14 movl %eax, %r15d leaq (%rdi,%r14,8), %rsi callq 0xc6d71 movslq 0xc(%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r14d cmovll %r14d, %eax decl %eax movl %eax, 0x10(%rsp) pushq $0x15 popq %rsi leaq 0x395ba8(%rip), %rdx # 0x45c2fd leaq 0xc(%rsp), %rcx callq 0xb91c2 movl %r14d, %eax sarl $0x1f, %eax andnl %r14d, %eax, %r13d xorl %r14d, %r14d shlq $0x3, %r13 cmpq %r14, %r13 je 0xc6797 movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x4(%rcx,%r14), %r8 addq %r14, %rcx callq 0xb91f0 addq $0x8, %r14 jmp 0xc6771 movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x39a8bd(%rip), %rdx # 0x461061 leaq 0x10(%rsp), %rcx callq 0xb921e vmovss 0x1c(%rsp), %xmm0 vmovss 0x18(%rsp), %xmm1 movq 0x38(%rsp), %r13 movq 0x28(%rsp), %rdx movl 0xc(%rsp), %ecx movl 0x10(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r13, %rsi callq 0xc6da4 movq 0x48(%rsp), %rcx movq 0x50(%rsp), %r14 orb %al, %cl addq $0x4, %r14 movq %rcx, %rax jmp 0xc66b9 andb $0x1, %al addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::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>>>>, float, float, float)
bool compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta) { auto at_least_one_pi_changed{ false }; logger::log("update-row {} {} {}\n", kappa, delta, theta); for (; first != last; ++first) { auto k = constraint(first); const auto it = ap.row(k); decrease_preference(std::get<0>(it), std::get<1>(it), theta); const auto r_size = compute_reduced_costs(std::get<0>(it), std::get<1>(it), x); calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int selected = select_variables(r_size, b[k]); logger::log("constraints {}: {} = ", k, b[k]); for (int i = 0; i < r_size; ++i) logger::log("{} ({}) ", R[i].value, R[i].id); logger::log(" => Selected: {}\n", selected); auto pi_change = affect( *this, x, std::get<0>(it), k, selected, r_size, kappa, delta); at_least_one_pi_changed = at_least_one_pi_changed || pi_change; } return at_least_one_pi_changed; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rcx, 0x40(%rsp) leaq 0x1c(%rsp), %rcx leaq 0x18(%rsp), %r8 leaq 0x14(%rsp), %r9 movq %rdx, %r14 movq %rsi, %r13 movq %rdi, %r12 leaq 0x395b0e(%rip), %rdx # 0x45c344 vmovss %xmm0, (%rcx) vmovss %xmm1, (%r8) vmovss %xmm2, (%r9) pushq $0x14 popq %rsi callq 0xb907e leaq 0x10(%r12), %rax leaq 0x395abb(%rip), %rbx # 0x45c313 movq %rax, 0x30(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x38(%rsp) cmpq 0x40(%rsp), %r14 je 0xc69a1 movl (%r14), %edx movq 0x30(%rsp), %rsi leaq 0x20(%rsp), %rdi movq %rax, 0x48(%rsp) movq %r14, 0x50(%rsp) movl %edx, 0xc(%rsp) callq 0x3de66 vmovss 0x14(%rsp), %xmm0 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi callq 0xc6c86 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0xc6ca4 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r14 movl %eax, %r15d leaq (%rdi,%r14,8), %rsi callq 0xc6d71 movslq 0xc(%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r14d cmovll %r14d, %eax decl %eax movl %eax, 0x10(%rsp) pushq $0x15 popq %rsi leaq 0x3959fa(%rip), %rdx # 0x45c2fd leaq 0xc(%rsp), %rcx callq 0xb91c2 movl %r14d, %eax sarl $0x1f, %eax andnl %r14d, %eax, %r13d xorl %r14d, %r14d shlq $0x3, %r13 cmpq %r14, %r13 je 0xc6945 movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x4(%rcx,%r14), %r8 addq %r14, %rcx callq 0xb91f0 addq $0x8, %r14 jmp 0xc691f movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x39a70f(%rip), %rdx # 0x461061 leaq 0x10(%rsp), %rcx callq 0xb921e vmovss 0x1c(%rsp), %xmm0 vmovss 0x18(%rsp), %xmm1 movq 0x38(%rsp), %r13 movq 0x28(%rsp), %rdx movl 0xc(%rsp), %ecx movl 0x10(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r13, %rsi callq 0xc6da4 movq 0x48(%rsp), %rcx movq 0x50(%rsp), %r14 orb %al, %cl addq $0x8, %r14 movq %rcx, %rax jmp 0xc6867 andb $0x1, %al addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>&, 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, 0x20(%rsp) cmpq %rax, 0x20(%rdi) je 0xc69d6 movq %rax, 0x20(%rdi) movq 0x20(%rsp), %rcx leaq 0x18(%rdi), %rax movq %rdi, 0x28(%rsp) xorl %ebp, %ebp movq %rax, 0x18(%rsp) movl 0x78(%rcx), %r12d leaq 0x10(%rcx), %rax movq %rax, 0x30(%rsp) cmpq %r12, %rbp je 0xc6a77 movq 0x30(%rsp), %rsi leaq 0x8(%rsp), %rdi movl %ebp, %edx callq 0x3de66 movq 0x8(%rsp), %r15 movq 0x10(%rsp), %r13 xorl %ebx, %ebx cmpq %r15, %r13 je 0xc6a33 movl 0x4(%r13), %esi movq %r14, %rdi callq 0x3664a addl %eax, %ebx addq $0x8, %r13 jmp 0xc6a1a movq 0x20(%rsp), %rax movq 0x60(%rax), %rax movl (%rax,%rbp,4), %eax movl %eax, %ecx subl %ebx, %ecx jle 0xc6a53 shlq $0x20, %rcx orq %rbp, %rcx movq %rcx, 0x8(%rsp) jmp 0xc6a63 jge 0xc6a72 subl %eax, %ebx shlq $0x20, %rbx orq %rbp, %rbx movq %rbx, 0x8(%rsp) movq 0x18(%rsp), %rdi leaq 0x8(%rsp), %rsi callq 0x3c8c2 incq %rbp jmp 0xc69f8 movq 0x28(%rsp), %rcx movq 0x20(%rcx), %rax subq 0x18(%rcx), %rax shrq $0x3, %rax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::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>>>, float, float, float)
bool compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta) { auto at_least_one_pi_changed{ false }; logger::log("update-row {} {} {}\n", kappa, delta, theta); for (; first != last; ++first) { auto k = constraint(first); const auto it = ap.row(k); decrease_preference(std::get<0>(it), std::get<1>(it), theta); const auto r_size = compute_reduced_costs(std::get<0>(it), std::get<1>(it), x); calculator_sort<Mode>(R.get(), R.get() + r_size, rng); int selected = select_variables(r_size, b[k]); logger::log("constraints {}: {} = ", k, b[k]); for (int i = 0; i < r_size; ++i) logger::log("{} ({}) ", R[i].value, R[i].id); logger::log(" => Selected: {}\n", selected); auto pi_change = affect( *this, x, std::get<0>(it), k, selected, r_size, kappa, delta); at_least_one_pi_changed = at_least_one_pi_changed || pi_change; } return at_least_one_pi_changed; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rcx, 0x40(%rsp) leaq 0x1c(%rsp), %rcx leaq 0x18(%rsp), %r8 leaq 0x14(%rsp), %r9 movq %rdx, %r14 movq %rsi, %r13 movq %rdi, %r12 leaq 0x39587a(%rip), %rdx # 0x45c344 vmovss %xmm0, (%rcx) vmovss %xmm1, (%r8) vmovss %xmm2, (%r9) pushq $0x14 popq %rsi callq 0xb907e leaq 0x10(%r12), %rax leaq 0x395827(%rip), %rbx # 0x45c313 movq %rax, 0x30(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x38(%rsp) cmpq 0x40(%rsp), %r14 je 0xc6c35 movl (%r14), %edx movq 0x30(%rsp), %rsi leaq 0x20(%rsp), %rdi movq %rax, 0x48(%rsp) movq %r14, 0x50(%rsp) movl %edx, 0xc(%rsp) callq 0x3de66 vmovss 0x14(%rsp), %xmm0 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi callq 0xc6c86 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0xc6ca4 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r14 movl %eax, %r15d leaq (%rdi,%r14,8), %rsi callq 0xc6d71 movslq 0xc(%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r14d cmovll %r14d, %eax decl %eax movl %eax, 0x10(%rsp) pushq $0x15 popq %rsi leaq 0x395766(%rip), %rdx # 0x45c2fd leaq 0xc(%rsp), %rcx callq 0xb91c2 movl %r14d, %eax sarl $0x1f, %eax andnl %r14d, %eax, %r13d xorl %r14d, %r14d shlq $0x3, %r13 cmpq %r14, %r13 je 0xc6bd9 movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x4(%rcx,%r14), %r8 addq %r14, %rcx callq 0xb91f0 addq $0x8, %r14 jmp 0xc6bb3 movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x39a47b(%rip), %rdx # 0x461061 leaq 0x10(%rsp), %rcx callq 0xb921e vmovss 0x1c(%rsp), %xmm0 vmovss 0x18(%rsp), %xmm1 movq 0x38(%rsp), %r13 movq 0x28(%rsp), %rdx movl 0xc(%rsp), %ecx movl 0x10(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r13, %rsi callq 0xc6da4 movq 0x48(%rsp), %rcx movq 0x50(%rsp), %r14 orb %al, %cl addq $0x4, %r14 movq %rcx, %rax jmp 0xc6afb andb $0x1, %al addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true> 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 0x78(%r14), %r15d je 0xc6c78 movq %r14, %rdi movl %r15d, %esi movq %rbx, %rdx callq 0xc6431 xorb $0x1, %al incl %r15d movzbl %al, %eax addl %eax, %ebp jmp 0xc6c58 movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::compute_reduced_costs<baryonyx::bit_array>(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, baryonyx::bit_array const&)
int compute_reduced_costs(sparse_matrix<int>::row_iterator begin, sparse_matrix<int>::row_iterator end, const Xtype& x) noexcept { int r_size = 0; for (; begin != end; ++begin) { Float sum_a_pi = 0; Float sum_a_p = 0; auto ht = ap.column(begin->column); for (; std::get<0>(ht) != std::get<1>(ht); ++std::get<0>(ht)) { sum_a_pi += pi[std::get<0>(ht)->row]; sum_a_p += P[std::get<0>(ht)->value]; } R[r_size].id = r_size; R[r_size].value = c(begin->column, x) - sum_a_pi - sum_a_p; ++r_size; } return r_size; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp leaq 0x10(%rdi), %rbp movq %rcx, %rbx movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r13 xorl %r12d, %r12d cmpq %r14, %r15 je 0xc6d5f movl 0x4(%r15), %edx leaq 0x8(%rsp), %rdi movq %rbp, %rsi callq 0x3dede movq 0x8(%rsp), %rax movq 0x10(%rsp), %rcx movq 0x50(%r13), %rdx movq 0x68(%r13), %rsi vxorps %xmm0, %xmm0, %xmm0 vxorps %xmm1, %xmm1, %xmm1 cmpq %rax, %rcx je 0xc6d1a movslq 0x4(%rcx), %rdi vaddss (%rsi,%rdi,4), %xmm0, %xmm0 movslq (%rcx), %rdi addq $0x8, %rcx vaddss (%rdx,%rdi,4), %xmm1, %xmm1 movq %rcx, 0x10(%rsp) jmp 0xc6cf9 movq 0x58(%r13), %rax movq %rbx, %rdx vmovss %xmm0, (%rsp) vmovss %xmm1, 0x4(%rsp) movl %r12d, 0x4(%rax,%r12,8) movq 0x70(%r13), %rdi movl 0x4(%r15), %esi callq 0x49ffa vsubss (%rsp), %xmm0, %xmm0 movq 0x58(%r13), %rax addq $0x8, %r15 vsubss 0x4(%rsp), %xmm0, %xmm0 vmovss %xmm0, (%rax,%r12,8) incq %r12 jmp 0xc6cc5 movl %r12d, %eax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp