name
stringlengths
1
473k
code
stringlengths
7
647k
asm
stringlengths
4
3.39M
file
stringlengths
8
196
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_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 0x37a54a(%rip), %rdx # 0x45c344 vmovss %xmm0, (%rcx) vmovss %xmm1, (%r8) vmovss %xmm2, (%r9) pushq $0x14 popq %rsi callq 0xb907e leaq 0x10(%r12), %rax leaq 0x37a4f7(%rip), %rbx # 0x45c313 movq %rax, 0x30(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x38(%rsp) cmpq 0x40(%rsp), %r14 je 0xe1f65 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 0xe224a movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0xe2268 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r14 movl %eax, %r15d leaq (%rdi,%r14,8), %rsi callq 0xe2335 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 0x37a436(%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 0xe1f09 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 0xe1ee3 movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x37f14b(%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 0xe2368 movq 0x48(%rsp), %rcx movq 0x50(%rsp), %r14 orb %al, %cl addq $0x8, %r14 movq %rcx, %rax jmp 0xe1e2b 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::minimize_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 0x37a2b6(%rip), %rdx # 0x45c344 vmovss %xmm0, (%rcx) vmovss %xmm1, (%r8) vmovss %xmm2, (%r9) pushq $0x14 popq %rsi callq 0xb907e leaq 0x10(%r12), %rax leaq 0x37a263(%rip), %rbx # 0x45c313 movq %rax, 0x30(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x38(%rsp) cmpq 0x40(%rsp), %r14 je 0xe21f9 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 0xe224a movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0xe2268 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r14 movl %eax, %r15d leaq (%rdi,%r14,8), %rsi callq 0xe2335 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 0x37a1a2(%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 0xe219d 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 0xe2177 movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x37eeb7(%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 0xe2368 movq 0x48(%rsp), %rcx movq 0x50(%rsp), %r14 orb %al, %cl addq $0x4, %r14 movq %rcx, %rax jmp 0xe20bf 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::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_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 0xe223c movq %r14, %rdi movl %r15d, %esi movq %rbx, %rdx callq 0xe19f5 xorb $0x1, %al incl %r15d movzbl %al, %eax addl %eax, %ebp jmp 0xe221c 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::minimize_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 0xe2323 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 0xe22de 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 0xe22bd 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 0xe2289 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
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::rc_data*>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::rc_data*, baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::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 0x8(%rdi), %rsi cmpq %r14, %rsi je 0xe25ec vmovss (%rdi), %xmm0 leaq 0x8(%rsi), %r15 vucomiss (%rsi), %xmm0 movq %r15, %rsi jne 0xe25d8 jnp 0xe25c0 addq $-0x8, %r15 movq %r15, %rsi movq %rbx, %rdx callq 0xe2a53 movq %r15, %rdi jmp 0xe25bc movq %rbx, %rdx callq 0xe2a53 popq %rbx popq %r14 popq %r15 retq jmp 0xe25fc movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::push_and_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, 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 $0x48, %rsp movq %rcx, 0x38(%rsp) movq %rdx, %rbx leaq 0x14(%rsp), %rcx leaq 0x10(%rsp), %r8 leaq 0xc(%rsp), %r9 leaq 0x3784d5(%rip), %rdx # 0x45c33f vmovss %xmm3, 0x8(%rsp) movq %rsi, %r15 movq %rdi, %r12 vmovss %xmm0, (%rcx) vmovss %xmm1, (%r8) vmovss %xmm2, (%r9) pushq $0x19 popq %rsi callq 0xb907e leaq 0x10(%r12), %rax movq %rbx, 0x30(%rsp) xorl %edx, %edx movq %rax, 0x28(%rsp) movq (%rbx), %rax pushq $0x8 popq %rbp movq 0x38(%rsp), %rcx cmpq (%rcx), %rax je 0xe400f movq %rdx, 0x40(%rsp) movl -0x4(%rax), %edx movq 0x28(%rsp), %rsi leaq 0x18(%rsp), %rdi movl %edx, (%rsp) callq 0x3de66 vmovss 0xc(%rsp), %xmm0 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi callq 0xe224a movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0xe2268 movl %eax, %r14d xorl %r13d, %r13d cmpq %r13, %r14 je 0xe3f36 movq 0x58(%r12), %rax movq 0x70(%r12), %rdi movq %r15, %rdx movl 0x4(%rax,%r13,8), %esi callq 0x49ffa movq 0x58(%r12), %rax vmovss 0x8(%rsp), %xmm1 vfmadd213ss (%rax,%r13,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovss %xmm0, (%rax,%r13,8) incq %r13 jmp 0xe3efe movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %r14d, %rbx leaq (%rdi,%rbx,8), %rsi callq 0xe2335 movslq (%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %ebx cmovll %ebx, %eax decl %eax movl %eax, 0x4(%rsp) pushq $0x15 popq %rsi leaq 0x378389(%rip), %rdx # 0x45c2fd movq %rsp, %rcx callq 0xb91c2 movl %ebx, %eax sarl $0x1f, %eax andnl %ebx, %eax, %r13d xorl %ebx, %ebx shlq $0x3, %r13 cmpq %rbx, %r13 je 0xe3fb6 movq 0x58(%r12), %rcx leaq 0x378376(%rip), %rdx # 0x45c313 movq %r12, %rdi movq %rbp, %rsi leaq 0x4(%rcx,%rbx), %r8 addq %rbx, %rcx callq 0xb91f0 addq $0x8, %rbx jmp 0xe3f8c movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x37d09e(%rip), %rdx # 0x461061 leaq 0x4(%rsp), %rcx callq 0xb921e vmovss 0x14(%rsp), %xmm0 vmovss 0x10(%rsp), %xmm1 movq 0x20(%rsp), %rdx movl (%rsp), %ecx movl 0x4(%rsp), %r8d movq %r12, %rdi movq %r15, %rsi movl %r14d, %r9d callq 0xe2368 movq 0x40(%rsp), %rdx movq 0x30(%rsp), %rcx orb %al, %dl movq (%rcx), %rax addq $-0x4, %rax movq %rax, (%rcx) jmp 0xe3ea3 andb $0x1, %dl movl %edx, %eax addq $0x48, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::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 $0x48, %rsp movq %rcx, 0x30(%rsp) leaq 0x14(%rsp), %rcx leaq 0x10(%rsp), %r8 leaq 0xc(%rsp), %r9 movq %rdx, %rbx vmovss %xmm3, 0x8(%rsp) movq %rsi, %r15 movq %rdi, %r12 leaq 0x3782e3(%rip), %rdx # 0x45c33f vmovss %xmm0, (%rcx) vmovss %xmm1, (%r8) vmovss %xmm2, (%r9) pushq $0x19 popq %rsi callq 0xb907e leaq 0x10(%r12), %rax movq %rax, 0x28(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp cmpq 0x30(%rsp), %rbx je 0xe41eb movl (%rbx), %edx movq 0x28(%rsp), %rsi leaq 0x18(%rsp), %rdi movq %rax, 0x38(%rsp) movl %edx, (%rsp) callq 0x3de66 vmovss 0xc(%rsp), %xmm0 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi callq 0xe224a movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0xe2268 movl %eax, %r13d xorl %r14d, %r14d cmpq %r14, %r13 je 0xe4110 movq 0x58(%r12), %rax movq 0x70(%r12), %rdi movq %r15, %rdx movl 0x4(%rax,%r14,8), %esi callq 0x49ffa movq 0x58(%r12), %rax vmovss 0x8(%rsp), %xmm1 vfmadd213ss (%rax,%r14,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovss %xmm0, (%rax,%r14,8) incq %r14 jmp 0xe40d8 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movq %rbx, 0x40(%rsp) movslq %r13d, %rbx leaq (%rdi,%rbx,8), %rsi callq 0xe2335 movslq (%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %ebx cmovll %ebx, %eax decl %eax movl %eax, 0x4(%rsp) pushq $0x15 popq %rsi leaq 0x3781aa(%rip), %rdx # 0x45c2fd movq %rsp, %rcx callq 0xb91c2 movl %ebx, %eax sarl $0x1f, %eax andnl %ebx, %eax, %r14d xorl %ebx, %ebx shlq $0x3, %r14 cmpq %rbx, %r14 je 0xe4195 movq 0x58(%r12), %rcx leaq 0x378197(%rip), %rdx # 0x45c313 movq %r12, %rdi movq %rbp, %rsi leaq 0x4(%rcx,%rbx), %r8 addq %rbx, %rcx callq 0xb91f0 addq $0x8, %rbx jmp 0xe416b movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x37cebf(%rip), %rdx # 0x461061 leaq 0x4(%rsp), %rcx callq 0xb921e vmovss 0x14(%rsp), %xmm0 vmovss 0x10(%rsp), %xmm1 movq 0x20(%rsp), %rdx movl (%rsp), %ecx movl 0x4(%rsp), %r8d movq %r12, %rdi movq %r15, %rsi movl %r13d, %r9d callq 0xe2368 movq 0x38(%rsp), %rcx movq 0x40(%rsp), %rbx orb %al, %cl addq $0x4, %rbx movq %rcx, %rax jmp 0xe4081 andb $0x1, %al addq $0x48, %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::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::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 $0x48, %rsp movq %rcx, 0x30(%rsp) leaq 0x14(%rsp), %rcx leaq 0x10(%rsp), %r8 leaq 0xc(%rsp), %r9 movq %rdx, %rbx vmovss %xmm3, 0x8(%rsp) movq %rsi, %r15 movq %rdi, %r12 leaq 0x37810b(%rip), %rdx # 0x45c33f vmovss %xmm0, (%rcx) vmovss %xmm1, (%r8) vmovss %xmm2, (%r9) pushq $0x19 popq %rsi callq 0xb907e leaq 0x10(%r12), %rax movq %rax, 0x28(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp cmpq 0x30(%rsp), %rbx je 0xe43c3 movl (%rbx), %edx movq 0x28(%rsp), %rsi leaq 0x18(%rsp), %rdi movq %rax, 0x38(%rsp) movl %edx, (%rsp) callq 0x3de66 vmovss 0xc(%rsp), %xmm0 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi callq 0xe224a movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0xe2268 movl %eax, %r13d xorl %r14d, %r14d cmpq %r14, %r13 je 0xe42e8 movq 0x58(%r12), %rax movq 0x70(%r12), %rdi movq %r15, %rdx movl 0x4(%rax,%r14,8), %esi callq 0x49ffa movq 0x58(%r12), %rax vmovss 0x8(%rsp), %xmm1 vfmadd213ss (%rax,%r14,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovss %xmm0, (%rax,%r14,8) incq %r14 jmp 0xe42b0 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movq %rbx, 0x40(%rsp) movslq %r13d, %rbx leaq (%rdi,%rbx,8), %rsi callq 0xe2335 movslq (%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %ebx cmovll %ebx, %eax decl %eax movl %eax, 0x4(%rsp) pushq $0x15 popq %rsi leaq 0x377fd2(%rip), %rdx # 0x45c2fd movq %rsp, %rcx callq 0xb91c2 movl %ebx, %eax sarl $0x1f, %eax andnl %ebx, %eax, %r14d xorl %ebx, %ebx shlq $0x3, %r14 cmpq %rbx, %r14 je 0xe436d movq 0x58(%r12), %rcx leaq 0x377fbf(%rip), %rdx # 0x45c313 movq %r12, %rdi movq %rbp, %rsi leaq 0x4(%rcx,%rbx), %r8 addq %rbx, %rcx callq 0xb91f0 addq $0x8, %rbx jmp 0xe4343 movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x37cce7(%rip), %rdx # 0x461061 leaq 0x4(%rsp), %rcx callq 0xb921e vmovss 0x14(%rsp), %xmm0 vmovss 0x10(%rsp), %xmm1 movq 0x20(%rsp), %rdx movl (%rsp), %ecx movl 0x4(%rsp), %r8d movq %r12, %rdi movq %r15, %rsi movl %r13d, %r9d callq 0xe2368 movq 0x38(%rsp), %rcx movq 0x40(%rsp), %rbx orb %al, %cl addq $0x8, %rbx movq %rcx, %rax jmp 0xe4259 andb $0x1, %al addq $0x48, %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::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, 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 0xe6dfc pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xe6e76 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_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, 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 0x372c21(%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::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::none_observer>::store_if_better(baryonyx::bit_array const&, double, long)
void store_if_better(const bit_array& x, double current, long int i) { if (is_better_solution<Mode>(current, m_best.value)) { m_best.x = x; m_best.duration = duration(); m_best.loop = i; m_best.remaining_constraints = 0; m_best.value = current; } }
vmovsd 0x30(%rdi), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xe6ee2 pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xe6f5c 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_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_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 0x372b3b(%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::optimize_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::minimize_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::minimize_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 0xe7451 movq 0x70(%rsp), %rax movq (%rax), %rdi leaq 0x80(%rsp), %rsi movl %ebx, %edx callq 0x46ce1 vmovss %xmm0, 0x8(%rsp) jmp 0xe745b 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 0xe78aa 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 0xe7811 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 0x5b276 vmovsd %xmm0, (%rsp) leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi movq %rbx, %rdx callq 0xe7a1a vcvtsd2ss (%rsp), %xmm3, %xmm0 movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF xorl %r14d, %r14d vmovss %xmm0, 0x60(%rsp) movb (%r15), %al testb $0x1, %al jne 0xe7612 cmpq 0xb0(%r13), %r14 je 0xe7612 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 0xe7a5c testl %eax, %eax je 0xe762a cmpl %eax, %ebx cmovgel %eax, %ebx cmpq 0x78(%rsp), %r14 jle 0xe75fd 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 0xe7602 vmovss (%rsp), %xmm0 vucomiss 0x48(%rsp), %xmm0 ja 0xe7612 incq %r14 jmp 0xe7579 testl %ebx, %ebx jg 0xe77f1 leaq 0x18(%rsp), %rbx movq $0x0, 0x10(%rsp) jmp 0xe765c 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 0x5b5c4 movb $0x1, %al movq %rax, 0x10(%rsp) xorl %r14d, %r14d movl $0x0, 0x38(%rsp) movb (%r15), %al testb $0x1, %al jne 0xe7509 cmpl 0xbc(%r13), %r14d jge 0xe7509 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 0xe7c68 testl %eax, %eax jne 0xe76f0 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 0x5b5c4 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 0xe779b leal -0x1(%rbx), %r12d cmpl 0xc0(%r13), %r12d jge 0xe779b 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 0xe7a5c testl %eax, %eax je 0xe77a2 vcvtsi2sd %r12d, %xmm4, %xmm0 vucomisd 0xa0(%r13), %xmm0 jbe 0xe7787 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 0xe778c vmovss (%rsp), %xmm0 vucomiss 0x48(%rsp), %xmm0 ja 0xe779b incl %ebx jmp 0xe76fb leaq 0x18(%rsp), %rbx jmp 0xe77e5 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 0x5b5c4 movb $0x1, %al movq %rax, 0x10(%rsp) decl 0x38(%rsp) incl %r14d jmp 0xe7667 movq 0xb0(%r13), %r8 movq 0x28(%rsp), %rdi leaq 0x18(%rsp), %rdx movq %rbp, %rsi movl %ebx, %ecx callq 0x5b64c jmp 0xe7500 leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xe7ebc 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 0xe785b movq %rax, %rbx jmp 0xe787d movq %rax, %rbx jmp 0xe788a movq %rax, %rbx jmp 0xe7897 jmp 0xe786d jmp 0xe786d jmp 0xe786d jmp 0xe786d leaq 0xa0(%rsp), %rdi movq %rax, %rbx callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xe7ebc 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::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::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 andq $0x0, (%rdi) leaq 0x10(%rdi), %r14 movq %rsi, 0x8(%rdi) movq %rdi, %rbx movq %r9, %r12 movq %r8, 0x20(%rsp) movl %ecx, %r13d movl %edx, %ebp movq %r9, %rsi movq %r14, %rdi 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 0xe7ef1 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 0xe7988 imulq $0x28, %rdx, %rdi leaq (%rax,%rdi), %rsi movq (%rax,%rdi), %r8 movq 0x8(%rax,%rdi), %rdi cmpq %rdi, %r8 je 0xe7975 cmpl $0x1, (%r8) leaq 0x8(%r8), %r8 je 0xe7964 jmp 0xe7997 movl 0x18(%rsi), %edi cmpl 0x1c(%rsi), %edi jne 0xe79b8 movl %edi, (%rcx,%rdx,4) incq %rdx movl 0x78(%rbx), %ebp jmp 0xe794c addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x370a8c(%rip), %rdi # 0x45842a leaq 0x3748b6(%rip), %rsi # 0x45c25b leaq 0x3748bf(%rip), %rdx # 0x45c26b leaq 0x372af7(%rip), %rcx # 0x45a4aa callq 0x2813f leaq 0x370a6b(%rip), %rdi # 0x45842a leaq 0x37490f(%rip), %rsi # 0x45c2d5 leaq 0x37489e(%rip), %rdx # 0x45c26b leaq 0x37491c(%rip), %rcx # 0x45c2f0 callq 0x2813f movq %r14, %rdi movq %rax, %rbx callq 0x28fb6 jmp 0xe79e9 movq %rax, %rbx movq 0x8(%rsp), %rdi callq 0xe7f32 jmp 0xe79f8 movq %rax, %rbx movq 0x10(%rsp), %rdi callq 0x35c1a jmp 0xe7a07 movq %rax, %rbx movq 0x18(%rsp), %rdi callq 0x3a954 movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false> 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 0xe7a30 movq %rax, %rdi jmp 0xe7f5a cmpl $0x7, %ecx jne 0xe7a4d movq (%rax), %rcx movq 0x8(%rax), %rax xorl %edx, %edx cmpq %rax, %rcx je 0xe7a5b movl %edx, (%rcx) incl %edx addq $0x4, %rcx jmp 0xe7a3e movq %rsi, %rdi movq %rdx, %rsi movq %rax, %rdx jmp 0xe803f retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>&, 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 0xe7c94 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 0xe7e2d leaq 0x3741ca(%rip), %rdx # 0x45be70 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 0xea1fa movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0xe803f 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 0xeafb6 jmp 0xe7e16 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovss %xmm3, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) callq 0xea6e0 jmp 0xe7d5e movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovss %xmm3, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) callq 0xeab4b 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 0xea474 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0xe83f0 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 0xea33e jmp 0xe7e3f 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 0xeb4a8 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 0xea5aa movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0xe803f 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 0xea33e movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0xe85c6
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false> 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 movl %esi, %ebp leaq 0x10(%rdi), %rsi leaq 0x8(%rsp), %r15 movq %rdx, %r14 movq %rdi, %rbx movl %ebp, %edx movq %r15, %rdi callq 0x3c868 movq (%r15), %r12 movq 0x8(%r15), %r13 xorl %r15d, %r15d cmpq %r12, %r13 je 0xe80f4 movl 0x4(%r13), %esi movq %r14, %rdi callq 0x3664a addl %eax, %r15d addq $0x8, %r13 jmp 0xe80da movq 0x60(%rbx), %rcx movslq %ebp, %rax cmpl (%rcx,%rax,4), %r15d sete %al addq $0x18, %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::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::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 $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) movq (%rdx), %rax movq 0x30(%rsp), %rcx cmpq (%rcx), %rax je 0xe81fa movslq -0x4(%rax), %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 0xe8606 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0xe8624 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 leaq (%rdi,%r13,8), %rsi callq 0xe86f1 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 0xe8724 orb %al, %bpl movq (%r14), %rax addq $-0x4, %rax movq %rax, (%r14) jmp 0xe814e andb $0x1, %bpl movl %ebp, %eax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
bool baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, 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>>>, double, double, double)
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, 0x28(%rsp) leaq 0x50(%rsp), %rcx leaq 0x48(%rsp), %r8 leaq 0x40(%rsp), %r9 movq %rdx, %r14 movq %rsi, %r13 movq %rdi, %r12 leaq 0x36c7f2(%rip), %rdx # 0x45c344 vmovsd %xmm0, (%rcx) vmovsd %xmm1, (%r8) vmovsd %xmm2, (%r9) pushq $0x14 popq %rsi callq 0xefd10 leaq 0x10(%r12), %rax leaq 0x36c79f(%rip), %rbx # 0x45c313 movq %rax, 0x18(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x20(%rsp) cmpq 0x28(%rsp), %r14 je 0xefcbe movl (%r14), %edx movq 0x18(%rsp), %rsi leaq 0x8(%rsp), %rdi movq %rax, 0x30(%rsp) movq %r14, 0x38(%rsp) movl %edx, (%rsp) callq 0x3de66 vmovsd 0x40(%rsp), %xmm0 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r12, %rdi callq 0xefd42 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0xefd60 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 movl %eax, %r15d movq %r13, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xefe26 movslq (%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r13d cmovll %r13d, %eax decl %eax movl %eax, 0x4(%rsp) pushq $0x15 popq %rsi leaq 0x36c6da(%rip), %rdx # 0x45c2fd movq %rsp, %rcx callq 0xb91c2 movl %r13d, %eax sarl $0x1f, %eax xorl %r14d, %r14d andnl %r13d, %eax, %r13d shlq $0x4, %r13 cmpq %r14, %r13 je 0xefc63 movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x8(%rcx,%r14), %r8 addq %r14, %rcx callq 0xefe5a addq $0x10, %r14 jmp 0xefc3d movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x3713f1(%rip), %rdx # 0x461061 leaq 0x4(%rsp), %rcx callq 0xb921e vmovsd 0x50(%rsp), %xmm0 vmovsd 0x48(%rsp), %xmm1 movq 0x20(%rsp), %r13 movq 0x10(%rsp), %rdx movl (%rsp), %ecx movl 0x4(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r13, %rsi callq 0xefe88 movq 0x30(%rsp), %rcx movq 0x38(%rsp), %r14 orb %al, %cl addq $0x4, %r14 movq %rcx, %rax jmp 0xefb83 andb $0x1, %al addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, 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 0xefd02 movq %r14, %rdi movl %r15d, %esi movq %rbx, %rdx callq 0xef4b3 xorb $0x1, %al incl %r15d movzbl %al, %eax addl %eax, %ebp jmp 0xefce2 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, 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), %r13 leaq 0x8(%rsp), %rbp movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r12 xorl %r15d, %r15d cmpq %rbx, %r14 je 0xefe14 movl 0x4(%r14), %edx movq %rbp, %rdi movq %r13, %rsi callq 0x3dede movq 0x8(%rsp), %rax movq 0x10(%rsp), %rcx movq 0x50(%r12), %rdx movq 0x68(%r12), %rsi vxorpd %xmm0, %xmm0, %xmm0 vxorpd %xmm1, %xmm1, %xmm1 cmpq %rax, %rcx je 0xefdd8 movslq 0x4(%rcx), %rdi vaddsd (%rsi,%rdi,8), %xmm0, %xmm0 movslq (%rcx), %rdi addq $0x8, %rcx vaddsd (%rdx,%rdi,8), %xmm1, %xmm1 movq %rcx, 0x10(%rsp) jmp 0xefdb7 movq 0x58(%r12), %rax movq %r15, %rcx shlq $0x4, %rcx movl %r15d, 0x8(%rax,%rcx) incq %r15 movq 0x70(%r12), %rdx movslq 0x4(%r14), %rsi addq $0x8, %r14 movq 0x8(%rdx), %rdx vmovsd (%rdx,%rsi,8), %xmm2 vsubsd %xmm0, %xmm2, %xmm0 vsubsd %xmm1, %xmm0, %xmm0 vmovsd %xmm0, (%rax,%rcx) jmp 0xefd83 movl %r15d, %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
bool baryonyx::itm::affect<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, double>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, double, double)
bool affect(Solver& slv, Xtype& x, Iterator it, int k, int selected, int r_size, const Float kappa, const Float delta) { constexpr Float one{ 1 }; constexpr Float two{ 2 }; constexpr Float middle{ (two + one) / two }; const auto old_pi = slv.pi[k]; auto d = delta; if (selected < 0) { // slv.pi[k] += slv.R[0].value / two; d += (kappa / (one - kappa)) * (slv.R[0].value / two); for (int i = 0; i != r_size; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.set(var->column); slv.P[var->value] += d; } else { x.unset(var->column); slv.P[var->value] -= d; } } } else if (selected + 1 >= r_size) { // slv.pi[k] += slv.R[selected].value * middle; d += (kappa / (one - kappa)) * (slv.R[selected].value * middle); for (int i = 0; i != r_size; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.unset(var->column); slv.P[var->value] -= d; } else { x.set(var->column); slv.P[var->value] += d; } } } else { slv.pi[k] += ((slv.R[selected].value + slv.R[selected + 1].value) / two); d += (kappa / (one - kappa)) * (slv.R[selected + 1].value - slv.R[selected].value); int i = 0; for (; i <= selected; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.unset(var->column); slv.P[var->value] -= d; } else { x.set(var->column); slv.P[var->value] += d; } } for (; i != r_size; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.set(var->column); slv.P[var->value] += d; } else { x.unset(var->column); slv.P[var->value] -= d; } } } // TODO job: develops is_valid_constraint for all the solvers bx_expects(is_valid_constraint(slv, k, x)); return is_signbit_change(old_pi, slv.pi[k]); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movq %rdi, %rbx movq 0x68(%rbx), %rax movslq %ecx, %rdi movq %rdx, %r15 movq %rsi, %r14 movl %ecx, 0xc(%rsp) movq %rdi, 0x18(%rsp) vmovsd (%rax,%rdi,8), %xmm3 vmovapd %xmm3, 0x20(%rsp) testl %r8d, %r8d js 0xeff69 leal 0x1(%r8), %ecx cmpl %r9d, %ecx jge 0xeffd8 movq 0x58(%rbx), %rsi movl %r8d, %edx shlq $0x4, %rdx movl %ecx, %ebp movq %rbp, 0x10(%rsp) shlq $0x4, %rbp xorl %r13d, %r13d movl %r9d, 0x8(%rsp) vmovsd (%rsi,%rdx), %xmm2 vaddsd (%rsi,%rbp), %xmm2, %xmm2 vmulsd 0x368a78(%rip), %xmm2, %xmm2 # 0x458978 vaddsd %xmm2, %xmm3, %xmm2 vmovsd %xmm2, (%rax,%rdi,8) vmovsd 0x364127(%rip), %xmm2 # 0x454038 vsubsd %xmm0, %xmm2, %xmm2 vdivsd %xmm2, %xmm0, %xmm0 vmovsd (%rsi,%rbp), %xmm2 vsubsd (%rsi,%rdx), %xmm2, %xmm2 vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1 vmovsd %xmm2, (%rsp) cmpq %r13, %rbp je 0xf004b movq 0x58(%rbx), %rax movq %r14, %rdi movslq 0x8(%rax,%r13), %r12 movl 0x4(%r15,%r12,8), %esi callq 0x369c8 movslq (%r15,%r12,8), %rax movq 0x50(%rbx), %rcx vmovsd (%rsp), %xmm0 addq $0x10, %r13 vaddsd (%rcx,%rax,8), %xmm0, %xmm0 vmovsd %xmm0, (%rcx,%rax,8) jmp 0xeff2d vmovsd 0x3640c7(%rip), %xmm2 # 0x454038 movq 0x58(%rbx), %rax movl %r9d, %r12d shlq $0x4, %r12 xorl %ebp, %ebp vsubsd %xmm0, %xmm2, %xmm2 vdivsd %xmm2, %xmm0, %xmm0 vmovsd (%rax), %xmm2 vmulsd 0x3689e6(%rip), %xmm2, %xmm2 # 0x458978 vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1 vmovsd %xmm2, (%rsp) cmpq %rbp, %r12 je 0xf0091 movq 0x58(%rbx), %rax movq %r14, %rdi movslq 0x8(%rax,%rbp), %r13 movl 0x4(%r15,%r13,8), %esi callq 0x36a06 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx addq $0x10, %rbp vmovsd (%rcx,%rax,8), %xmm0 vsubsd (%rsp), %xmm0, %xmm0 vmovsd %xmm0, (%rcx,%rax,8) jmp 0xeff9c vmovsd 0x364058(%rip), %xmm2 # 0x454038 movq 0x58(%rbx), %rcx movl %r8d, %eax shlq $0x4, %rax movl %r9d, %r12d shlq $0x4, %r12 xorl %ebp, %ebp vsubsd %xmm0, %xmm2, %xmm2 vdivsd %xmm2, %xmm0, %xmm0 vmovsd (%rcx,%rax), %xmm2 vmulsd 0x36bcb7(%rip), %xmm2, %xmm2 # 0x45bcc0 vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1 vmovsd %xmm2, (%rsp) cmpq %rbp, %r12 je 0xf0091 movq 0x58(%rbx), %rax movq %r14, %rdi movslq 0x8(%rax,%rbp), %r13 movl 0x4(%r15,%r13,8), %esi callq 0x369c8 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx vmovsd (%rsp), %xmm0 addq $0x10, %rbp vaddsd (%rcx,%rax,8), %xmm0, %xmm0 vmovsd %xmm0, (%rcx,%rax,8) jmp 0xf0013 movl 0x8(%rsp), %r12d orq $0x8, %rbp subq 0x10(%rsp), %r12 subq $0x1, %r12 jb 0xf0091 movq 0x58(%rbx), %rax movq %r14, %rdi movslq (%rax,%rbp), %r13 movl 0x4(%r15,%r13,8), %esi callq 0x36a06 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx addq $0x10, %rbp vmovsd (%rcx,%rax,8), %xmm0 vsubsd (%rsp), %xmm0, %xmm0 vmovsd %xmm0, (%rcx,%rax,8) jmp 0xf0059 movl 0xc(%rsp), %esi movq %rbx, %rdi movq %r14, %rdx callq 0xef4b3 testb %al, %al je 0xf00d2 vmovapd 0x20(%rsp), %xmm0 movq 0x68(%rbx), %rcx movq 0x18(%rsp), %rdx vmovmskpd %xmm0, %eax shlq $0x3f, %rax xorq (%rcx,%rdx,8), %rax shrq $0x3f, %rax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x368105(%rip), %rdi # 0x4581de leaq 0x36c23c(%rip), %rsi # 0x45c31c leaq 0x369ea5(%rip), %rdx # 0x459f8c leaq 0x36c24d(%rip), %rcx # 0x45c33b callq 0x2813f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>::rc_data*>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>::rc_data*, baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>::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 0x10(%rdi), %rsi cmpq %r14, %rsi je 0xf015f vmovsd (%rdi), %xmm0 leaq 0x10(%rsi), %r15 vucomisd (%rsi), %xmm0 movq %r15, %rsi jne 0xf014b jnp 0xf0133 addq $-0x10, %r15 movq %r15, %rsi movq %rbx, %rdx callq 0xf067e movq %r15, %rdi jmp 0xf012f movq %rbx, %rdx callq 0xf067e popq %rbx popq %r14 popq %r15 retq jmp 0xf016f movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>::push_and_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>>>>, double, double, double, double)
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 $0x68, %rsp movq %rcx, 0x40(%rsp) movq %rdx, %rbx leaq 0x60(%rsp), %rcx leaq 0x58(%rsp), %r8 leaq 0x50(%rsp), %r9 leaq 0x36a82b(%rip), %rdx # 0x45c33f vmovsd %xmm3, 0x38(%rsp) movq %rsi, %r14 movq %rdi, %r12 vmovsd %xmm0, (%rcx) vmovsd %xmm1, (%r8) vmovsd %xmm2, (%r9) pushq $0x19 popq %rsi callq 0xefd10 leaq 0x10(%r12), %rax movq %rbx, 0x30(%rsp) xorl %edx, %edx movq %rax, 0x20(%rsp) movq (%rbx), %rax leaq 0x36a7c2(%rip), %rbx # 0x45c313 pushq $0x8 popq %rbp movq %r14, 0x28(%rsp) movq 0x40(%rsp), %rcx cmpq (%rcx), %rax je 0xf1cd0 movq %rdx, 0x48(%rsp) movl -0x4(%rax), %edx movq 0x20(%rsp), %rsi leaq 0x10(%rsp), %rdi movl %edx, 0x8(%rsp) callq 0x3de66 vmovsd 0x50(%rsp), %xmm0 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq %r12, %rdi callq 0xefd42 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq %r12, %rdi movq %r14, %rcx callq 0xefd60 vmovsd 0x38(%rsp), %xmm1 movl %eax, %r15d movq 0x58(%r12), %rdi movq 0x70(%r12), %rax movl %r15d, %ecx shlq $0x4, %rcx xorl %edx, %edx cmpq %rdx, %rcx je 0xf1bf0 movslq 0x8(%rdi,%rdx), %rsi movq 0x8(%rax), %r8 vmovsd (%r8,%rsi,8), %xmm0 vfmadd213sd (%rdi,%rdx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovsd %xmm0, (%rdi,%rdx) addq $0x10, %rdx jmp 0xf1bcb movq 0x8(%r12), %rdx movslq %r15d, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xefe26 movslq 0x8(%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r15d cmovll %r15d, %eax decl %eax movl %eax, 0xc(%rsp) pushq $0x15 popq %rsi leaq 0x36a6ce(%rip), %rdx # 0x45c2fd leaq 0x8(%rsp), %rcx callq 0xb91c2 movl %r15d, %eax sarl $0x1f, %eax xorl %r13d, %r13d andnl %r15d, %eax, %r14d shlq $0x4, %r14 cmpq %r13, %r14 je 0xf1c71 movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x8(%rcx,%r13), %r8 addq %r13, %rcx callq 0xefe5a addq $0x10, %r13 jmp 0xf1c4b movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x36f3e3(%rip), %rdx # 0x461061 leaq 0xc(%rsp), %rcx callq 0xb921e vmovsd 0x60(%rsp), %xmm0 vmovsd 0x58(%rsp), %xmm1 movq 0x28(%rsp), %r14 movq 0x18(%rsp), %rdx movl 0x8(%rsp), %ecx movl 0xc(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r14, %rsi callq 0xefe88 movq 0x48(%rsp), %rdx movq 0x30(%rsp), %rcx orb %al, %dl movq (%rcx), %rax addq $-0x4, %rax movq %rax, (%rcx) jmp 0xf1b59 andb $0x1, %dl movl %edx, %eax addq $0x68, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>::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>>>, double, double, double, double)
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 $0x68, %rsp movq %rcx, 0x38(%rsp) leaq 0x60(%rsp), %rcx leaq 0x58(%rsp), %r8 leaq 0x50(%rsp), %r9 movq %rdx, %r14 vmovsd %xmm3, 0x30(%rsp) movq %rsi, %r13 movq %rdi, %r12 leaq 0x36a623(%rip), %rdx # 0x45c33f vmovsd %xmm0, (%rcx) vmovsd %xmm1, (%r8) vmovsd %xmm2, (%r9) pushq $0x19 popq %rsi callq 0xefd10 leaq 0x10(%r12), %rax leaq 0x36a5d5(%rip), %rbx # 0x45c313 movq %rax, 0x20(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x28(%rsp) cmpq 0x38(%rsp), %r14 je 0xf1ec3 movl (%r14), %edx movq 0x20(%rsp), %rsi leaq 0x10(%rsp), %rdi movq %rax, 0x40(%rsp) movl %edx, 0x8(%rsp) callq 0x3de66 vmovsd 0x50(%rsp), %xmm0 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq %r12, %rdi callq 0xefd42 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0xefd60 vmovsd 0x30(%rsp), %xmm1 movl %eax, %r15d movq 0x58(%r12), %rdi movq 0x70(%r12), %rax movl %r15d, %ecx shlq $0x4, %rcx xorl %edx, %edx cmpq %rdx, %rcx je 0xf1de1 movslq 0x8(%rdi,%rdx), %rsi movq 0x8(%rax), %r8 vmovsd (%r8,%rsi,8), %xmm0 vfmadd213sd (%rdi,%rdx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovsd %xmm0, (%rdi,%rdx) addq $0x10, %rdx jmp 0xf1dbc movq 0x8(%r12), %rdx movslq %r15d, %rsi movq %r14, 0x48(%rsp) shlq $0x4, %rsi addq %rdi, %rsi callq 0xefe26 movslq 0x8(%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r15d cmovll %r15d, %eax decl %eax movl %eax, 0xc(%rsp) pushq $0x15 popq %rsi leaq 0x36a4d8(%rip), %rdx # 0x45c2fd leaq 0x8(%rsp), %rcx callq 0xb91c2 movl %r15d, %eax sarl $0x1f, %eax xorl %r14d, %r14d andnl %r15d, %eax, %r13d shlq $0x4, %r13 cmpq %r14, %r13 je 0xf1e67 movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x8(%rcx,%r14), %r8 addq %r14, %rcx callq 0xefe5a addq $0x10, %r14 jmp 0xf1e41 movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x36f1ed(%rip), %rdx # 0x461061 leaq 0xc(%rsp), %rcx callq 0xb921e vmovsd 0x60(%rsp), %xmm0 vmovsd 0x58(%rsp), %xmm1 movq 0x28(%rsp), %r13 movq 0x18(%rsp), %rdx movl 0x8(%rsp), %ecx movl 0xc(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r13, %rsi callq 0xefe88 movq 0x40(%rsp), %rcx movq 0x48(%rsp), %r14 orb %al, %cl addq $0x4, %r14 movq %rcx, %rax jmp 0xf1d4d andb $0x1, %al addq $0x68, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>::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>>>>, double, double, double, double)
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 $0x68, %rsp movq %rcx, 0x38(%rsp) leaq 0x60(%rsp), %rcx leaq 0x58(%rsp), %r8 leaq 0x50(%rsp), %r9 movq %rdx, %r14 vmovsd %xmm3, 0x30(%rsp) movq %rsi, %r13 movq %rdi, %r12 leaq 0x36a433(%rip), %rdx # 0x45c33f vmovsd %xmm0, (%rcx) vmovsd %xmm1, (%r8) vmovsd %xmm2, (%r9) pushq $0x19 popq %rsi callq 0xefd10 leaq 0x10(%r12), %rax leaq 0x36a3e5(%rip), %rbx # 0x45c313 movq %rax, 0x20(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x28(%rsp) cmpq 0x38(%rsp), %r14 je 0xf20b3 movl (%r14), %edx movq 0x20(%rsp), %rsi leaq 0x10(%rsp), %rdi movq %rax, 0x40(%rsp) movl %edx, 0x8(%rsp) callq 0x3de66 vmovsd 0x50(%rsp), %xmm0 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq %r12, %rdi callq 0xefd42 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0xefd60 vmovsd 0x30(%rsp), %xmm1 movl %eax, %r15d movq 0x58(%r12), %rdi movq 0x70(%r12), %rax movl %r15d, %ecx shlq $0x4, %rcx xorl %edx, %edx cmpq %rdx, %rcx je 0xf1fd1 movslq 0x8(%rdi,%rdx), %rsi movq 0x8(%rax), %r8 vmovsd (%r8,%rsi,8), %xmm0 vfmadd213sd (%rdi,%rdx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovsd %xmm0, (%rdi,%rdx) addq $0x10, %rdx jmp 0xf1fac movq 0x8(%r12), %rdx movslq %r15d, %rsi movq %r14, 0x48(%rsp) shlq $0x4, %rsi addq %rdi, %rsi callq 0xefe26 movslq 0x8(%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r15d cmovll %r15d, %eax decl %eax movl %eax, 0xc(%rsp) pushq $0x15 popq %rsi leaq 0x36a2e8(%rip), %rdx # 0x45c2fd leaq 0x8(%rsp), %rcx callq 0xb91c2 movl %r15d, %eax sarl $0x1f, %eax xorl %r14d, %r14d andnl %r15d, %eax, %r13d shlq $0x4, %r13 cmpq %r14, %r13 je 0xf2057 movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x8(%rcx,%r14), %r8 addq %r14, %rcx callq 0xefe5a addq $0x10, %r14 jmp 0xf2031 movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x36effd(%rip), %rdx # 0x461061 leaq 0xc(%rsp), %rcx callq 0xb921e vmovsd 0x60(%rsp), %xmm0 vmovsd 0x58(%rsp), %xmm1 movq 0x28(%rsp), %r13 movq 0x18(%rsp), %rdx movl 0x8(%rsp), %ecx movl 0xc(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r13, %rsi callq 0xefe88 movq 0x40(%rsp), %rcx movq 0x48(%rsp), %r14 orb %al, %cl addq $0x8, %r14 movq %rcx, %rax jmp 0xf1f3d andb $0x1, %al addq $0x68, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>::push_and_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>>>, double, double, double, double)
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 $0x68, %rsp movq %rcx, 0x38(%rsp) leaq 0x60(%rsp), %rcx leaq 0x58(%rsp), %r8 leaq 0x50(%rsp), %r9 movq %rdx, %r14 vmovsd %xmm3, 0x30(%rsp) movq %rsi, %r13 movq %rdi, %r12 leaq 0x36a243(%rip), %rdx # 0x45c33f vmovsd %xmm0, (%rcx) vmovsd %xmm1, (%r8) vmovsd %xmm2, (%r9) pushq $0x19 popq %rsi callq 0xefd10 leaq 0x10(%r12), %rax leaq 0x36a1f5(%rip), %rbx # 0x45c313 movq %rax, 0x20(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x28(%rsp) cmpq 0x38(%rsp), %r14 je 0xf22a3 movl (%r14), %edx movq 0x20(%rsp), %rsi leaq 0x10(%rsp), %rdi movq %rax, 0x40(%rsp) movl %edx, 0x8(%rsp) callq 0x3de66 vmovsd 0x50(%rsp), %xmm0 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq %r12, %rdi callq 0xefd42 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0xefd60 vmovsd 0x30(%rsp), %xmm1 movl %eax, %r15d movq 0x58(%r12), %rdi movq 0x70(%r12), %rax movl %r15d, %ecx shlq $0x4, %rcx xorl %edx, %edx cmpq %rdx, %rcx je 0xf21c1 movslq 0x8(%rdi,%rdx), %rsi movq 0x8(%rax), %r8 vmovsd (%r8,%rsi,8), %xmm0 vfmadd213sd (%rdi,%rdx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovsd %xmm0, (%rdi,%rdx) addq $0x10, %rdx jmp 0xf219c movq 0x8(%r12), %rdx movslq %r15d, %rsi movq %r14, 0x48(%rsp) shlq $0x4, %rsi addq %rdi, %rsi callq 0xefe26 movslq 0x8(%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r15d cmovll %r15d, %eax decl %eax movl %eax, 0xc(%rsp) pushq $0x15 popq %rsi leaq 0x36a0f8(%rip), %rdx # 0x45c2fd leaq 0x8(%rsp), %rcx callq 0xb91c2 movl %r15d, %eax sarl $0x1f, %eax xorl %r14d, %r14d andnl %r15d, %eax, %r13d shlq $0x4, %r13 cmpq %r14, %r13 je 0xf2247 movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x8(%rcx,%r14), %r8 addq %r14, %rcx callq 0xefe5a addq $0x10, %r14 jmp 0xf2221 movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x36ee0d(%rip), %rdx # 0x461061 leaq 0xc(%rsp), %rcx callq 0xb921e vmovsd 0x60(%rsp), %xmm0 vmovsd 0x58(%rsp), %xmm1 movq 0x28(%rsp), %r13 movq 0x18(%rsp), %rdx movl 0x8(%rsp), %ecx movl 0xc(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r13, %rsi callq 0xefe88 movq 0x40(%rsp), %rcx movq 0x48(%rsp), %r14 orb %al, %cl addq $0x4, %r14 movq %rcx, %rax jmp 0xf212d andb $0x1, %al addq $0x68, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<double> const&, double)
result operator()(const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { result r; bit_array x(variables); int best_remaining = INT_MAX; auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const long int w_limit = static_cast<long int>(p.w); Solver slv( m_rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); { std::bernoulli_distribution choose_mutation( m_ctx.parameters.init_policy_random); bit_array empty_x; switch (p.init_policy) { case solver_parameters::init_policy_type::pessimistic_solve: init_with_pre_solve<Cost, Mode>( x, empty_x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::optimistic_solve: init_with_pre_solve<Cost, Mode>( empty_x, x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::bastert: init_with_bastert<Cost, Mode>(x, original_costs, variables, 0); break; } for (int i = 0, e = x.size(); i != e; ++i) if (choose_mutation(m_rng)) x.invert(i); } bool start_push = false; auto kappa = static_cast<Float>(p.kappa_min); Observer obs("img", slv.m, slv.n, p.limit); m_begin = std::chrono::steady_clock::now(); m_end = std::chrono::steady_clock::now(); compute.init(slv, x); for (long int i = 0; i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta); obs.make_observation(slv.ap, slv.P.get(), slv.pi.get()); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), i); best_remaining = remaining; start_push = true; break; } if (remaining < best_remaining) { store_if_better(x, remaining, i); best_remaining = remaining; } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) { r.status = result_status::kappa_max_reached; break; } if (is_timelimit_reached()) { r.status = result_status::time_limit_reached; break; } } if (!start_push) { r.status = result_status::limit_reached; } else { for (int push = 0; push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_rng, pushing_k_factor * kappa, delta, theta, pushing_objective_amplifier); if (remaining == 0) store_if_better(x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); if (is_timelimit_reached()) break; for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run(slv, x, m_rng, kappa, delta, theta); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; if (is_timelimit_reached()) break; } } } if (m_best.remaining_constraints == 0) r.status = result_status::success; if (!m_best.x.empty()) { r.solutions.resize(1); convert(m_best, r.solutions[0], variables); } return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x3a8, %rsp # imm = 0x3A8 vmovsd %xmm0, 0x48(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %r8, %r13 movl %ecx, %ebx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, 0x10(%rsp) vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) leaq 0x20(%rsp), %rdi movl %ecx, %esi vzeroupper callq 0x368ae movq 0x10(%r14), %r12 movq 0x18(%r14), %rcx leaq 0x78(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x64935 vmovsd 0x20(%r12), %xmm0 vmovsd 0x10(%r12), %xmm1 vmovsd %xmm0, 0x68(%rsp) vmovsd 0x28(%r12), %xmm0 vmovsd %xmm1, 0x30(%rsp) vmovsd %xmm0, 0x70(%rsp) vmovsd 0x30(%r12), %xmm0 vmovsd %xmm0, 0x60(%rsp) vmovsd 0x8(%r12), %xmm0 vmovsd %xmm0, 0x38(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vucomisd %xmm1, %xmm0 jbe 0xf3682 movq 0x10(%r14), %rdi vmovsd 0x38(%rsp), %xmm0 leaq 0x78(%rsp), %rsi movl %ebx, %edx callq 0x64a13 vmovsd %xmm0, 0x30(%rsp) vcvttsd2si 0xa0(%r12), %rax vmovsd 0x38(%r12), %xmm0 vmovsd 0x40(%r12), %xmm1 movq 0x18(%r14), %rsi movq %rax, 0x50(%rsp) movq 0x8(%r15), %rax vmovsd %xmm0, 0x90(%rsp) vmovsd %xmm1, 0x88(%rsp) subq (%r15), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0xd0(%rsp), %rdi leaq 0x78(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0xeec92 movl 0xcc(%r12), %esi leaq 0x98(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x5c(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, 0x8(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0x150(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0xf3763 cmpl $0x1, %eax je 0xf373d cmpl $0x2, %eax jne 0xf3774 movq 0x18(%r14), %rdx leaq 0x150(%rsp), %rdi leaq 0x20(%rsp), %rsi jmp 0xf374e movq 0x18(%r14), %rdx leaq 0x20(%rsp), %rdi leaq 0x150(%rsp), %rsi vmovsd 0x3608e2(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x62c65 jmp 0xf3774 leaq 0x20(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0x62bf9 leaq 0x20(%rsp), %r15 movq %r13, 0x40(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0xf37aa movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd 0x8(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xf37a6 movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0xf3783 leaq 0x158(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 movl 0x148(%rsp), %ecx movl 0x14c(%rsp), %r8d movq 0xb0(%r12), %r9 vmovsd %xmm0, 0x8(%rsp) leaq 0x366d95(%rip), %rdx # 0x45a577 leaq 0x150(%rsp), %rdi pushq $0x3 popq %rsi callq 0x42b5a callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0x98(%rsp), %rdi leaq 0xd0(%rsp), %rsi leaq 0x20(%rsp), %rdx callq 0xeee22 vmovsd 0x8(%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x20(%rsp), %r13 xorl %r15d, %r15d cmpq 0xb0(%r12), %r15 je 0xf3915 movq 0x18(%r14), %rcx vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 leaq 0x98(%rsp), %rdi leaq 0xd0(%rsp), %rsi movq %r13, %rdx vmovsd %xmm0, 0x8(%rsp) callq 0xeee64 movq 0x120(%rsp), %rdx movq 0x138(%rsp), %rcx movl %eax, %ebx leaq 0x150(%rsp), %rdi leaq 0xe0(%rsp), %rsi callq 0x6c2be testl %ebx, %ebx je 0xf39ba cmpl %ebp, %ebx jge 0xf38b1 movq %r14, %rdi movq %r13, %rsi movl %ebx, %edx movq %r15, %rcx callq 0xf48de movl %ebx, %ebp cmpq 0x50(%rsp), %r15 jle 0xf38e7 vcvtsi2sd %ebx, %xmm3, %xmm0 vcvtsi2sdl 0x148(%rsp), %xmm3, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x60(%rsp), %xmm1 callq 0xb1f0 vmovsd 0x8(%rsp), %xmm1 vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xf38ed vmovsd 0x8(%rsp), %xmm0 vucomisd 0x70(%rsp), %xmm0 ja 0xf3915 movq %r14, %rdi vmovsd %xmm0, 0x8(%rsp) callq 0xf4916 vmovsd 0x8(%rsp), %xmm0 testb %al, %al jne 0xf3915 incq %r15 jmp 0xf3830 movq 0x10(%rsp), %rax movl $0x5, 0xa0(%rax) cmpl $0x0, 0x50(%r14) jne 0xf3937 movq 0x10(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0xf3965 movq 0x10(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x5c(%rsp), %edx movq %r14, %rdi callq 0x35781 leaq 0x150(%rsp), %rdi callq 0x42cbc leaq 0x98(%rsp), %rdi callq 0x393ac leaq 0xd0(%rsp), %rdi callq 0xef2c4 leaq 0x80(%rsp), %rdi callq 0x29066 leaq 0x28(%rsp), %rdi callq 0x357fe movq 0x10(%rsp), %rax addq $0x3a8, %rsp # imm = 0x3A8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi leaq 0x20(%rsp), %rbx movq %rbx, %rsi callq 0x62f18 movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0xf4894 vmovsd 0x8(%rsp), %xmm0 leaq 0xd0(%rsp), %r15 leaq 0x20(%rsp), %rbp xorl %ebx, %ebx movl $0x0, 0x1c(%rsp) cmpl 0xbc(%r12), %ebx jge 0xf3924 vmovsd %xmm0, 0x8(%rsp) vmulsd 0x90(%rsp), %xmm0, %xmm0 movq 0x18(%r14), %rcx vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 vmovsd 0x88(%rsp), %xmm3 leaq 0x98(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx callq 0xef070 testl %eax, %eax jne 0xf3a78 vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi movq %rbp, %rsi callq 0x62f18 movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xf4894 movq %r14, %rdi callq 0xf4916 vmovsd 0x8(%rsp), %xmm0 testb %al, %al jne 0xf3924 movl %ebx, 0x50(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0xf3b81 movq 0x18(%r14), %rcx vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 leaq 0x98(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx vmovsd %xmm0, 0x8(%rsp) callq 0xeee64 testl %eax, %eax je 0xf3b43 vcvtsi2sd %r13d, %xmm4, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0xf3b16 vcvtsi2sd %eax, %xmm4, %xmm0 vcvtsi2sdl 0x148(%rsp), %xmm4, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x60(%rsp), %xmm1 callq 0xb1f0 vmovsd 0x8(%rsp), %xmm1 vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xf3b1c vmovsd 0x8(%rsp), %xmm0 vucomisd 0x70(%rsp), %xmm0 ja 0xf3b81 movq %r14, %rdi vmovsd %xmm0, 0x8(%rsp) callq 0xf4916 testb %al, %al jne 0xf3b7b vmovsd 0x8(%rsp), %xmm0 incl %ebx jmp 0xf3a97 vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi movq %rbp, %rsi callq 0x62f18 movl 0xc0(%r12), %eax imull 0x1c(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xf4894 vmovsd 0x8(%rsp), %xmm0 jmp 0xf3b81 vmovsd 0x8(%rsp), %xmm0 movl 0x50(%rsp), %ebx decl 0x1c(%rsp) incl %ebx jmp 0xf39fd jmp 0xf3bc7 jmp 0xf3ba0 jmp 0xf3bc7 movq %rax, %r14 jmp 0xf3bd7 movq %rax, %r14 jmp 0xf3be4 movq %rax, %r14 jmp 0xf3bf1 movq %rax, %r14 jmp 0xf3bfe movq %rax, %r14 jmp 0xf3c08 jmp 0xf3bc7 jmp 0xf3bc7 jmp 0xf3bc7 leaq 0x158(%rsp), %rdi movq %rax, %r14 callq 0x357fe jmp 0xf3bd7 leaq 0x150(%rsp), %rdi movq %rax, %r14 callq 0x42cbc leaq 0x98(%rsp), %rdi callq 0x393ac leaq 0xd0(%rsp), %rdi callq 0xef2c4 leaq 0x80(%rsp), %rdi callq 0x29066 leaq 0x28(%rsp), %rdi callq 0x357fe movq 0x10(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<double> const&, double)
result operator()(const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { result r; bit_array x(variables); int best_remaining = INT_MAX; auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const long int w_limit = static_cast<long int>(p.w); Solver slv( m_rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); { std::bernoulli_distribution choose_mutation( m_ctx.parameters.init_policy_random); bit_array empty_x; switch (p.init_policy) { case solver_parameters::init_policy_type::pessimistic_solve: init_with_pre_solve<Cost, Mode>( x, empty_x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::optimistic_solve: init_with_pre_solve<Cost, Mode>( empty_x, x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::bastert: init_with_bastert<Cost, Mode>(x, original_costs, variables, 0); break; } for (int i = 0, e = x.size(); i != e; ++i) if (choose_mutation(m_rng)) x.invert(i); } bool start_push = false; auto kappa = static_cast<Float>(p.kappa_min); Observer obs("img", slv.m, slv.n, p.limit); m_begin = std::chrono::steady_clock::now(); m_end = std::chrono::steady_clock::now(); compute.init(slv, x); for (long int i = 0; i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta); obs.make_observation(slv.ap, slv.P.get(), slv.pi.get()); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), i); best_remaining = remaining; start_push = true; break; } if (remaining < best_remaining) { store_if_better(x, remaining, i); best_remaining = remaining; } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) { r.status = result_status::kappa_max_reached; break; } if (is_timelimit_reached()) { r.status = result_status::time_limit_reached; break; } } if (!start_push) { r.status = result_status::limit_reached; } else { for (int push = 0; push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_rng, pushing_k_factor * kappa, delta, theta, pushing_objective_amplifier); if (remaining == 0) store_if_better(x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); if (is_timelimit_reached()) break; for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run(slv, x, m_rng, kappa, delta, theta); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; if (is_timelimit_reached()) break; } } } if (m_best.remaining_constraints == 0) r.status = result_status::success; if (!m_best.x.empty()) { r.solutions.resize(1); convert(m_best, r.solutions[0], variables); } return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x158, %rsp # imm = 0x158 vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %r8, %r13 movl %ecx, %ebx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, 0x8(%rsp) vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) leaq 0x18(%rsp), %rdi movl %ecx, %esi vzeroupper callq 0x368ae movq 0x10(%r14), %r12 movq 0x18(%r14), %rcx leaq 0x80(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x64935 vmovsd 0x20(%r12), %xmm0 vmovsd 0x10(%r12), %xmm1 vmovsd %xmm0, 0x60(%rsp) vmovsd 0x28(%r12), %xmm0 vmovsd %xmm1, 0x28(%rsp) vmovsd %xmm0, 0x68(%rsp) vmovsd 0x30(%r12), %xmm0 vmovsd %xmm0, 0x58(%rsp) vmovsd 0x8(%r12), %xmm0 vmovsd %xmm0, 0x30(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vucomisd %xmm1, %xmm0 jbe 0xf4388 movq 0x10(%r14), %rdi vmovsd 0x30(%rsp), %xmm0 leaq 0x80(%rsp), %rsi movl %ebx, %edx callq 0x64a13 vmovsd %xmm0, 0x28(%rsp) vcvttsd2si 0xa0(%r12), %rax vmovsd 0x38(%r12), %xmm0 vmovsd 0x40(%r12), %xmm1 movq 0x18(%r14), %rsi movq %rax, 0x48(%rsp) movq 0x8(%r15), %rax vmovsd %xmm0, 0x98(%rsp) vmovsd %xmm1, 0x90(%rsp) subq (%r15), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0xd8(%rsp), %rdi leaq 0x80(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0xeec92 movl 0xcc(%r12), %esi leaq 0xa0(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x54(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, (%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0x70(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0xf4462 cmpl $0x1, %eax je 0xf443f cmpl $0x2, %eax jne 0xf4473 movq 0x18(%r14), %rdx leaq 0x70(%rsp), %rdi leaq 0x18(%rsp), %rsi jmp 0xf444d movq 0x18(%r14), %rdx leaq 0x18(%rsp), %rdi leaq 0x70(%rsp), %rsi vmovsd 0x35fbe3(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x62c65 jmp 0xf4473 leaq 0x18(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0x62bf9 leaq 0x18(%rsp), %r15 movq %r13, 0x38(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0xf44a8 movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd (%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xf44a4 movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0xf4482 leaq 0x78(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 vmovsd %xmm0, (%rsp) callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi leaq 0x18(%rsp), %rdx callq 0xeee22 vmovsd (%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x18(%rsp), %rbx xorl %r15d, %r15d cmpq 0xb0(%r12), %r15 je 0xf45bb movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi movq %rbx, %rdx vmovsd %xmm0, (%rsp) callq 0xeee64 movl %eax, %r13d testl %eax, %eax je 0xf4653 cmpl %ebp, %r13d jge 0xf455a movq %r14, %rdi movq %rbx, %rsi movl %r13d, %edx movq %r15, %rcx callq 0xf4aa2 movl %r13d, %ebp cmpq 0x48(%rsp), %r15 jle 0xf4590 vcvtsi2sd %r13d, %xmm3, %xmm0 vcvtsi2sdl 0x150(%rsp), %xmm3, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x58(%rsp), %xmm1 callq 0xb1f0 vmovsd (%rsp), %xmm1 vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xf4595 vmovsd (%rsp), %xmm0 vucomisd 0x68(%rsp), %xmm0 ja 0xf45bb movq %r14, %rdi vmovsd %xmm0, (%rsp) callq 0xf4ada vmovsd (%rsp), %xmm0 testb %al, %al jne 0xf45bb incq %r15 jmp 0xf44fb movq 0x8(%rsp), %rax movl $0x5, 0xa0(%rax) cmpl $0x0, 0x50(%r14) jne 0xf45dd movq 0x8(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0xf460b movq 0x8(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x54(%rsp), %edx movq %r14, %rdi callq 0x35781 leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xef2c4 leaq 0x88(%rsp), %rdi callq 0x29066 leaq 0x20(%rsp), %rdi callq 0x357fe movq 0x8(%rsp), %rax addq $0x158, %rsp # imm = 0x158 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi leaq 0x18(%rsp), %rbx movq %rbx, %rsi callq 0x62f18 movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0xf4a58 vmovsd (%rsp), %xmm0 leaq 0xd8(%rsp), %r15 leaq 0x18(%rsp), %rbp xorl %ebx, %ebx movl $0x0, 0x14(%rsp) cmpl 0xbc(%r12), %ebx jge 0xf45ca vmovsd %xmm0, (%rsp) vmulsd 0x98(%rsp), %xmm0, %xmm0 movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 vmovsd 0x90(%rsp), %xmm3 leaq 0xa0(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx callq 0xef070 testl %eax, %eax jne 0xf470f vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x62f18 movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xf4a58 movq %r14, %rdi callq 0xf4ada vmovsd (%rsp), %xmm0 testb %al, %al jne 0xf45ca movl %ebx, 0x48(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0xf4810 movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx vmovsd %xmm0, (%rsp) callq 0xeee64 testl %eax, %eax je 0xf47d4 vcvtsi2sd %r13d, %xmm4, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0xf47aa vcvtsi2sd %eax, %xmm4, %xmm0 vcvtsi2sdl 0x150(%rsp), %xmm4, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x58(%rsp), %xmm1 callq 0xb1f0 vmovsd (%rsp), %xmm1 vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xf47af vmovsd (%rsp), %xmm0 vucomisd 0x68(%rsp), %xmm0 ja 0xf4810 movq %r14, %rdi vmovsd %xmm0, (%rsp) callq 0xf4ada testb %al, %al jne 0xf480b vmovsd (%rsp), %xmm0 incl %ebx jmp 0xf472d vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x62f18 movl 0xc0(%r12), %eax imull 0x14(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xf4a58 vmovsd (%rsp), %xmm0 jmp 0xf4810 vmovsd (%rsp), %xmm0 movl 0x48(%rsp), %ebx decl 0x14(%rsp) incl %ebx jmp 0xf4695 jmp 0xf484e jmp 0xf482a jmp 0xf484e movq %rax, %r14 jmp 0xf485e movq %rax, %r14 jmp 0xf486b movq %rax, %r14 jmp 0xf4878 movq %rax, %r14 jmp 0xf4882 jmp 0xf484e jmp 0xf484e jmp 0xf484e leaq 0x78(%rsp), %rdi movq %rax, %r14 callq 0x357fe jmp 0xf4851 movq %rax, %r14 leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xef2c4 leaq 0x88(%rsp), %rdi callq 0x29066 leaq 0x20(%rsp), %rdi callq 0x357fe movq 0x8(%rsp), %rdi callq 0xea60 movq %r14, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long)
inline bool is_better_solution(Float lhs, Float rhs) noexcept { if constexpr (std::is_same_v<Mode, minimize_tag>) return lhs < rhs; else return lhs > rhs; }
vucomisd 0x30(%rdi), %xmm0 jbe 0xf48dc pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xf4956 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<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 0xf49be pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xf4a38 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::file_observer>::is_timelimit_reached()
bool is_timelimit_reached() { m_end = std::chrono::steady_clock::now(); return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end); }
pushq %rbx movq %rdi, %rbx callq 0xb5a0 movq %rax, 0x8(%rbx) vxorpd %xmm2, %xmm2, %xmm2 movq 0x10(%rbx), %rcx subq (%rbx), %rax vmovsd (%rcx), %xmm0 vcvtsi2sd %rax, %xmm1, %xmm1 vdivsd 0x36505f(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::none_observer>::store_if_better(baryonyx::bit_array const&, double, long)
inline bool is_better_solution(Float lhs, Float rhs) noexcept { if constexpr (std::is_same_v<Mode, minimize_tag>) return lhs < rhs; else return lhs > rhs; }
vucomisd 0x30(%rdi), %xmm0 jbe 0xf4aa0 pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xf4b1a 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::none_observer>::is_timelimit_reached()
bool is_timelimit_reached() { m_end = std::chrono::steady_clock::now(); return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end); }
pushq %rbx movq %rdi, %rbx callq 0xb5a0 movq %rax, 0x8(%rbx) vxorpd %xmm2, %xmm2, %xmm2 movq 0x10(%rbx), %rcx subq (%rbx), %rax vmovsd (%rcx), %xmm0 vcvtsi2sd %rax, %xmm1, %xmm1 vdivsd 0x364f7d(%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::optimize_functor<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<double>, double, baryonyx::itm::maximize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<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 $0x158, %rsp # imm = 0x158 movq %rdi, %rbp leaq 0x8(%rsp), %rdi movq %rsi, %r15 movl %r8d, %esi vmovsd %xmm0, 0x48(%rsp) movq %r9, %r12 movl %r8d, %ebx movq %rcx, %r14 movq %rdx, 0x18(%rsp) callq 0x368ae movq (%rbp), %r13 movq %rbp, 0x50(%rsp) addq $0x8, %rbp leaq 0x78(%rsp), %rdi movq %r13, %rsi movq %r12, 0x40(%rsp) movq %r12, %rdx movq %rbp, %rcx movl %ebx, %r8d callq 0x64935 vmovsd 0x20(%r13), %xmm0 vmovsd 0x10(%r13), %xmm1 vmovsd %xmm0, 0x68(%rsp) vmovsd 0x28(%r13), %xmm0 vmovsd %xmm1, 0x30(%rsp) vmovsd %xmm0, 0x70(%rsp) vmovsd 0x30(%r13), %xmm0 vmovsd %xmm0, 0x60(%rsp) vmovsd 0x8(%r13), %xmm0 vmovsd %xmm0, 0x38(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vucomisd %xmm1, %xmm0 jbe 0xf5014 movq 0x50(%rsp), %rax movq (%rax), %rdi vmovsd 0x38(%rsp), %xmm0 leaq 0x78(%rsp), %rsi movl %ebx, %edx callq 0x64a13 vmovsd %xmm0, 0x30(%rsp) vcvttsd2si 0xa0(%r13), %rax vmovsd 0x38(%r13), %xmm0 vmovsd 0x40(%r13), %xmm1 movq %rax, 0x88(%rsp) movq 0x8(%r14), %rax vmovsd %xmm0, 0x98(%rsp) vmovsd %xmm1, 0x90(%rsp) subq (%r14), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0xd8(%rsp), %rdi leaq 0x78(%rsp), %r8 movq %rbp, %rsi movl %eax, %edx movl %ebx, %ecx movq %r14, %r9 callq 0xf5432 movl 0xcc(%r13), %esi leaq 0xa0(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq $0x0, (%rsp) movb (%r15), %al testb $0x1, %al jne 0xf539a movq 0x50(%rsp), %rax incq 0xb0(%rax) vmovsd 0x18(%r13), %xmm0 vmovsd 0x28(%r13), %xmm1 movzbl (%rsp), %edx movq 0x18(%rsp), %rdi leaq 0x8(%rsp), %rbx movq %rbp, %rsi movq %rbx, %rcx andl $0x1, %edx callq 0x64cb4 vmovsd %xmm0, 0x58(%rsp) leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi movq %rbx, %rdx callq 0xf55a2 vmovsd 0x58(%rsp), %xmm0 movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF xorl %r14d, %r14d movb (%r15), %al testb $0x1, %al jne 0xf5196 cmpq 0xb0(%r13), %r14 je 0xf5196 vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi leaq 0x8(%rsp), %rdx movq %rbp, %rcx vmovsd %xmm0, 0x20(%rsp) callq 0xf55e4 testl %eax, %eax je 0xf51ad cmpl %eax, %ebx cmovgel %eax, %ebx cmpq 0x88(%rsp), %r14 jle 0xf5180 vcvtsi2sd %eax, %xmm3, %xmm0 vcvtsi2sdl 0x150(%rsp), %xmm3, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x60(%rsp), %xmm1 callq 0xb1f0 vmovsd 0x20(%rsp), %xmm1 vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xf5186 vmovsd 0x20(%rsp), %xmm0 vucomisd 0x70(%rsp), %xmm0 ja 0xf5196 incq %r14 jmp 0xf50f7 testl %ebx, %ebx jg 0xf537a leaq 0x8(%rsp), %rbx movq $0x0, (%rsp) jmp 0xf51de vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi leaq 0x8(%rsp), %rbx movq %rbx, %rsi callq 0x62f18 movq 0x18(%rsp), %rdi movq %rbp, %rsi movq %rbx, %rdx movq %r14, %rcx callq 0x65002 movb $0x1, %al movq %rax, (%rsp) xorl %r14d, %r14d movl $0x0, 0x2c(%rsp) movb (%r15), %al testb $0x1, %al jne 0xf508c cmpl 0xbc(%r13), %r14d jge 0xf508c vmovsd 0x98(%rsp), %xmm0 vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 vmovsd 0x90(%rsp), %xmm3 leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi movq %rbx, %rdx movq %rbp, %rcx callq 0xf57f0 testl %eax, %eax jne 0xf5277 vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi movq %rbx, %rsi callq 0x62f18 movl 0xc0(%r13), %eax movq 0x18(%rsp), %rdi movq %rbp, %rsi movq %rbx, %rdx imull %r14d, %eax notl %eax movslq %eax, %rcx callq 0x65002 movb $0x1, %al movq %rax, (%rsp) pushq $0x1 popq %rax vmovsd 0x58(%rsp), %xmm0 movl %eax, %ebx movb (%r15), %al testb $0x1, %al jne 0xf5325 leal -0x1(%rbx), %r12d cmpl 0xc0(%r13), %r12d jge 0xf5325 vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi leaq 0x8(%rsp), %rdx movq %rbp, %rcx vmovsd %xmm0, 0x20(%rsp) callq 0xf55e4 testl %eax, %eax je 0xf532c vcvtsi2sd %r12d, %xmm4, %xmm0 vucomisd 0xa0(%r13), %xmm0 jbe 0xf5310 vcvtsi2sd %eax, %xmm4, %xmm0 vcvtsi2sdl 0x150(%rsp), %xmm4, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x60(%rsp), %xmm1 callq 0xb1f0 vmovsd 0x20(%rsp), %xmm1 vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xf5316 vmovsd 0x20(%rsp), %xmm0 vucomisd 0x70(%rsp), %xmm0 ja 0xf5325 incl %ebx jmp 0xf5282 leaq 0x8(%rsp), %rbx jmp 0xf536e vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi leaq 0x8(%rsp), %r12 movq %r12, %rsi callq 0x62f18 movl 0xc0(%r13), %eax movq 0x18(%rsp), %rdi movq %rbp, %rsi movq %r12, %rdx imull 0x2c(%rsp), %eax subl %ebx, %eax movq %r12, %rbx movslq %eax, %rcx callq 0x65002 movb $0x1, %al movq %rax, (%rsp) decl 0x2c(%rsp) incl %r14d jmp 0xf51e9 movq 0xb0(%r13), %r8 movq 0x18(%rsp), %rdi leaq 0x8(%rsp), %rdx movq %rbp, %rsi movl %ebx, %ecx callq 0x6508a jmp 0xf5084 leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xf5a44 leaq 0x80(%rsp), %rdi callq 0x29066 leaq 0x10(%rsp), %rdi callq 0x357fe addq $0x158, %rsp # imm = 0x158 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0xf53e4 movq %rax, %rbx jmp 0xf5406 movq %rax, %rbx jmp 0xf5413 movq %rax, %rbx jmp 0xf5420 jmp 0xf53f6 jmp 0xf53f6 jmp 0xf53f6 jmp 0xf53f6 leaq 0xa0(%rsp), %rdi movq %rax, %rbx callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xf5a44 leaq 0x80(%rsp), %rdi callq 0x29066 leaq 0x10(%rsp), %rdi callq 0x357fe movq %rbx, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::solver_equalities_01coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::default_cost_type<double> 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 andq $0x0, (%rdi) leaq 0x10(%rdi), %r14 movq %rsi, 0x8(%rdi) movq %rdi, %rbx movq %r9, %r12 movq %r8, 0x20(%rsp) movl %ecx, %r13d movl %edx, %ebp movq %r9, %rsi movq %r14, %rdi callq 0x3a4ca movl 0x38(%rbx), %esi leaq 0x50(%rbx), %r15 movq %r15, %rdi movq %r14, 0x18(%rsp) callq 0x2900a movq %r12, %rdi movq %r15, 0x10(%rsp) leaq 0x58(%rbx), %r14 callq 0x3a89d movq %r14, 0x8(%rsp) movq %r14, %rdi movq %rax, %rsi callq 0xf5a79 leaq 0x60(%rbx), %r14 movslq %ebp, %r15 movq %r14, %rdi movq %r15, %rsi callq 0x28eb6 leaq 0x68(%rbx), %rdi movq %r15, %rsi callq 0x2900a 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 0xf5510 imulq $0x28, %rdx, %rdi leaq (%rax,%rdi), %rsi movq (%rax,%rdi), %r8 movq 0x8(%rax,%rdi), %rdi cmpq %rdi, %r8 je 0xf54fd cmpl $0x1, (%r8) leaq 0x8(%r8), %r8 je 0xf54ec jmp 0xf551f movl 0x18(%rsi), %edi cmpl 0x1c(%rsi), %edi jne 0xf5540 movl %edi, (%rcx,%rdx,4) incq %rdx movl 0x78(%rbx), %ebp jmp 0xf54d4 addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x362f04(%rip), %rdi # 0x45842a leaq 0x366d2e(%rip), %rsi # 0x45c25b leaq 0x366d37(%rip), %rdx # 0x45c26b leaq 0x364f6f(%rip), %rcx # 0x45a4aa callq 0x2813f leaq 0x362ee3(%rip), %rdi # 0x45842a leaq 0x366d87(%rip), %rsi # 0x45c2d5 leaq 0x366d16(%rip), %rdx # 0x45c26b leaq 0x366d94(%rip), %rcx # 0x45c2f0 callq 0x2813f movq %r14, %rdi movq %rax, %rbx callq 0x28fb6 jmp 0xf5571 movq %rax, %rbx movq 0x8(%rsp), %rdi callq 0xf5aba jmp 0xf5580 movq %rax, %rbx movq 0x10(%rsp), %rdi callq 0x29066 jmp 0xf558f movq %rax, %rbx movq 0x18(%rsp), %rdi callq 0x3a954 movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false> 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 0xf55b8 movq %rax, %rdi jmp 0xf5ae2 cmpl $0x7, %ecx jne 0xf55d5 movq (%rax), %rcx movq 0x8(%rax), %rax xorl %edx, %edx cmpq %rax, %rcx je 0xf55e3 movl %edx, (%rcx) incl %edx addq $0x4, %rcx jmp 0xf55c6 movq %rsi, %rdi movq %rdx, %rsi movq %rax, %rdx jmp 0xf5bc7 retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array, double>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, double, double, 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 $0x30, %rsp movl 0x30(%rdi), %eax movq %rdx, %rbx movq %rsi, %r15 movq %rdi, %r14 decl %eax cmpl $0x6, %eax ja 0xf5723 leaq 0x3668b9(%rip), %rdx # 0x45bec4 movslq (%rdx,%rax,4), %rax addq %rdx, %rax jmpq *%rax movq 0x8(%r14), %rax leaq 0x28(%rsp), %rdx leaq 0x20(%rsp), %rcx movq %r15, %rdi movq %rbx, %rsi movq %rax, (%rdx) movq (%r14), %rax movq %rax, (%rcx) callq 0xf5c9a movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0xf5bc7 addq $0x30, %rsp popq %rbx popq %r14 popq %r15 retq movq (%r14), %rdi movq 0x8(%r14), %rsi movq %r15, %rdx vmovsd %xmm2, 0x18(%rsp) vmovsd %xmm1, 0x10(%rsp) vmovsd %xmm0, 0x8(%rsp) callq 0xf74cd jmp 0xf5758 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovsd %xmm2, 0x18(%rsp) vmovsd %xmm1, 0x10(%rsp) vmovsd %xmm0, 0x8(%rsp) callq 0xf6bf7 jmp 0xf56b4 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovsd %xmm2, 0x18(%rsp) vmovsd %xmm1, 0x10(%rsp) vmovsd %xmm0, 0x8(%rsp) callq 0xf7062 vmovsd 0x8(%rsp), %xmm0 vmovsd 0x10(%rsp), %xmm1 vmovsd 0x18(%rsp), %xmm2 movq 0x18(%r14), %rdx movq 0x20(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xf5e8c movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x30, %rsp popq %rbx popq %r14 popq %r15 jmp 0xf5f7e movq (%r14), %rdi movq 0x8(%r14), %rsi movq %rcx, %rdx vmovsd %xmm2, 0x18(%rsp) vmovsd %xmm1, 0x10(%rsp) vmovsd %xmm0, 0x8(%rsp) callq 0x3ceed vmovsd 0x8(%rsp), %xmm0 vmovsd 0x10(%rsp), %xmm1 vmovsd 0x18(%rsp), %xmm2 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xf5d9a jmp 0xf577c movq (%r14), %rdi movq 0x8(%r14), %rsi movq %r15, %rdx vmovsd %xmm2, 0x18(%rsp) vmovsd %xmm1, 0x10(%rsp) vmovsd %xmm0, 0x8(%rsp) callq 0xf79bf vmovsd 0x8(%rsp), %xmm0 vmovsd 0x10(%rsp), %xmm1 vmovsd 0x18(%rsp), %xmm2 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xf6064 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x30, %rsp popq %rbx popq %r14 popq %r15 jmp 0xf5bc7 movq (%r14), %rdi movq 0x8(%r14), %rsi movq %rcx, %rdx vmovsd %xmm2, 0x18(%rsp) vmovsd %xmm1, 0x10(%rsp) vmovsd %xmm0, 0x8(%rsp) callq 0x3ceed vmovsd 0x8(%rsp), %xmm0 vmovsd 0x10(%rsp), %xmm1 vmovsd 0x18(%rsp), %xmm2 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xf5d9a movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x30, %rsp popq %rbx popq %r14 popq %r15 jmp 0xf6156 nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array, double>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, double, double, double, 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 $0x30, %rsp movl 0x30(%rdi), %eax cmpb $0x1, 0x34(%rdi) movq %rdx, %rbx movq %rsi, %r15 movq %rdi, %r14 jne 0xf581c 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 0xf59b5 leaq 0x3666b2(%rip), %rdx # 0x45bee0 movslq (%rdx,%rax,4), %rax addq %rdx, %rax jmpq *%rax movq 0x8(%r14), %rax leaq 0x28(%rsp), %rdx leaq 0x20(%rsp), %rcx movq %r15, %rdi movq %rbx, %rsi movq %rax, (%rdx) movq (%r14), %rax movq %rax, (%rcx) callq 0xf7eb6 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0xf5bc7 addq $0x30, %rsp popq %rbx popq %r14 popq %r15 retq movq (%r14), %rdi movq 0x8(%r14), %rsi movq %r15, %rdx vmovsd %xmm3, 0x18(%rsp) vmovsd %xmm2, 0x10(%rsp) vmovsd %xmm1, 0x8(%rsp) vmovsd %xmm0, (%rsp) callq 0xf8c68 jmp 0xf599e movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovsd %xmm3, 0x18(%rsp) vmovsd %xmm2, 0x10(%rsp) vmovsd %xmm1, 0x8(%rsp) vmovsd %xmm0, (%rsp) callq 0xf8392 jmp 0xf58e6 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovsd %xmm3, 0x18(%rsp) vmovsd %xmm2, 0x10(%rsp) vmovsd %xmm1, 0x8(%rsp) vmovsd %xmm0, (%rsp) callq 0xf87fd vmovsd (%rsp), %xmm0 vmovsd 0x8(%rsp), %xmm1 vmovsd 0x10(%rsp), %xmm2 vmovsd 0x18(%rsp), %xmm3 movq 0x18(%r14), %rdx movq 0x20(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xf812a movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x30, %rsp popq %rbx popq %r14 popq %r15 jmp 0xf5f7e movq (%r14), %rdi movq 0x8(%r14), %rsi movq %rcx, %rdx vmovsd %xmm3, 0x18(%rsp) vmovsd %xmm2, 0x10(%rsp) vmovsd %xmm1, 0x8(%rsp) vmovsd %xmm0, (%rsp) callq 0x3ceed vmovsd (%rsp), %xmm0 vmovsd 0x8(%rsp), %xmm1 vmovsd 0x10(%rsp), %xmm2 vmovsd 0x18(%rsp), %xmm3 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xf7ff6 jmp 0xf59c7 movq (%r14), %rdi movq 0x8(%r14), %rsi movq %r15, %rdx vmovsd %xmm3, 0x18(%rsp) vmovsd %xmm2, 0x10(%rsp) vmovsd %xmm1, 0x8(%rsp) vmovsd %xmm0, (%rsp) callq 0xf915a vmovsd (%rsp), %xmm0 vmovsd 0x8(%rsp), %xmm1 vmovsd 0x10(%rsp), %xmm2 vmovsd 0x18(%rsp), %xmm3 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xf825e movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x30, %rsp popq %rbx popq %r14 popq %r15 jmp 0xf5bc7 movq (%r14), %rdi movq 0x8(%r14), %rsi movq %rcx, %rdx vmovsd %xmm3, 0x18(%rsp) vmovsd %xmm2, 0x10(%rsp) vmovsd %xmm1, 0x8(%rsp) vmovsd %xmm0, (%rsp) callq 0x3ceed vmovsd (%rsp), %xmm0 vmovsd 0x8(%rsp), %xmm1 vmovsd 0x10(%rsp), %xmm2 vmovsd 0x18(%rsp), %xmm3 movq (%r14), %rdx movq 0x8(%r14), %rcx movq %r15, %rdi movq %rbx, %rsi callq 0xf7ff6 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x30, %rsp popq %rbx popq %r14 popq %r15 jmp 0xf6156
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false> const, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, 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 0xf5b06 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 0xf5ba7 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 0xf5b63 movl 0x4(%r13), %esi movq %r14, %rdi callq 0x3664a addl %eax, %ebx addq $0x8, %r13 jmp 0xf5b4a movq 0x20(%rsp), %rax movq 0x60(%rax), %rax movl (%rax,%rbp,4), %eax movl %eax, %ecx subl %ebx, %ecx jle 0xf5b83 shlq $0x20, %rcx orq %rbp, %rcx movq %rcx, 0x8(%rsp) jmp 0xf5b93 jge 0xf5ba2 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 0xf5b28 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, 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 0xf5be5 movq %rax, 0x8(%rbx) leaq 0x4(%rsp), %r12 xorl %esi, %esi movl %esi, 0x4(%rsp) cmpl 0x78(%r15), %esi je 0xf5c18 movq %r15, %rdi movq %r14, %rdx callq 0xf5c2f testb %al, %al jne 0xf5c10 movq %rbx, %rdi movq %r12, %rsi callq 0x31460 movl 0x4(%rsp), %esi incl %esi jmp 0xf5bec 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_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false> 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 movl %esi, %ebp leaq 0x10(%rdi), %rsi leaq 0x8(%rsp), %r15 movq %rdx, %r14 movq %rdi, %rbx movl %ebp, %edx movq %r15, %rdi callq 0x3c868 movq (%r15), %r12 movq 0x8(%r15), %r13 xorl %r15d, %r15d cmpq %r12, %r13 je 0xf5c7c movl 0x4(%r13), %esi movq %r14, %rdi callq 0x3664a addl %eax, %r15d addq $0x8, %r13 jmp 0xf5c62 movq 0x60(%rbx), %rcx movslq %ebp, %rax cmpl (%rcx,%rax,4), %r15d sete %al addq $0x18, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::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>>>>, double, double, double)
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 vmovsd %xmm2, 0x28(%rsp) vmovsd %xmm1, 0x20(%rsp) vmovsd %xmm0, 0x18(%rsp) movq %rcx, 0x30(%rsp) movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 xorl %ebp, %ebp movq %rax, 0x10(%rsp) movq (%rdx), %rax movq 0x30(%rsp), %rcx cmpq (%rcx), %rax je 0xf5d84 movslq -0x4(%rax), %rbx movq 0x10(%rsp), %rsi movq %rsp, %rdi movl %ebx, %edx callq 0x3de66 vmovsd 0x28(%rsp), %xmm0 movq (%rsp), %rdx movq 0x8(%rsp), %rsi movq %r12, %rdi callq 0xf6196 movq (%rsp), %rdx movq 0x8(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0xf61b4 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 movq %r13, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xf627a movq 0x60(%r12), %rax vmovsd 0x18(%rsp), %xmm0 vmovsd 0x20(%rsp), %xmm1 movq 0x8(%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 0xf62ad orb %al, %bpl movq (%r14), %rax addq $-0x4, %rax movq %rax, (%r14) jmp 0xf5cd6 andb $0x1, %bpl movl %ebp, %eax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
bool baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, 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>>>, double, double, double)
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 vmovsd %xmm2, 0x28(%rsp) vmovsd %xmm1, 0x20(%rsp) vmovsd %xmm0, 0x18(%rsp) movq %rcx, 0x30(%rsp) movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 xorl %ebp, %ebp movq %rax, 0x10(%rsp) cmpq 0x30(%rsp), %r14 je 0xf5e77 movslq (%r14), %rbx movq 0x10(%rsp), %rsi movq %rsp, %rdi movl %ebx, %edx callq 0x3de66 vmovsd 0x28(%rsp), %xmm0 movq (%rsp), %rdx movq 0x8(%rsp), %rsi movq %r12, %rdi callq 0xf6196 movq (%rsp), %rdx movq 0x8(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0xf61b4 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 movq %r13, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xf627a movq 0x60(%r12), %rax vmovsd 0x18(%rsp), %xmm0 vmovsd 0x20(%rsp), %xmm1 movq 0x8(%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 0xf62ad orb %al, %bpl addq $0x4, %r14 jmp 0xf5dd3 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
bool baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::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>>>>, double, double, double)
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 vmovsd %xmm2, 0x28(%rsp) vmovsd %xmm1, 0x20(%rsp) vmovsd %xmm0, 0x18(%rsp) movq %rcx, 0x30(%rsp) movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 xorl %ebp, %ebp movq %rax, 0x10(%rsp) cmpq 0x30(%rsp), %r14 je 0xf5f69 movslq (%r14), %rbx movq 0x10(%rsp), %rsi movq %rsp, %rdi movl %ebx, %edx callq 0x3de66 vmovsd 0x28(%rsp), %xmm0 movq (%rsp), %rdx movq 0x8(%rsp), %rsi movq %r12, %rdi callq 0xf6196 movq (%rsp), %rdx movq 0x8(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0xf61b4 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 movq %r13, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xf627a movq 0x60(%r12), %rax vmovsd 0x18(%rsp), %xmm0 vmovsd 0x20(%rsp), %xmm1 movq 0x8(%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 0xf62ad orb %al, %bpl addq $0x8, %r14 jmp 0xf5ec5 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, 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 0xf5fa2 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 0xf6043 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 0xf5fff movl 0x4(%r13), %esi movq %r14, %rdi callq 0x3664a addl %eax, %ebx addq $0x8, %r13 jmp 0xf5fe6 movq 0x20(%rsp), %rax movq 0x60(%rax), %rax movl (%rax,%rbp,4), %eax movl %eax, %ecx subl %ebx, %ecx jle 0xf601f shlq $0x20, %rcx orq %rbp, %rcx movq %rcx, 0x8(%rsp) jmp 0xf602f jge 0xf603e 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 0xf5fc4 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, 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>>>, double, double, double)
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 vmovsd %xmm2, 0x28(%rsp) vmovsd %xmm1, 0x20(%rsp) vmovsd %xmm0, 0x18(%rsp) movq %rcx, 0x30(%rsp) movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 xorl %ebp, %ebp movq %rax, 0x10(%rsp) cmpq 0x30(%rsp), %r14 je 0xf6141 movslq (%r14), %rbx movq 0x10(%rsp), %rsi movq %rsp, %rdi movl %ebx, %edx callq 0x3de66 vmovsd 0x28(%rsp), %xmm0 movq (%rsp), %rdx movq 0x8(%rsp), %rsi movq %r12, %rdi callq 0xf6196 movq (%rsp), %rdx movq 0x8(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0xf61b4 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 movq %r13, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xf627a movq 0x60(%r12), %rax vmovsd 0x18(%rsp), %xmm0 vmovsd 0x20(%rsp), %xmm1 movq 0x8(%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 0xf62ad orb %al, %bpl addq $0x4, %r14 jmp 0xf609d 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, 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 0xf6188 movq %r14, %rdi movl %r15d, %esi movq %rbx, %rdx callq 0xf5c2f xorb $0x1, %al incl %r15d movzbl %al, %eax addl %eax, %ebp jmp 0xf6168 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::affect<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, double>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, double, double)
bool affect(Solver& slv, Xtype& x, Iterator it, int k, int selected, int r_size, const Float kappa, const Float delta) { constexpr Float one{ 1 }; constexpr Float two{ 2 }; constexpr Float middle{ (two + one) / two }; const auto old_pi = slv.pi[k]; auto d = delta; if (selected < 0) { // slv.pi[k] += slv.R[0].value / two; d += (kappa / (one - kappa)) * (slv.R[0].value / two); for (int i = 0; i != r_size; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.set(var->column); slv.P[var->value] += d; } else { x.unset(var->column); slv.P[var->value] -= d; } } } else if (selected + 1 >= r_size) { // slv.pi[k] += slv.R[selected].value * middle; d += (kappa / (one - kappa)) * (slv.R[selected].value * middle); for (int i = 0; i != r_size; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.unset(var->column); slv.P[var->value] -= d; } else { x.set(var->column); slv.P[var->value] += d; } } } else { slv.pi[k] += ((slv.R[selected].value + slv.R[selected + 1].value) / two); d += (kappa / (one - kappa)) * (slv.R[selected + 1].value - slv.R[selected].value); int i = 0; for (; i <= selected; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.unset(var->column); slv.P[var->value] -= d; } else { x.set(var->column); slv.P[var->value] += d; } } for (; i != r_size; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.set(var->column); slv.P[var->value] += d; } else { x.unset(var->column); slv.P[var->value] -= d; } } } // TODO job: develops is_valid_constraint for all the solvers bx_expects(is_valid_constraint(slv, k, x)); return is_signbit_change(old_pi, slv.pi[k]); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movq %rdi, %rbx movq 0x68(%rbx), %rax movslq %ecx, %rdi movq %rdx, %r15 movq %rsi, %r14 movl %ecx, 0xc(%rsp) movq %rdi, 0x18(%rsp) vmovsd (%rax,%rdi,8), %xmm3 vmovapd %xmm3, 0x20(%rsp) testl %r8d, %r8d js 0xf638e leal 0x1(%r8), %ecx cmpl %r9d, %ecx jge 0xf63fd movq 0x58(%rbx), %rsi movl %r8d, %edx shlq $0x4, %rdx movl %ecx, %ebp movq %rbp, 0x10(%rsp) shlq $0x4, %rbp xorl %r13d, %r13d movl %r9d, 0x8(%rsp) vmovsd (%rsi,%rdx), %xmm2 vaddsd (%rsi,%rbp), %xmm2, %xmm2 vmulsd 0x362653(%rip), %xmm2, %xmm2 # 0x458978 vaddsd %xmm2, %xmm3, %xmm2 vmovsd %xmm2, (%rax,%rdi,8) vmovsd 0x35dd02(%rip), %xmm2 # 0x454038 vsubsd %xmm0, %xmm2, %xmm2 vdivsd %xmm2, %xmm0, %xmm0 vmovsd (%rsi,%rbp), %xmm2 vsubsd (%rsi,%rdx), %xmm2, %xmm2 vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1 vmovsd %xmm2, (%rsp) cmpq %r13, %rbp je 0xf6470 movq 0x58(%rbx), %rax movq %r14, %rdi movslq 0x8(%rax,%r13), %r12 movl 0x4(%r15,%r12,8), %esi callq 0x369c8 movslq (%r15,%r12,8), %rax movq 0x50(%rbx), %rcx vmovsd (%rsp), %xmm0 addq $0x10, %r13 vaddsd (%rcx,%rax,8), %xmm0, %xmm0 vmovsd %xmm0, (%rcx,%rax,8) jmp 0xf6352 vmovsd 0x35dca2(%rip), %xmm2 # 0x454038 movq 0x58(%rbx), %rax movl %r9d, %r12d shlq $0x4, %r12 xorl %ebp, %ebp vsubsd %xmm0, %xmm2, %xmm2 vdivsd %xmm2, %xmm0, %xmm0 vmovsd (%rax), %xmm2 vmulsd 0x3625c1(%rip), %xmm2, %xmm2 # 0x458978 vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1 vmovsd %xmm2, (%rsp) cmpq %rbp, %r12 je 0xf64b6 movq 0x58(%rbx), %rax movq %r14, %rdi movslq 0x8(%rax,%rbp), %r13 movl 0x4(%r15,%r13,8), %esi callq 0x36a06 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx addq $0x10, %rbp vmovsd (%rcx,%rax,8), %xmm0 vsubsd (%rsp), %xmm0, %xmm0 vmovsd %xmm0, (%rcx,%rax,8) jmp 0xf63c1 vmovsd 0x35dc33(%rip), %xmm2 # 0x454038 movq 0x58(%rbx), %rcx movl %r8d, %eax shlq $0x4, %rax movl %r9d, %r12d shlq $0x4, %r12 xorl %ebp, %ebp vsubsd %xmm0, %xmm2, %xmm2 vdivsd %xmm2, %xmm0, %xmm0 vmovsd (%rcx,%rax), %xmm2 vmulsd 0x365892(%rip), %xmm2, %xmm2 # 0x45bcc0 vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1 vmovsd %xmm2, (%rsp) cmpq %rbp, %r12 je 0xf64b6 movq 0x58(%rbx), %rax movq %r14, %rdi movslq 0x8(%rax,%rbp), %r13 movl 0x4(%r15,%r13,8), %esi callq 0x369c8 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx vmovsd (%rsp), %xmm0 addq $0x10, %rbp vaddsd (%rcx,%rax,8), %xmm0, %xmm0 vmovsd %xmm0, (%rcx,%rax,8) jmp 0xf6438 movl 0x8(%rsp), %r12d orq $0x8, %rbp subq 0x10(%rsp), %r12 subq $0x1, %r12 jb 0xf64b6 movq 0x58(%rbx), %rax movq %r14, %rdi movslq (%rax,%rbp), %r13 movl 0x4(%r15,%r13,8), %esi callq 0x36a06 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx addq $0x10, %rbp vmovsd (%rcx,%rax,8), %xmm0 vsubsd (%rsp), %xmm0, %xmm0 vmovsd %xmm0, (%rcx,%rax,8) jmp 0xf647e movl 0xc(%rsp), %esi movq %rbx, %rdi movq %r14, %rdx callq 0xf5c2f testb %al, %al je 0xf64f7 vmovapd 0x20(%rsp), %xmm0 movq 0x68(%rbx), %rcx movq 0x18(%rsp), %rdx vmovmskpd %xmm0, %eax shlq $0x3f, %rax xorq (%rcx,%rdx,8), %rax shrq $0x3f, %rax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x361ce0(%rip), %rdi # 0x4581de leaq 0x365e17(%rip), %rsi # 0x45c31c leaq 0x363a80(%rip), %rdx # 0x459f8c leaq 0x365e28(%rip), %rcx # 0x45c33b callq 0x2813f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::rc_data*>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::rc_data*, baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::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 0x10(%rdi), %rsi cmpq %r14, %rsi je 0xf6553 vmovsd (%rdi), %xmm0 leaq 0x10(%rsi), %r15 vucomisd (%rsi), %xmm0 movq %r15, %rsi jne 0xf653f jnp 0xf6527 addq $-0x10, %r15 movq %r15, %rsi movq %rbx, %rdx callq 0xf6a72 movq %r15, %rdi jmp 0xf6523 movq %rbx, %rdx callq 0xf6a72 popq %rbx popq %r14 popq %r15 retq jmp 0xf6563 movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::push_and_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>>>>, double, double, double, double)
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 $0x48, %rsp leaq 0x10(%rdi), %rax vmovsd %xmm3, 0x38(%rsp) vmovsd %xmm2, 0x30(%rsp) vmovsd %xmm1, 0x28(%rsp) vmovsd %xmm0, 0x20(%rsp) movq %rcx, 0x40(%rsp) movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r13 xorl %r12d, %r12d movq %rax, 0x18(%rsp) movq (%rdx), %rax movq 0x40(%rsp), %rcx cmpq (%rcx), %rax je 0xf7fe0 movl -0x4(%rax), %eax movq 0x18(%rsp), %rsi leaq 0x8(%rsp), %rdi movslq %eax, %rbp movl %ebp, %edx callq 0x3de66 vmovsd 0x30(%rsp), %xmm0 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r13, %rdi callq 0xf6196 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r13, %rdi movq %r15, %rcx callq 0xf61b4 vmovsd 0x38(%rsp), %xmm1 movl %eax, %ebx movq 0x58(%r13), %rdi movq 0x70(%r13), %rax movl %ebx, %ecx shlq $0x4, %rcx xorl %edx, %edx cmpq %rdx, %rcx je 0xf7f88 movslq 0x8(%rdi,%rdx), %rsi movq 0x8(%rax), %r8 vmovsd (%r8,%rsi,8), %xmm0 vfmadd213sd (%rdi,%rdx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovsd %xmm0, (%rdi,%rdx) addq $0x10, %rdx jmp 0xf7f63 movq 0x8(%r13), %rdx movslq %ebx, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xf627a movq 0x60(%r13), %rax vmovsd 0x20(%rsp), %xmm0 vmovsd 0x28(%rsp), %xmm1 movq 0x10(%rsp), %rdx movq %r13, %rdi movq %r15, %rsi movl %ebp, %ecx movl %ebx, %r9d movl (%rax,%rbp,4), %r8d cmpl %r8d, %ebx cmovll %ebx, %r8d decl %r8d callq 0xf62ad orb %al, %r12b movq (%r14), %rax addq $-0x4, %rax movq %rax, (%r14) jmp 0xf7ef9 andb $0x1, %r12b movl %r12d, %eax addq $0x48, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, 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>>>, double, double, double, double)
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 $0x48, %rsp leaq 0x10(%rdi), %rax vmovsd %xmm3, 0x38(%rsp) vmovsd %xmm2, 0x30(%rsp) vmovsd %xmm1, 0x28(%rsp) vmovsd %xmm0, 0x20(%rsp) movq %rcx, 0x40(%rsp) movq %rdx, %r14 movq %rsi, %r12 movq %rdi, %r13 xorl %r15d, %r15d movq %rax, 0x18(%rsp) cmpq 0x40(%rsp), %r14 je 0xf8114 movl (%r14), %eax movq 0x18(%rsp), %rsi leaq 0x8(%rsp), %rdi movslq %eax, %rbp movl %ebp, %edx callq 0x3de66 vmovsd 0x30(%rsp), %xmm0 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r13, %rdi callq 0xf6196 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r13, %rdi movq %r12, %rcx callq 0xf61b4 vmovsd 0x38(%rsp), %xmm1 movl %eax, %ebx movq 0x58(%r13), %rdi movq 0x70(%r13), %rax movl %ebx, %ecx shlq $0x4, %rcx xorl %edx, %edx cmpq %rdx, %rcx je 0xf80c2 movslq 0x8(%rdi,%rdx), %rsi movq 0x8(%rax), %r8 vmovsd (%r8,%rsi,8), %xmm0 vfmadd213sd (%rdi,%rdx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovsd %xmm0, (%rdi,%rdx) addq $0x10, %rdx jmp 0xf809d movq 0x8(%r13), %rdx movslq %ebx, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xf627a movq 0x60(%r13), %rax vmovsd 0x20(%rsp), %xmm0 vmovsd 0x28(%rsp), %xmm1 movq 0x10(%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 0xf62ad orb %al, %r15b addq $0x4, %r14 jmp 0xf8036 andb $0x1, %r15b movl %r15d, %eax addq $0x48, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, 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>>>>, double, double, double, double)
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 $0x48, %rsp leaq 0x10(%rdi), %rax vmovsd %xmm3, 0x38(%rsp) vmovsd %xmm2, 0x30(%rsp) vmovsd %xmm1, 0x28(%rsp) vmovsd %xmm0, 0x20(%rsp) movq %rcx, 0x40(%rsp) movq %rdx, %r14 movq %rsi, %r12 movq %rdi, %r13 xorl %r15d, %r15d movq %rax, 0x18(%rsp) cmpq 0x40(%rsp), %r14 je 0xf8248 movl (%r14), %eax movq 0x18(%rsp), %rsi leaq 0x8(%rsp), %rdi movslq %eax, %rbp movl %ebp, %edx callq 0x3de66 vmovsd 0x30(%rsp), %xmm0 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r13, %rdi callq 0xf6196 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r13, %rdi movq %r12, %rcx callq 0xf61b4 vmovsd 0x38(%rsp), %xmm1 movl %eax, %ebx movq 0x58(%r13), %rdi movq 0x70(%r13), %rax movl %ebx, %ecx shlq $0x4, %rcx xorl %edx, %edx cmpq %rdx, %rcx je 0xf81f6 movslq 0x8(%rdi,%rdx), %rsi movq 0x8(%rax), %r8 vmovsd (%r8,%rsi,8), %xmm0 vfmadd213sd (%rdi,%rdx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovsd %xmm0, (%rdi,%rdx) addq $0x10, %rdx jmp 0xf81d1 movq 0x8(%r13), %rdx movslq %ebx, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xf627a movq 0x60(%r13), %rax vmovsd 0x20(%rsp), %xmm0 vmovsd 0x28(%rsp), %xmm1 movq 0x10(%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 0xf62ad orb %al, %r15b addq $0x8, %r14 jmp 0xf816a andb $0x1, %r15b movl %r15d, %eax addq $0x48, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::push_and_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>>>, double, double, double, double)
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 $0x48, %rsp leaq 0x10(%rdi), %rax vmovsd %xmm3, 0x38(%rsp) vmovsd %xmm2, 0x30(%rsp) vmovsd %xmm1, 0x28(%rsp) vmovsd %xmm0, 0x20(%rsp) movq %rcx, 0x40(%rsp) movq %rdx, %r14 movq %rsi, %r12 movq %rdi, %r13 xorl %r15d, %r15d movq %rax, 0x18(%rsp) cmpq 0x40(%rsp), %r14 je 0xf837c movl (%r14), %eax movq 0x18(%rsp), %rsi leaq 0x8(%rsp), %rdi movslq %eax, %rbp movl %ebp, %edx callq 0x3de66 vmovsd 0x30(%rsp), %xmm0 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r13, %rdi callq 0xf6196 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r13, %rdi movq %r12, %rcx callq 0xf61b4 vmovsd 0x38(%rsp), %xmm1 movl %eax, %ebx movq 0x58(%r13), %rdi movq 0x70(%r13), %rax movl %ebx, %ecx shlq $0x4, %rcx xorl %edx, %edx cmpq %rdx, %rcx je 0xf832a movslq 0x8(%rdi,%rdx), %rsi movq 0x8(%rax), %r8 vmovsd (%r8,%rsi,8), %xmm0 vfmadd213sd (%rdi,%rdx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovsd %xmm0, (%rdi,%rdx) addq $0x10, %rdx jmp 0xf8305 movq 0x8(%r13), %rdx movslq %ebx, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xf627a movq 0x60(%r13), %rax vmovsd 0x20(%rsp), %xmm0 vmovsd 0x28(%rsp), %xmm1 movq 0x10(%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 0xf62ad orb %al, %r15b addq $0x4, %r14 jmp 0xf829e andb $0x1, %r15b movl %r15d, %eax addq $0x48, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<double> const&, double)
result operator()(const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { result r; bit_array x(variables); int best_remaining = INT_MAX; auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const long int w_limit = static_cast<long int>(p.w); Solver slv( m_rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); { std::bernoulli_distribution choose_mutation( m_ctx.parameters.init_policy_random); bit_array empty_x; switch (p.init_policy) { case solver_parameters::init_policy_type::pessimistic_solve: init_with_pre_solve<Cost, Mode>( x, empty_x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::optimistic_solve: init_with_pre_solve<Cost, Mode>( empty_x, x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::bastert: init_with_bastert<Cost, Mode>(x, original_costs, variables, 0); break; } for (int i = 0, e = x.size(); i != e; ++i) if (choose_mutation(m_rng)) x.invert(i); } bool start_push = false; auto kappa = static_cast<Float>(p.kappa_min); Observer obs("img", slv.m, slv.n, p.limit); m_begin = std::chrono::steady_clock::now(); m_end = std::chrono::steady_clock::now(); compute.init(slv, x); for (long int i = 0; i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta); obs.make_observation(slv.ap, slv.P.get(), slv.pi.get()); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), i); best_remaining = remaining; start_push = true; break; } if (remaining < best_remaining) { store_if_better(x, remaining, i); best_remaining = remaining; } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) { r.status = result_status::kappa_max_reached; break; } if (is_timelimit_reached()) { r.status = result_status::time_limit_reached; break; } } if (!start_push) { r.status = result_status::limit_reached; } else { for (int push = 0; push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_rng, pushing_k_factor * kappa, delta, theta, pushing_objective_amplifier); if (remaining == 0) store_if_better(x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); if (is_timelimit_reached()) break; for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run(slv, x, m_rng, kappa, delta, theta); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; if (is_timelimit_reached()) break; } } } if (m_best.remaining_constraints == 0) r.status = result_status::success; if (!m_best.x.empty()) { r.solutions.resize(1); convert(m_best, r.solutions[0], variables); } return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x3a8, %rsp # imm = 0x3A8 vmovsd %xmm0, 0x48(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %r8, %r13 movl %ecx, %ebx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, 0x10(%rsp) vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) leaq 0x20(%rsp), %rdi movl %ecx, %esi vzeroupper callq 0x368ae movq 0x10(%r14), %r12 movq 0x18(%r14), %rcx leaq 0x78(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x64935 vmovsd 0x20(%r12), %xmm0 vmovsd 0x10(%r12), %xmm1 vmovsd %xmm0, 0x68(%rsp) vmovsd 0x28(%r12), %xmm0 vmovsd %xmm1, 0x30(%rsp) vmovsd %xmm0, 0x70(%rsp) vmovsd 0x30(%r12), %xmm0 vmovsd %xmm0, 0x60(%rsp) vmovsd 0x8(%r12), %xmm0 vmovsd %xmm0, 0x38(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vucomisd %xmm1, %xmm0 jbe 0xf9de0 movq 0x10(%r14), %rdi vmovsd 0x38(%rsp), %xmm0 leaq 0x78(%rsp), %rsi movl %ebx, %edx callq 0x64a13 vmovsd %xmm0, 0x30(%rsp) vcvttsd2si 0xa0(%r12), %rax vmovsd 0x38(%r12), %xmm0 vmovsd 0x40(%r12), %xmm1 movq 0x18(%r14), %rsi movq %rax, 0x50(%rsp) movq 0x8(%r15), %rax vmovsd %xmm0, 0x90(%rsp) vmovsd %xmm1, 0x88(%rsp) subq (%r15), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0xd0(%rsp), %rdi leaq 0x78(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0xf5432 movl 0xcc(%r12), %esi leaq 0x98(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x5c(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, 0x8(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0x150(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0xf9ec1 cmpl $0x1, %eax je 0xf9e9b cmpl $0x2, %eax jne 0xf9ed2 movq 0x18(%r14), %rdx leaq 0x150(%rsp), %rdi leaq 0x20(%rsp), %rsi jmp 0xf9eac movq 0x18(%r14), %rdx leaq 0x20(%rsp), %rdi leaq 0x150(%rsp), %rsi vmovsd 0x35a184(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x62c65 jmp 0xf9ed2 leaq 0x20(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0x62bf9 leaq 0x20(%rsp), %r15 movq %r13, 0x40(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0xf9f08 movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd 0x8(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xf9f04 movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0xf9ee1 leaq 0x158(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 movl 0x148(%rsp), %ecx movl 0x14c(%rsp), %r8d movq 0xb0(%r12), %r9 vmovsd %xmm0, 0x8(%rsp) leaq 0x360637(%rip), %rdx # 0x45a577 leaq 0x150(%rsp), %rdi pushq $0x3 popq %rsi callq 0x4346e callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0x98(%rsp), %rdi leaq 0xd0(%rsp), %rsi leaq 0x20(%rsp), %rdx callq 0xf55a2 vmovsd 0x8(%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x20(%rsp), %r13 xorl %r15d, %r15d cmpq 0xb0(%r12), %r15 je 0xfa073 movq 0x18(%r14), %rcx vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 leaq 0x98(%rsp), %rdi leaq 0xd0(%rsp), %rsi movq %r13, %rdx vmovsd %xmm0, 0x8(%rsp) callq 0xf55e4 movq 0x120(%rsp), %rdx movq 0x138(%rsp), %rcx movl %eax, %ebx leaq 0x150(%rsp), %rdi leaq 0xe0(%rsp), %rsi callq 0x6c6c0 testl %ebx, %ebx je 0xfa118 cmpl %ebp, %ebx jge 0xfa00f movq %r14, %rdi movq %r13, %rsi movl %ebx, %edx movq %r15, %rcx callq 0xfaa9e movl %ebx, %ebp cmpq 0x50(%rsp), %r15 jle 0xfa045 vcvtsi2sd %ebx, %xmm3, %xmm0 vcvtsi2sdl 0x148(%rsp), %xmm3, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x60(%rsp), %xmm1 callq 0xb1f0 vmovsd 0x8(%rsp), %xmm1 vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xfa04b vmovsd 0x8(%rsp), %xmm0 vucomisd 0x70(%rsp), %xmm0 ja 0xfa073 movq %r14, %rdi vmovsd %xmm0, 0x8(%rsp) callq 0xfaad6 vmovsd 0x8(%rsp), %xmm0 testb %al, %al jne 0xfa073 incq %r15 jmp 0xf9f8e movq 0x10(%rsp), %rax movl $0x5, 0xa0(%rax) cmpl $0x0, 0x50(%r14) jne 0xfa095 movq 0x10(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0xfa0c3 movq 0x10(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x5c(%rsp), %edx movq %r14, %rdi callq 0x35781 leaq 0x150(%rsp), %rdi callq 0x435d0 leaq 0x98(%rsp), %rdi callq 0x393ac leaq 0xd0(%rsp), %rdi callq 0xf5a44 leaq 0x80(%rsp), %rdi callq 0x29066 leaq 0x28(%rsp), %rdi callq 0x357fe movq 0x10(%rsp), %rax addq $0x3a8, %rsp # imm = 0x3A8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi leaq 0x20(%rsp), %rbx movq %rbx, %rsi callq 0x62f18 movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0xfaa54 vmovsd 0x8(%rsp), %xmm0 leaq 0xd0(%rsp), %r15 leaq 0x20(%rsp), %rbp xorl %ebx, %ebx movl $0x0, 0x1c(%rsp) cmpl 0xbc(%r12), %ebx jge 0xfa082 vmovsd %xmm0, 0x8(%rsp) vmulsd 0x90(%rsp), %xmm0, %xmm0 movq 0x18(%r14), %rcx vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 vmovsd 0x88(%rsp), %xmm3 leaq 0x98(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx callq 0xf57f0 testl %eax, %eax jne 0xfa1d6 vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi movq %rbp, %rsi callq 0x62f18 movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xfaa54 movq %r14, %rdi callq 0xfaad6 vmovsd 0x8(%rsp), %xmm0 testb %al, %al jne 0xfa082 movl %ebx, 0x50(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0xfa2df movq 0x18(%r14), %rcx vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 leaq 0x98(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx vmovsd %xmm0, 0x8(%rsp) callq 0xf55e4 testl %eax, %eax je 0xfa2a1 vcvtsi2sd %r13d, %xmm4, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0xfa274 vcvtsi2sd %eax, %xmm4, %xmm0 vcvtsi2sdl 0x148(%rsp), %xmm4, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x60(%rsp), %xmm1 callq 0xb1f0 vmovsd 0x8(%rsp), %xmm1 vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xfa27a vmovsd 0x8(%rsp), %xmm0 vucomisd 0x70(%rsp), %xmm0 ja 0xfa2df movq %r14, %rdi vmovsd %xmm0, 0x8(%rsp) callq 0xfaad6 testb %al, %al jne 0xfa2d9 vmovsd 0x8(%rsp), %xmm0 incl %ebx jmp 0xfa1f5 vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi movq %rbp, %rsi callq 0x62f18 movl 0xc0(%r12), %eax imull 0x1c(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xfaa54 vmovsd 0x8(%rsp), %xmm0 jmp 0xfa2df vmovsd 0x8(%rsp), %xmm0 movl 0x50(%rsp), %ebx decl 0x1c(%rsp) incl %ebx jmp 0xfa15b jmp 0xfa325 jmp 0xfa2fe jmp 0xfa325 movq %rax, %r14 jmp 0xfa335 movq %rax, %r14 jmp 0xfa342 movq %rax, %r14 jmp 0xfa34f movq %rax, %r14 jmp 0xfa35c movq %rax, %r14 jmp 0xfa366 jmp 0xfa325 jmp 0xfa325 jmp 0xfa325 leaq 0x158(%rsp), %rdi movq %rax, %r14 callq 0x357fe jmp 0xfa335 leaq 0x150(%rsp), %rdi movq %rax, %r14 callq 0x435d0 leaq 0x98(%rsp), %rdi callq 0x393ac leaq 0xd0(%rsp), %rdi callq 0xf5a44 leaq 0x80(%rsp), %rdi callq 0x29066 leaq 0x28(%rsp), %rdi callq 0x357fe movq 0x10(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<double> const&, double)
result operator()(const std::vector<merged_constraint>& constraints, int variables, const Cost& original_costs, double cost_constant) { result r; bit_array x(variables); int best_remaining = INT_MAX; auto& p = m_ctx.parameters; auto norm_costs = normalize_costs<Float, Cost>( m_ctx, original_costs, m_rng, variables); const auto kappa_step = static_cast<Float>(p.kappa_step); const auto kappa_max = static_cast<Float>(p.kappa_max); const auto alpha = static_cast<Float>(p.alpha); const auto theta = static_cast<Float>(p.theta); const auto delta = p.delta < 0 ? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables) : static_cast<Float>(p.delta); const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor); const auto pushing_objective_amplifier = static_cast<Float>(p.pushing_objective_amplifier); const long int w_limit = static_cast<long int>(p.w); Solver slv( m_rng, length(constraints), variables, norm_costs, constraints); compute_order compute(p.order, variables); { std::bernoulli_distribution choose_mutation( m_ctx.parameters.init_policy_random); bit_array empty_x; switch (p.init_policy) { case solver_parameters::init_policy_type::pessimistic_solve: init_with_pre_solve<Cost, Mode>( x, empty_x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::optimistic_solve: init_with_pre_solve<Cost, Mode>( empty_x, x, m_rng, original_costs, constraints, 1.0); break; case solver_parameters::init_policy_type::bastert: init_with_bastert<Cost, Mode>(x, original_costs, variables, 0); break; } for (int i = 0, e = x.size(); i != e; ++i) if (choose_mutation(m_rng)) x.invert(i); } bool start_push = false; auto kappa = static_cast<Float>(p.kappa_min); Observer obs("img", slv.m, slv.n, p.limit); m_begin = std::chrono::steady_clock::now(); m_end = std::chrono::steady_clock::now(); compute.init(slv, x); for (long int i = 0; i != p.limit; ++i) { auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta); obs.make_observation(slv.ap, slv.P.get(), slv.pi.get()); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), i); best_remaining = remaining; start_push = true; break; } if (remaining < best_remaining) { store_if_better(x, remaining, i); best_remaining = remaining; } if (i > w_limit) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) { r.status = result_status::kappa_max_reached; break; } if (is_timelimit_reached()) { r.status = result_status::time_limit_reached; break; } } if (!start_push) { r.status = result_status::limit_reached; } else { for (int push = 0; push < p.pushes_limit; ++push) { auto remaining = compute.push_and_run(slv, x, m_rng, pushing_k_factor * kappa, delta, theta, pushing_objective_amplifier); if (remaining == 0) store_if_better(x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - 1); if (is_timelimit_reached()) break; for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) { remaining = compute.run(slv, x, m_rng, kappa, delta, theta); if (remaining == 0) { store_if_better( x, original_costs.results(x, cost_constant), -push * p.pushing_iteration_limit - iter - 1); break; } if (iter > p.w) kappa += kappa_step * std::pow(static_cast<Float>(remaining) / static_cast<Float>(slv.m), alpha); if (kappa > kappa_max) break; if (is_timelimit_reached()) break; } } } if (m_best.remaining_constraints == 0) r.status = result_status::success; if (!m_best.x.empty()) { r.solutions.resize(1); convert(m_best, r.solutions[0], variables); } return r; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x158, %rsp # imm = 0x158 vmovsd %xmm0, 0x40(%rsp) vxorpd %xmm0, %xmm0, %xmm0 movq %r8, %r13 movl %ecx, %ebx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, 0x8(%rsp) vmovupd %zmm0, 0x58(%rdi) vmovupd %zmm0, 0x40(%rdi) vmovupd %zmm0, (%rdi) movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF movl $0x2, 0xa0(%rdi) leaq 0x18(%rsp), %rdi movl %ecx, %esi vzeroupper callq 0x368ae movq 0x10(%r14), %r12 movq 0x18(%r14), %rcx leaq 0x80(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx movl %ebx, %r8d callq 0x64935 vmovsd 0x20(%r12), %xmm0 vmovsd 0x10(%r12), %xmm1 vmovsd %xmm0, 0x60(%rsp) vmovsd 0x28(%r12), %xmm0 vmovsd %xmm1, 0x28(%rsp) vmovsd %xmm0, 0x68(%rsp) vmovsd 0x30(%r12), %xmm0 vmovsd %xmm0, 0x58(%rsp) vmovsd 0x8(%r12), %xmm0 vmovsd %xmm0, 0x30(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vucomisd %xmm1, %xmm0 jbe 0xfa466 movq 0x10(%r14), %rdi vmovsd 0x30(%rsp), %xmm0 leaq 0x80(%rsp), %rsi movl %ebx, %edx callq 0x64a13 vmovsd %xmm0, 0x28(%rsp) vcvttsd2si 0xa0(%r12), %rax vmovsd 0x38(%r12), %xmm0 vmovsd 0x40(%r12), %xmm1 movq 0x18(%r14), %rsi movq %rax, 0x48(%rsp) movq 0x8(%r15), %rax vmovsd %xmm0, 0x98(%rsp) vmovsd %xmm1, 0x90(%rsp) subq (%r15), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0xd8(%rsp), %rdi leaq 0x80(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0xf5432 movl 0xcc(%r12), %esi leaq 0xa0(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq 0x10(%r14), %rax movl %ebx, 0x54(%rsp) vmovsd 0x48(%rax), %xmm0 vmovsd %xmm0, (%rsp) vxorpd %xmm0, %xmm0, %xmm0 vmovapd %xmm0, 0x70(%rsp) movl 0xd4(%r12), %eax testl %eax, %eax je 0xfa540 cmpl $0x1, %eax je 0xfa51d cmpl $0x2, %eax jne 0xfa551 movq 0x18(%r14), %rdx leaq 0x70(%rsp), %rdi leaq 0x18(%rsp), %rsi jmp 0xfa52b movq 0x18(%r14), %rdx leaq 0x18(%rsp), %rdi leaq 0x70(%rsp), %rsi vmovsd 0x359b05(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x62c65 jmp 0xfa551 leaq 0x18(%rsp), %rdi movq %r13, %rsi movl %ebx, %edx xorl %ecx, %ecx callq 0x62bf9 leaq 0x18(%rsp), %r15 movq %r13, 0x38(%rsp) xorl %ebx, %ebx movl (%r15), %ebp cmpl %ebx, %ebp je 0xfa586 movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd (%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0xfa582 movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0xfa560 leaq 0x78(%rsp), %rdi callq 0x357fe vmovsd 0x18(%r12), %xmm0 vmovsd %xmm0, (%rsp) callq 0xb5a0 movq %rax, (%r14) callq 0xb5a0 movq %rax, 0x8(%r14) leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi leaq 0x18(%rsp), %rdx callq 0xf55a2 vmovsd (%rsp), %xmm0 movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF leaq 0x18(%rsp), %rbx xorl %r15d, %r15d cmpq 0xb0(%r12), %r15 je 0xfa699 movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi leaq 0xd8(%rsp), %rsi movq %rbx, %rdx vmovsd %xmm0, (%rsp) callq 0xf55e4 movl %eax, %r13d testl %eax, %eax je 0xfa731 cmpl %ebp, %r13d jge 0xfa638 movq %r14, %rdi movq %rbx, %rsi movl %r13d, %edx movq %r15, %rcx callq 0xfab80 movl %r13d, %ebp cmpq 0x48(%rsp), %r15 jle 0xfa66e vcvtsi2sd %r13d, %xmm3, %xmm0 vcvtsi2sdl 0x150(%rsp), %xmm3, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x58(%rsp), %xmm1 callq 0xb1f0 vmovsd (%rsp), %xmm1 vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xfa673 vmovsd (%rsp), %xmm0 vucomisd 0x68(%rsp), %xmm0 ja 0xfa699 movq %r14, %rdi vmovsd %xmm0, (%rsp) callq 0xfabb8 vmovsd (%rsp), %xmm0 testb %al, %al jne 0xfa699 incq %r15 jmp 0xfa5d9 movq 0x8(%rsp), %rax movl $0x5, 0xa0(%rax) cmpl $0x0, 0x50(%r14) jne 0xfa6bb movq 0x8(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0xfa6e9 movq 0x8(%rsp), %rax leaq 0x68(%rax), %rbx pushq $0x1 popq %rsi movq %rbx, %rdi callq 0x35292 movq (%rbx), %rsi addq $0x20, %r14 movl 0x54(%rsp), %edx movq %r14, %rdi callq 0x35781 leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xf5a44 leaq 0x88(%rsp), %rdi callq 0x29066 leaq 0x20(%rsp), %rdi callq 0x357fe movq 0x8(%rsp), %rax addq $0x158, %rsp # imm = 0x158 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi leaq 0x18(%rsp), %rbx movq %rbx, %rsi callq 0x62f18 movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx callq 0xfab36 vmovsd (%rsp), %xmm0 leaq 0xd8(%rsp), %r15 leaq 0x18(%rsp), %rbp xorl %ebx, %ebx movl $0x0, 0x14(%rsp) cmpl 0xbc(%r12), %ebx jge 0xfa6a8 vmovsd %xmm0, (%rsp) vmulsd 0x98(%rsp), %xmm0, %xmm0 movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 vmovsd 0x90(%rsp), %xmm3 leaq 0xa0(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx callq 0xf57f0 testl %eax, %eax jne 0xfa7ed vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x62f18 movl 0xc0(%r12), %eax imull %ebx, %eax notl %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xfab36 movq %r14, %rdi callq 0xfabb8 vmovsd (%rsp), %xmm0 testb %al, %al jne 0xfa6a8 movl %ebx, 0x48(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0xfa8ee movq 0x18(%r14), %rcx vmovsd 0x28(%rsp), %xmm1 vmovsd 0x30(%rsp), %xmm2 leaq 0xa0(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx vmovsd %xmm0, (%rsp) callq 0xf55e4 testl %eax, %eax je 0xfa8b2 vcvtsi2sd %r13d, %xmm4, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0xfa888 vcvtsi2sd %eax, %xmm4, %xmm0 vcvtsi2sdl 0x150(%rsp), %xmm4, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x58(%rsp), %xmm1 callq 0xb1f0 vmovsd (%rsp), %xmm1 vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xfa88d vmovsd (%rsp), %xmm0 vucomisd 0x68(%rsp), %xmm0 ja 0xfa8ee movq %r14, %rdi vmovsd %xmm0, (%rsp) callq 0xfabb8 testb %al, %al jne 0xfa8e9 vmovsd (%rsp), %xmm0 incl %ebx jmp 0xfa80b vmovsd 0x40(%rsp), %xmm0 movq 0x38(%rsp), %rdi movq %rbp, %rsi callq 0x62f18 movl 0xc0(%r12), %eax imull 0x14(%rsp), %eax subl %ebx, %eax movslq %eax, %rdx movq %r14, %rdi movq %rbp, %rsi callq 0xfab36 vmovsd (%rsp), %xmm0 jmp 0xfa8ee vmovsd (%rsp), %xmm0 movl 0x48(%rsp), %ebx decl 0x14(%rsp) incl %ebx jmp 0xfa773 jmp 0xfa92c jmp 0xfa908 jmp 0xfa92c movq %rax, %r14 jmp 0xfa93c movq %rax, %r14 jmp 0xfa949 movq %rax, %r14 jmp 0xfa956 movq %rax, %r14 jmp 0xfa960 jmp 0xfa92c jmp 0xfa92c jmp 0xfa92c leaq 0x78(%rsp), %rdi movq %rax, %r14 callq 0x357fe jmp 0xfa92f movq %rax, %r14 leaq 0xa0(%rsp), %rdi callq 0x393ac leaq 0xd8(%rsp), %rdi callq 0xf5a44 leaq 0x88(%rsp), %rdi callq 0x29066 leaq 0x20(%rsp), %rdi callq 0x357fe movq 0x8(%rsp), %rdi callq 0xea60 movq %r14, %rdi callq 0xb3d0
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long)
inline bool is_better_solution(Float lhs, Float rhs) noexcept { if constexpr (std::is_same_v<Mode, minimize_tag>) return lhs < rhs; else return lhs > rhs; }
vucomisd 0x30(%rdi), %xmm0 jbe 0xfa9ba pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xfaa34 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::pnm_observer>::is_timelimit_reached()
bool is_timelimit_reached() { m_end = std::chrono::steady_clock::now(); return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end); }
pushq %rbx movq %rdi, %rbx callq 0xb5a0 movq %rax, 0x8(%rbx) vxorpd %xmm2, %xmm2, %xmm2 movq 0x10(%rbx), %rcx subq (%rbx), %rax vmovsd (%rcx), %xmm0 vcvtsi2sd %rax, %xmm1, %xmm1 vdivsd 0x35f063(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<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 0xfaa9c pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0xfab16 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::file_observer>::is_timelimit_reached()
bool is_timelimit_reached() { m_end = std::chrono::steady_clock::now(); return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end); }
pushq %rbx movq %rdi, %rbx callq 0xb5a0 movq %rax, 0x8(%rbx) vxorpd %xmm2, %xmm2, %xmm2 movq 0x10(%rbx), %rcx subq (%rbx), %rax vmovsd (%rcx), %xmm0 vcvtsi2sd %rax, %xmm1, %xmm1 vdivsd 0x35ef81(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::none_observer>::is_timelimit_reached()
bool is_timelimit_reached() { m_end = std::chrono::steady_clock::now(); return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end); }
pushq %rbx movq %rdi, %rbx callq 0xb5a0 movq %rax, 0x8(%rbx) vxorpd %xmm2, %xmm2, %xmm2 movq 0x10(%rbx), %rcx subq (%rbx), %rax vmovsd (%rcx), %xmm0 vcvtsi2sd %rax, %xmm1, %xmm1 vdivsd 0x35ee9f(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<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 0xfb2b2 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 0xfb3db movq 0xa8(%r15), %rax cmpq 0xb0(%r15), %rax je 0xfb3db 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 0x6d526 vmovsd 0x40(%r15), %xmm0 movl 0xe4(%r14), %eax vxorps %xmm1, %xmm1, %xmm1 leaq 0x40(%rsp), %rsi cmpl $0x1, %eax je 0xfb402 cmpl $0x2, %eax jne 0xfb451 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 0x10171a jmp 0xfb49e 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 0xfb4cd 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 0x101096 jmp 0xfb49e 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 0x101d9e 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 0x6d8d6 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 0xfb539 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 0xfb55b jmp 0xfb55b leaq 0x68(%rsp), %rdi movq %rax, %r14 callq 0x357fe leaq 0x20(%rsp), %rdi callq 0x6d8d6 jmp 0xfb57e jmp 0xfb57b movq %rax, %r14 jmp 0xfb588 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<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 0xfb5fe 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 0xfb75d movq 0xa8(%r13), %rax cmpq 0xb0(%r13), %rax je 0xfb75d 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 0x6d526 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 0x6d740 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 0xfb7b8 movl %eax, %ecx shlq $0x3, %rcx addq 0x30(%rsp), %rcx movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x10263e movl 0x8(%rsp), %eax incl %eax jmp 0xfb734 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 0xfbb53 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 0xfb87c 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 0x10268a 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 0xfb7d8 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 0xfb911 movq 0x60(%rsp), %rax xorl %ecx, %ecx xorl %r14d, %r14d cmpq %rcx, %r15 je 0xfb8d2 addq 0xb0(%rax,%rcx), %r14 addq $0xc0, %rcx jmp 0xfb8bc leaq 0xe0(%rsp), %rdi leaq 0x18(%rsp), %rsi leaq 0x28(%rsp), %rdx leaq 0x20(%rsp), %rcx movq %rbp, %r8 callq 0x7611c 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 0x35e14c(%rip), %xmm1, %xmm1 # 0x459a80 jae 0xfb897 vucomisd %xmm0, %xmm1 jbe 0xfb897 movb $0x1, %al xchgb %al, 0x3(%rsp) movq 0xa0(%rsp), %rbx movq 0xa8(%rsp), %r14 movq 0x10(%rsp), %r12 cmpq %r14, %rbx je 0xfb972 movq %rbx, %rdi callq 0xb1a0 addq $0x8, %rbx jmp 0xfb95f 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 0xfbacd cmpl $0x1, %eax je 0xfba95 cmpl $0x2, %eax jne 0xfbaec leaq 0x68(%r12), %rbx pushq $0x5 popq %rsi movq %rbx, %rdi callq 0x35292 xorl %r14d, %r14d xorl %r15d, %r15d cmpq $0x5, %r15 je 0xfbaec 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 0xfba5b 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 0x7619a movq (%r14), %rsi movq %rax, %rbx addq $0x20, %rsi jmp 0xfbae0 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 0x6d8a4 cmpq $0x0, 0x168(%r13) je 0xfbb18 addq $0x158, %r13 # imm = 0x158 movq %r13, %rdi movq %r12, %rsi callq 0x357ea leaq 0x30(%rsp), %rdi callq 0x357fe leaq 0xd8(%rsp), %rdi callq 0x6d8b8 leaq 0xa0(%rsp), %rdi callq 0x35836 leaq 0x60(%rsp), %rdi callq 0x1071c0 leaq 0xb8(%rsp), %rdi callq 0x6d8d6 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 0xfbbb4 movq %rax, %rbx jmp 0xfbbc1 movq %rax, %rbx jmp 0xfbbce jmp 0xfbb98 jmp 0xfbb89 jmp 0xfbba7 jmp 0xfbba7 movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0xfbbef movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0xfbbe5 jmp 0xfbba7 jmp 0xfbba7 jmp 0xfbba7 jmp 0xfbba7 jmp 0xfbba7 movq %rax, %rbx leaq 0x30(%rsp), %rdi callq 0x357fe leaq 0xd8(%rsp), %rdi callq 0x6d8b8 leaq 0xa0(%rsp), %rdi callq 0x35836 leaq 0x60(%rsp), %rdi callq 0x1071c0 leaq 0xb8(%rsp), %rdi callq 0x6d8d6 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<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 0xfbc33 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 0xfbd5c movq 0xa8(%r15), %rax cmpq 0xb0(%r15), %rax je 0xfbd5c 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 0x6d526 vmovsd 0x40(%r15), %xmm0 movl 0xe4(%r14), %eax vxorps %xmm1, %xmm1, %xmm1 leaq 0x40(%rsp), %rsi cmpl $0x1, %eax je 0xfbd83 cmpl $0x2, %eax jne 0xfbdd2 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 0x10786c jmp 0xfbe1f 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 0xfbe4e 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 0x1071e8 jmp 0xfbe1f 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 0x107ef0 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 0x6d8d6 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 0xfbeba 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 0xfbedc jmp 0xfbedc leaq 0x68(%rsp), %rdi movq %rax, %r14 callq 0x357fe leaq 0x20(%rsp), %rdi callq 0x6d8d6 jmp 0xfbeff jmp 0xfbefc movq %rax, %r14 jmp 0xfbf09 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<double>, double, baryonyx::itm::maximize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<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 $0x168, %rsp # imm = 0x168 movq %rdi, %rbp leaq 0x8(%rsp), %rdi movq %rsi, %r15 movl %r8d, %esi vmovsd %xmm0, 0x48(%rsp) movq %r9, %r12 movl %r8d, %ebx movq %rcx, %r14 movq %rdx, 0x18(%rsp) callq 0x368ae movq (%rbp), %r13 movq %rbp, 0x50(%rsp) addq $0x8, %rbp leaq 0x90(%rsp), %rdi movq %r13, %rsi movq %r12, 0x40(%rsp) movq %r12, %rdx movq %rbp, %rcx movl %ebx, %r8d callq 0x6fb57 vmovsd 0x20(%r13), %xmm0 vmovsd 0x10(%r13), %xmm1 vmovsd %xmm0, 0x68(%rsp) vmovsd 0x28(%r13), %xmm0 vmovsd %xmm1, 0x30(%rsp) vmovsd %xmm0, 0x70(%rsp) vmovsd 0x30(%r13), %xmm0 vmovsd %xmm0, 0x60(%rsp) vmovsd 0x8(%r13), %xmm0 vmovsd %xmm0, 0x38(%rsp) vxorpd %xmm0, %xmm0, %xmm0 vucomisd %xmm1, %xmm0 jbe 0xfc3fa movq 0x50(%rsp), %rax movq (%rax), %rdi vmovsd 0x38(%rsp), %xmm0 leaq 0x90(%rsp), %rsi movl %ebx, %edx callq 0x6fc31 vmovsd %xmm0, 0x30(%rsp) vcvttsd2si 0xa0(%r13), %rax vmovsd 0x38(%r13), %xmm0 vmovsd 0x40(%r13), %xmm1 movq %rax, 0x78(%rsp) movq 0x8(%r14), %rax vmovsd %xmm0, 0x88(%rsp) vmovsd %xmm1, 0x80(%rsp) subq (%r14), %rax pushq $0x28 popq %rcx cqto idivq %rcx leaq 0xe8(%rsp), %rdi leaq 0x90(%rsp), %r8 movq %rbp, %rsi movl %eax, %edx movl %ebx, %ecx movq %r14, %r9 callq 0xfc816 movl 0xcc(%r13), %esi leaq 0xb0(%rsp), %rdi movl %ebx, %edx callq 0x38cd8 movq $0x0, (%rsp) movb (%r15), %al testb $0x1, %al jne 0xfc77d movq 0x50(%rsp), %rax incq 0xb0(%rax) vmovsd 0x18(%r13), %xmm0 vmovsd 0x28(%r13), %xmm1 movzbl (%rsp), %edx movq 0x18(%rsp), %rdi leaq 0x8(%rsp), %rbx movq %rbp, %rsi movq %rbx, %rcx andl $0x1, %edx callq 0x6fed2 vmovsd %xmm0, 0x58(%rsp) leaq 0xb0(%rsp), %rdi leaq 0xe8(%rsp), %rsi movq %rbx, %rdx callq 0xfc9a6 vmovsd 0x58(%rsp), %xmm0 movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF xorl %r14d, %r14d movb (%r15), %al testb $0x1, %al jne 0xfc579 cmpq 0xb0(%r13), %r14 je 0xfc579 vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 leaq 0xb0(%rsp), %rdi leaq 0xe8(%rsp), %rsi leaq 0x8(%rsp), %rdx movq %rbp, %rcx vmovsd %xmm0, 0x20(%rsp) callq 0xfc9e8 testl %eax, %eax je 0xfc590 cmpl %eax, %ebx cmovgel %eax, %ebx cmpq 0x78(%rsp), %r14 jle 0xfc563 vcvtsi2sd %eax, %xmm3, %xmm0 vcvtsi2sdl 0x160(%rsp), %xmm3, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x60(%rsp), %xmm1 callq 0xb1f0 vmovsd 0x20(%rsp), %xmm1 vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xfc569 vmovsd 0x20(%rsp), %xmm0 vucomisd 0x70(%rsp), %xmm0 ja 0xfc579 incq %r14 jmp 0xfc4dd testl %ebx, %ebx jg 0xfc75d leaq 0x8(%rsp), %rbx movq $0x0, (%rsp) jmp 0xfc5c1 vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi leaq 0x8(%rsp), %rbx movq %rbx, %rsi callq 0x6e096 movq 0x18(%rsp), %rdi movq %rbp, %rsi movq %rbx, %rdx movq %r14, %rcx callq 0x70220 movb $0x1, %al movq %rax, (%rsp) xorl %r14d, %r14d movl $0x0, 0x2c(%rsp) movb (%r15), %al testb $0x1, %al jne 0xfc472 cmpl 0xbc(%r13), %r14d jge 0xfc472 vmovsd 0x88(%rsp), %xmm0 vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 vmovsd 0x80(%rsp), %xmm3 leaq 0xb0(%rsp), %rdi leaq 0xe8(%rsp), %rsi movq %rbx, %rdx movq %rbp, %rcx callq 0xfcbf4 testl %eax, %eax jne 0xfc65a vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi movq %rbx, %rsi callq 0x6e096 movl 0xc0(%r13), %eax movq 0x18(%rsp), %rdi movq %rbp, %rsi movq %rbx, %rdx imull %r14d, %eax notl %eax movslq %eax, %rcx callq 0x70220 movb $0x1, %al movq %rax, (%rsp) pushq $0x1 popq %rax vmovsd 0x58(%rsp), %xmm0 movl %eax, %ebx movb (%r15), %al testb $0x1, %al jne 0xfc708 leal -0x1(%rbx), %r12d cmpl 0xc0(%r13), %r12d jge 0xfc708 vmovsd 0x30(%rsp), %xmm1 vmovsd 0x38(%rsp), %xmm2 leaq 0xb0(%rsp), %rdi leaq 0xe8(%rsp), %rsi leaq 0x8(%rsp), %rdx movq %rbp, %rcx vmovsd %xmm0, 0x20(%rsp) callq 0xfc9e8 testl %eax, %eax je 0xfc70f vcvtsi2sd %r12d, %xmm4, %xmm0 vucomisd 0xa0(%r13), %xmm0 jbe 0xfc6f3 vcvtsi2sd %eax, %xmm4, %xmm0 vcvtsi2sdl 0x160(%rsp), %xmm4, %xmm1 vdivsd %xmm1, %xmm0, %xmm0 vmovsd 0x60(%rsp), %xmm1 callq 0xb1f0 vmovsd 0x20(%rsp), %xmm1 vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1 vmovapd %xmm1, %xmm0 jmp 0xfc6f9 vmovsd 0x20(%rsp), %xmm0 vucomisd 0x70(%rsp), %xmm0 ja 0xfc708 incl %ebx jmp 0xfc665 leaq 0x8(%rsp), %rbx jmp 0xfc751 vmovsd 0x48(%rsp), %xmm0 movq 0x40(%rsp), %rdi leaq 0x8(%rsp), %r12 movq %r12, %rsi callq 0x6e096 movl 0xc0(%r13), %eax movq 0x18(%rsp), %rdi movq %rbp, %rsi movq %r12, %rdx imull 0x2c(%rsp), %eax subl %ebx, %eax movq %r12, %rbx movslq %eax, %rcx callq 0x70220 movb $0x1, %al movq %rax, (%rsp) decl 0x2c(%rsp) incl %r14d jmp 0xfc5cc movq 0xb0(%r13), %r8 movq 0x18(%rsp), %rdi leaq 0x8(%rsp), %rdx movq %rbp, %rsi movl %ebx, %ecx callq 0x702a8 jmp 0xfc46a leaq 0xb0(%rsp), %rdi callq 0x393ac leaq 0xe8(%rsp), %rdi callq 0xfce48 leaq 0x90(%rsp), %rdi callq 0x6d8d6 leaq 0x10(%rsp), %rdi callq 0x357fe addq $0x168, %rsp # imm = 0x168 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0xfc7c7 movq %rax, %rbx jmp 0xfc7e9 movq %rax, %rbx jmp 0xfc7f6 movq %rax, %rbx jmp 0xfc803 jmp 0xfc7d9 jmp 0xfc7d9 jmp 0xfc7d9 jmp 0xfc7d9 leaq 0xb0(%rsp), %rdi movq %rax, %rbx callq 0x393ac leaq 0xe8(%rsp), %rdi callq 0xfce48 leaq 0x90(%rsp), %rdi callq 0x6d8d6 leaq 0x10(%rsp), %rdi callq 0x357fe movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::solver_equalities_01coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::quadratic_cost_type<double> 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 0x35fa14(%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 0x2900a movq %r12, %rdi movq %r15, 0x10(%rsp) leaq 0x58(%rbx), %r14 callq 0x3a89d movq %r14, 0x8(%rsp) movq %r14, %rdi movq %rax, %rsi callq 0xfce82 leaq 0x60(%rbx), %r14 movslq %ebp, %r15 movq %r14, %rdi movq %r15, %rsi callq 0x28eb6 leaq 0x68(%rbx), %rdi movq %r15, %rsi callq 0x2900a 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 0xfc907 imulq $0x28, %rdx, %rdi leaq (%rax,%rdi), %rsi movq (%rax,%rdi), %r8 movq 0x8(%rax,%rdi), %rdi cmpq %rdi, %r8 je 0xfc8f4 cmpl $0x1, (%r8) leaq 0x8(%r8), %r8 je 0xfc8e3 jmp 0xfc916 movl 0x18(%rsi), %edi cmpl 0x1c(%rsi), %edi jne 0xfc937 movl %edi, (%rcx,%rdx,4) incq %rdx movl 0x78(%rbx), %ebp jmp 0xfc8cb addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x35bb0d(%rip), %rdi # 0x45842a leaq 0x35f937(%rip), %rsi # 0x45c25b leaq 0x35f940(%rip), %rdx # 0x45c26b leaq 0x35db78(%rip), %rcx # 0x45a4aa callq 0x2813f leaq 0x35baec(%rip), %rdi # 0x45842a leaq 0x35f990(%rip), %rsi # 0x45c2d5 leaq 0x35f91f(%rip), %rdx # 0x45c26b leaq 0x35f99d(%rip), %rcx # 0x45c2f0 callq 0x2813f movq %r14, %rdi movq %rax, %r12 callq 0x28fb6 jmp 0xfc968 movq %rax, %r12 movq 0x8(%rsp), %rdi callq 0xfcec2 jmp 0xfc977 movq %rax, %r12 movq 0x10(%rsp), %rdi callq 0x29066 jmp 0xfc986 movq %rax, %r12 movq 0x18(%rsp), %rdi callq 0x3a954 jmp 0xfc995 movq %rax, %r12 movq %rbx, %rdi callq 0xb853a movq %r12, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true> 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 0xfc9bc movq %rax, %rdi jmp 0xfceea cmpl $0x7, %ecx jne 0xfc9d9 movq (%rax), %rcx movq 0x8(%rax), %rax xorl %edx, %edx cmpq %rax, %rcx je 0xfc9e7 movl %edx, (%rcx) incl %edx addq $0x4, %rcx jmp 0xfc9ca movq %rsi, %rdi movq %rdx, %rsi movq %rax, %rdx jmp 0xfcfcf retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true> const, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true> 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 0xfcf0e 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 0xfcfaf 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 0xfcf6b movl 0x4(%r13), %esi movq %r14, %rdi callq 0x3664a addl %eax, %ebx addq $0x8, %r13 jmp 0xfcf52 movq 0x20(%rsp), %rax movq 0x60(%rax), %rax movl (%rax,%rbp,4), %eax movl %eax, %ecx subl %ebx, %ecx jle 0xfcf8b shlq $0x20, %rcx orq %rbp, %rcx movq %rcx, 0x8(%rsp) jmp 0xfcf9b jge 0xfcfaa 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 0xfcf30 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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true> 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 0xfcfed movq %rax, 0x8(%rbx) leaq 0x4(%rsp), %r12 xorl %esi, %esi movl %esi, 0x4(%rsp) cmpl 0x78(%r15), %esi je 0xfd020 movq %r15, %rdi movq %r14, %rdx callq 0xfd037 testb %al, %al jne 0xfd018 movq %rbx, %rdi movq %r12, %rsi callq 0x31460 movl 0x4(%rsp), %esi incl %esi jmp 0xfcff4 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_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true> 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 movl %esi, %ebp leaq 0x10(%rdi), %rsi leaq 0x8(%rsp), %r15 movq %rdx, %r14 movq %rdi, %rbx movl %ebp, %edx movq %r15, %rdi callq 0x3c868 movq (%r15), %r12 movq 0x8(%r15), %r13 xorl %r15d, %r15d cmpq %r12, %r13 je 0xfd084 movl 0x4(%r13), %esi movq %r14, %rdi callq 0x3664a addl %eax, %r15d addq $0x8, %r13 jmp 0xfd06a movq 0x60(%rbx), %rcx movslq %ebp, %rax cmpl (%rcx,%rax,4), %r15d sete %al addq $0x18, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, 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>>>>, double, double, double)
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, 0x30(%rsp) movq %rdx, %rbx leaq 0x50(%rsp), %rcx leaq 0x48(%rsp), %r8 leaq 0x40(%rsp), %r9 leaq 0x35f276(%rip), %rdx # 0x45c344 movq %rsi, %r14 movq %rdi, %r12 vmovsd %xmm0, (%rcx) vmovsd %xmm1, (%r8) vmovsd %xmm2, (%r9) pushq $0x14 popq %rsi callq 0xefd10 leaq 0x10(%r12), %rax movq %rbx, 0x28(%rsp) xorl %edx, %edx movq %rax, 0x18(%rsp) movq (%rbx), %rax leaq 0x35f20e(%rip), %rbx # 0x45c313 pushq $0x8 popq %rbp movq %r14, 0x20(%rsp) movq 0x30(%rsp), %rcx cmpq (%rcx), %rax je 0xfd249 movq %rdx, 0x38(%rsp) movl -0x4(%rax), %edx movq 0x18(%rsp), %rsi leaq 0x8(%rsp), %rdi movl %edx, (%rsp) callq 0x3de66 vmovsd 0x40(%rsp), %xmm0 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r12, %rdi callq 0xfd894 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r12, %rdi movq %r14, %rcx callq 0xfd8b2 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r14 movl %eax, %r15d movq %r14, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xfd988 movslq (%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, 0x4(%rsp) pushq $0x15 popq %rsi leaq 0x35f152(%rip), %rdx # 0x45c2fd movq %rsp, %rcx callq 0xb91c2 movl %r14d, %eax sarl $0x1f, %eax xorl %r13d, %r13d andnl %r14d, %eax, %r14d shlq $0x4, %r14 cmpq %r13, %r14 je 0xfd1eb movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x8(%rcx,%r13), %r8 addq %r13, %rcx callq 0xefe5a addq $0x10, %r13 jmp 0xfd1c5 movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x363e69(%rip), %rdx # 0x461061 leaq 0x4(%rsp), %rcx callq 0xb921e vmovsd 0x50(%rsp), %xmm0 vmovsd 0x48(%rsp), %xmm1 movq 0x20(%rsp), %r14 movq 0x10(%rsp), %rdx movl (%rsp), %ecx movl 0x4(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r14, %rsi callq 0xfd9bb movq 0x38(%rsp), %rdx movq 0x28(%rsp), %rcx orb %al, %dl movq (%rcx), %rax addq $-0x4, %rax movq %rax, (%rcx) jmp 0xfd10d andb $0x1, %dl movl %edx, %eax addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
bool baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, 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>>>, double, double, double)
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, 0x28(%rsp) leaq 0x50(%rsp), %rcx leaq 0x48(%rsp), %r8 leaq 0x40(%rsp), %r9 movq %rdx, %r14 movq %rsi, %r13 movq %rdi, %r12 leaq 0x35f0b4(%rip), %rdx # 0x45c344 vmovsd %xmm0, (%rcx) vmovsd %xmm1, (%r8) vmovsd %xmm2, (%r9) pushq $0x14 popq %rsi callq 0xefd10 leaq 0x10(%r12), %rax leaq 0x35f061(%rip), %rbx # 0x45c313 movq %rax, 0x18(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x20(%rsp) cmpq 0x28(%rsp), %r14 je 0xfd3fc movl (%r14), %edx movq 0x18(%rsp), %rsi leaq 0x8(%rsp), %rdi movq %rax, 0x30(%rsp) movq %r14, 0x38(%rsp) movl %edx, (%rsp) callq 0x3de66 vmovsd 0x40(%rsp), %xmm0 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r12, %rdi callq 0xfd894 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0xfd8b2 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 movl %eax, %r15d movq %r13, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0xfd988 movslq (%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r13d cmovll %r13d, %eax decl %eax movl %eax, 0x4(%rsp) pushq $0x15 popq %rsi leaq 0x35ef9c(%rip), %rdx # 0x45c2fd movq %rsp, %rcx callq 0xb91c2 movl %r13d, %eax sarl $0x1f, %eax xorl %r14d, %r14d andnl %r13d, %eax, %r13d shlq $0x4, %r13 cmpq %r14, %r13 je 0xfd3a1 movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x8(%rcx,%r14), %r8 addq %r14, %rcx callq 0xefe5a addq $0x10, %r14 jmp 0xfd37b movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x363cb3(%rip), %rdx # 0x461061 leaq 0x4(%rsp), %rcx callq 0xb921e vmovsd 0x50(%rsp), %xmm0 vmovsd 0x48(%rsp), %xmm1 movq 0x20(%rsp), %r13 movq 0x10(%rsp), %rdx movl (%rsp), %ecx movl 0x4(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r13, %rsi callq 0xfd9bb movq 0x30(%rsp), %rcx movq 0x38(%rsp), %r14 orb %al, %cl addq $0x4, %r14 movq %rcx, %rax jmp 0xfd2c1 andb $0x1, %al addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
bool baryonyx::itm::solver_equalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, 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>>>, double, double, double)
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, 0x28(%rsp) leaq 0x50(%rsp), %rcx leaq 0x48(%rsp), %r8 leaq 0x40(%rsp), %r9 movq %rdx, %r14 movq %rsi, %r13 movq %rdi, %r12 leaq 0x351112(%rip), %rdx # 0x45c344 vmovsd %xmm0, (%rcx) vmovsd %xmm1, (%r8) vmovsd %xmm2, (%r9) pushq $0x14 popq %rsi callq 0xefd10 leaq 0x10(%r12), %rax leaq 0x3510bf(%rip), %rbx # 0x45c313 movq %rax, 0x18(%rsp) xorl %eax, %eax pushq $0x8 popq %rbp movq %r13, 0x20(%rsp) cmpq 0x28(%rsp), %r14 je 0x10b39e movl (%r14), %edx movq 0x18(%rsp), %rsi leaq 0x8(%rsp), %rdi movq %rax, 0x30(%rsp) movq %r14, 0x38(%rsp) movl %edx, (%rsp) callq 0x3de66 vmovsd 0x40(%rsp), %xmm0 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r12, %rdi callq 0x10b3f0 movq 0x8(%rsp), %rdx movq 0x10(%rsp), %rsi movq %r12, %rdi movq %r13, %rcx callq 0x10b40e movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 movl %eax, %r15d movq %r13, %rsi shlq $0x4, %rsi addq %rdi, %rsi callq 0x10b4d4 movslq (%rsp), %rax movq 0x60(%r12), %rcx movq %r12, %rdi leaq (%rcx,%rax,4), %r8 movl (%r8), %eax cmpl %eax, %r13d cmovll %r13d, %eax decl %eax movl %eax, 0x4(%rsp) pushq $0x15 popq %rsi leaq 0x350ffa(%rip), %rdx # 0x45c2fd movq %rsp, %rcx callq 0xb91c2 movl %r13d, %eax sarl $0x1f, %eax xorl %r14d, %r14d andnl %r13d, %eax, %r13d shlq $0x4, %r13 cmpq %r14, %r13 je 0x10b343 movq 0x58(%r12), %rcx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rdx leaq 0x8(%rcx,%r14), %r8 addq %r14, %rcx callq 0xefe5a addq $0x10, %r14 jmp 0x10b31d movq %r12, %rdi pushq $0x11 popq %rsi leaq 0x355d11(%rip), %rdx # 0x461061 leaq 0x4(%rsp), %rcx callq 0xb921e vmovsd 0x50(%rsp), %xmm0 vmovsd 0x48(%rsp), %xmm1 movq 0x20(%rsp), %r13 movq 0x10(%rsp), %rdx movl (%rsp), %ecx movl 0x4(%rsp), %r8d movq %r12, %rdi movl %r15d, %r9d movq %r13, %rsi callq 0x10b507 movq 0x30(%rsp), %rcx movq 0x38(%rsp), %r14 orb %al, %cl addq $0x4, %r14 movq %rcx, %rax jmp 0x10b263 andb $0x1, %al addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
baryonyx::itm::solver_equalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>::solver_equalities_01coeff(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_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 andq $0x0, (%rdi) leaq 0x10(%rdi), %r14 movq %rsi, 0x8(%rdi) movq %rdi, %rbx movq %r9, %r12 movq %r8, 0x20(%rsp) movl %ecx, %r13d movl %edx, %ebp movq %r9, %rsi movq %r14, %rdi callq 0x3a4ca movl 0x38(%rbx), %esi leaq 0x50(%rbx), %r15 movq %r15, %rdi movq %r14, 0x18(%rsp) callq 0x8afb9 movq %r12, %rdi movq %r15, 0x10(%rsp) leaq 0x58(%rbx), %r14 callq 0x3a89d movq %r14, 0x8(%rsp) movq %r14, %rdi movq %rax, %rsi callq 0x14a0c3 leaq 0x60(%rbx), %r14 movslq %ebp, %r15 movq %r14, %rdi movq %r15, %rsi callq 0x28eb6 leaq 0x68(%rbx), %rdi movq %r15, %rsi callq 0x8afb9 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 0x149ae6 imulq $0x28, %rdx, %rdi leaq (%rax,%rdi), %rsi movq (%rax,%rdi), %r8 movq 0x8(%rax,%rdi), %rdi cmpq %rdi, %r8 je 0x149ad3 cmpl $0x1, (%r8) leaq 0x8(%r8), %r8 je 0x149ac2 jmp 0x149af5 movl 0x18(%rsi), %edi cmpl 0x1c(%rsi), %edi jne 0x149b16 movl %edi, (%rcx,%rdx,4) incq %rdx movl 0x78(%rbx), %ebp jmp 0x149aaa addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x30e92e(%rip), %rdi # 0x45842a leaq 0x312758(%rip), %rsi # 0x45c25b leaq 0x312761(%rip), %rdx # 0x45c26b leaq 0x310999(%rip), %rcx # 0x45a4aa callq 0x2813f leaq 0x30e90d(%rip), %rdi # 0x45842a leaq 0x3127b1(%rip), %rsi # 0x45c2d5 leaq 0x312740(%rip), %rdx # 0x45c26b leaq 0x3127be(%rip), %rcx # 0x45c2f0 callq 0x2813f movq %r14, %rdi movq %rax, %rbx callq 0x28fb6 jmp 0x149b47 movq %rax, %rbx movq 0x8(%rsp), %rdi callq 0x14a104 jmp 0x149b56 movq %rax, %rbx movq 0x10(%rsp), %rdi callq 0x8affa jmp 0x149b65 movq %rax, %rbx movq 0x18(%rsp), %rdi callq 0x3a954 movq %rbx, %rdi callq 0xb3d0 nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_equalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false> 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 0x149b8e movq %rax, %rdi jmp 0x14a12c cmpl $0x7, %ecx jne 0x149bab movq (%rax), %rcx movq 0x8(%rax), %rax xorl %edx, %edx cmpq %rax, %rcx je 0x149bb9 movl %edx, (%rcx) incl %edx addq $0x4, %rcx jmp 0x149b9c movq %rsi, %rdi movq %rdx, %rsi movq %rax, %rdx jmp 0x14a211 retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, 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 0x14a22f movq %rax, 0x8(%rbx) leaq 0x4(%rsp), %r12 xorl %esi, %esi movl %esi, 0x4(%rsp) cmpl 0x78(%r15), %esi je 0x14a262 movq %r15, %rdi movq %r14, %rdx callq 0x14a279 testb %al, %al jne 0x14a25a movq %rbx, %rdi movq %r12, %rsi callq 0x31460 movl 0x4(%rsp), %esi incl %esi jmp 0x14a236 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_equalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false> 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 movl %esi, %ebp leaq 0x10(%rdi), %rsi leaq 0x8(%rsp), %r15 movq %rdx, %r14 movq %rdi, %rbx movl %ebp, %edx movq %r15, %rdi callq 0x3c868 movq (%r15), %r12 movq 0x8(%r15), %r13 xorl %r15d, %r15d cmpq %r12, %r13 je 0x14a2c6 movl 0x4(%r13), %esi movq %r14, %rdi callq 0x3664a addl %eax, %r15d addq $0x8, %r13 jmp 0x14a2ac movq 0x60(%rbx), %rcx movslq %ebp, %rax cmpl (%rcx,%rax,4), %r15d sete %al addq $0x18, %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<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>::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) { 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 $0x68, %rsp movq %rcx, 0x38(%rsp) leaq 0x10(%rdi), %rax movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 xorl %ebp, %ebp fldt 0xc0(%rsp) fstpt 0x5c(%rsp) fldt 0xb0(%rsp) fstpt 0x50(%rsp) fldt 0xa0(%rsp) fstpt 0x44(%rsp) movq %rax, 0x30(%rsp) movq (%rdx), %rax movq 0x38(%rsp), %rcx cmpq (%rcx), %rax je 0x14a3e5 movslq -0x4(%rax), %rbx movq 0x30(%rsp), %rsi leaq 0x20(%rsp), %rdi movl %ebx, %edx callq 0x3de66 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi fldt 0x5c(%rsp) movq %r12, %rdi fstpt (%rsp) callq 0x14a83e movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0x14a864 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 movq %r13, %rsi shlq $0x5, %rsi addq %rdi, %rsi callq 0x14a92a movq 0x60(%r12), %rax movq 0x28(%rsp), %rdx movq %r12, %rdi movq %r15, %rsi movl %ebx, %ecx movl %r13d, %r9d movl (%rax,%rbx,4), %r8d fldt 0x50(%rsp) fstpt 0x10(%rsp) fldt 0x44(%rsp) fstpt (%rsp) cmpl %r8d, %r13d cmovll %r13d, %r8d decl %r8d callq 0x14a95d orb %al, %bpl movq (%r14), %rax addq $-0x4, %rax movq %rax, (%r14) jmp 0x14a32f andb $0x1, %bpl movl %ebp, %eax addq $0x68, %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<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>::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) { 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 $0x68, %rsp movq %rcx, 0x38(%rsp) leaq 0x10(%rdi), %rax movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 xorl %ebp, %ebp fldt 0xc0(%rsp) fstpt 0x5c(%rsp) fldt 0xb0(%rsp) fstpt 0x50(%rsp) fldt 0xa0(%rsp) fstpt 0x44(%rsp) movq %rax, 0x30(%rsp) cmpq 0x38(%rsp), %r14 je 0x14a5f8 movslq (%r14), %rbx movq 0x30(%rsp), %rsi leaq 0x20(%rsp), %rdi movl %ebx, %edx callq 0x3de66 movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi fldt 0x5c(%rsp) movq %r12, %rdi fstpt (%rsp) callq 0x14a83e movq 0x20(%rsp), %rdx movq 0x28(%rsp), %rsi movq %r12, %rdi movq %r15, %rcx callq 0x14a864 movq 0x58(%r12), %rdi movq 0x8(%r12), %rdx movslq %eax, %r13 movq %r13, %rsi shlq $0x5, %rsi addq %rdi, %rsi callq 0x14a92a movq 0x60(%r12), %rax movq 0x28(%rsp), %rdx movq %r12, %rdi movq %r15, %rsi movl %ebx, %ecx movl %r13d, %r9d movl (%rax,%rbx,4), %r8d fldt 0x50(%rsp) fstpt 0x10(%rsp) fldt 0x44(%rsp) fstpt (%rsp) cmpl %r8d, %r13d cmovll %r13d, %r8d decl %r8d callq 0x14a95d orb %al, %bpl addq $0x8, %r14 jmp 0x14a54c andb $0x1, %bpl movl %ebp, %eax addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_101coeff<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 $0x168, %rsp # imm = 0x168 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 0x98(%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 0x165afa movq 0x10(%r14), %rdi leaq 0x98(%rsp), %rsi movl %ebx, %edx callq 0x38a37 vmovss %xmm0, 0x14(%rsp) jmp 0x165b04 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 0xe0(%rsp), %rdi leaq 0x98(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0x160034 movl 0xcc(%r12), %esi leaq 0xa8(%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 0x165be2 cmpl $0x1, %eax je 0x165bbc cmpl $0x2, %eax jne 0x165bf3 movq 0x18(%r14), %rdx leaq 0x80(%rsp), %rdi leaq 0x28(%rsp), %rsi jmp 0x165bcd movq 0x18(%r14), %rdx leaq 0x28(%rsp), %rdi leaq 0x80(%rsp), %rsi vmovsd 0x2ee463(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x36301 jmp 0x165bf3 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 0x165c65 movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd 0x8(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x165c61 movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0x165c3e 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 0xa8(%rsp), %rdi leaq 0xe0(%rsp), %rsi leaq 0x28(%rsp), %rdx callq 0x16021c 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 0x165d88 movq 0x18(%r14), %rcx vmovss 0x14(%rsp), %xmm1 leaq 0xa8(%rsp), %rdi leaq 0xe0(%rsp), %rsi movq %rbx, %rdx vmovss %xmm0, 0x8(%rsp) callq 0x16025e movl %eax, %r13d testl %eax, %eax je 0x165e20 cmpl %ebp, %r13d jge 0x165d1d movq %r14, %rdi movq %rbx, %rsi movl %r13d, %edx movq %r15, %rcx callq 0x166294 movl %r13d, %ebp cmpq 0x70(%rsp), %r15 jle 0x165d54 vcvtsi2ss %r13d, %xmm3, %xmm0 vcvtsi2ssl 0x160(%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 0x165d5a vmovss 0x8(%rsp), %xmm0 vucomiss 0x48(%rsp), %xmm0 ja 0x165d88 movq %r14, %rdi vmovss %xmm0, 0x8(%rsp) callq 0x1662cc vmovss 0x8(%rsp), %xmm0 vmovss 0x4(%rsp), %xmm2 testb %al, %al jne 0x165d88 incq %r15 jmp 0x165cc3 movq 0x18(%rsp), %rax movl $0x5, 0xa0(%rax) cmpl $0x0, 0x50(%r14) jne 0x165daa movq 0x18(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0x165dd8 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 0xa8(%rsp), %rdi callq 0x393ac leaq 0xe0(%rsp), %rdi callq 0x1606be leaq 0xa0(%rsp), %rdi callq 0x35c1a leaq 0x30(%rsp), %rdi callq 0x357fe movq 0x18(%rsp), %rax addq $0x168, %rsp # imm = 0x168 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 0x16624a vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 leaq 0xe0(%rsp), %r15 leaq 0x28(%rsp), %rbp xorl %ebx, %ebx movl $0x0, 0x38(%rsp) cmpl 0xbc(%r12), %ebx jge 0x165d97 vmovss %xmm0, 0x8(%rsp) vmulss 0x68(%rsp), %xmm0, %xmm0 movq 0x18(%r14), %rcx vmovss 0x14(%rsp), %xmm1 vmovss 0x60(%rsp), %xmm3 leaq 0xa8(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx callq 0x16046a testl %eax, %eax jne 0x165ed8 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 0x16624a movq %r14, %rdi callq 0x1662cc vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 testb %al, %al jne 0x165d97 movl %ebx, 0x70(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0x165fff movq 0x18(%r14), %rcx vmovss 0x14(%rsp), %xmm1 leaq 0xa8(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx vmovss %xmm0, 0x8(%rsp) callq 0x16025e testl %eax, %eax je 0x165fb5 vcvtsi2sd %r13d, %xmm4, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0x165f7c vcvtsi2ss %eax, %xmm4, %xmm0 vcvtsi2ssl 0x160(%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 0x165f88 vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 vucomiss 0x48(%rsp), %xmm0 ja 0x165fff movq %r14, %rdi vmovss %xmm0, 0x8(%rsp) callq 0x1662cc testb %al, %al jne 0x165ff3 vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 incl %ebx jmp 0x165efd 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 0x16624a vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 jmp 0x165fff vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 movl 0x70(%rsp), %ebx decl 0x38(%rsp) incl %ebx jmp 0x165e69 jmp 0x166040 jmp 0x166019 jmp 0x166040 movq %rax, %r14 jmp 0x166050 movq %rax, %r14 jmp 0x16605d movq %rax, %r14 jmp 0x16606a movq %rax, %r14 jmp 0x166074 jmp 0x166040 jmp 0x166040 jmp 0x166040 leaq 0x88(%rsp), %rdi movq %rax, %r14 callq 0x357fe jmp 0x166043 movq %rax, %r14 leaq 0xa8(%rsp), %rdi callq 0x393ac leaq 0xe0(%rsp), %rdi callq 0x1606be leaq 0xa0(%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
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>&, 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 0x1670ae 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 0x167247 leaq 0x2f7394(%rip), %rdx # 0x45e454 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 0x169ab0 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0x1674e1 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 0x16a8c2 jmp 0x167230 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovss %xmm3, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) callq 0x169fec jmp 0x167178 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovss %xmm3, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) callq 0x16a457 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 0x169d54 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0x167988 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 0x169c08 jmp 0x167259 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 0x16adb4 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 0x169ea0 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0x1674e1 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 0x169c08 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0x167bc4
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_101coeff<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 0x1674ff movq %rax, 0x8(%rbx) leaq 0x4(%rsp), %r12 xorl %esi, %esi movl %esi, 0x4(%rsp) cmpl 0x80(%r15), %esi je 0x167535 movq %r15, %rdi movq %r14, %rdx callq 0x16754c testb %al, %al jne 0x16752d movq %rbx, %rdi movq %r12, %rsi callq 0x31460 movl 0x4(%rsp), %esi incl %esi jmp 0x167506 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_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>::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); bx_expects(k < m); const auto it = ap.row(k); decrease_preference(std::get<0>(it), std::get<1>(it), theta); const auto sizes = compute_reduced_costs(std::get<0>(it), std::get<1>(it), x); calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng); int selected = select_variables(sizes, b[k].value); logger::log("constraints {}: {} = ", k, b[k].value); for (int i = 0; i < sizes.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, sizes.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 $0x48, %rsp movq %rsi, 0x38(%rsp) leaq 0x10(%rdi), %rax vmovss %xmm2, 0x14(%rsp) vmovss %xmm1, 0x10(%rsp) vmovss %xmm0, 0xc(%rsp) movq %rcx, 0x40(%rsp) movq %rdi, %r12 movq %rdx, 0x30(%rsp) xorl %ebp, %ebp movq %rax, 0x28(%rsp) movq (%rdx), %rax movq 0x38(%rsp), %r14 movq 0x40(%rsp), %rcx cmpq (%rcx), %rax je 0x1676d9 movslq -0x4(%rax), %rbx cmpl 0x80(%r12), %ebx jge 0x1676ee 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 0x167c06 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi movq %r14, %rcx callq 0x167c24 movq 0x60(%r12), %rdi movq %rax, %r15 movslq %r15d, %r13 movq 0x8(%r12), %rdx shrq $0x20, %r15 imulq $0xc, %r13, %rsi addq %rdi, %rsi callq 0x167d15 movq 0x68(%r12), %rax vmovss 0xc(%rsp), %xmm0 vmovss 0x10(%rsp), %xmm1 movq 0x20(%rsp), %rdx movq %r12, %rdi movq %r14, %rsi movl %ebx, %ecx movl %r13d, %r9d addl (%rax,%rbx,8), %r15d cmpl %r15d, %r13d cmovll %r13d, %r15d decl %r15d movl %r15d, %r8d callq 0x167d48 movq 0x30(%rsp), %rcx orb %al, %bpl movq (%rcx), %rax addq $-0x4, %rax movq %rax, (%rcx) jmp 0x16760d andb $0x1, %bpl movl %ebp, %eax addq $0x48, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x2f0ae9(%rip), %rdi # 0x4581de leaq 0x2f2d7e(%rip), %rsi # 0x45a47a leaq 0x2f7272(%rip), %rdx # 0x45e975 leaq 0x2f72de(%rip), %rcx # 0x45e9e8 callq 0x2813f nop
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
bool baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>::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); bx_expects(k < m); const auto it = ap.row(k); decrease_preference(std::get<0>(it), std::get<1>(it), theta); const auto sizes = compute_reduced_costs(std::get<0>(it), std::get<1>(it), x); calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng); int selected = select_variables(sizes, b[k].value); logger::log("constraints {}: {} = ", k, b[k].value); for (int i = 0; i < sizes.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, sizes.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 $0x48, %rsp movq %rsi, 0x30(%rsp) leaq 0x10(%rdi), %rax vmovss %xmm2, 0x14(%rsp) vmovss %xmm1, 0x10(%rsp) vmovss %xmm0, 0xc(%rsp) movq %rcx, 0x38(%rsp) movq %rdi, %r12 xorl %r14d, %r14d movq 0x30(%rsp), %rbp movq %rax, 0x28(%rsp) cmpq 0x38(%rsp), %rdx je 0x167951 movslq (%rdx), %rbx cmpl 0x80(%r12), %ebx jge 0x167967 movq 0x28(%rsp), %rsi leaq 0x18(%rsp), %rdi movq %rdx, 0x40(%rsp) movl %ebx, %edx callq 0x3de66 vmovss 0x14(%rsp), %xmm0 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi callq 0x167c06 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r12, %rdi movq %rbp, %rcx callq 0x167c24 movq 0x60(%r12), %rdi movq %rax, %r15 movslq %r15d, %r13 movq 0x8(%r12), %rdx shrq $0x20, %r15 imulq $0xc, %r13, %rsi addq %rdi, %rsi callq 0x167d15 movq 0x68(%r12), %rax vmovss 0xc(%rsp), %xmm0 vmovss 0x10(%rsp), %xmm1 movq 0x20(%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi movl %ebx, %ecx movl %r13d, %r9d addl (%rax,%rbx,8), %r15d cmpl %r15d, %r13d cmovll %r13d, %r15d decl %r15d movl %r15d, %r8d callq 0x167d48 movq 0x40(%rsp), %rdx orb %al, %r14b addq $0x8, %rdx jmp 0x16788a andb $0x1, %r14b movl %r14d, %eax addq $0x48, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x2f0870(%rip), %rdi # 0x4581de leaq 0x2f2b05(%rip), %rsi # 0x45a47a leaq 0x2f6ff9(%rip), %rdx # 0x45e975 leaq 0x2f7065(%rip), %rcx # 0x45e9e8 callq 0x2813f
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
bool baryonyx::itm::affect<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, float>(baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, float, float)
bool affect(Solver& slv, Xtype& x, Iterator it, int k, int selected, int r_size, const Float kappa, const Float delta) { constexpr Float one{ 1 }; constexpr Float two{ 2 }; constexpr Float middle{ (two + one) / two }; const auto old_pi = slv.pi[k]; auto d = delta; if (selected < 0) { // slv.pi[k] += slv.R[0].value / two; d += (kappa / (one - kappa)) * (slv.R[0].value / two); for (int i = 0; i != r_size; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.set(var->column); slv.P[var->value] += d; } else { x.unset(var->column); slv.P[var->value] -= d; } } } else if (selected + 1 >= r_size) { // slv.pi[k] += slv.R[selected].value * middle; d += (kappa / (one - kappa)) * (slv.R[selected].value * middle); for (int i = 0; i != r_size; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.unset(var->column); slv.P[var->value] -= d; } else { x.set(var->column); slv.P[var->value] += d; } } } else { slv.pi[k] += ((slv.R[selected].value + slv.R[selected + 1].value) / two); d += (kappa / (one - kappa)) * (slv.R[selected + 1].value - slv.R[selected].value); int i = 0; for (; i <= selected; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.unset(var->column); slv.P[var->value] -= d; } else { x.set(var->column); slv.P[var->value] += d; } } for (; i != r_size; ++i) { auto var = it + slv.R[i].id; if (slv.R[i].is_negative_factor()) { x.set(var->column); slv.P[var->value] += d; } else { x.unset(var->column); slv.P[var->value] -= d; } } } // TODO job: develops is_valid_constraint for all the solvers bx_expects(is_valid_constraint(slv, k, x)); return is_signbit_change(old_pi, slv.pi[k]); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movq 0x70(%rdi), %rax movl %ecx, 0xc(%rsp) movslq %ecx, %rcx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx movq %rcx, 0x10(%rsp) vmovss (%rax,%rcx,4), %xmm2 vmovaps %xmm2, 0x20(%rsp) testl %r8d, %r8d js 0x167e54 leal 0x1(%r8), %ecx cmpl %r9d, %ecx jge 0x167ee6 movq 0x60(%rbx), %rsi movl %r8d, %edx imulq $0xc, %rdx, %rdx movl %ecx, %ecx imulq $0xc, %rcx, %rbp movq %rcx, 0x18(%rsp) movq 0x10(%rsp), %rcx xorl %r13d, %r13d movl %r9d, 0x8(%rsp) vmovss (%rsi,%rdx), %xmm2 vaddss (%rsi,%rbp), %xmm2, %xmm2 vmulss 0x2f1d0b(%rip), %xmm2, %xmm2 # 0x459ad0 vaddss 0x20(%rsp), %xmm2, %xmm2 vmovss %xmm2, (%rax,%rcx,4) vmovss 0x2f1cec(%rip), %xmm2 # 0x459ac4 vsubss %xmm0, %xmm2, %xmm2 vdivss %xmm2, %xmm0, %xmm0 vmovss (%rsi,%rbp), %xmm2 vsubss (%rsi,%rdx), %xmm2, %xmm2 vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1 vmovss %xmm2, 0x4(%rsp) cmpq %r13, %rbp je 0x167f80 movq 0x60(%rbx), %rax movq %r14, %rdi movslq 0x8(%rax,%r13), %r12 cmpl $0x0, 0x4(%rax,%r13) movl 0x4(%r15,%r12,8), %esi js 0x167e31 callq 0x369c8 movslq (%r15,%r12,8), %rax movq 0x50(%rbx), %rcx vmovss 0x4(%rsp), %xmm0 vaddss (%rcx,%rax,4), %xmm0, %xmm0 jmp 0x167e49 callq 0x36a06 movslq (%r15,%r12,8), %rax movq 0x50(%rbx), %rcx vmovss (%rcx,%rax,4), %xmm0 vsubss 0x4(%rsp), %xmm0, %xmm0 vmovss %xmm0, (%rcx,%rax,4) addq $0xc, %r13 jmp 0x167df5 vmovss 0x2f1c68(%rip), %xmm2 # 0x459ac4 movq 0x60(%rbx), %rax xorl %ebp, %ebp vsubss %xmm0, %xmm2, %xmm2 vdivss %xmm2, %xmm0, %xmm0 vmovss (%rax), %xmm2 movl %r9d, %eax imulq $0xc, %rax, %r12 vmulss 0x2f1c53(%rip), %xmm2, %xmm2 # 0x459ad0 vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1 vmovss %xmm2, 0x4(%rsp) cmpq %rbp, %r12 je 0x167fe8 movq 0x60(%rbx), %rax movq %r14, %rdi movslq 0x8(%rax,%rbp), %r13 cmpl $0x0, 0x4(%rax,%rbp) movl 0x4(%r15,%r13,8), %esi js 0x167ec3 callq 0x36a06 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx vmovss (%rcx,%rax,4), %xmm0 vsubss 0x4(%rsp), %xmm0, %xmm0 jmp 0x167edb callq 0x369c8 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx vmovss 0x4(%rsp), %xmm0 vaddss (%rcx,%rax,4), %xmm0, %xmm0 vmovss %xmm0, (%rcx,%rax,4) addq $0xc, %rbp jmp 0x167e88 vmovss 0x2f1bd6(%rip), %xmm2 # 0x459ac4 movq 0x60(%rbx), %rcx movl %r8d, %eax imulq $0xc, %rax, %rax xorl %ebp, %ebp vsubss %xmm0, %xmm2, %xmm2 vdivss %xmm2, %xmm0, %xmm0 vmovss (%rcx,%rax), %xmm2 movl %r9d, %eax imulq $0xc, %rax, %r12 vmulss 0x2f3db1(%rip), %xmm2, %xmm2 # 0x45bcc8 vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1 vmovss %xmm2, 0x4(%rsp) cmpq %rbp, %r12 je 0x167fe8 movq 0x60(%rbx), %rax movq %r14, %rdi movslq 0x8(%rax,%rbp), %r13 cmpl $0x0, 0x4(%rax,%rbp) movl 0x4(%r15,%r13,8), %esi js 0x167f5d callq 0x369c8 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx vmovss 0x4(%rsp), %xmm0 vaddss (%rcx,%rax,4), %xmm0, %xmm0 jmp 0x167f75 callq 0x36a06 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx vmovss (%rcx,%rax,4), %xmm0 vsubss 0x4(%rsp), %xmm0, %xmm0 vmovss %xmm0, (%rcx,%rax,4) addq $0xc, %rbp jmp 0x167f22 movl 0x8(%rsp), %r12d addq $0x8, %rbp subq 0x18(%rsp), %r12 subq $0x1, %r12 jb 0x167fe8 movq 0x60(%rbx), %rax movq %r14, %rdi movslq (%rax,%rbp), %r13 cmpl $0x0, -0x4(%rax,%rbp) movl 0x4(%r15,%r13,8), %esi js 0x167fc5 callq 0x36a06 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx vmovss (%rcx,%rax,4), %xmm0 vsubss 0x4(%rsp), %xmm0, %xmm0 jmp 0x167fdd callq 0x369c8 movslq (%r15,%r13,8), %rax movq 0x50(%rbx), %rcx vmovss 0x4(%rsp), %xmm0 vaddss (%rcx,%rax,4), %xmm0, %xmm0 vmovss %xmm0, (%rcx,%rax,4) addq $0xc, %rbp jmp 0x167f8e movl 0xc(%rsp), %esi movq %rbx, %rdi movq %r14, %rdx callq 0x16754c testb %al, %al je 0x168026 vmovaps 0x20(%rsp), %xmm0 movq 0x70(%rbx), %rcx movq 0x10(%rsp), %rdx vmovmskps %xmm0, %eax shll $0x1f, %eax xorl (%rcx,%rdx,4), %eax shrl $0x1f, %eax addq $0x38, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x2f01b1(%rip), %rdi # 0x4581de leaq 0x2f42e8(%rip), %rsi # 0x45c31c leaq 0x2f1f51(%rip), %rdx # 0x459f8c leaq 0x2f42f9(%rip), %rcx # 0x45c33b callq 0x2813f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>::rc_data*>(baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>::rc_data*, baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>::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 0xc(%rdi), %rsi cmpq %r14, %rsi je 0x168082 vmovss (%rdi), %xmm0 leaq 0xc(%rsi), %r15 vucomiss (%rsi), %xmm0 movq %r15, %rsi jne 0x16806e jnp 0x168056 addq $-0xc, %r15 movq %r15, %rsi movq %rbx, %rdx callq 0x168618 movq %r15, %rdi jmp 0x168052 movq %rbx, %rdx callq 0x168618 popq %rbx popq %r14 popq %r15 retq jmp 0x168092 movq %rax, %rdi callq 0xeb9f
/quesnel[P]baryonyx/lib/src/itm-common.hpp
bool baryonyx::itm::solver_equalities_101coeff<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 obj_amp) { 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 sizes = 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 != sizes.r_size; ++i) R[i].value += obj_amp * c((std::get<0>(it) + R[i].id)->column, x); calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng); int selected = select_variables(sizes, b[k].value); logger::log("constraints {}: {} = ", k, b[k].value); for (int i = 0; i < sizes.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, sizes.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, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) movq %rcx, 0x30(%rsp) movq %rdx, %r14 movq %rsi, 0x20(%rsp) movq %rdi, %r13 xorl %r15d, %r15d movq %rax, 0x28(%rsp) cmpq 0x30(%rsp), %r14 je 0x169d3e movl (%r14), %eax movq 0x28(%rsp), %rsi leaq 0x10(%rsp), %rdi movslq %eax, %rbp movl %ebp, %edx callq 0x3de66 vmovss 0x8(%rsp), %xmm0 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq %r13, %rdi callq 0x167c06 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq 0x20(%rsp), %rcx movq %r13, %rdi callq 0x167c24 vmovss 0xc(%rsp), %xmm1 movq %rax, %rbx movq %rax, %r12 movq 0x60(%r13), %rdi movq 0x78(%r13), %rax movq 0x18(%rsp), %rcx movl %r12d, %edx imulq $0xc, %rdx, %rdx shrq $0x20, %rbx xorl %esi, %esi cmpq %rsi, %rdx je 0x169cea movslq 0x8(%rdi,%rsi), %r8 movq 0x8(%rax), %r9 movslq 0x4(%rcx,%r8,8), %r8 vmovss (%r9,%r8,4), %xmm0 vfmadd213ss (%rdi,%rsi), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovss %xmm0, (%rdi,%rsi) addq $0xc, %rsi jmp 0x169cc0 movslq %r12d, %rax movq 0x8(%r13), %rdx imulq $0xc, %rax, %rsi addq %rdi, %rsi callq 0x167d15 movq 0x68(%r13), %rax vmovss (%rsp), %xmm0 vmovss 0x4(%rsp), %xmm1 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r13, %rdi movl %ebp, %ecx movl %r12d, %r9d addl (%rax,%rbp,8), %ebx cmpl %ebx, %r12d cmovll %r12d, %ebx decl %ebx movl %ebx, %r8d callq 0x167d48 orb %al, %r15b addq $0x4, %r14 jmp 0x169c49 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-101.cpp
bool baryonyx::itm::solver_equalities_101coeff<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 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, float)
bool push_and_compute_update_row(Xtype& x, Iterator first, Iterator last, Float kappa, Float delta, Float theta, Float obj_amp) { 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 sizes = 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 != sizes.r_size; ++i) R[i].value += obj_amp * c((std::get<0>(it) + R[i].id)->column, x); calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng); int selected = select_variables(sizes, b[k].value); logger::log("constraints {}: {} = ", k, b[k].value); for (int i = 0; i < sizes.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, sizes.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, 0xc(%rsp) vmovss %xmm2, 0x8(%rsp) vmovss %xmm1, 0x4(%rsp) vmovss %xmm0, (%rsp) movq %rcx, 0x30(%rsp) movq %rdx, %r14 movq %rsi, 0x20(%rsp) movq %rdi, %r13 xorl %r15d, %r15d movq %rax, 0x28(%rsp) cmpq 0x30(%rsp), %r14 je 0x169fd6 movl (%r14), %eax movq 0x28(%rsp), %rsi leaq 0x10(%rsp), %rdi movslq %eax, %rbp movl %ebp, %edx callq 0x3de66 vmovss 0x8(%rsp), %xmm0 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq %r13, %rdi callq 0x167c06 movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rsi movq 0x20(%rsp), %rcx movq %r13, %rdi callq 0x167c24 vmovss 0xc(%rsp), %xmm1 movq %rax, %rbx movq %rax, %r12 movq 0x60(%r13), %rdi movq 0x78(%r13), %rax movq 0x18(%rsp), %rcx movl %r12d, %edx imulq $0xc, %rdx, %rdx shrq $0x20, %rbx xorl %esi, %esi cmpq %rsi, %rdx je 0x169f82 movslq 0x8(%rdi,%rsi), %r8 movq 0x8(%rax), %r9 movslq 0x4(%rcx,%r8,8), %r8 vmovss (%r9,%r8,4), %xmm0 vfmadd213ss (%rdi,%rsi), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem vmovss %xmm0, (%rdi,%rsi) addq $0xc, %rsi jmp 0x169f58 movslq %r12d, %rax movq 0x8(%r13), %rdx imulq $0xc, %rax, %rsi addq %rdi, %rsi callq 0x167d15 movq 0x68(%r13), %rax vmovss (%rsp), %xmm0 vmovss 0x4(%rsp), %xmm1 movq 0x18(%rsp), %rdx movq 0x20(%rsp), %rsi movq %r13, %rdi movl %ebp, %ecx movl %r12d, %r9d addl (%rax,%rbp,8), %ebx cmpl %ebx, %r12d cmovll %r12d, %ebx decl %ebx movl %ebx, %r8d callq 0x167d48 orb %al, %r15b addq $0x4, %r14 jmp 0x169ee1 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-101.cpp
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_101coeff<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>::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 $0x168, %rsp # imm = 0x168 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 0x98(%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 0x16c172 movq 0x10(%r14), %rdi leaq 0x98(%rsp), %rsi movl %ebx, %edx callq 0x38a37 vmovss %xmm0, 0x14(%rsp) jmp 0x16c17c 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 0xe0(%rsp), %rdi leaq 0x98(%rsp), %r8 movl %eax, %edx movl %ebx, %ecx movq %r15, %r9 callq 0x166c6a movl 0xcc(%r12), %esi leaq 0xa8(%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 0x16c25a cmpl $0x1, %eax je 0x16c234 cmpl $0x2, %eax jne 0x16c26b movq 0x18(%r14), %rdx leaq 0x80(%rsp), %rdi leaq 0x28(%rsp), %rsi jmp 0x16c245 movq 0x18(%r14), %rdx leaq 0x28(%rsp), %rdi leaq 0x80(%rsp), %rsi vmovsd 0x2e7deb(%rip), %xmm0 # 0x454038 movq %r13, %rcx movq %r15, %r8 callq 0x36301 jmp 0x16c26b 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 0x16c2dd movq 0x18(%r14), %rdi callq 0x36ac3 vmovsd 0x8(%rsp), %xmm1 vucomisd %xmm0, %xmm1 jbe 0x16c2d9 movq %r15, %rdi movl %ebx, %esi callq 0x3626e incl %ebx jmp 0x16c2b6 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 0xa8(%rsp), %rdi leaq 0xe0(%rsp), %rsi leaq 0x28(%rsp), %rdx callq 0x166e34 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 0x16c400 movq 0x18(%r14), %rcx vmovss 0x14(%rsp), %xmm1 leaq 0xa8(%rsp), %rdi leaq 0xe0(%rsp), %rsi movq %rbx, %rdx vmovss %xmm0, 0x8(%rsp) callq 0x166e76 movl %eax, %r13d testl %eax, %eax je 0x16c498 cmpl %ebp, %r13d jge 0x16c395 movq %r14, %rdi movq %rbx, %rsi movl %r13d, %edx movq %r15, %rcx callq 0x16c90c movl %r13d, %ebp cmpq 0x70(%rsp), %r15 jle 0x16c3cc vcvtsi2ss %r13d, %xmm3, %xmm0 vcvtsi2ssl 0x160(%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 0x16c3d2 vmovss 0x8(%rsp), %xmm0 vucomiss 0x48(%rsp), %xmm0 ja 0x16c400 movq %r14, %rdi vmovss %xmm0, 0x8(%rsp) callq 0x16c944 vmovss 0x8(%rsp), %xmm0 vmovss 0x4(%rsp), %xmm2 testb %al, %al jne 0x16c400 incq %r15 jmp 0x16c33b movq 0x18(%rsp), %rax movl $0x5, 0xa0(%rax) cmpl $0x0, 0x50(%r14) jne 0x16c422 movq 0x18(%rsp), %rax andl $0x0, 0xa0(%rax) cmpq $0x0, 0x28(%r14) je 0x16c450 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 0xa8(%rsp), %rdi callq 0x393ac leaq 0xe0(%rsp), %rdi callq 0x1672d6 leaq 0xa0(%rsp), %rdi callq 0x35c1a leaq 0x30(%rsp), %rdi callq 0x357fe movq 0x18(%rsp), %rax addq $0x168, %rsp # imm = 0x168 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 0x16c8c2 vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 leaq 0xe0(%rsp), %r15 leaq 0x28(%rsp), %rbp xorl %ebx, %ebx movl $0x0, 0x38(%rsp) cmpl 0xbc(%r12), %ebx jge 0x16c40f vmovss %xmm0, 0x8(%rsp) vmulss 0x68(%rsp), %xmm0, %xmm0 movq 0x18(%r14), %rcx vmovss 0x14(%rsp), %xmm1 vmovss 0x60(%rsp), %xmm3 leaq 0xa8(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx callq 0x167082 testl %eax, %eax jne 0x16c550 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 0x16c8c2 movq %r14, %rdi callq 0x16c944 vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 testb %al, %al jne 0x16c40f movl %ebx, 0x70(%rsp) pushq $0x1 popq %rax movl %eax, %ebx leal -0x1(%rbx), %r13d cmpl 0xc0(%r12), %r13d jge 0x16c677 movq 0x18(%r14), %rcx vmovss 0x14(%rsp), %xmm1 leaq 0xa8(%rsp), %rdi movq %r15, %rsi movq %rbp, %rdx vmovss %xmm0, 0x8(%rsp) callq 0x166e76 testl %eax, %eax je 0x16c62d vcvtsi2sd %r13d, %xmm4, %xmm0 vucomisd 0xa0(%r12), %xmm0 jbe 0x16c5f4 vcvtsi2ss %eax, %xmm4, %xmm0 vcvtsi2ssl 0x160(%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 0x16c600 vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 vucomiss 0x48(%rsp), %xmm0 ja 0x16c677 movq %r14, %rdi vmovss %xmm0, 0x8(%rsp) callq 0x16c944 testb %al, %al jne 0x16c66b vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 incl %ebx jmp 0x16c575 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 0x16c8c2 vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 jmp 0x16c677 vmovss 0x4(%rsp), %xmm2 vmovss 0x8(%rsp), %xmm0 movl 0x70(%rsp), %ebx decl 0x38(%rsp) incl %ebx jmp 0x16c4e1 jmp 0x16c6b8 jmp 0x16c691 jmp 0x16c6b8 movq %rax, %r14 jmp 0x16c6c8 movq %rax, %r14 jmp 0x16c6d5 movq %rax, %r14 jmp 0x16c6e2 movq %rax, %r14 jmp 0x16c6ec jmp 0x16c6b8 jmp 0x16c6b8 jmp 0x16c6b8 leaq 0x88(%rsp), %rdi movq %rax, %r14 callq 0x357fe jmp 0x16c6bb movq %rax, %r14 leaq 0xa8(%rsp), %rdi callq 0x393ac leaq 0xe0(%rsp), %rdi callq 0x1672d6 leaq 0xa0(%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_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<float>, 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 0x2ed1f5(%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_101coeff<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 0x16c90a pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 addq $0x20, %rdi movq %rdx, %rbx vmovsd %xmm0, (%rsp) callq 0x36a44 movq %r14, %rdi callq 0x16c984 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_101coeff<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 0x2ed113(%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_equalities_101coeff<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 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 0x16ca09 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 0x16cb68 movq 0xa8(%r13), %rax cmpq 0xb0(%r13), %rax je 0x16cb68 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 0x16cbc3 movl %eax, %ecx shlq $0x3, %rcx addq 0x30(%rsp), %rcx movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x16dca6 movl 0x8(%rsp), %eax incl %eax jmp 0x16cb3f 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 0x16cf5e 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 0x16cc87 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 0x16dcf2 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 0x16cbe3 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 0x16cd1c movq 0x60(%rsp), %rax xorl %ecx, %ecx xorl %r14d, %r14d cmpq %rcx, %r15 je 0x16ccdd addq 0xb0(%rax,%rcx), %r14 addq $0xc0, %rcx jmp 0x16ccc7 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 0x2ecd41(%rip), %xmm1, %xmm1 # 0x459a80 jae 0x16cca2 vucomisd %xmm0, %xmm1 jbe 0x16cca2 movb $0x1, %al xchgb %al, 0x3(%rsp) movq 0xa0(%rsp), %rbx movq 0xa8(%rsp), %r14 movq 0x10(%rsp), %r12 cmpq %r14, %rbx je 0x16cd7d movq %rbx, %rdi callq 0xb1a0 addq $0x8, %rbx jmp 0x16cd6a 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 0x16ced8 cmpl $0x1, %eax je 0x16cea0 cmpl $0x2, %eax jne 0x16cef7 leaq 0x68(%r12), %rbx pushq $0x5 popq %rsi movq %rbx, %rdi callq 0x35292 xorl %r14d, %r14d xorl %r15d, %r15d cmpq $0x5, %r15 je 0x16cef7 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 0x16ce66 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 0x16ceeb 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 0x16cf23 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 0x173220 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 0x16cfbf movq %rax, %rbx jmp 0x16cfcc movq %rax, %rbx jmp 0x16cfd9 jmp 0x16cfa3 jmp 0x16cf94 jmp 0x16cfb2 jmp 0x16cfb2 movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0x16cffa movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0x16cff0 jmp 0x16cfb2 jmp 0x16cfb2 jmp 0x16cfb2 jmp 0x16cfb2 jmp 0x16cfb2 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 0x173220 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_101coeff<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 0x16d03e 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 0x16d167 movq 0xa8(%r15), %rax cmpq 0xb0(%r15), %rax je 0x16d167 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 0x16d18e cmpl $0x2, %eax jne 0x16d1dd 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 0x173926 jmp 0x16d22a 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 0x16d259 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 0x173248 jmp 0x16d22a 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 0x174004 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 0x16d2c5 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 0x16d2e7 jmp 0x16d2e7 leaq 0x68(%rsp), %rdi movq %rax, %r14 callq 0x357fe leaq 0x20(%rsp), %rdi callq 0x4495c jmp 0x16d30a jmp 0x16d307 movq %rax, %r14 jmp 0x16d314 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_101coeff<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 0x16d38a 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 0x16d4e9 movq 0xa8(%r13), %rax cmpq 0xb0(%r13), %rax je 0x16d4e9 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 0x16d544 movl %eax, %ecx shlq $0x3, %rcx addq 0x30(%rsp), %rcx movq %rbx, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x17491a movl 0x8(%rsp), %eax incl %eax jmp 0x16d4c0 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 0x16d8df 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 0x16d608 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 0x174966 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 0x16d564 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 0x16d69d movq 0x60(%rsp), %rax xorl %ecx, %ecx xorl %r14d, %r14d cmpq %rcx, %r15 je 0x16d65e addq 0xb0(%rax,%rcx), %r14 addq $0xc0, %rcx jmp 0x16d648 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 0x2ec3c0(%rip), %xmm1, %xmm1 # 0x459a80 jae 0x16d623 vucomisd %xmm0, %xmm1 jbe 0x16d623 movb $0x1, %al xchgb %al, 0x3(%rsp) movq 0xa0(%rsp), %rbx movq 0xa8(%rsp), %r14 movq 0x10(%rsp), %r12 cmpq %r14, %rbx je 0x16d6fe movq %rbx, %rdi callq 0xb1a0 addq $0x8, %rbx jmp 0x16d6eb 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 0x16d859 cmpl $0x1, %eax je 0x16d821 cmpl $0x2, %eax jne 0x16d878 leaq 0x68(%r12), %rbx pushq $0x5 popq %rsi movq %rbx, %rdi callq 0x35292 xorl %r14d, %r14d xorl %r15d, %r15d cmpq $0x5, %r15 je 0x16d878 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 0x16d7e7 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 0x16d86c 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 0x16d8a4 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 0x179914 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 0x16d940 movq %rax, %rbx jmp 0x16d94d movq %rax, %rbx jmp 0x16d95a jmp 0x16d924 jmp 0x16d915 jmp 0x16d933 jmp 0x16d933 movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0x16d97b movq %r12, 0x10(%rsp) movq %rax, %rbx jmp 0x16d971 jmp 0x16d933 jmp 0x16d933 jmp 0x16d933 jmp 0x16d933 jmp 0x16d933 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 0x179914 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_101coeff<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 0x16d9bf 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 0x16dae8 movq 0xa8(%r15), %rax cmpq 0xb0(%r15), %rax je 0x16dae8 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 0x16db0f cmpl $0x2, %eax jne 0x16db5e 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 0x17a01a jmp 0x16dbab 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 0x16dbda 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 0x17993c jmp 0x16dbab 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 0x17a6f8 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 0x16dc46 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 0x16dc68 jmp 0x16dc68 leaq 0x68(%rsp), %rdi movq %rax, %r14 callq 0x357fe leaq 0x20(%rsp), %rdi callq 0x4495c jmp 0x16dc8b jmp 0x16dc88 movq %rax, %r14 jmp 0x16dc95 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
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true> 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 0x16e7e2 movq %rax, %rdi jmp 0x16ed80 cmpl $0x7, %ecx jne 0x16e7ff movq (%rax), %rcx movq 0x8(%rax), %rax xorl %edx, %edx cmpq %rax, %rcx je 0x16e80d movl %edx, (%rcx) incl %edx addq $0x4, %rcx jmp 0x16e7f0 movq %rsi, %rdi movq %rdx, %rsi movq %rax, %rdx jmp 0x16ee7f retq
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_101coeff<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 0x16e94d leaq 0x2efc3b(%rip), %rdx # 0x45e470 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 0x16ef66 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0x16ee7f 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 0x170d54 jmp 0x16e982 movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovss %xmm2, 0xc(%rsp) vmovss %xmm1, 0x8(%rsp) vmovss %xmm0, 0x4(%rsp) callq 0x17047e jmp 0x16e8de movq 0x18(%r14), %rdi movq 0x20(%r14), %rsi vmovss %xmm2, 0xc(%rsp) vmovss %xmm1, 0x8(%rsp) vmovss %xmm0, 0x4(%rsp) callq 0x1708e9 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 0x16f348 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0x16f532 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 0x16f15e jmp 0x16e9a6 movq (%r14), %rdi movq 0x8(%r14), %rsi movq %r15, %rdx vmovss %xmm2, 0xc(%rsp) vmovss %xmm1, 0x8(%rsp) vmovss %xmm0, 0x4(%rsp) callq 0x171246 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 0x16f632 movq %r15, %rdi movq %rbx, %rsi movq %r14, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0x16ee7f 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 0x16f15e movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx addq $0x20, %rsp popq %rbx popq %r14 popq %r15 jmp 0x16f81c nop
/quesnel[P]baryonyx/lib/src/itm-common.hpp
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true> 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 0x16ee9d movq %rax, 0x8(%rbx) leaq 0x4(%rsp), %r12 xorl %esi, %esi movl %esi, 0x4(%rsp) cmpl 0x80(%r15), %esi je 0x16eed3 movq %r15, %rdi movq %r14, %rdx callq 0x16eeea testb %al, %al jne 0x16eecb movq %rbx, %rdi movq %r12, %rsi callq 0x31460 movl 0x4(%rsp), %esi incl %esi jmp 0x16eea4 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_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true> 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 0x10(%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 0x16ef47 movslq (%r13), %rax movq 0x58(%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 0x16ef1f movslq 0x4(%rsp), %rax movq 0x68(%rbx), %rcx cmpl (%rcx,%rax,8), %r15d sete %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