name
stringlengths 1
473k
| code
stringlengths 7
647k
| asm
stringlengths 4
3.39M
| file
stringlengths 8
196
|
---|---|---|---|
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long 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>>>>, long double, long double, long double, long 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);
bx_expects(k < m);
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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0x78, %rsp
movq %rcx, 0x48(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x6c(%rsp)
fldt 0xc0(%rsp)
fstpt 0x60(%rsp)
fldt 0xb0(%rsp)
fstpt 0x54(%rsp)
movq %rax, 0x40(%rsp)
fstpt 0x34(%rsp)
cmpq 0x48(%rsp), %r14
je 0x287cd7
movslq (%r14), %rbx
cmpl 0x78(%r12), %ebx
jge 0x287ced
movq 0x40(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
fldt 0x6c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x2859c8
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2859ee
fldt 0x34(%rsp)
movl %eax, %ebp
movq 0x58(%r12), %rdi
movq 0x70(%r12), %rax
movl %ebp, %ecx
shlq $0x5, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x287c72
movslq 0x10(%rdi,%rdx), %rsi
movq 0x8(%rax), %r8
shlq $0x4, %rsi
fldt (%r8,%rsi)
fmul %st(1), %st
fldt (%rdi,%rdx)
faddp %st, %st(1)
fstpt (%rdi,%rdx)
addq $0x20, %rdx
jmp 0x287c4c
fstp %st(0)
movq 0x8(%r12), %rdx
movslq %ebp, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x285ab4
movq 0x60(%r12), %rax
movq %r12, %rdi
movl %ebp, %esi
movl (%rax,%rbx,8), %edx
movl 0x4(%rax,%rbx,8), %ecx
callq 0x285ae8
movq 0x28(%rsp), %rdx
fldt 0x60(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
movl %ebp, %r9d
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x285b59
fldt 0x34(%rsp)
fstp %st(0)
orb %al, %r13b
addq $0x8, %r14
jmp 0x287bdc
andb $0x1, %r13b
movl %r13d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d04ea(%rip), %rdi # 0x4581de
leaq 0x1d277f(%rip), %rsi # 0x45a47a
leaq 0x1d92d3(%rip), %rdx # 0x460fd5
leaq 0x1d936a(%rip), %rcx # 0x461073
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long 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>>>, long double, long double, long double, long 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);
bx_expects(k < m);
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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0x78, %rsp
movq %rcx, 0x48(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x6c(%rsp)
fldt 0xc0(%rsp)
fstpt 0x60(%rsp)
fldt 0xb0(%rsp)
fstpt 0x54(%rsp)
movq %rax, 0x40(%rsp)
fstpt 0x34(%rsp)
cmpq 0x48(%rsp), %r14
je 0x287e5d
movslq (%r14), %rbx
cmpl 0x78(%r12), %ebx
jge 0x287e73
movq 0x40(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
fldt 0x6c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x2859c8
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2859ee
fldt 0x34(%rsp)
movl %eax, %ebp
movq 0x58(%r12), %rdi
movq 0x70(%r12), %rax
movl %ebp, %ecx
shlq $0x5, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x287df8
movslq 0x10(%rdi,%rdx), %rsi
movq 0x8(%rax), %r8
shlq $0x4, %rsi
fldt (%r8,%rsi)
fmul %st(1), %st
fldt (%rdi,%rdx)
faddp %st, %st(1)
fstpt (%rdi,%rdx)
addq $0x20, %rdx
jmp 0x287dd2
fstp %st(0)
movq 0x8(%r12), %rdx
movslq %ebp, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x285ab4
movq 0x60(%r12), %rax
movq %r12, %rdi
movl %ebp, %esi
movl (%rax,%rbx,8), %edx
movl 0x4(%rax,%rbx,8), %ecx
callq 0x285ae8
movq 0x28(%rsp), %rdx
fldt 0x60(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
movl %ebp, %r9d
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x285b59
fldt 0x34(%rsp)
fstp %st(0)
orb %al, %r13b
addq $0x4, %r14
jmp 0x287d62
andb $0x1, %r13b
movl %r13d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d0364(%rip), %rdi # 0x4581de
leaq 0x1d25f9(%rip), %rsi # 0x45a47a
leaq 0x1d914d(%rip), %rdx # 0x460fd5
leaq 0x1d91e4(%rip), %rcx # 0x461073
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp # imm = 0x428
vmovsd %xmm0, 0x88(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x60(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x70(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0xb8(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x8d226
fldl 0x20(%r12)
fstpt 0xd8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xe4(%rsp)
fldl 0x30(%r12)
fstpt 0xcc(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x54(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x289a64
movq 0x10(%r14), %rdi
leaq 0xb8(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x8d304
fstpt 0x9c(%rsp)
jmp 0x289a7d
fstp %st(0)
vmovsd %xmm0, 0xf8(%rsp)
fldl 0xf8(%rsp)
fstpt 0x9c(%rsp)
fldl 0x38(%r12)
fstpt 0x10c(%rsp)
fldl 0x40(%r12)
fstpt 0x100(%rsp)
vcvttsd2si 0xa0(%r12), %rax
movq 0x18(%r14), %rsi
movq %rax, 0x90(%rsp)
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x150(%rsp), %rdi
leaq 0xb8(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x284acc
movl 0xcc(%r12), %esi
leaq 0x118(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x98(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x1d0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x289b5f
cmpl $0x1, %eax
je 0x289b39
cmpl $0x2, %eax
jne 0x289b70
movq 0x18(%r14), %rdx
leaq 0x1d0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
jmp 0x289b4a
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
vmovsd 0x1ca4e6(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x8b497
jmp 0x289b70
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x8b41f
leaq 0x70(%rsp), %r15
movq %r13, 0x80(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x289ba9
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x48(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x289ba5
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x289b82
leaq 0x1d8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x1c8(%rsp), %ecx
movl 0x1cc(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x48(%rsp)
leaq 0x1d0996(%rip), %rdx # 0x45a577
leaq 0x1d0(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x118(%rsp), %rdi
leaq 0x150(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x284c76
vmovsd 0x48(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x70(%rsp), %r13
xorl %r15d, %r15d
vmovsd %xmm0, 0xf0(%rsp)
fldl 0xf0(%rsp)
fldt 0x54(%rsp)
cmpq 0xb0(%r12), %r15
je 0x289d52
movq 0x18(%r14), %rcx
fstpt 0x20(%rsp)
leaq 0x118(%rsp), %rdi
leaq 0x150(%rsp), %rsi
movq %r13, %rdx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x284cb8
movq 0x1a0(%rsp), %rdx
movq 0x1b8(%rsp), %rcx
movl %eax, %ebx
leaq 0x1d0(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x95692
testl %ebx, %ebx
je 0x289e06
cmpl %ebp, %ebx
jge 0x289cca
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x28a8c0
movl %ebx, %ebp
cmpq 0x90(%rsp), %r15
jle 0x289d1b
movl %ebx, 0xb0(%rsp)
fildl 0xb0(%rsp)
movl 0x1c8(%rsp), %eax
movl %eax, 0xb4(%rsp)
fidivl 0xb4(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x289d1f
fldt 0x48(%rsp)
fldt 0xe4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x289d52
fstp %st(0)
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x28a8f8
fldt 0x48(%rsp)
fldt 0x54(%rsp)
testb %al, %al
jne 0x289d52
incq %r15
jmp 0x289c43
fstp %st(0)
fstp %st(0)
movq 0x60(%rsp), %rax
movl $0x5, 0xa0(%rax)
fldz
fldz
fstp %st(1)
fstp %st(0)
cmpl $0x0, 0x50(%r14)
jne 0x289d80
movq 0x60(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x289db1
movq 0x60(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x98(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x1d0(%rsp), %rdi
callq 0x435d0
leaq 0x118(%rsp), %rdi
callq 0x393ac
leaq 0x150(%rsp), %rdi
callq 0x28518c
leaq 0xc0(%rsp), %rdi
callq 0x8affa
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rax
addq $0x428, %rsp # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
leaq 0x70(%rsp), %rbx
movq %rbx, %rsi
callq 0x8b74a
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x28a876
movl $0x0, 0x6c(%rsp)
leaq 0x150(%rsp), %r15
leaq 0x70(%rsp), %rbp
xorl %ebx, %ebx
fldt 0x54(%rsp)
fldt 0x48(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x289d69
movq 0x18(%r14), %rcx
fldt 0x10c(%rsp)
fld %st(1)
fstpt 0x48(%rsp)
fmulp %st, %st(1)
fldt 0x100(%rsp)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x118(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x284ee8
testl %eax, %eax
jne 0x289edc
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x8b74a
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x28a876
movq %r14, %rdi
callq 0x28a8f8
fldt 0x54(%rsp)
fldt 0x48(%rsp)
testb %al, %al
jne 0x289d69
movl %ebx, 0x90(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x28a025
movq 0x18(%r14), %rcx
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x118(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x284cb8
testl %eax, %eax
je 0x289fd5
vcvtsi2sd %r13d, %xmm1, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x289fa3
movl %eax, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x1c8(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x289fa7
fldt 0x48(%rsp)
fldt 0xe4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x28a015
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x28a8f8
testb %al, %al
jne 0x28a01d
fldt 0x54(%rsp)
fldt 0x48(%rsp)
incl %ebx
jmp 0x289f00
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x8b74a
movl 0xc0(%r12), %eax
imull 0x6c(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x28a876
fldt 0x54(%rsp)
fldt 0x48(%rsp)
jmp 0x28a025
fldt 0x54(%rsp)
fxch %st(1)
jmp 0x28a025
fldt 0x54(%rsp)
fldt 0x48(%rsp)
movl 0x90(%rsp), %ebx
decl 0x6c(%rsp)
incl %ebx
jmp 0x289e51
jmp 0x28a072
jmp 0x28a04b
fstp %st(1)
fstp %st(0)
jmp 0x28a072
movq %rax, %rbx
jmp 0x28a082
movq %rax, %rbx
jmp 0x28a08f
movq %rax, %rbx
jmp 0x28a09c
movq %rax, %rbx
jmp 0x28a0a9
movq %rax, %rbx
jmp 0x28a0b3
jmp 0x28a072
jmp 0x28a072
jmp 0x28a072
leaq 0x1d8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x28a082
leaq 0x1d0(%rsp), %rdi
movq %rax, %rbx
callq 0x435d0
leaq 0x118(%rsp), %rdi
callq 0x393ac
leaq 0x150(%rsp), %rdi
callq 0x28518c
leaq 0xc0(%rsp), %rdi
callq 0x8affa
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp # imm = 0x1D8
vmovsd %xmm0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x58(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x68(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0xc0(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x8d226
fldl 0x20(%r12)
fstpt 0xe0(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xec(%rsp)
fldl 0x30(%r12)
fstpt 0xd4(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x4c(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x28a1ac
movq 0x10(%r14), %rdi
leaq 0xc0(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x8d304
fstpt 0x94(%rsp)
jmp 0x28a1c5
fstp %st(0)
vmovsd %xmm0, 0x100(%rsp)
fldl 0x100(%rsp)
fstpt 0x94(%rsp)
fldl 0x38(%r12)
fstpt 0x114(%rsp)
fldl 0x40(%r12)
fstpt 0x108(%rsp)
vcvttsd2si 0xa0(%r12), %rax
movq 0x18(%r14), %rsi
movq %rax, 0x88(%rsp)
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x158(%rsp), %rdi
leaq 0xc0(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x284acc
movl 0xcc(%r12), %esi
leaq 0x120(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x90(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0xb0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x28a2a7
cmpl $0x1, %eax
je 0x28a281
cmpl $0x2, %eax
jne 0x28a2b8
movq 0x18(%r14), %rdx
leaq 0xb0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
jmp 0x28a292
movq 0x18(%r14), %rdx
leaq 0x68(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
vmovsd 0x1c9d9e(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x8b497
jmp 0x28a2b8
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x8b41f
leaq 0x68(%rsp), %r15
movq %r13, 0x78(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x28a2ee
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x40(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x28a2ea
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x28a2c7
leaq 0xb8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x120(%rsp), %rdi
leaq 0x158(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x284c76
vmovsd 0x40(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x68(%rsp), %rbx
xorl %r15d, %r15d
vmovsd %xmm0, 0xf8(%rsp)
fldl 0xf8(%rsp)
fldt 0x4c(%rsp)
cmpq 0xb0(%r12), %r15
je 0x28a449
movq 0x18(%r14), %rcx
fstpt 0x20(%rsp)
leaq 0x120(%rsp), %rdi
leaq 0x158(%rsp), %rsi
movq %rbx, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x40(%rsp)
fstpt (%rsp)
callq 0x284cb8
movl %eax, %r13d
testl %eax, %eax
je 0x28a4f0
cmpl %ebp, %r13d
jge 0x28a3c0
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0x28a9a2
movl %r13d, %ebp
cmpq 0x88(%rsp), %r15
jle 0x28a412
movl %r13d, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x1d0(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xd4(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xe0(%rsp)
fmulp %st, %st(1)
fldt 0x40(%rsp)
faddp %st, %st(1)
jmp 0x28a416
fldt 0x40(%rsp)
fldt 0xec(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x28a449
fstp %st(0)
movq %r14, %rdi
fstpt 0x40(%rsp)
callq 0x28a9da
fldt 0x40(%rsp)
fldt 0x4c(%rsp)
testb %al, %al
jne 0x28a449
incq %r15
jmp 0x28a35a
fstp %st(0)
fstp %st(0)
movq 0x58(%rsp), %rax
movl $0x5, 0xa0(%rax)
fldz
fldz
fstp %st(1)
fstp %st(0)
cmpl $0x0, 0x50(%r14)
jne 0x28a477
movq 0x58(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x28a4a8
movq 0x58(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x90(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x120(%rsp), %rdi
callq 0x393ac
leaq 0x158(%rsp), %rdi
callq 0x28518c
leaq 0xc8(%rsp), %rdi
callq 0x8affa
leaq 0x70(%rsp), %rdi
callq 0x357fe
movq 0x58(%rsp), %rax
addq $0x1d8, %rsp # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
leaq 0x68(%rsp), %rbx
movq %rbx, %rsi
callq 0x8b74a
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x28a958
movl $0x0, 0x64(%rsp)
leaq 0x158(%rsp), %r15
leaq 0x68(%rsp), %rbp
xorl %ebx, %ebx
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x28a460
movq 0x18(%r14), %rcx
fldt 0x114(%rsp)
fld %st(1)
fstpt 0x40(%rsp)
fmulp %st, %st(1)
fldt 0x108(%rsp)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x120(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x284ee8
testl %eax, %eax
jne 0x28a5c0
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x8b74a
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x28a958
movq %r14, %rdi
callq 0x28a9da
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
testb %al, %al
jne 0x28a460
movl %ebx, 0x88(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x28a706
movq 0x18(%r14), %rcx
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x120(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x40(%rsp)
fstpt (%rsp)
callq 0x284cb8
testl %eax, %eax
je 0x28a6b9
vcvtsi2sd %r13d, %xmm2, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x28a687
movl %eax, 0xa0(%rsp)
fildl 0xa0(%rsp)
movl 0x1d0(%rsp), %eax
movl %eax, 0xa4(%rsp)
fidivl 0xa4(%rsp)
fldt 0xd4(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xe0(%rsp)
fmulp %st, %st(1)
fldt 0x40(%rsp)
faddp %st, %st(1)
jmp 0x28a68b
fldt 0x40(%rsp)
fldt 0xec(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x28a6f6
movq %r14, %rdi
fstpt 0x40(%rsp)
callq 0x28a9da
testb %al, %al
jne 0x28a6fe
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
incl %ebx
jmp 0x28a5e4
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x8b74a
movl 0xc0(%r12), %eax
imull 0x64(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x28a958
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
jmp 0x28a706
fldt 0x4c(%rsp)
fxch %st(1)
jmp 0x28a706
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
movl 0x88(%rsp), %ebx
decl 0x64(%rsp)
incl %ebx
jmp 0x28a538
jmp 0x28a74e
jmp 0x28a727
fstp %st(1)
fstp %st(0)
jmp 0x28a74e
movq %rax, %rbx
jmp 0x28a75e
movq %rax, %rbx
jmp 0x28a76b
movq %rax, %rbx
jmp 0x28a778
movq %rax, %rbx
jmp 0x28a782
jmp 0x28a74e
jmp 0x28a74e
jmp 0x28a74e
leaq 0xb8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x28a751
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x393ac
leaq 0x158(%rsp), %rdi
callq 0x28518c
leaq 0xc8(%rsp), %rdi
callq 0x8affa
leaq 0x70(%rsp), %rdi
callq 0x357fe
movq 0x58(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long) | inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
} | vucomisd 0x30(%rdi), %xmm0
jbe 0x28a7dc
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x28a856
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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::pnm_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1cf241(%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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long) | inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
} | vucomisd 0x30(%rdi), %xmm0
jbe 0x28a8be
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x28a938
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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::file_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1cf15f(%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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::store_if_better(baryonyx::bit_array const&, double, long) | inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
} | vucomisd 0x30(%rdi), %xmm0
jbe 0x28a9a0
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x28aa1a
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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1cf07d(%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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
optimize_problem(const context& ctx, const problem& pb)
{
result r;
if (ctx.start)
ctx.start(ctx.parameters);
auto constraints{ make_merged_constraints(ctx, pb) };
if (constraints.empty() || pb.vars.values.empty()) {
r.status = result_status::success;
r.solutions.resize(1);
r.solutions.back().value = pb.objective.value;
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
return r;
}
random_engine rng(init_random_generator_seed(ctx));
auto variables = length(pb.vars.values);
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
const auto thread = get_thread_number(ctx);
std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors;
std::vector<std::thread> pool(thread);
best_solution_recorder<Cost, Float, Mode> best_recorder(
rng,
thread,
cost,
cost_constant,
variables,
constraints,
ctx.parameters.init_population_size);
auto seeds = generate_seed(rng, thread);
std::atomic_bool stop_task;
stop_task.store(false);
for (unsigned i = 0u; i != thread; ++i)
functors.emplace_back(ctx, i, seeds[i]);
for (unsigned i = 0u; i != thread; ++i)
pool[i] = std::thread(std::ref(functors[i]),
std::ref(stop_task),
std::ref(best_recorder),
std::cref(constraints),
variables,
std::cref(cost),
cost_constant);
const auto start = std::chrono::steady_clock::now();
auto end = start;
do {
std::this_thread::sleep_for(std::chrono::seconds{ 1L });
if (ctx.update) {
auto call_number = 0L;
for (auto i = 0u; i != thread; ++i)
call_number += functors[i].m_call_number;
int constraints_remaining;
long int loop;
double value;
double duration;
best_recorder.get_best(
constraints_remaining, value, duration, loop);
ctx.update(
constraints_remaining, value, loop, duration, call_number);
}
end = std::chrono::steady_clock::now();
} while (!is_time_limit(ctx.parameters.time_limit, start, end));
stop_task.store(true);
for (auto& t : pool)
t.join();
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
r.variables = variables;
r.constraints = length(constraints);
const auto& first = best_recorder.get_best(0);
if (!first.is_solution())
r.status = result_status::time_limit_reached;
else
r.status = result_status::success;
r.duration = first.duration;
r.loop = first.loop;
r.remaining_constraints = first.remaining_constraints;
switch (ctx.parameters.storage) {
case solver_parameters::storage_type::one: {
r.solutions.resize(1);
convert(first, r.solutions[0], variables);
} break;
case solver_parameters::storage_type::bound: {
r.solutions.resize(2);
convert(first, r.solutions[0], variables);
convert(best_recorder.get_worst(), r.solutions[1], variables);
} break;
case solver_parameters::storage_type::five: {
r.solutions.resize(5);
for (int i = 0; i != 5; ++i)
convert(best_recorder.get_best(i), r.solutions[i], variables);
} break;
}
best_recorder.show_population(ctx);
if (ctx.finish)
ctx.finish(r);
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp # imm = 0x198
vxorpd %xmm0, %xmm0, %xmm0
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
cmpq $0x0, 0x128(%rsi)
je 0x28aa9f
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 0x28abfe
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x28abfe
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0xb8(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x9650c
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x70(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x60(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xe0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0xc0(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0x96720
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x60(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x88(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0x28ac59
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x28bd3c
movl 0x8(%rsp), %eax
incl %eax
jmp 0x28abd5
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 0x28aff4
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 0x28ad1d
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 0x28bd88
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 0x28ac79
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 0x28adb2
movq 0x60(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x28ad73
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x28ad5d
leaq 0xe0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x9f4ce
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x20(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movl 0x18(%rsp), %esi
movq %r12, %rdi
movq %r14, %rcx
callq 0x35736
callq 0xb5a0
vmovsd (%r13), %xmm0
subq %rbx, %rax
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm0, %xmm1
vcvtsi2sd %rax, %xmm2, %xmm1
vdivsd 0x1cecab(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x28ad38
vucomisd %xmm0, %xmm1
jbe 0x28ad38
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xa0(%rsp), %rbx
movq 0xa8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x28ae13
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x28ae00
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 0x28af6e
cmpl $0x1, %eax
je 0x28af36
cmpl $0x2, %eax
jne 0x28af8d
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x28af8d
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 0x28aefc
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x35781
leaq 0xe0(%rsp), %rdi
callq 0x9f54c
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x28af81
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x35781
leaq 0xd8(%rsp), %rdi
movq %r13, %rsi
callq 0x96884
cmpq $0x0, 0x168(%r13)
je 0x28afb9
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x96898
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x2915f4
leaq 0xb8(%rsp), %rdi
callq 0x968b6
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x198, %rsp # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x28b055
movq %rax, %rbx
jmp 0x28b062
movq %rax, %rbx
jmp 0x28b06f
jmp 0x28b039
jmp 0x28b02a
jmp 0x28b048
jmp 0x28b048
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x28b090
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x28b086
jmp 0x28b048
jmp 0x28b048
jmp 0x28b048
jmp 0x28b048
jmp 0x28b048
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x96898
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x2915f4
leaq 0xb8(%rsp), %rdi
callq 0x968b6
leaq 0x48(%rsp), %rdi
callq 0x35858
movq 0x10(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
baryonyx::result baryonyx::itm::solve_problem<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
solve_problem(const context& ctx, const problem& pb)
{
if (ctx.start)
ctx.start(ctx.parameters);
result ret;
auto variables = length(pb.vars.values);
auto constraints{ make_merged_constraints(ctx, pb) };
if (!constraints.empty() && !pb.vars.values.empty()) {
random_engine rng(init_random_generator_seed(ctx));
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
switch (ctx.parameters.observer) {
case solver_parameters::observer_type::pnm: {
using obs = pnm_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
case solver_parameters::observer_type::file: {
using obs = file_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
default: {
using obs = none_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
break;
}
}
} else {
ret.status = result_status::success;
ret.solutions.resize(1);
ret.solutions.back().value = pb.objective.value;
}
ret.strings = pb.strings;
ret.variable_name = std::move(pb.vars.names);
ret.affected_vars = std::move(pb.affected_vars);
ret.variables = variables;
ret.constraints = length(constraints);
if (ctx.finish)
ctx.finish(ret);
return ret;
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x140, %rsp # imm = 0x140
cmpq $0x0, 0x128(%rsi)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
je 0x28b0d4
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 0x28b1fd
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0x28b1fd
movq %r14, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
leaq 0x10(%r15), %rsi
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, (%rsp)
leaq 0x20(%rsp), %rdi
movl %r12d, %edx
callq 0x9650c
vmovsd 0x40(%r15), %xmm0
movl 0xe4(%r14), %eax
vxorps %xmm1, %xmm1, %xmm1
leaq 0x40(%rsp), %rsi
cmpl $0x1, %eax
je 0x28b224
cmpl $0x2, %eax
jne 0x28b273
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 0x291d64
jmp 0x28b2c0
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 0x28b2ef
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 0x29161c
jmp 0x28b2c0
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 0x2924ac
leaq 0x98(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x41d9e
movq %r13, %rdi
callq 0xea60
leaq 0x68(%rsp), %rdi
callq 0x357fe
leaq 0x20(%rsp), %rdi
callq 0x968b6
leaq 0x90(%r15), %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31d28
leaq 0x50(%rbx), %rdi
movq %r13, %rsi
callq 0x352ec
addq $0xc0, %r15
leaq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x352c2
movq 0x10(%rsp), %rax
movl %r12d, 0x90(%rbx)
subq 0x8(%rsp), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
movl %eax, 0x94(%rbx)
cmpq $0x0, 0x168(%r14)
je 0x28b35b
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 0x28b37d
jmp 0x28b37d
leaq 0x68(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x20(%rsp), %rdi
callq 0x968b6
jmp 0x28b3a0
jmp 0x28b39d
movq %rax, %r14
jmp 0x28b3aa
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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
optimize_problem(const context& ctx, const problem& pb)
{
result r;
if (ctx.start)
ctx.start(ctx.parameters);
auto constraints{ make_merged_constraints(ctx, pb) };
if (constraints.empty() || pb.vars.values.empty()) {
r.status = result_status::success;
r.solutions.resize(1);
r.solutions.back().value = pb.objective.value;
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
return r;
}
random_engine rng(init_random_generator_seed(ctx));
auto variables = length(pb.vars.values);
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
const auto thread = get_thread_number(ctx);
std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors;
std::vector<std::thread> pool(thread);
best_solution_recorder<Cost, Float, Mode> best_recorder(
rng,
thread,
cost,
cost_constant,
variables,
constraints,
ctx.parameters.init_population_size);
auto seeds = generate_seed(rng, thread);
std::atomic_bool stop_task;
stop_task.store(false);
for (unsigned i = 0u; i != thread; ++i)
functors.emplace_back(ctx, i, seeds[i]);
for (unsigned i = 0u; i != thread; ++i)
pool[i] = std::thread(std::ref(functors[i]),
std::ref(stop_task),
std::ref(best_recorder),
std::cref(constraints),
variables,
std::cref(cost),
cost_constant);
const auto start = std::chrono::steady_clock::now();
auto end = start;
do {
std::this_thread::sleep_for(std::chrono::seconds{ 1L });
if (ctx.update) {
auto call_number = 0L;
for (auto i = 0u; i != thread; ++i)
call_number += functors[i].m_call_number;
int constraints_remaining;
long int loop;
double value;
double duration;
best_recorder.get_best(
constraints_remaining, value, duration, loop);
ctx.update(
constraints_remaining, value, loop, duration, call_number);
}
end = std::chrono::steady_clock::now();
} while (!is_time_limit(ctx.parameters.time_limit, start, end));
stop_task.store(true);
for (auto& t : pool)
t.join();
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
r.variables = variables;
r.constraints = length(constraints);
const auto& first = best_recorder.get_best(0);
if (!first.is_solution())
r.status = result_status::time_limit_reached;
else
r.status = result_status::success;
r.duration = first.duration;
r.loop = first.loop;
r.remaining_constraints = first.remaining_constraints;
switch (ctx.parameters.storage) {
case solver_parameters::storage_type::one: {
r.solutions.resize(1);
convert(first, r.solutions[0], variables);
} break;
case solver_parameters::storage_type::bound: {
r.solutions.resize(2);
convert(first, r.solutions[0], variables);
convert(best_recorder.get_worst(), r.solutions[1], variables);
} break;
case solver_parameters::storage_type::five: {
r.solutions.resize(5);
for (int i = 0; i != 5; ++i)
convert(best_recorder.get_best(i), r.solutions[i], variables);
} break;
}
best_recorder.show_population(ctx);
if (ctx.finish)
ctx.finish(r);
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp # imm = 0x198
vxorpd %xmm0, %xmm0, %xmm0
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
cmpq $0x0, 0x128(%rsi)
je 0x28b420
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 0x28b57f
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x28b57f
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0xb8(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x9650c
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x70(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x60(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xe0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0xc0(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0x96720
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x60(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x88(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0x28b5da
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x292e20
movl 0x8(%rsp), %eax
incl %eax
jmp 0x28b556
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 0x28b975
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 0x28b69e
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 0x292e6c
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 0x28b5fa
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 0x28b733
movq 0x60(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x28b6f4
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x28b6de
leaq 0xe0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x9f4ce
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x20(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movl 0x18(%rsp), %esi
movq %r12, %rdi
movq %r14, %rcx
callq 0x35736
callq 0xb5a0
vmovsd (%r13), %xmm0
subq %rbx, %rax
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm0, %xmm1
vcvtsi2sd %rax, %xmm2, %xmm1
vdivsd 0x1ce32a(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x28b6b9
vucomisd %xmm0, %xmm1
jbe 0x28b6b9
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xa0(%rsp), %rbx
movq 0xa8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x28b794
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x28b781
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 0x28b8ef
cmpl $0x1, %eax
je 0x28b8b7
cmpl $0x2, %eax
jne 0x28b90e
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x28b90e
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 0x28b87d
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x35781
leaq 0xe0(%rsp), %rdi
callq 0x9f54c
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x28b902
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x35781
leaq 0xd8(%rsp), %rdi
movq %r13, %rsi
callq 0x96884
cmpq $0x0, 0x168(%r13)
je 0x28b93a
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x96898
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x297f8e
leaq 0xb8(%rsp), %rdi
callq 0x968b6
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x198, %rsp # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x28b9d6
movq %rax, %rbx
jmp 0x28b9e3
movq %rax, %rbx
jmp 0x28b9f0
jmp 0x28b9ba
jmp 0x28b9ab
jmp 0x28b9c9
jmp 0x28b9c9
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x28ba11
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x28ba07
jmp 0x28b9c9
jmp 0x28b9c9
jmp 0x28b9c9
jmp 0x28b9c9
jmp 0x28b9c9
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x96898
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x297f8e
leaq 0xb8(%rsp), %rdi
callq 0x968b6
leaq 0x48(%rsp), %rdi
callq 0x35858
movq 0x10(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
baryonyx::result baryonyx::itm::solve_problem<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
solve_problem(const context& ctx, const problem& pb)
{
if (ctx.start)
ctx.start(ctx.parameters);
result ret;
auto variables = length(pb.vars.values);
auto constraints{ make_merged_constraints(ctx, pb) };
if (!constraints.empty() && !pb.vars.values.empty()) {
random_engine rng(init_random_generator_seed(ctx));
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
switch (ctx.parameters.observer) {
case solver_parameters::observer_type::pnm: {
using obs = pnm_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
case solver_parameters::observer_type::file: {
using obs = file_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
default: {
using obs = none_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
break;
}
}
} else {
ret.status = result_status::success;
ret.solutions.resize(1);
ret.solutions.back().value = pb.objective.value;
}
ret.strings = pb.strings;
ret.variable_name = std::move(pb.vars.names);
ret.affected_vars = std::move(pb.affected_vars);
ret.variables = variables;
ret.constraints = length(constraints);
if (ctx.finish)
ctx.finish(ret);
return ret;
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x140, %rsp # imm = 0x140
cmpq $0x0, 0x128(%rsi)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
je 0x28ba55
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 0x28bb7e
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0x28bb7e
movq %r14, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
leaq 0x10(%r15), %rsi
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, (%rsp)
leaq 0x20(%rsp), %rdi
movl %r12d, %edx
callq 0x9650c
vmovsd 0x40(%r15), %xmm0
movl 0xe4(%r14), %eax
vxorps %xmm1, %xmm1, %xmm1
leaq 0x40(%rsp), %rsi
cmpl $0x1, %eax
je 0x28bba5
cmpl $0x2, %eax
jne 0x28bbf4
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 0x2986fe
jmp 0x28bc41
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 0x28bc70
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 0x297fb6
jmp 0x28bc41
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 0x298e46
leaq 0x98(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x41d9e
movq %r13, %rdi
callq 0xea60
leaq 0x68(%rsp), %rdi
callq 0x357fe
leaq 0x20(%rsp), %rdi
callq 0x968b6
leaq 0x90(%r15), %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31d28
leaq 0x50(%rbx), %rdi
movq %r13, %rsi
callq 0x352ec
addq $0xc0, %r15
leaq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x352c2
movq 0x10(%rsp), %rax
movl %r12d, 0x90(%rbx)
subq 0x8(%rsp), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
movl %eax, 0x94(%rbx)
cmpq $0x0, 0x168(%r14)
je 0x28bcdc
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 0x28bcfe
jmp 0x28bcfe
leaq 0x68(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x20(%rsp), %rdi
callq 0x968b6
jmp 0x28bd21
jmp 0x28bd1e
movq %rax, %r14
jmp 0x28bd2b
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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<long double>, long double, baryonyx::itm::maximize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<long double> const&, double) | void operator()(const std::atomic_bool& stop_task,
best_solution_recorder<Cost, Float, Mode>& best_recorder,
const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
bit_array x(variables);
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_local_ctx.rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const auto w_limit = static_cast<long int>(p.w);
Solver slv(m_local_ctx.rng,
length(constraints),
variables,
norm_costs,
constraints);
compute_order compute(p.order, variables);
bool is_a_solution = false;
while (!stop_task.load()) {
++m_call_number;
const auto kappa_start = static_cast<Float>(best_recorder.reinit(
m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x));
auto kappa = kappa_start;
compute.init(slv, x);
auto best_remaining = INT_MAX;
is_a_solution = false;
for (long int i = 0; !stop_task.load() && i != p.limit; ++i) {
auto remaining =
compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
i);
best_remaining = 0;
is_a_solution = true;
break;
} else {
best_remaining = std::min(remaining, best_remaining);
}
if (i > w_limit)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
if (best_remaining > 0) {
best_recorder.try_advance(
m_local_ctx, x, best_remaining, p.limit);
continue;
}
for (int push = 0; !stop_task.load() && push < p.pushes_limit;
++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_local_ctx.rng,
pushing_k_factor,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
is_a_solution = true;
}
kappa = kappa_start;
for (int iter = 0;
!stop_task.load() && iter < p.pushing_iteration_limit;
++iter) {
remaining = compute.run(
slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
is_a_solution = true;
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
}
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp # imm = 0x1F8
movq %rdi, %rbp
leaq 0x60(%rsp), %rdi
movq %rsi, %r15
movl %r8d, %esi
vmovsd %xmm0, 0x90(%rsp)
movq %r9, %r12
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x70(%rsp)
callq 0x368ae
movq (%rbp), %r13
movq %rbp, 0xb8(%rsp)
addq $0x8, %rbp
leaq 0x120(%rsp), %rdi
movq %r13, %rsi
movq %r12, 0x88(%rsp)
movq %r12, %rdx
movq %rbp, %rcx
movl %ebx, %r8d
callq 0x98bf0
fldl 0x20(%r13)
fstpt 0xd8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r13)
fstpt 0xe4(%rsp)
fldl 0x30(%r13)
fstpt 0xcc(%rsp)
fldl 0x8(%r13)
vmovsd 0x10(%r13), %xmm0
fld %st(0)
fstpt 0x4c(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x28c21d
movq 0xb8(%rsp), %rax
movq (%rax), %rdi
leaq 0x120(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x98cca
fstpt 0x9c(%rsp)
jmp 0x28c236
fstp %st(0)
vmovsd %xmm0, 0x100(%rsp)
fldl 0x100(%rsp)
fstpt 0x9c(%rsp)
fldl 0x38(%r13)
fstpt 0x114(%rsp)
fldl 0x40(%r13)
fstpt 0x108(%rsp)
vcvttsd2si 0xa0(%r13), %rax
movq %rax, 0xf0(%rsp)
movq 0x8(%r14), %rax
subq (%r14), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x178(%rsp), %rdi
leaq 0x120(%rsp), %r8
movq %rbp, %rsi
movl %eax, %edx
movl %ebx, %ecx
movq %r14, %r9
callq 0x28c702
movl 0xcc(%r13), %esi
leaq 0x140(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq $0x0, 0x58(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x28c66a
movq 0xb8(%rsp), %rax
incq 0xb0(%rax)
vmovsd 0x18(%r13), %xmm0
vmovsd 0x28(%r13), %xmm1
movzbl 0x58(%rsp), %edx
movq 0x70(%rsp), %rdi
leaq 0x60(%rsp), %rbx
movq %rbp, %rsi
movq %rbx, %rcx
andl $0x1, %edx
callq 0x98f66
vmovsd %xmm0, 0xf8(%rsp)
fldl 0xf8(%rsp)
fstpt 0xc0(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x178(%rsp), %rsi
movq %rbx, %rdx
callq 0x28c8ca
fldt 0xc0(%rsp)
fldt 0x4c(%rsp)
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movb (%r15), %al
testb $0x1, %al
jne 0x28c3ff
cmpq 0xb0(%r13), %r14
je 0x28c3ff
fstpt 0x20(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x178(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %rbp, %rcx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x7c(%rsp)
fstpt (%rsp)
callq 0x28c90c
testl %eax, %eax
je 0x28c419
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0xf0(%rsp), %r14
jle 0x28c3de
movl %eax, 0xb0(%rsp)
fildl 0xb0(%rsp)
movl 0x1f0(%rsp), %eax
movl %eax, 0xb4(%rsp)
fidivl 0xb4(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x7c(%rsp)
faddp %st, %st(1)
fldt 0x4c(%rsp)
jmp 0x28c3e8
fldt 0x4c(%rsp)
fldt 0x7c(%rsp)
fxch %st(1)
fldt 0xe4(%rsp)
fxch %st(2)
fucomi %st(2), %st
fstp %st(2)
ja 0x28c3ff
incq %r14
jmp 0x28c32f
fstp %st(1)
testl %ebx, %ebx
jg 0x28c648
movq $0x0, 0x58(%rsp)
leaq 0x60(%rsp), %rbx
jmp 0x28c455
vmovsd 0x90(%rsp), %xmm0
movq 0x88(%rsp), %rdi
leaq 0x60(%rsp), %rbx
movq %rbx, %rsi
callq 0x9706e
movq 0x70(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x992d8
movb $0x1, %al
movq %rax, 0x58(%rsp)
fldt 0x4c(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x78(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x28c641
cmpl 0xbc(%r13), %r14d
jge 0x28c641
fldt 0x108(%rsp)
fstpt 0x30(%rsp)
fstpt 0x20(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x178(%rsp), %rsi
movq %rbx, %rdx
movq %rbp, %rcx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fldt 0x114(%rsp)
fstpt (%rsp)
callq 0x28cb3c
testl %eax, %eax
jne 0x28c4fb
vmovsd 0x90(%rsp), %xmm0
movq 0x88(%rsp), %rdi
movq %rbx, %rsi
callq 0x9706e
movl 0xc0(%r13), %eax
movq 0x70(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
imull %r14d, %eax
notl %eax
movslq %eax, %rcx
callq 0x992d8
movb $0x1, %al
movq %rax, 0x58(%rsp)
pushq $0x1
popq %rax
fldt 0xc0(%rsp)
fldt 0x4c(%rsp)
movl %eax, %ebx
movb (%r15), %al
testb $0x1, %al
jne 0x28c5df
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0x28c5df
fstpt 0x20(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x178(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %rbp, %rcx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x7c(%rsp)
fstpt (%rsp)
callq 0x28c90c
testl %eax, %eax
je 0x28c5e8
vcvtsi2sd %r12d, %xmm2, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0x28c5bf
movl %eax, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x1f0(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x7c(%rsp)
faddp %st, %st(1)
fldt 0x4c(%rsp)
jmp 0x28c5c9
fldt 0x4c(%rsp)
fldt 0x7c(%rsp)
fxch %st(1)
fldt 0xe4(%rsp)
fxch %st(2)
fucomi %st(2), %st
fstp %st(2)
ja 0x28c5df
incl %ebx
jmp 0x28c50b
fstp %st(1)
leaq 0x60(%rsp), %rbx
jmp 0x28c635
vmovsd 0x90(%rsp), %xmm0
movq 0x88(%rsp), %rdi
leaq 0x60(%rsp), %r12
movq %r12, %rsi
callq 0x9706e
movl 0xc0(%r13), %eax
movq 0x70(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
imull 0x78(%rsp), %eax
subl %ebx, %eax
movq %r12, %rbx
movslq %eax, %rcx
callq 0x992d8
movb $0x1, %al
movq %rax, 0x58(%rsp)
fldt 0x4c(%rsp)
decl 0x78(%rsp)
incl %r14d
jmp 0x28c460
fstp %st(0)
jmp 0x28c2aa
fstp %st(0)
movq 0xb0(%r13), %r8
movq 0x70(%rsp), %rdi
leaq 0x60(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0x99360
jmp 0x28c2a1
leaq 0x140(%rsp), %rdi
callq 0x393ac
leaq 0x178(%rsp), %rdi
callq 0x28cde0
leaq 0x120(%rsp), %rdi
callq 0x968b6
leaq 0x68(%rsp), %rdi
callq 0x357fe
addq $0x1f8, %rsp # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x28c6b4
movq %rax, %rbx
jmp 0x28c6d6
movq %rax, %rbx
jmp 0x28c6e3
movq %rax, %rbx
jmp 0x28c6f0
jmp 0x28c6c6
jmp 0x28c6c6
jmp 0x28c6c6
jmp 0x28c6c6
leaq 0x140(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0x178(%rsp), %rdi
callq 0x28cde0
leaq 0x120(%rsp), %rdi
callq 0x968b6
leaq 0x68(%rsp), %rdi
callq 0x357fe
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, baryonyx::bit_array, long double>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double, long double) | int push_and_run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
bool pi_changed = 0;
int remaining = 0;
if (use_cycle)
order = next_state(order);
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.push_and_compute_update_row(x,
R.crbegin(),
R.crend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
}
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
fldt 0xd0(%rsp)
fldt 0xc0(%rsp)
fldt 0xb0(%rsp)
fldt 0xa0(%rsp)
movl 0x30(%rdi), %eax
cmpb $0x1, 0x34(%rdi)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
jne 0x28cb87
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 0x28cc9e
leaq 0x1d42b3(%rip), %rdx # 0x460e4c
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x78(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
fxch %st(3)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x28f894
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x28cfd1
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %r15, %rdx
fstpt 0x40(%rsp)
callq 0x290b4f
jmp 0x28cd2b
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x290279
jmp 0x28cc52
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x2906e4
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x28fd8e
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x28d6be
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fxch %st(3)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
jmp 0x28cd4e
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %rcx, %rdx
fstpt 0x40(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x28fb18
jmp 0x28cd5c
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %r15, %rdx
fstpt 0x40(%rsp)
callq 0x2910a3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x290004
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x28cfd1
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %rcx, %rdx
fstpt 0x40(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x28fb18
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x28d99e
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true> const, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long 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 0x28cf10
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 0x28cfb1
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 0x28cf6d
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0x28cf54
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rcx
movl (%rcx,%rbp,8), %eax
subl %ebx, %eax
jle 0x28cf8b
shlq $0x20, %rax
orq %rbp, %rax
movq %rax, 0x8(%rsp)
jmp 0x28cf9d
subl 0x4(%rcx,%rbp,8), %ebx
jle 0x28cfac
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0x28cf32
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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long 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 0x28cfef
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x78(%r15), %esi
je 0x28d022
movq %r15, %rdi
movq %r14, %rdx
callq 0x28d039
testb %al, %al
jne 0x28d01a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0x28cff6
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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long 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 0x28d086
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %r15d
addq $0x8, %r13
jmp 0x28d06c
movq 0x60(%rbx), %rcx
movslq %ebp, %rax
cmpl %r15d, (%rcx,%rax,8)
jle 0x28d097
xorl %eax, %eax
jmp 0x28d09f
cmpl 0x4(%rcx,%rax,8), %r15d
setle %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long 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>>>>, 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0xa8, %rsp
movq %rcx, 0x60(%rsp)
movq %rdx, %rbx
leaq 0x1cf276(%rip), %rdx # 0x45c344
movq %rsi, %r14
movq %rdi, %r12
fldt 0x100(%rsp)
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fstpt 0x90(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
pushq $0x14
popq %rsi
leaq 0x90(%rsp), %rcx
leaq 0x80(%rsp), %r8
leaq 0x70(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
movq %rbx, 0x58(%rsp)
xorl %edx, %edx
movq %rax, 0x48(%rsp)
movq (%rbx), %rax
pushq $0x16
popq %r13
leaq 0x1d6607(%rip), %rbp # 0x46373e
pushq $0x8
popq %rbx
movq %r14, 0x50(%rsp)
movq 0x60(%rsp), %rcx
cmpq (%rcx), %rax
je 0x28d2b2
movq %rdx, 0x68(%rsp)
movl -0x4(%rax), %edx
movq 0x48(%rsp), %rsi
leaq 0x38(%rsp), %rdi
movl %edx, 0x2c(%rsp)
callq 0x3de66
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
fldt 0x70(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x28d9de
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x28da04
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r14
movl %eax, 0x34(%rsp)
movq %r14, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x28dada
movslq 0x2c(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r14d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x28db0e
movslq 0x2c(%rsp), %r8
movl %eax, 0x30(%rsp)
leaq 0x1d3e63(%rip), %rdx # 0x461045
leaq 0x2c(%rsp), %rcx
movq %r12, %rdi
movq %r13, %r15
movq %r13, %rsi
shlq $0x3, %r8
addq 0x60(%r12), %r8
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
xorl %r13d, %r13d
andnl %r14d, %eax, %r14d
shlq $0x5, %r14
cmpq %r13, %r14
je 0x28d236
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r13), %r8
addq %r13, %rcx
callq 0x126d84
addq $0x20, %r13
jmp 0x28d210
movslq 0x2c(%rsp), %rax
movq 0x60(%r12), %rcx
leaq 0x1d3e15(%rip), %rdx # 0x46105c
leaq 0x30(%rsp), %r8
movq %r12, %rdi
movq %r15, %r13
movq %r15, %rsi
leaq 0x4(%rcx,%rax,8), %rcx
callq 0xb91c2
movq 0x40(%rsp), %rdx
movl 0x2c(%rsp), %ecx
movl 0x30(%rsp), %r8d
fldt 0x90(%rsp)
fldt 0x80(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq 0x50(%rsp), %r14
movl 0x34(%rsp), %r9d
movq %r14, %rsi
callq 0x28db7f
movq 0x68(%rsp), %rdx
movq 0x58(%rsp), %rcx
orb %al, %dl
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x28d13f
andb $0x1, %dl
movl %edx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long 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>>>, 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0x98, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1cf054(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1d6404(%rip), %rbp # 0x46373e
movq %rax, 0x38(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x40(%rsp)
cmpq 0x48(%rsp), %r14
je 0x28d4af
movl (%r14), %edx
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq %r14, 0x58(%rsp)
movl %edx, 0x20(%rsp)
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x28d9de
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x28da04
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movl %eax, %r15d
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x28dada
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x28db0e
movslq 0x20(%rsp), %r8
movl %eax, 0x24(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1d3c49(%rip), %rdx # 0x461045
leaq 0x20(%rsp), %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %r13d
shlq $0x5, %r13
cmpq %r14, %r13
je 0x28d43e
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r14), %r8
addq %r14, %rcx
callq 0x126d84
addq $0x20, %r14
jmp 0x28d418
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1d3c02(%rip), %rdx # 0x46105c
leaq 0x24(%rsp), %r8
callq 0xb91c2
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %r8d
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movl %r15d, %r9d
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x28db7f
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x28d349
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, 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>>>>, 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0x98, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1cee5a(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1d620a(%rip), %rbp # 0x46373e
movq %rax, 0x38(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x40(%rsp)
cmpq 0x48(%rsp), %r14
je 0x28d6a9
movl (%r14), %edx
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq %r14, 0x58(%rsp)
movl %edx, 0x20(%rsp)
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x28d9de
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x28da04
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movl %eax, %r15d
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x28dada
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x28db0e
movslq 0x20(%rsp), %r8
movl %eax, 0x24(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1d3a4f(%rip), %rdx # 0x461045
leaq 0x20(%rsp), %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %r13d
shlq $0x5, %r13
cmpq %r14, %r13
je 0x28d638
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r14), %r8
addq %r14, %rcx
callq 0x126d84
addq $0x20, %r14
jmp 0x28d612
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1d3a08(%rip), %rdx # 0x46105c
leaq 0x24(%rsp), %r8
callq 0xb91c2
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %r8d
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movl %r15d, %r9d
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x28db7f
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x8, %r14
movq %rcx, %rax
jmp 0x28d543
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>&, baryonyx::bit_array const&) | int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x28d6e2
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 0x28d783
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 0x28d73f
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0x28d726
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rcx
movl (%rcx,%rbp,8), %eax
subl %ebx, %eax
jle 0x28d75d
shlq $0x20, %rax
orq %rbp, %rax
movq %rax, 0x8(%rsp)
jmp 0x28d76f
subl 0x4(%rcx,%rbp,8), %ebx
jle 0x28d77e
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0x28d704
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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long 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>>>, 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0x98, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1ceb7a(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1d5f2a(%rip), %rbp # 0x46373e
movq %rax, 0x38(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x40(%rsp)
cmpq 0x48(%rsp), %r14
je 0x28d989
movl (%r14), %edx
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq %r14, 0x58(%rsp)
movl %edx, 0x20(%rsp)
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x28d9de
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x28da04
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movl %eax, %r15d
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x28dada
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x28db0e
movslq 0x20(%rsp), %r8
movl %eax, 0x24(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1d376f(%rip), %rdx # 0x461045
leaq 0x20(%rsp), %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %r13d
shlq $0x5, %r13
cmpq %r14, %r13
je 0x28d918
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r14), %r8
addq %r14, %rcx
callq 0x126d84
addq $0x20, %r14
jmp 0x28d8f2
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1d3728(%rip), %rdx # 0x46105c
leaq 0x24(%rsp), %r8
callq 0xb91c2
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %r8d
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movl %r15d, %r9d
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x28db7f
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x28d823
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::file_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1c6d79(%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_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::solver_inequalities_01coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::quadratic_cost_type<long double> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&) | solver_inequalities_01coeff(random_engine& rng_,
int m_,
int n_,
const cost_type& c_,
const std::vector<merged_constraint>& csts)
: logger("solver_inequalities_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
if (csts[i].min == csts[i].max) {
b[i].min = csts[i].min;
b[i].max = csts[i].max;
} else {
b[i].min = std::max(0, csts[i].min);
b[i].max = std::min(length(csts[i].elements), csts[i].max);
}
bx_ensures(b[i].min <= b[i].max);
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
andq $0x0, (%rdi)
leaq 0x10(%rdi), %rbx
movq %rsi, 0x8(%rdi)
movq %rdi, %r13
movq %r9, %r15
movq %r8, 0x20(%rsp)
movl %ecx, %r12d
movl %edx, %ebp
movq %r9, %rsi
movq %rbx, %rdi
callq 0x3a4ca
movl 0x38(%r13), %esi
leaq 0x50(%r13), %r14
movq %r14, %rdi
movq %rbx, 0x18(%rsp)
callq 0x8afb9
movq %r15, %rdi
movq %r14, 0x10(%rsp)
leaq 0x58(%r13), %rbx
callq 0x3a89d
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x293edb
leaq 0x60(%r13), %rbx
movslq %ebp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x293f1b
leaq 0x68(%r13), %rdi
movq %r14, %rsi
callq 0x8afb9
movq 0x20(%rsp), %rax
movl %ebp, %edx
xorl %esi, %esi
movq %rax, 0x70(%r13)
movl %ebp, 0x78(%r13)
movl %r12d, 0x7c(%r13)
movq (%r15), %rax
movq 0x60(%r13), %rcx
cmpq %rdx, %rsi
je 0x29391f
imulq $0x28, %rsi, %rdi
movq (%rax,%rdi), %r9
leaq (%rax,%rdi), %r8
movq 0x8(%rax,%rdi), %rdi
movq %r9, %r10
cmpq %rdi, %r10
je 0x2938b9
cmpl $0x1, (%r10)
leaq 0x8(%r10), %r10
je 0x2938a8
jmp 0x29392e
movl 0x18(%r8), %r11d
cmpl 0x1c(%r8), %r11d
jne 0x2938cc
movl %r11d, (%rcx,%rsi,8)
movl %r11d, %r10d
jmp 0x2938f1
movl %r11d, %r10d
sarl $0x1f, %r10d
subq %r9, %rdi
andnl %r11d, %r10d, %r10d
shrq $0x3, %rdi
movl %r10d, (%rcx,%rsi,8)
movl 0x1c(%r8), %r8d
cmpl %edi, %r8d
cmovll %r8d, %edi
movl %edi, %r11d
movl %r11d, 0x4(%rcx,%rsi,8)
incq %rsi
cmpl %r11d, %r10d
jle 0x29388b
leaq 0x1c4b25(%rip), %rdi # 0x45842a
leaq 0x1c699d(%rip), %rsi # 0x45a2a9
leaq 0x1cd6c2(%rip), %rdx # 0x460fd5
leaq 0x1cd727(%rip), %rcx # 0x461041
callq 0x2813f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c4af5(%rip), %rdi # 0x45842a
leaq 0x1c891f(%rip), %rsi # 0x45c25b
leaq 0x1cd692(%rip), %rdx # 0x460fd5
leaq 0x1c6cce(%rip), %rcx # 0x45a618
callq 0x2813f
movq %rbx, %rdi
movq %rax, %r15
callq 0x293f5c
jmp 0x29395f
movq %rax, %r15
movq 0x8(%rsp), %rdi
callq 0x293f76
jmp 0x29396e
movq %rax, %r15
movq 0x10(%rsp), %rdi
callq 0x8affa
jmp 0x29397d
movq %rax, %r15
movq 0x18(%rsp), %rdi
callq 0x3a954
movq %r15, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, baryonyx::bit_array, long double>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double) | int run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta)
{
bool pi_changed = false;
int remaining = 0;
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.compute_update_row(
x, R.crbegin(), R.crend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
}
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
fldt 0xb0(%rsp)
fldt 0xa0(%rsp)
fldt 0x90(%rsp)
movl 0x30(%rdi), %eax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decl %eax
cmpl $0x6, %eax
ja 0x293af3
leaq 0x1cd45a(%rip), %rdx # 0x460e68
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x68(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
fxch %st(2)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x29416e
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x294091
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %r15, %rdx
fstpt 0x3c(%rsp)
callq 0x295af3
jmp 0x293b67
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
fstpt 0x3c(%rsp)
callq 0x29521d
jmp 0x293ab2
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
fstpt 0x3c(%rsp)
callq 0x295688
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x29439c
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2944ac
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fxch %st(2)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
jmp 0x293b3c
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %rcx, %rdx
fstpt 0x3c(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x29428c
jmp 0x293b90
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %r15, %rdx
fstpt 0x3c(%rsp)
callq 0x296047
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x294592
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x294091
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %rcx, %rdx
fstpt 0x3c(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x29428c
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2946a2
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<long double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp # imm = 0x438
vmovsd %xmm0, 0x88(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x60(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x70(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x108(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x98bf0
fldl 0x20(%r12)
fstpt 0xc8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xd4(%rsp)
fldl 0x30(%r12)
fstpt 0xbc(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x54(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x2987e4
movq 0x10(%r14), %rdi
leaq 0x108(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x98cca
fstpt 0xa0(%rsp)
jmp 0x2987fd
fstp %st(0)
vmovsd %xmm0, 0xe8(%rsp)
fldl 0xe8(%rsp)
fstpt 0xa0(%rsp)
fldl 0x38(%r12)
fstpt 0xfc(%rsp)
fldl 0x40(%r12)
fstpt 0xf0(%rsp)
vcvttsd2si 0xa0(%r12), %rax
movq 0x18(%r14), %rsi
movq %rax, 0x90(%rsp)
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x160(%rsp), %rdi
leaq 0x108(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2937e6
movl 0xcc(%r12), %esi
leaq 0x128(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x9c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x1e0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x2988df
cmpl $0x1, %eax
je 0x2988b9
cmpl $0x2, %eax
jne 0x2988f0
movq 0x18(%r14), %rdx
leaq 0x1e0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
jmp 0x2988ca
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
vmovsd 0x1bb766(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x96db2
jmp 0x2988f0
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x96d3f
leaq 0x70(%rsp), %r15
movq %r13, 0x80(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x298929
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x48(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x298925
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x298902
leaq 0x1e8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x1d8(%rsp), %ecx
movl 0x1dc(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x48(%rsp)
leaq 0x1c1c16(%rip), %rdx # 0x45a577
leaq 0x1e0(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x293990
vmovsd 0x48(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x70(%rsp), %r13
xorl %r15d, %r15d
vmovsd %xmm0, 0xe0(%rsp)
fldl 0xe0(%rsp)
fldt 0x54(%rsp)
cmpq 0xb0(%r12), %r15
je 0x298ad2
movq 0x18(%r14), %rcx
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
movq %r13, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x2939d2
movq 0x1b0(%rsp), %rdx
movq 0x1c8(%rsp), %rcx
movl %eax, %ebx
leaq 0x1e0(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x95692
testl %ebx, %ebx
je 0x298b86
cmpl %ebp, %ebx
jge 0x298a4a
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x299640
movl %ebx, %ebp
cmpq 0x90(%rsp), %r15
jle 0x298a9b
movl %ebx, 0xb4(%rsp)
fildl 0xb4(%rsp)
movl 0x1d8(%rsp), %eax
movl %eax, 0xb8(%rsp)
fidivl 0xb8(%rsp)
fldt 0xbc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xc8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x298a9f
fldt 0x48(%rsp)
fldt 0xd4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x298ad2
fstp %st(0)
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x299678
fldt 0x48(%rsp)
fldt 0x54(%rsp)
testb %al, %al
jne 0x298ad2
incq %r15
jmp 0x2989c3
fstp %st(0)
fstp %st(0)
movq 0x60(%rsp), %rax
movl $0x5, 0xa0(%rax)
fldz
fldz
fstp %st(1)
fstp %st(0)
cmpl $0x0, 0x50(%r14)
jne 0x298b00
movq 0x60(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x298b31
movq 0x60(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x9c(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x1e0(%rsp), %rdi
callq 0x435d0
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x293ea6
leaq 0x108(%rsp), %rdi
callq 0x968b6
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rax
addq $0x438, %rsp # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
leaq 0x70(%rsp), %rbx
movq %rbx, %rsi
callq 0x9706e
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2995f6
movl $0x0, 0x6c(%rsp)
leaq 0x160(%rsp), %r15
leaq 0x70(%rsp), %rbp
xorl %ebx, %ebx
fldt 0x54(%rsp)
fldt 0x48(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x298ae9
movq 0x18(%r14), %rcx
fldt 0xfc(%rsp)
fld %st(1)
fstpt 0x48(%rsp)
fmulp %st, %st(1)
fldt 0xf0(%rsp)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x293c02
testl %eax, %eax
jne 0x298c5c
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2995f6
movq %r14, %rdi
callq 0x299678
fldt 0x54(%rsp)
fldt 0x48(%rsp)
testb %al, %al
jne 0x298ae9
movl %ebx, 0x90(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x298da5
movq 0x18(%r14), %rcx
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x2939d2
testl %eax, %eax
je 0x298d55
vcvtsi2sd %r13d, %xmm1, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x298d23
movl %eax, 0xac(%rsp)
fildl 0xac(%rsp)
movl 0x1d8(%rsp), %eax
movl %eax, 0xb0(%rsp)
fidivl 0xb0(%rsp)
fldt 0xbc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xc8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x298d27
fldt 0x48(%rsp)
fldt 0xd4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x298d95
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x299678
testb %al, %al
jne 0x298d9d
fldt 0x54(%rsp)
fldt 0x48(%rsp)
incl %ebx
jmp 0x298c80
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull 0x6c(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2995f6
fldt 0x54(%rsp)
fldt 0x48(%rsp)
jmp 0x298da5
fldt 0x54(%rsp)
fxch %st(1)
jmp 0x298da5
fldt 0x54(%rsp)
fldt 0x48(%rsp)
movl 0x90(%rsp), %ebx
decl 0x6c(%rsp)
incl %ebx
jmp 0x298bd1
jmp 0x298df2
jmp 0x298dcb
fstp %st(1)
fstp %st(0)
jmp 0x298df2
movq %rax, %rbx
jmp 0x298e02
movq %rax, %rbx
jmp 0x298e0f
movq %rax, %rbx
jmp 0x298e1c
movq %rax, %rbx
jmp 0x298e29
movq %rax, %rbx
jmp 0x298e33
jmp 0x298df2
jmp 0x298df2
jmp 0x298df2
leaq 0x1e8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x298e02
leaq 0x1e0(%rsp), %rdi
movq %rax, %rbx
callq 0x435d0
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x293ea6
leaq 0x108(%rsp), %rdi
callq 0x968b6
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<long double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp # imm = 0x1E8
vmovsd %xmm0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x58(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x68(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x110(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x98bf0
fldl 0x20(%r12)
fstpt 0xd0(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xdc(%rsp)
fldl 0x30(%r12)
fstpt 0xc4(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x4c(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x298f2c
movq 0x10(%r14), %rdi
leaq 0x110(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x98cca
fstpt 0x94(%rsp)
jmp 0x298f45
fstp %st(0)
vmovsd %xmm0, 0xf0(%rsp)
fldl 0xf0(%rsp)
fstpt 0x94(%rsp)
fldl 0x38(%r12)
fstpt 0x104(%rsp)
fldl 0x40(%r12)
fstpt 0xf8(%rsp)
vcvttsd2si 0xa0(%r12), %rax
movq 0x18(%r14), %rsi
movq %rax, 0x88(%rsp)
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x168(%rsp), %rdi
leaq 0x110(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2937e6
movl 0xcc(%r12), %esi
leaq 0x130(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x90(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0xb0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x299027
cmpl $0x1, %eax
je 0x299001
cmpl $0x2, %eax
jne 0x299038
movq 0x18(%r14), %rdx
leaq 0xb0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
jmp 0x299012
movq 0x18(%r14), %rdx
leaq 0x68(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
vmovsd 0x1bb01e(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x96db2
jmp 0x299038
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x96d3f
leaq 0x68(%rsp), %r15
movq %r13, 0x78(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x29906e
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x40(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x29906a
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x299047
leaq 0xb8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x130(%rsp), %rdi
leaq 0x168(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x293990
vmovsd 0x40(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x68(%rsp), %rbx
xorl %r15d, %r15d
vmovsd %xmm0, 0xe8(%rsp)
fldl 0xe8(%rsp)
fldt 0x4c(%rsp)
cmpq 0xb0(%r12), %r15
je 0x2991c9
movq 0x18(%r14), %rcx
fstpt 0x20(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x168(%rsp), %rsi
movq %rbx, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x40(%rsp)
fstpt (%rsp)
callq 0x2939d2
movl %eax, %r13d
testl %eax, %eax
je 0x299270
cmpl %ebp, %r13d
jge 0x299140
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0x299722
movl %r13d, %ebp
cmpq 0x88(%rsp), %r15
jle 0x299192
movl %r13d, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x1e0(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xc4(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd0(%rsp)
fmulp %st, %st(1)
fldt 0x40(%rsp)
faddp %st, %st(1)
jmp 0x299196
fldt 0x40(%rsp)
fldt 0xdc(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x2991c9
fstp %st(0)
movq %r14, %rdi
fstpt 0x40(%rsp)
callq 0x29975a
fldt 0x40(%rsp)
fldt 0x4c(%rsp)
testb %al, %al
jne 0x2991c9
incq %r15
jmp 0x2990da
fstp %st(0)
fstp %st(0)
movq 0x58(%rsp), %rax
movl $0x5, 0xa0(%rax)
fldz
fldz
fstp %st(1)
fstp %st(0)
cmpl $0x0, 0x50(%r14)
jne 0x2991f7
movq 0x58(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x299228
movq 0x58(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x90(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x130(%rsp), %rdi
callq 0x393ac
leaq 0x168(%rsp), %rdi
callq 0x293ea6
leaq 0x110(%rsp), %rdi
callq 0x968b6
leaq 0x70(%rsp), %rdi
callq 0x357fe
movq 0x58(%rsp), %rax
addq $0x1e8, %rsp # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
leaq 0x68(%rsp), %rbx
movq %rbx, %rsi
callq 0x9706e
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2996d8
movl $0x0, 0x64(%rsp)
leaq 0x168(%rsp), %r15
leaq 0x68(%rsp), %rbp
xorl %ebx, %ebx
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2991e0
movq 0x18(%r14), %rcx
fldt 0x104(%rsp)
fld %st(1)
fstpt 0x40(%rsp)
fmulp %st, %st(1)
fldt 0xf8(%rsp)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x130(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x293c02
testl %eax, %eax
jne 0x299340
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2996d8
movq %r14, %rdi
callq 0x29975a
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
testb %al, %al
jne 0x2991e0
movl %ebx, 0x88(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x299486
movq 0x18(%r14), %rcx
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x130(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x40(%rsp)
fstpt (%rsp)
callq 0x2939d2
testl %eax, %eax
je 0x299439
vcvtsi2sd %r13d, %xmm2, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x299407
movl %eax, 0xa0(%rsp)
fildl 0xa0(%rsp)
movl 0x1e0(%rsp), %eax
movl %eax, 0xa4(%rsp)
fidivl 0xa4(%rsp)
fldt 0xc4(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd0(%rsp)
fmulp %st, %st(1)
fldt 0x40(%rsp)
faddp %st, %st(1)
jmp 0x29940b
fldt 0x40(%rsp)
fldt 0xdc(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x299476
movq %r14, %rdi
fstpt 0x40(%rsp)
callq 0x29975a
testb %al, %al
jne 0x29947e
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
incl %ebx
jmp 0x299364
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull 0x64(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2996d8
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
jmp 0x299486
fldt 0x4c(%rsp)
fxch %st(1)
jmp 0x299486
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
movl 0x88(%rsp), %ebx
decl 0x64(%rsp)
incl %ebx
jmp 0x2992b8
jmp 0x2994ce
jmp 0x2994a7
fstp %st(1)
fstp %st(0)
jmp 0x2994ce
movq %rax, %rbx
jmp 0x2994de
movq %rax, %rbx
jmp 0x2994eb
movq %rax, %rbx
jmp 0x2994f8
movq %rax, %rbx
jmp 0x299502
jmp 0x2994ce
jmp 0x2994ce
jmp 0x2994ce
leaq 0xb8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x2994d1
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x393ac
leaq 0x168(%rsp), %rdi
callq 0x293ea6
leaq 0x110(%rsp), %rdi
callq 0x968b6
leaq 0x70(%rsp), %rdi
callq 0x357fe
movq 0x58(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::result baryonyx::itm::optimize_problem<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
optimize_problem(const context& ctx, const problem& pb)
{
result r;
if (ctx.start)
ctx.start(ctx.parameters);
auto constraints{ make_merged_constraints(ctx, pb) };
if (constraints.empty() || pb.vars.values.empty()) {
r.status = result_status::success;
r.solutions.resize(1);
r.solutions.back().value = pb.objective.value;
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
return r;
}
random_engine rng(init_random_generator_seed(ctx));
auto variables = length(pb.vars.values);
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
const auto thread = get_thread_number(ctx);
std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors;
std::vector<std::thread> pool(thread);
best_solution_recorder<Cost, Float, Mode> best_recorder(
rng,
thread,
cost,
cost_constant,
variables,
constraints,
ctx.parameters.init_population_size);
auto seeds = generate_seed(rng, thread);
std::atomic_bool stop_task;
stop_task.store(false);
for (unsigned i = 0u; i != thread; ++i)
functors.emplace_back(ctx, i, seeds[i]);
for (unsigned i = 0u; i != thread; ++i)
pool[i] = std::thread(std::ref(functors[i]),
std::ref(stop_task),
std::ref(best_recorder),
std::cref(constraints),
variables,
std::cref(cost),
cost_constant);
const auto start = std::chrono::steady_clock::now();
auto end = start;
do {
std::this_thread::sleep_for(std::chrono::seconds{ 1L });
if (ctx.update) {
auto call_number = 0L;
for (auto i = 0u; i != thread; ++i)
call_number += functors[i].m_call_number;
int constraints_remaining;
long int loop;
double value;
double duration;
best_recorder.get_best(
constraints_remaining, value, duration, loop);
ctx.update(
constraints_remaining, value, loop, duration, call_number);
}
end = std::chrono::steady_clock::now();
} while (!is_time_limit(ctx.parameters.time_limit, start, end));
stop_task.store(true);
for (auto& t : pool)
t.join();
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
r.variables = variables;
r.constraints = length(constraints);
const auto& first = best_recorder.get_best(0);
if (!first.is_solution())
r.status = result_status::time_limit_reached;
else
r.status = result_status::success;
r.duration = first.duration;
r.loop = first.loop;
r.remaining_constraints = first.remaining_constraints;
switch (ctx.parameters.storage) {
case solver_parameters::storage_type::one: {
r.solutions.resize(1);
convert(first, r.solutions[0], variables);
} break;
case solver_parameters::storage_type::bound: {
r.solutions.resize(2);
convert(first, r.solutions[0], variables);
convert(best_recorder.get_worst(), r.solutions[1], variables);
} break;
case solver_parameters::storage_type::five: {
r.solutions.resize(5);
for (int i = 0; i != 5; ++i)
convert(best_recorder.get_best(i), r.solutions[i], variables);
} break;
}
best_recorder.show_population(ctx);
if (ctx.finish)
ctx.finish(r);
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp # imm = 0x188
vxorpd %xmm0, %xmm0, %xmm0
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
cmpq $0x0, 0x128(%rsi)
je 0x29981f
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 0x29997b
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x29997b
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0x60(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x8adb0
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x70(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0xa17b4
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x70(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x98(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0x2999d6
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x29aaa4
movl 0x8(%rsp), %eax
incl %eax
jmp 0x299952
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 0x299d6b
movq %r13, 0x90(%rsp)
movq %r15, %r13
leaq 0x8(%rsp), %r15
leaq 0xa8(%rsp), %r14
leaq 0x4(%rsp), %rbx
xorl %r12d, %r12d
cmpq %rbp, %r12
je 0x299a97
imulq $0xc0, %r12, %rax
addq 0x70(%rsp), %rax
leaq 0x3(%rsp), %r10
leaq 0xc8(%rsp), %r11
movq %r10, 0x20(%rsp)
leaq 0x48(%rsp), %r10
movq %r11, 0x18(%rsp)
movq %r10, 0xa8(%rsp)
movq %rax, 0x28(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x20(%rsp), %rdx
leaq 0x38(%rsp), %rax
movq %r15, %rdi
leaq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rcx
movq %r14, %r8
movq %rbx, %r9
pushq %rax
leaq 0xa8(%rsp), %rax
pushq %rax
callq 0x29aaf0
popq %rax
popq %rcx
leaq (,%r12,8), %rdi
addq 0xb0(%rsp), %rdi
movq %r15, %rsi
callq 0x356d6
movq %r15, %rdi
callq 0x356f0
incq %r12
jmp 0x2999f6
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 0x299b2c
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x299aed
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x299ad7
leaq 0xd0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0xa90e8
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 0x1bff31(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x299ab2
vucomisd %xmm0, %xmm1
jbe 0x299ab2
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x299b8d
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x299b7a
movq 0x90(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x31d28
addq $0xc0, %rbx
leaq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x352c2
leaq 0x50(%r12), %rdi
movq 0x98(%rsp), %rsi
callq 0x352ec
movl 0x4(%rsp), %eax
movl %eax, 0x90(%r12)
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
pushq $0x28
popq %rcx
cqto
xorl %esi, %esi
idivq %rcx
movq 0x108(%rsp), %rdi
movq 0x120(%rsp), %rcx
movl %eax, 0x94(%r12)
movslq (%rdi), %rax
imulq $0x38, %rax, %rax
movl 0x30(%rcx,%rax), %edx
leaq (%rcx,%rax), %rbx
testl %edx, %edx
setne %sil
leal (%rsi,%rsi,2), %esi
movl %esi, 0xa0(%r12)
vmovsd 0x18(%rcx,%rax), %xmm0
vmovsd %xmm0, 0x80(%r12)
movq 0x28(%rcx,%rax), %rax
movq %rax, 0x88(%r12)
movl %edx, 0x98(%r12)
movl 0xe8(%r13), %eax
testl %eax, %eax
je 0x299ce8
cmpl $0x1, %eax
je 0x299cb0
cmpl $0x2, %eax
jne 0x299d07
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x299d07
movq 0x108(%rsp), %rax
movq (%rbx), %rsi
movl 0x4(%rsp), %edx
movslq (%rax,%r15,4), %rax
addq %r14, %rsi
imulq $0x38, %rax, %rdi
addq 0x120(%rsp), %rdi
callq 0x4f485
incq %r15
addq $0x20, %r14
jmp 0x299c76
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4f485
leaq 0xd0(%rsp), %rdi
callq 0xa9166
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x299cfb
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x4f485
leaq 0xc8(%rsp), %rdi
movq %r13, %rsi
callq 0xa1918
cmpq $0x0, 0x168(%r13)
je 0x299d33
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0xa192c
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x2a033c
leaq 0x68(%rsp), %rdi
callq 0x8affa
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x188, %rsp # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x299dcc
movq %rax, %rbx
jmp 0x299dd9
movq %rax, %rbx
jmp 0x299de6
jmp 0x299db0
jmp 0x299da1
jmp 0x299dbf
jmp 0x299dbf
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x299e04
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x299dfa
jmp 0x299dbf
jmp 0x299dbf
jmp 0x299dbf
jmp 0x299dbf
jmp 0x299dbf
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0xa192c
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x2a033c
leaq 0x68(%rsp), %rdi
callq 0x8affa
leaq 0x48(%rsp), %rdi
callq 0x35858
movq 0x10(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
baryonyx::result baryonyx::itm::optimize_problem<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
optimize_problem(const context& ctx, const problem& pb)
{
result r;
if (ctx.start)
ctx.start(ctx.parameters);
auto constraints{ make_merged_constraints(ctx, pb) };
if (constraints.empty() || pb.vars.values.empty()) {
r.status = result_status::success;
r.solutions.resize(1);
r.solutions.back().value = pb.objective.value;
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
return r;
}
random_engine rng(init_random_generator_seed(ctx));
auto variables = length(pb.vars.values);
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
const auto thread = get_thread_number(ctx);
std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors;
std::vector<std::thread> pool(thread);
best_solution_recorder<Cost, Float, Mode> best_recorder(
rng,
thread,
cost,
cost_constant,
variables,
constraints,
ctx.parameters.init_population_size);
auto seeds = generate_seed(rng, thread);
std::atomic_bool stop_task;
stop_task.store(false);
for (unsigned i = 0u; i != thread; ++i)
functors.emplace_back(ctx, i, seeds[i]);
for (unsigned i = 0u; i != thread; ++i)
pool[i] = std::thread(std::ref(functors[i]),
std::ref(stop_task),
std::ref(best_recorder),
std::cref(constraints),
variables,
std::cref(cost),
cost_constant);
const auto start = std::chrono::steady_clock::now();
auto end = start;
do {
std::this_thread::sleep_for(std::chrono::seconds{ 1L });
if (ctx.update) {
auto call_number = 0L;
for (auto i = 0u; i != thread; ++i)
call_number += functors[i].m_call_number;
int constraints_remaining;
long int loop;
double value;
double duration;
best_recorder.get_best(
constraints_remaining, value, duration, loop);
ctx.update(
constraints_remaining, value, loop, duration, call_number);
}
end = std::chrono::steady_clock::now();
} while (!is_time_limit(ctx.parameters.time_limit, start, end));
stop_task.store(true);
for (auto& t : pool)
t.join();
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
r.variables = variables;
r.constraints = length(constraints);
const auto& first = best_recorder.get_best(0);
if (!first.is_solution())
r.status = result_status::time_limit_reached;
else
r.status = result_status::success;
r.duration = first.duration;
r.loop = first.loop;
r.remaining_constraints = first.remaining_constraints;
switch (ctx.parameters.storage) {
case solver_parameters::storage_type::one: {
r.solutions.resize(1);
convert(first, r.solutions[0], variables);
} break;
case solver_parameters::storage_type::bound: {
r.solutions.resize(2);
convert(first, r.solutions[0], variables);
convert(best_recorder.get_worst(), r.solutions[1], variables);
} break;
case solver_parameters::storage_type::five: {
r.solutions.resize(5);
for (int i = 0; i != 5; ++i)
convert(best_recorder.get_best(i), r.solutions[i], variables);
} break;
}
best_recorder.show_population(ctx);
if (ctx.finish)
ctx.finish(r);
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp # imm = 0x188
vxorpd %xmm0, %xmm0, %xmm0
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
cmpq $0x0, 0x128(%rsi)
je 0x29a194
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 0x29a2f0
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x29a2f0
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0x60(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x8adb0
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x70(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0xa17b4
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x70(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x98(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0x29a34b
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2a1b74
movl 0x8(%rsp), %eax
incl %eax
jmp 0x29a2c7
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 0x29a6e0
movq %r13, 0x90(%rsp)
movq %r15, %r13
leaq 0x8(%rsp), %r15
leaq 0xa8(%rsp), %r14
leaq 0x4(%rsp), %rbx
xorl %r12d, %r12d
cmpq %rbp, %r12
je 0x29a40c
imulq $0xc0, %r12, %rax
addq 0x70(%rsp), %rax
leaq 0x3(%rsp), %r10
leaq 0xc8(%rsp), %r11
movq %r10, 0x20(%rsp)
leaq 0x48(%rsp), %r10
movq %r11, 0x18(%rsp)
movq %r10, 0xa8(%rsp)
movq %rax, 0x28(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x20(%rsp), %rdx
leaq 0x38(%rsp), %rax
movq %r15, %rdi
leaq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rcx
movq %r14, %r8
movq %rbx, %r9
pushq %rax
leaq 0xa8(%rsp), %rax
pushq %rax
callq 0x2a1bc0
popq %rax
popq %rcx
leaq (,%r12,8), %rdi
addq 0xb0(%rsp), %rdi
movq %r15, %rsi
callq 0x356d6
movq %r15, %rdi
callq 0x356f0
incq %r12
jmp 0x29a36b
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 0x29a4a1
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x29a462
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x29a44c
leaq 0xd0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0xa90e8
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 0x1bf5bc(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x29a427
vucomisd %xmm0, %xmm1
jbe 0x29a427
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x29a502
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x29a4ef
movq 0x90(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x31d28
addq $0xc0, %rbx
leaq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x352c2
leaq 0x50(%r12), %rdi
movq 0x98(%rsp), %rsi
callq 0x352ec
movl 0x4(%rsp), %eax
movl %eax, 0x90(%r12)
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
pushq $0x28
popq %rcx
cqto
xorl %esi, %esi
idivq %rcx
movq 0x108(%rsp), %rdi
movq 0x120(%rsp), %rcx
movl %eax, 0x94(%r12)
movslq (%rdi), %rax
imulq $0x38, %rax, %rax
movl 0x30(%rcx,%rax), %edx
leaq (%rcx,%rax), %rbx
testl %edx, %edx
setne %sil
leal (%rsi,%rsi,2), %esi
movl %esi, 0xa0(%r12)
vmovsd 0x18(%rcx,%rax), %xmm0
vmovsd %xmm0, 0x80(%r12)
movq 0x28(%rcx,%rax), %rax
movq %rax, 0x88(%r12)
movl %edx, 0x98(%r12)
movl 0xe8(%r13), %eax
testl %eax, %eax
je 0x29a65d
cmpl $0x1, %eax
je 0x29a625
cmpl $0x2, %eax
jne 0x29a67c
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x29a67c
movq 0x108(%rsp), %rax
movq (%rbx), %rsi
movl 0x4(%rsp), %edx
movslq (%rax,%r15,4), %rax
addq %r14, %rsi
imulq $0x38, %rax, %rdi
addq 0x120(%rsp), %rdi
callq 0x4f485
incq %r15
addq $0x20, %r14
jmp 0x29a5eb
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4f485
leaq 0xd0(%rsp), %rdi
callq 0xa9166
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x29a670
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x4f485
leaq 0xc8(%rsp), %rdi
movq %r13, %rsi
callq 0xa1918
cmpq $0x0, 0x168(%r13)
je 0x29a6a8
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0xa192c
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x2a6c7c
leaq 0x68(%rsp), %rdi
callq 0x8affa
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x188, %rsp # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x29a741
movq %rax, %rbx
jmp 0x29a74e
movq %rax, %rbx
jmp 0x29a75b
jmp 0x29a725
jmp 0x29a716
jmp 0x29a734
jmp 0x29a734
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x29a779
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x29a76f
jmp 0x29a734
jmp 0x29a734
jmp 0x29a734
jmp 0x29a734
jmp 0x29a734
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0xa192c
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x2a6c7c
leaq 0x68(%rsp), %rdi
callq 0x8affa
leaq 0x48(%rsp), %rdi
callq 0x35858
movq 0x10(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long 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>>>>, 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0xa8, %rsp
movq %rcx, 0x60(%rsp)
movq %rdx, %rbx
leaq 0x1c050e(%rip), %rdx # 0x45c344
movq %rsi, %r14
movq %rdi, %r12
fldt 0x100(%rsp)
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fstpt 0x90(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
pushq $0x14
popq %rsi
leaq 0x90(%rsp), %rcx
leaq 0x80(%rsp), %r8
leaq 0x70(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
movq %rbx, 0x58(%rsp)
xorl %edx, %edx
movq %rax, 0x48(%rsp)
movq (%rbx), %rax
pushq $0x16
popq %r13
leaq 0x1c789f(%rip), %rbp # 0x46373e
pushq $0x8
popq %rbx
movq %r14, 0x50(%rsp)
movq 0x60(%rsp), %rcx
cmpq (%rcx), %rax
je 0x29c01a
movq %rdx, 0x68(%rsp)
movl -0x4(%rax), %edx
movq 0x48(%rsp), %rsi
leaq 0x38(%rsp), %rdi
movl %edx, 0x2c(%rsp)
callq 0x3de66
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
fldt 0x70(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x29c746
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x29c76c
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r14
movl %eax, 0x34(%rsp)
movq %r14, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x29c832
movslq 0x2c(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r14d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x29c866
movslq 0x2c(%rsp), %r8
movl %eax, 0x30(%rsp)
leaq 0x1c50fb(%rip), %rdx # 0x461045
leaq 0x2c(%rsp), %rcx
movq %r12, %rdi
movq %r13, %r15
movq %r13, %rsi
shlq $0x3, %r8
addq 0x60(%r12), %r8
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
xorl %r13d, %r13d
andnl %r14d, %eax, %r14d
shlq $0x5, %r14
cmpq %r13, %r14
je 0x29bf9e
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r13), %r8
addq %r13, %rcx
callq 0x126d84
addq $0x20, %r13
jmp 0x29bf78
movslq 0x2c(%rsp), %rax
movq 0x60(%r12), %rcx
leaq 0x1c50ad(%rip), %rdx # 0x46105c
leaq 0x30(%rsp), %r8
movq %r12, %rdi
movq %r15, %r13
movq %r15, %rsi
leaq 0x4(%rcx,%rax,8), %rcx
callq 0xb91c2
movq 0x40(%rsp), %rdx
movl 0x2c(%rsp), %ecx
movl 0x30(%rsp), %r8d
fldt 0x90(%rsp)
fldt 0x80(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq 0x50(%rsp), %r14
movl 0x34(%rsp), %r9d
movq %r14, %rsi
callq 0x29c8d7
movq 0x68(%rsp), %rdx
movq 0x58(%rsp), %rcx
orb %al, %dl
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x29bea7
andb $0x1, %dl
movl %edx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long 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>>>, 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0x98, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1c02ec(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1c769c(%rip), %rbp # 0x46373e
movq %rax, 0x38(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x40(%rsp)
cmpq 0x48(%rsp), %r14
je 0x29c217
movl (%r14), %edx
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq %r14, 0x58(%rsp)
movl %edx, 0x20(%rsp)
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x29c746
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x29c76c
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movl %eax, %r15d
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x29c832
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x29c866
movslq 0x20(%rsp), %r8
movl %eax, 0x24(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1c4ee1(%rip), %rdx # 0x461045
leaq 0x20(%rsp), %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %r13d
shlq $0x5, %r13
cmpq %r14, %r13
je 0x29c1a6
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r14), %r8
addq %r14, %rcx
callq 0x126d84
addq $0x20, %r14
jmp 0x29c180
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1c4e9a(%rip), %rdx # 0x46105c
leaq 0x24(%rsp), %r8
callq 0xb91c2
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %r8d
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movl %r15d, %r9d
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x29c8d7
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x29c0b1
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>::rc_data*>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>::rc_data*, baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long 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 0x20(%rdi), %r15
cmpq %r14, %r15
je 0x2a3852
fldt (%rdi)
fldt (%r15)
addq $0x20, %r15
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jne 0x2a383e
jnp 0x2a3826
addq $-0x20, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2a3dd3
movq %r15, %rdi
jmp 0x2a3822
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2a3dd3
popq %rbx
popq %r14
popq %r15
retq
jmp 0x2a3865
movq %rax, %rdi
callq 0xeb9f
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::pnm_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1b17cf(%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 |
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long 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>>>, 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0x98, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1b15da(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1b898a(%rip), %rbp # 0x46373e
movq %rax, 0x38(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x40(%rsp)
cmpq 0x48(%rsp), %r14
je 0x2aaf29
movl (%r14), %edx
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq %r14, 0x58(%rsp)
movl %edx, 0x20(%rsp)
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x2ab458
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x2ab47e
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movl %eax, %r15d
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x2ab554
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x2ab588
movslq 0x20(%rsp), %r8
movl %eax, 0x24(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1b61cf(%rip), %rdx # 0x461045
leaq 0x20(%rsp), %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %r13d
shlq $0x5, %r13
cmpq %r14, %r13
je 0x2aaeb8
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r14), %r8
addq %r14, %rcx
callq 0x126d84
addq $0x20, %r14
jmp 0x2aae92
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1b6188(%rip), %rdx # 0x46105c
leaq 0x24(%rsp), %r8
callq 0xb91c2
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %r8d
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movl %r15d, %r9d
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x2ab5f9
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x2aadc3
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long 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 0x2ab44a
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x2aaab3
xorb $0x1, %al
incl %r15d
movzbl %al, %eax
addl %eax, %ebp
jmp 0x2ab42a
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long 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>>>, long double, long double, long double, long 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);
bx_expects(k < m);
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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0xa8, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x1aed87(%rip), %rdx # 0x45c33f
fldt 0x110(%rsp)
fstpt 0x64(%rsp)
fldt 0x100(%rsp)
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fstpt 0x90(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
pushq $0x19
popq %rsi
leaq 0x90(%rsp), %rcx
leaq 0x80(%rsp), %r8
leaq 0x70(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1b612b(%rip), %rbp # 0x46373e
movq %rax, 0x40(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
cmpq 0x48(%rsp), %r14
je 0x2ad7d2
movl (%r14), %edx
movl %edx, 0x24(%rsp)
cmpl 0x78(%r12), %edx
jge 0x2ad7e6
movq 0x40(%rsp), %rsi
leaq 0x30(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq %r14, 0x58(%rsp)
callq 0x3de66
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rsi
fldt 0x70(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x2ab458
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2ab47e
movl %eax, %r14d
shlq $0x5, %r14
xorl %r13d, %r13d
movl %eax, 0x28(%rsp)
cmpq %r13, %r14
je 0x2ad6c6
movq 0x58(%r12), %rax
movq 0x70(%r12), %rdi
movq %r15, %rdx
movl 0x10(%rax,%r13), %esi
callq 0x9c23c
movq 0x58(%r12), %rax
fldt (%rax,%r13)
fldt 0x64(%rsp)
fmulp %st, %st(2)
faddp %st, %st(1)
fstpt (%rax,%r13)
addq $0x20, %r13
jmp 0x2ad68f
movl 0x28(%rsp), %r14d
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %r14d, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x2ab554
movslq 0x24(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r14d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x2ab588
movslq 0x24(%rsp), %r8
movl %eax, 0x2c(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1b3926(%rip), %rdx # 0x461045
leaq 0x24(%rsp), %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
xorl %r13d, %r13d
andnl %r14d, %eax, %r14d
shlq $0x5, %r14
cmpq %r13, %r14
je 0x2ad761
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r13), %r8
addq %r13, %rcx
callq 0x126d84
addq $0x20, %r13
jmp 0x2ad73b
movslq 0x24(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1b38df(%rip), %rdx # 0x46105c
leaq 0x2c(%rsp), %r8
callq 0xb91c2
movq 0x38(%rsp), %rdx
movl 0x24(%rsp), %ecx
movl 0x2c(%rsp), %r8d
fldt 0x90(%rsp)
fldt 0x80(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl 0x28(%rsp), %r9d
callq 0x2ab5f9
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x2ad61d
andb $0x1, %al
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1aa9f1(%rip), %rdi # 0x4581de
leaq 0x1acc86(%rip), %rsi # 0x45a47a
leaq 0x1b37da(%rip), %rdx # 0x460fd5
leaq 0x1b3871(%rip), %rcx # 0x461073
callq 0x2813f
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long) | void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
} | vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2b0640
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2b06ba
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_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::pnm_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1a93dd(%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_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<long double>, long double, baryonyx::itm::minimize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<long double> const&, double) | void operator()(const std::atomic_bool& stop_task,
best_solution_recorder<Cost, Float, Mode>& best_recorder,
const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
bit_array x(variables);
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_local_ctx.rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const auto w_limit = static_cast<long int>(p.w);
Solver slv(m_local_ctx.rng,
length(constraints),
variables,
norm_costs,
constraints);
compute_order compute(p.order, variables);
bool is_a_solution = false;
while (!stop_task.load()) {
++m_call_number;
const auto kappa_start = static_cast<Float>(best_recorder.reinit(
m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x));
auto kappa = kappa_start;
compute.init(slv, x);
auto best_remaining = INT_MAX;
is_a_solution = false;
for (long int i = 0; !stop_task.load() && i != p.limit; ++i) {
auto remaining =
compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
i);
best_remaining = 0;
is_a_solution = true;
break;
} else {
best_remaining = std::min(remaining, best_remaining);
}
if (i > w_limit)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
if (best_remaining > 0) {
best_recorder.try_advance(
m_local_ctx, x, best_remaining, p.limit);
continue;
}
for (int push = 0; !stop_task.load() && push < p.pushes_limit;
++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_local_ctx.rng,
pushing_k_factor,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
is_a_solution = true;
}
kappa = kappa_start;
for (int iter = 0;
!stop_task.load() && iter < p.pushing_iteration_limit;
++iter) {
remaining = compute.run(
slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
is_a_solution = true;
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
}
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp # imm = 0x1F8
movq %rdi, %rbp
leaq 0x60(%rsp), %rdi
movq %rsi, %r15
movl %r8d, %esi
vmovsd %xmm0, 0x90(%rsp)
movq %r9, %r12
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x70(%rsp)
callq 0x368ae
movq (%rbp), %r13
movq %rbp, 0xb8(%rsp)
addq $0x8, %rbp
leaq 0x120(%rsp), %rdi
movq %r13, %rsi
movq %r12, 0x88(%rsp)
movq %r12, %rdx
movq %rbp, %rcx
movl %ebx, %r8d
callq 0x98bf0
fldl 0x20(%r13)
fstpt 0xd8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r13)
fstpt 0xe4(%rsp)
fldl 0x30(%r13)
fstpt 0xcc(%rsp)
fldl 0x8(%r13)
vmovsd 0x10(%r13), %xmm0
fld %st(0)
fstpt 0x4c(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x2b0d87
movq 0xb8(%rsp), %rax
movq (%rax), %rdi
leaq 0x120(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x98cca
fstpt 0x9c(%rsp)
jmp 0x2b0da0
fstp %st(0)
vmovsd %xmm0, 0x100(%rsp)
fldl 0x100(%rsp)
fstpt 0x9c(%rsp)
fldl 0x38(%r13)
fstpt 0x114(%rsp)
fldl 0x40(%r13)
fstpt 0x108(%rsp)
vcvttsd2si 0xa0(%r13), %rax
movq %rax, 0xf0(%rsp)
movq 0x8(%r14), %rax
subq (%r14), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x178(%rsp), %rdi
leaq 0x120(%rsp), %r8
movq %rbp, %rsi
movl %eax, %edx
movl %ebx, %ecx
movq %r14, %r9
callq 0x2b126c
movl 0xcc(%r13), %esi
leaq 0x140(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq $0x0, 0x58(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x2b11d4
movq 0xb8(%rsp), %rax
incq 0xb0(%rax)
vmovsd 0x18(%r13), %xmm0
vmovsd 0x28(%r13), %xmm1
movzbl 0x58(%rsp), %edx
movq 0x70(%rsp), %rdi
leaq 0x60(%rsp), %rbx
movq %rbp, %rsi
movq %rbx, %rcx
andl $0x1, %edx
callq 0xad93c
vmovsd %xmm0, 0xf8(%rsp)
fldl 0xf8(%rsp)
fstpt 0xc0(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x178(%rsp), %rsi
movq %rbx, %rdx
callq 0x2b1416
fldt 0xc0(%rsp)
fldt 0x4c(%rsp)
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movb (%r15), %al
testb $0x1, %al
jne 0x2b0f69
cmpq 0xb0(%r13), %r14
je 0x2b0f69
fstpt 0x20(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x178(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %rbp, %rcx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x7c(%rsp)
fstpt (%rsp)
callq 0x2b1458
testl %eax, %eax
je 0x2b0f83
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0xf0(%rsp), %r14
jle 0x2b0f48
movl %eax, 0xb0(%rsp)
fildl 0xb0(%rsp)
movl 0x1f0(%rsp), %eax
movl %eax, 0xb4(%rsp)
fidivl 0xb4(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x7c(%rsp)
faddp %st, %st(1)
fldt 0x4c(%rsp)
jmp 0x2b0f52
fldt 0x4c(%rsp)
fldt 0x7c(%rsp)
fxch %st(1)
fldt 0xe4(%rsp)
fxch %st(2)
fucomi %st(2), %st
fstp %st(2)
ja 0x2b0f69
incq %r14
jmp 0x2b0e99
fstp %st(1)
testl %ebx, %ebx
jg 0x2b11b2
movq $0x0, 0x58(%rsp)
leaq 0x60(%rsp), %rbx
jmp 0x2b0fbf
vmovsd 0x90(%rsp), %xmm0
movq 0x88(%rsp), %rdi
leaq 0x60(%rsp), %rbx
movq %rbx, %rsi
callq 0x9706e
movq 0x70(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0xadcae
movb $0x1, %al
movq %rax, 0x58(%rsp)
fldt 0x4c(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x78(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x2b11ab
cmpl 0xbc(%r13), %r14d
jge 0x2b11ab
fldt 0x108(%rsp)
fstpt 0x30(%rsp)
fstpt 0x20(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x178(%rsp), %rsi
movq %rbx, %rdx
movq %rbp, %rcx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fldt 0x114(%rsp)
fstpt (%rsp)
callq 0x2b1688
testl %eax, %eax
jne 0x2b1065
vmovsd 0x90(%rsp), %xmm0
movq 0x88(%rsp), %rdi
movq %rbx, %rsi
callq 0x9706e
movl 0xc0(%r13), %eax
movq 0x70(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
imull %r14d, %eax
notl %eax
movslq %eax, %rcx
callq 0xadcae
movb $0x1, %al
movq %rax, 0x58(%rsp)
pushq $0x1
popq %rax
fldt 0xc0(%rsp)
fldt 0x4c(%rsp)
movl %eax, %ebx
movb (%r15), %al
testb $0x1, %al
jne 0x2b1149
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0x2b1149
fstpt 0x20(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x178(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %rbp, %rcx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x7c(%rsp)
fstpt (%rsp)
callq 0x2b1458
testl %eax, %eax
je 0x2b1152
vcvtsi2sd %r12d, %xmm2, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0x2b1129
movl %eax, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x1f0(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x7c(%rsp)
faddp %st, %st(1)
fldt 0x4c(%rsp)
jmp 0x2b1133
fldt 0x4c(%rsp)
fldt 0x7c(%rsp)
fxch %st(1)
fldt 0xe4(%rsp)
fxch %st(2)
fucomi %st(2), %st
fstp %st(2)
ja 0x2b1149
incl %ebx
jmp 0x2b1075
fstp %st(1)
leaq 0x60(%rsp), %rbx
jmp 0x2b119f
vmovsd 0x90(%rsp), %xmm0
movq 0x88(%rsp), %rdi
leaq 0x60(%rsp), %r12
movq %r12, %rsi
callq 0x9706e
movl 0xc0(%r13), %eax
movq 0x70(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
imull 0x78(%rsp), %eax
subl %ebx, %eax
movq %r12, %rbx
movslq %eax, %rcx
callq 0xadcae
movb $0x1, %al
movq %rax, 0x58(%rsp)
fldt 0x4c(%rsp)
decl 0x78(%rsp)
incl %r14d
jmp 0x2b0fca
fstp %st(0)
jmp 0x2b0e14
fstp %st(0)
movq 0xb0(%r13), %r8
movq 0x70(%rsp), %rdi
leaq 0x60(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0xadd36
jmp 0x2b0e0b
leaq 0x140(%rsp), %rdi
callq 0x393ac
leaq 0x178(%rsp), %rdi
callq 0x2b192c
leaq 0x120(%rsp), %rdi
callq 0x968b6
leaq 0x68(%rsp), %rdi
callq 0x357fe
addq $0x1f8, %rsp # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2b121e
movq %rax, %rbx
jmp 0x2b1240
movq %rax, %rbx
jmp 0x2b124d
movq %rax, %rbx
jmp 0x2b125a
jmp 0x2b1230
jmp 0x2b1230
jmp 0x2b1230
jmp 0x2b1230
leaq 0x140(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0x178(%rsp), %rdi
callq 0x2b192c
leaq 0x120(%rsp), %rdi
callq 0x968b6
leaq 0x68(%rsp), %rdi
callq 0x357fe
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::decrease_preference(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, long double) | void decrease_preference(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
Float theta) noexcept
{
for (; begin != end; ++begin)
P[begin->value] *= theta;
} | fldt 0x8(%rsp)
movq 0x50(%rdi), %rax
cmpq %rdx, %rsi
je 0x2b218a
movslq (%rsi), %rcx
addq $0x8, %rsi
shlq $0x4, %rcx
fldt (%rax,%rcx)
fmul %st(1), %st
fstpt (%rax,%rcx)
jmp 0x2b2170
fstp %st(0)
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<long double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp # imm = 0x438
vmovsd %xmm0, 0x88(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x60(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x70(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x108(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x98bf0
fldl 0x20(%r12)
fstpt 0xc8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xd4(%rsp)
fldl 0x30(%r12)
fstpt 0xbc(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x54(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x2b626a
movq 0x10(%r14), %rdi
leaq 0x108(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x98cca
fstpt 0xa0(%rsp)
jmp 0x2b6283
fstp %st(0)
vmovsd %xmm0, 0xe8(%rsp)
fldl 0xe8(%rsp)
fstpt 0xa0(%rsp)
fldl 0x38(%r12)
fstpt 0xfc(%rsp)
fldl 0x40(%r12)
fstpt 0xf0(%rsp)
vcvttsd2si 0xa0(%r12), %rax
movq 0x18(%r14), %rsi
movq %rax, 0x90(%rsp)
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x160(%rsp), %rdi
leaq 0x108(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2b126c
movl 0xcc(%r12), %esi
leaq 0x128(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x9c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x1e0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x2b6365
cmpl $0x1, %eax
je 0x2b633f
cmpl $0x2, %eax
jne 0x2b6376
movq 0x18(%r14), %rdx
leaq 0x1e0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
jmp 0x2b6350
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
vmovsd 0x19dce0(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0xab9ee
jmp 0x2b6376
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0xab979
leaq 0x70(%rsp), %r15
movq %r13, 0x80(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x2b63af
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x48(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2b63ab
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2b6388
leaq 0x1e8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x1d8(%rsp), %ecx
movl 0x1dc(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x48(%rsp)
leaq 0x1a4190(%rip), %rdx # 0x45a577
leaq 0x1e0(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x2b1416
vmovsd 0x48(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x70(%rsp), %r13
xorl %r15d, %r15d
vmovsd %xmm0, 0xe0(%rsp)
fldl 0xe0(%rsp)
fldt 0x54(%rsp)
cmpq 0xb0(%r12), %r15
je 0x2b6558
movq 0x18(%r14), %rcx
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
movq %r13, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x2b1458
movq 0x1b0(%rsp), %rdx
movq 0x1c8(%rsp), %rcx
movl %eax, %ebx
leaq 0x1e0(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x95692
testl %ebx, %ebx
je 0x2b660c
cmpl %ebp, %ebx
jge 0x2b64d0
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x2b70ce
movl %ebx, %ebp
cmpq 0x90(%rsp), %r15
jle 0x2b6521
movl %ebx, 0xb4(%rsp)
fildl 0xb4(%rsp)
movl 0x1d8(%rsp), %eax
movl %eax, 0xb8(%rsp)
fidivl 0xb8(%rsp)
fldt 0xbc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xc8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x2b6525
fldt 0x48(%rsp)
fldt 0xd4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x2b6558
fstp %st(0)
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x2b7106
fldt 0x48(%rsp)
fldt 0x54(%rsp)
testb %al, %al
jne 0x2b6558
incq %r15
jmp 0x2b6449
fstp %st(0)
fstp %st(0)
movq 0x60(%rsp), %rax
movl $0x5, 0xa0(%rax)
fldz
fldz
fstp %st(1)
fstp %st(0)
cmpl $0x0, 0x50(%r14)
jne 0x2b6586
movq 0x60(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2b65b7
movq 0x60(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x9c(%rsp), %edx
movq %r14, %rdi
callq 0x4f485
leaq 0x1e0(%rsp), %rdi
callq 0x435d0
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x2b192c
leaq 0x108(%rsp), %rdi
callq 0x968b6
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rax
addq $0x438, %rsp # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
leaq 0x70(%rsp), %rbx
movq %rbx, %rsi
callq 0x9706e
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2b7080
movl $0x0, 0x6c(%rsp)
leaq 0x160(%rsp), %r15
leaq 0x70(%rsp), %rbp
xorl %ebx, %ebx
fldt 0x54(%rsp)
fldt 0x48(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2b656f
movq 0x18(%r14), %rcx
fldt 0xfc(%rsp)
fld %st(1)
fstpt 0x48(%rsp)
fmulp %st, %st(1)
fldt 0xf0(%rsp)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x2b1688
testl %eax, %eax
jne 0x2b66e2
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2b7080
movq %r14, %rdi
callq 0x2b7106
fldt 0x54(%rsp)
fldt 0x48(%rsp)
testb %al, %al
jne 0x2b656f
movl %ebx, 0x90(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2b682b
movq 0x18(%r14), %rcx
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x2b1458
testl %eax, %eax
je 0x2b67db
vcvtsi2sd %r13d, %xmm1, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2b67a9
movl %eax, 0xac(%rsp)
fildl 0xac(%rsp)
movl 0x1d8(%rsp), %eax
movl %eax, 0xb0(%rsp)
fidivl 0xb0(%rsp)
fldt 0xbc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xc8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x2b67ad
fldt 0x48(%rsp)
fldt 0xd4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x2b681b
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x2b7106
testb %al, %al
jne 0x2b6823
fldt 0x54(%rsp)
fldt 0x48(%rsp)
incl %ebx
jmp 0x2b6706
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull 0x6c(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2b7080
fldt 0x54(%rsp)
fldt 0x48(%rsp)
jmp 0x2b682b
fldt 0x54(%rsp)
fxch %st(1)
jmp 0x2b682b
fldt 0x54(%rsp)
fldt 0x48(%rsp)
movl 0x90(%rsp), %ebx
decl 0x6c(%rsp)
incl %ebx
jmp 0x2b6657
jmp 0x2b6878
jmp 0x2b6851
fstp %st(1)
fstp %st(0)
jmp 0x2b6878
movq %rax, %rbx
jmp 0x2b6888
movq %rax, %rbx
jmp 0x2b6895
movq %rax, %rbx
jmp 0x2b68a2
movq %rax, %rbx
jmp 0x2b68af
movq %rax, %rbx
jmp 0x2b68b9
jmp 0x2b6878
jmp 0x2b6878
jmp 0x2b6878
leaq 0x1e8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x2b6888
leaq 0x1e0(%rsp), %rdi
movq %rax, %rbx
callq 0x435d0
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x2b192c
leaq 0x108(%rsp), %rdi
callq 0x968b6
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
bool baryonyx::itm::affect<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, float>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_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 0x78(%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 0x2cffbb
leal 0x1(%r8), %ecx
cmpl %r9d, %ecx
jge 0x2d004d
movq 0x68(%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 0x189ba4(%rip), %xmm2, %xmm2 # 0x459ad0
vaddss 0x20(%rsp), %xmm2, %xmm2
vmovss %xmm2, (%rax,%rcx,4)
vmovss 0x189b85(%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 0x2d00e7
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq 0x8(%rax,%r13), %r12
cmpl $0x0, 0x4(%rax,%r13)
movl 0x4(%r15,%r12,8), %esi
js 0x2cff98
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
vmovss 0x4(%rsp), %xmm0
vaddss (%rcx,%rax,4), %xmm0, %xmm0
jmp 0x2cffb0
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 0x2cff5c
vmovss 0x189b01(%rip), %xmm2 # 0x459ac4
movq 0x68(%rbx), %rax
xorl %ebp, %ebp
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rax), %xmm2
movl %r9d, %eax
imulq $0xc, %rax, %r12
vmulss 0x189aec(%rip), %xmm2, %xmm2 # 0x459ad0
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0x4(%rsp)
cmpq %rbp, %r12
je 0x2d014f
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq 0x8(%rax,%rbp), %r13
cmpl $0x0, 0x4(%rax,%rbp)
movl 0x4(%r15,%r13,8), %esi
js 0x2d002a
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovss (%rcx,%rax,4), %xmm0
vsubss 0x4(%rsp), %xmm0, %xmm0
jmp 0x2d0042
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 0x2cffef
vmovss 0x189a6f(%rip), %xmm2 # 0x459ac4
movq 0x68(%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 0x18bc4a(%rip), %xmm2, %xmm2 # 0x45bcc8
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0x4(%rsp)
cmpq %rbp, %r12
je 0x2d014f
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq 0x8(%rax,%rbp), %r13
cmpl $0x0, 0x4(%rax,%rbp)
movl 0x4(%r15,%r13,8), %esi
js 0x2d00c4
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovss 0x4(%rsp), %xmm0
vaddss (%rcx,%rax,4), %xmm0, %xmm0
jmp 0x2d00dc
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 0x2d0089
movl 0x8(%rsp), %r12d
addq $0x8, %rbp
subq 0x18(%rsp), %r12
subq $0x1, %r12
jb 0x2d014f
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq (%rax,%rbp), %r13
cmpl $0x0, -0x4(%rax,%rbp)
movl 0x4(%r15,%r13,8), %esi
js 0x2d012c
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovss (%rcx,%rax,4), %xmm0
vsubss 0x4(%rsp), %xmm0, %xmm0
jmp 0x2d0144
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 0x2d00f5
movl 0xc(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2cf68e
testb %al, %al
je 0x2d018d
vmovaps 0x20(%rsp), %xmm0
movq 0x78(%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 0x18804a(%rip), %rdi # 0x4581de
leaq 0x18c181(%rip), %rsi # 0x45c31c
leaq 0x189dea(%rip), %rdx # 0x459f8c
leaq 0x18c192(%rip), %rcx # 0x45c33b
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::rc_data*>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::rc_data*, baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_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 0x2d01e9
vmovss (%rdi), %xmm0
leaq 0xc(%rsi), %r15
vucomiss (%rsi), %xmm0
movq %r15, %rsi
jne 0x2d01d5
jnp 0x2d01bd
addq $-0xc, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2d077f
movq %r15, %rdi
jmp 0x2d01b9
movq %rbx, %rdx
callq 0x2d077f
popq %rbx
popq %r14
popq %r15
retq
jmp 0x2d01f9
movq %rax, %rdi
callq 0xeb9f
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, float, float, float, float) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float 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);
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);
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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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
leaq 0x10(%rdi), %rax
vmovss %xmm3, 0x1c(%rsp)
vmovss %xmm2, 0x18(%rsp)
vmovss %xmm1, 0x14(%rsp)
vmovss %xmm0, 0x10(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movq %rax, 0x30(%rsp)
xorl %eax, %eax
cmpq 0x38(%rsp), %r14
je 0x2d209c
movslq (%r14), %rbp
cmpl 0x88(%r13), %ebp
jge 0x2d20ad
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebp, %edx
movq %rax, 0x40(%rsp)
callq 0x3de66
vmovss 0x18(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r13, %rdi
callq 0x2cfc94
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0x2cfcb2
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
xorl %r15d, %r15d
movl %eax, %ecx
cmpq %rcx, %r15
je 0x2d2031
movq 0x68(%r13), %rax
movq 0x28(%rsp), %rcx
movq 0x80(%r13), %rdi
movq %r12, %rdx
movslq 0x8(%rax,%rbx), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x49ffa
movq 0x68(%r13), %rax
vmovss 0x1c(%rsp), %xmm1
incq %r15
vfmadd213ss (%rax,%rbx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rax,%rbx)
addq $0xc, %rbx
movl 0x8(%rsp), %eax
jmp 0x2d1fe7
movq 0x68(%r13), %rdi
cltq
movq 0x8(%r13), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2cfe0b
movq 0x70(%r13), %rax
imulq $0xc, %rbp, %rcx
leaq 0x8(%rsp), %rsi
movq %r13, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2cfe3e
vmovss 0x10(%rsp), %xmm0
vmovss 0x14(%rsp), %xmm1
movl 0x8(%rsp), %r9d
movq 0x28(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %eax, %r8d
callq 0x2cfeaf
movq 0x40(%rsp), %rcx
addq $0x8, %r14
orb %al, %cl
movq %rcx, %rax
jmp 0x2d1f7f
andb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18612a(%rip), %rdi # 0x4581de
leaq 0x1883bf(%rip), %rsi # 0x45a47a
leaq 0x1915d6(%rip), %rdx # 0x463698
leaq 0x19167e(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_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::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_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 $0x3c8, %rsp # imm = 0x3C8
vmovsd %xmm0, 0x60(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x30(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x46c07
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, 0x50(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0x2d3626
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x1c(%rsp)
jmp 0x2d3630
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x1c(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x78(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x70(%rsp)
vmovsd %xmm1, 0x68(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xe0(%rsp), %rdi
leaq 0x88(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2cecc8
movl 0xcc(%r12), %esi
leaq 0xa8(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x84(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x10(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x170(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x2d3711
cmpl $0x1, %eax
je 0x2d36eb
cmpl $0x2, %eax
jne 0x2d3722
movq 0x18(%r14), %rdx
leaq 0x170(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0x2d36fc
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x170(%rsp), %rsi
vmovsd 0x180934(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x44e5a
jmp 0x2d3722
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x44de5
vcvtsd2ss 0x50(%rsp), %xmm3, %xmm0
leaq 0x30(%rsp), %r15
movq %r13, 0x58(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
vmovss %xmm0, 0x2c(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x50(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x70(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x70(%rsp)
vcvtsd2ss 0x68(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
cmpl %ebx, %ebp
je 0x2d3794
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2d3790
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2d376d
leaq 0x178(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x168(%rsp), %ecx
movl 0x16c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x10(%rsp)
leaq 0x186dab(%rip), %rdx # 0x45a577
leaq 0x170(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x42b5a
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x2cef5e
vcvtsd2ss 0x10(%rsp), %xmm3, %xmm0
vmovss 0xc(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x30(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x2d3905
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2cefa0
movq 0x130(%rsp), %rdx
movq 0x158(%rsp), %rcx
movl %eax, %ebx
leaq 0x170(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x42bbe
testl %ebx, %ebx
je 0x2d39ad
cmpl %ebp, %ebx
jge 0x2d389b
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x2d49c4
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0x2d38d1
vcvtsi2ss %ebx, %xmm3, %xmm0
vcvtsi2ssl 0x168(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0x2d38d7
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2d3905
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2d49fc
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0x2d3905
incq %r15
jmp 0x2d3820
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2d3927
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2d3958
movq 0x20(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x84(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x170(%rsp), %rdi
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x2cf400
leaq 0x88(%rsp), %rdi
callq 0x4495c
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rax
addq $0x3c8, %rsp # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x45118
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2d497a
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
leaq 0xe0(%rsp), %r15
leaq 0x30(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2d3914
vmovss %xmm0, 0x10(%rsp)
vmulss 0x70(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
vmovss 0x68(%rsp), %xmm3
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2cf1ac
testl %eax, %eax
jne 0x2d3a65
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x45118
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2d497a
movq %r14, %rdi
callq 0x2d49fc
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0x2d3914
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2d3b8c
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2cefa0
testl %eax, %eax
je 0x2d3b42
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2d3b09
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x168(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0x2d3b15
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2d3b8c
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2d49fc
testb %al, %al
jne 0x2d3b80
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0x2d3a8a
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x45118
movl 0xc0(%r12), %eax
imull 0x40(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2d497a
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0x2d3b8c
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0x2d39f6
jmp 0x2d3bd2
jmp 0x2d3bab
jmp 0x2d3bd2
movq %rax, %r14
jmp 0x2d3be2
movq %rax, %r14
jmp 0x2d3bef
movq %rax, %r14
jmp 0x2d3bfc
movq %rax, %r14
jmp 0x2d3c09
movq %rax, %r14
jmp 0x2d3c13
jmp 0x2d3bd2
jmp 0x2d3bd2
jmp 0x2d3bd2
leaq 0x178(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2d3be2
leaq 0x170(%rsp), %rdi
movq %rax, %r14
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x2cf400
leaq 0x88(%rsp), %rdi
callq 0x4495c
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_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::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 0x2d49c2
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2d4a3c
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_inequalities_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::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 0x18505b(%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_inequalities_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::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 0x2d4aa4
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2d4b1e
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_inequalities_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::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 0x184f79(%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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_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 $0x188, %rsp # imm = 0x188
vxorpd %xmm0, %xmm0, %xmm0
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
cmpq $0x0, 0x128(%rsi)
je 0x2d4c85
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 0x2d4de1
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x2d4de1
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0x60(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x353d2
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x70(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0x4f322
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x70(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x98(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0x2d4e3c
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2d5f0a
movl 0x8(%rsp), %eax
incl %eax
jmp 0x2d4db8
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 0x2d51d1
movq %r13, 0x90(%rsp)
movq %r15, %r13
leaq 0x8(%rsp), %r15
leaq 0xa8(%rsp), %r14
leaq 0x4(%rsp), %rbx
xorl %r12d, %r12d
cmpq %rbp, %r12
je 0x2d4efd
imulq $0xc0, %r12, %rax
addq 0x70(%rsp), %rax
leaq 0x3(%rsp), %r10
leaq 0xc8(%rsp), %r11
movq %r10, 0x20(%rsp)
leaq 0x48(%rsp), %r10
movq %r11, 0x18(%rsp)
movq %r10, 0xa8(%rsp)
movq %rax, 0x28(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x20(%rsp), %rdx
leaq 0x38(%rsp), %rax
movq %r15, %rdi
leaq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rcx
movq %r14, %r8
movq %rbx, %r9
pushq %rax
leaq 0xa8(%rsp), %rax
pushq %rax
callq 0x2d5f56
popq %rax
popq %rcx
leaq (,%r12,8), %rdi
addq 0xb0(%rsp), %rdi
movq %r15, %rsi
callq 0x356d6
movq %r15, %rdi
callq 0x356f0
incq %r12
jmp 0x2d4e5c
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 0x2d4f92
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x2d4f53
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x2d4f3d
leaq 0xd0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x56bc2
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 0x184acb(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x2d4f18
vucomisd %xmm0, %xmm1
jbe 0x2d4f18
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x2d4ff3
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x2d4fe0
movq 0x90(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x31d28
addq $0xc0, %rbx
leaq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x352c2
leaq 0x50(%r12), %rdi
movq 0x98(%rsp), %rsi
callq 0x352ec
movl 0x4(%rsp), %eax
movl %eax, 0x90(%r12)
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
pushq $0x28
popq %rcx
cqto
xorl %esi, %esi
idivq %rcx
movq 0x108(%rsp), %rdi
movq 0x120(%rsp), %rcx
movl %eax, 0x94(%r12)
movslq (%rdi), %rax
imulq $0x38, %rax, %rax
movl 0x30(%rcx,%rax), %edx
leaq (%rcx,%rax), %rbx
testl %edx, %edx
setne %sil
leal (%rsi,%rsi,2), %esi
movl %esi, 0xa0(%r12)
vmovsd 0x18(%rcx,%rax), %xmm0
vmovsd %xmm0, 0x80(%r12)
movq 0x28(%rcx,%rax), %rax
movq %rax, 0x88(%r12)
movl %edx, 0x98(%r12)
movl 0xe8(%r13), %eax
testl %eax, %eax
je 0x2d514e
cmpl $0x1, %eax
je 0x2d5116
cmpl $0x2, %eax
jne 0x2d516d
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x2d516d
movq 0x108(%rsp), %rax
movq (%rbx), %rsi
movl 0x4(%rsp), %edx
movslq (%rax,%r15,4), %rax
addq %r14, %rsi
imulq $0x38, %rax, %rdi
addq 0x120(%rsp), %rdi
callq 0x4f485
incq %r15
addq $0x20, %r14
jmp 0x2d50dc
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4f485
leaq 0xd0(%rsp), %rdi
callq 0x56c40
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x2d5161
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x4f485
leaq 0xc8(%rsp), %rdi
movq %r13, %rsi
callq 0x4f4da
cmpq $0x0, 0x168(%r13)
je 0x2d5199
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0x4f4ee
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x2db776
leaq 0x68(%rsp), %rdi
callq 0x35c1a
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x188, %rsp # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2d5232
movq %rax, %rbx
jmp 0x2d523f
movq %rax, %rbx
jmp 0x2d524c
jmp 0x2d5216
jmp 0x2d5207
jmp 0x2d5225
jmp 0x2d5225
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x2d526a
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x2d5260
jmp 0x2d5225
jmp 0x2d5225
jmp 0x2d5225
jmp 0x2d5225
jmp 0x2d5225
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0x4f4ee
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x2db776
leaq 0x68(%rsp), %rdi
callq 0x35c1a
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_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 $0x130, %rsp # imm = 0x130
cmpq $0x0, 0x128(%rsi)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
je 0x2d5c23
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 0x2d5d4c
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0x2d5d4c
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 0x353d2
vmovsd 0x40(%r15), %xmm0
movl 0xe4(%r14), %eax
vxorps %xmm1, %xmm1, %xmm1
leaq 0x30(%rsp), %rsi
cmpl $0x1, %eax
je 0x2d5d73
cmpl $0x2, %eax
jne 0x2d5dc2
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2e26a8
jmp 0x2d5e0f
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 0x2d5e3e
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2e1fc4
jmp 0x2d5e0f
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2e2d8c
leaq 0x88(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x41d9e
movq %r13, %rdi
callq 0xea60
leaq 0x58(%rsp), %rdi
callq 0x357fe
leaq 0x28(%rsp), %rdi
callq 0x35c1a
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 0x2d5eaa
addq $0x158, %r14 # imm = 0x158
movq %r14, %rdi
movq %rbx, %rsi
callq 0x357ea
leaq 0x8(%rsp), %rdi
callq 0x35858
movq %rbx, %rax
addq $0x130, %rsp # imm = 0x130
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x2d5ecc
jmp 0x2d5ecc
leaq 0x58(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x28(%rsp), %rdi
callq 0x35c1a
jmp 0x2d5eef
jmp 0x2d5eec
movq %rax, %r14
jmp 0x2d5ef9
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_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 0x2d6b0e
movq %rax, %rdi
jmp 0x2d70a8
cmpl $0x7, %ecx
jne 0x2d6b2b
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0x2d6b39
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0x2d6b1c
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0x2d71c3
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::file_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 $0x3b8, %rsp # imm = 0x3B8
vmovsd %xmm0, 0x60(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x30(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x88(%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, 0x50(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0x2dbf66
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x38a37
vmovss %xmm0, 0x1c(%rsp)
jmp 0x2dbf70
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x1c(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x78(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x70(%rsp)
vmovsd %xmm1, 0x68(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd0(%rsp), %rdi
leaq 0x88(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2d6834
movl 0xcc(%r12), %esi
leaq 0x98(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x84(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x10(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x160(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x2dc051
cmpl $0x1, %eax
je 0x2dc02b
cmpl $0x2, %eax
jne 0x2dc062
movq 0x18(%r14), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0x2dc03c
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x160(%rsp), %rsi
vmovsd 0x177ff4(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x4f9c9
jmp 0x2dc062
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x4f95d
vcvtsd2ss 0x50(%rsp), %xmm3, %xmm0
leaq 0x30(%rsp), %r15
movq %r13, 0x58(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
vmovss %xmm0, 0x2c(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x50(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x70(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x70(%rsp)
vcvtsd2ss 0x68(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
cmpl %ebx, %ebp
je 0x2dc0d4
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2dc0d0
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2dc0ad
leaq 0x168(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x158(%rsp), %ecx
movl 0x15c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x10(%rsp)
leaq 0x17e46b(%rip), %rdx # 0x45a577
leaq 0x160(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x2d6af8
vcvtsd2ss 0x10(%rsp), %xmm3, %xmm0
vmovss 0xc(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x30(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x2dc245
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2d6b3a
movq 0x120(%rsp), %rdx
movq 0x148(%rsp), %rcx
movl %eax, %ebx
leaq 0x160(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x434d2
testl %ebx, %ebx
je 0x2dc2ed
cmpl %ebp, %ebx
jge 0x2dc1db
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x2dcd0a
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0x2dc211
vcvtsi2ss %ebx, %xmm3, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0x2dc217
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2dc245
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2dcd42
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0x2dc245
incq %r15
jmp 0x2dc160
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2dc267
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2dc298
movq 0x20(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x84(%rsp), %edx
movq %r14, %rdi
callq 0x4f485
leaq 0x160(%rsp), %rdi
callq 0x435d0
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2d6f9a
leaq 0x90(%rsp), %rdi
callq 0x35c1a
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rax
addq $0x3b8, %rsp # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x365d4
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2dccbc
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
leaq 0xd0(%rsp), %r15
leaq 0x30(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2dc254
vmovss %xmm0, 0x10(%rsp)
vmulss 0x70(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
vmovss 0x68(%rsp), %xmm3
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2d6d46
testl %eax, %eax
jne 0x2dc3a5
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%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 0x2dccbc
movq %r14, %rdi
callq 0x2dcd42
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0x2dc254
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2dc4cc
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2d6b3a
testl %eax, %eax
je 0x2dc482
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2dc449
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0x2dc455
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2dc4cc
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2dcd42
testb %al, %al
jne 0x2dc4c0
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0x2dc3ca
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x365d4
movl 0xc0(%r12), %eax
imull 0x40(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2dccbc
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0x2dc4cc
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0x2dc336
jmp 0x2dc512
jmp 0x2dc4eb
jmp 0x2dc512
movq %rax, %r14
jmp 0x2dc522
movq %rax, %r14
jmp 0x2dc52f
movq %rax, %r14
jmp 0x2dc53c
movq %rax, %r14
jmp 0x2dc549
movq %rax, %r14
jmp 0x2dc553
jmp 0x2dc512
jmp 0x2dc512
jmp 0x2dc512
leaq 0x168(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2dc522
leaq 0x160(%rsp), %rdi
movq %rax, %r14
callq 0x435d0
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2d6f9a
leaq 0x90(%rsp), %rdi
callq 0x35c1a
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_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 0x90(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x38959
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x40(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0x4(%rsp)
jbe 0x2dc64a
movq 0x10(%r14), %rdi
leaq 0x90(%rsp), %rsi
movl %ebx, %edx
callq 0x38a37
vmovss %xmm0, 0x14(%rsp)
jmp 0x2dc654
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x14(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x70(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x68(%rsp)
vmovsd %xmm1, 0x60(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd8(%rsp), %rdi
leaq 0x90(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2d6834
movl 0xcc(%r12), %esi
leaq 0xa0(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x7c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x80(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x2dc732
cmpl $0x1, %eax
je 0x2dc70c
cmpl $0x2, %eax
jne 0x2dc743
movq 0x18(%r14), %rdx
leaq 0x80(%rsp), %rdi
leaq 0x28(%rsp), %rsi
jmp 0x2dc71d
movq 0x18(%r14), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x80(%rsp), %rsi
vmovsd 0x177913(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x4f9c9
jmp 0x2dc743
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x4f95d
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 0x2dc7b5
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2dc7b1
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2dc78e
leaq 0x88(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, 0x8(%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x2d6af8
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 0x2dc8d8
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0x2d6b3a
movl %eax, %r13d
testl %eax, %eax
je 0x2dc970
cmpl %ebp, %r13d
jge 0x2dc86d
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0x2dcdf0
movl %r13d, %ebp
cmpq 0x70(%rsp), %r15
jle 0x2dc8a4
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 0x2dc8aa
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x2dc8d8
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0x2dce28
vmovss 0x8(%rsp), %xmm0
vmovss 0x4(%rsp), %xmm2
testb %al, %al
jne 0x2dc8d8
incq %r15
jmp 0x2dc813
movq 0x18(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2dc8fa
movq 0x18(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2dc928
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 0x4f485
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2d6f9a
leaq 0x98(%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 0x2dcda2
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
leaq 0xd8(%rsp), %r15
leaq 0x28(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x38(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2dc8e7
vmovss %xmm0, 0x8(%rsp)
vmulss 0x68(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
vmovss 0x60(%rsp), %xmm3
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2d6d46
testl %eax, %eax
jne 0x2dca28
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 0x2dcda2
movq %r14, %rdi
callq 0x2dce28
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
testb %al, %al
jne 0x2dc8e7
movl %ebx, 0x70(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2dcb4f
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0x2d6b3a
testl %eax, %eax
je 0x2dcb05
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2dcacc
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 0x2dcad8
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x2dcb4f
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0x2dce28
testb %al, %al
jne 0x2dcb43
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
incl %ebx
jmp 0x2dca4d
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 0x2dcda2
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
jmp 0x2dcb4f
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
movl 0x70(%rsp), %ebx
decl 0x38(%rsp)
incl %ebx
jmp 0x2dc9b9
jmp 0x2dcb90
jmp 0x2dcb69
jmp 0x2dcb90
movq %rax, %r14
jmp 0x2dcba0
movq %rax, %r14
jmp 0x2dcbad
movq %rax, %r14
jmp 0x2dcbba
movq %rax, %r14
jmp 0x2dcbc4
jmp 0x2dcb90
jmp 0x2dcb90
jmp 0x2dcb90
leaq 0x88(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2dcb93
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2d6f9a
leaq 0x98(%rsp), %rdi
callq 0x35c1a
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_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 0x2dcd08
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2dcd82
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_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 0x17cd15(%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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_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 0x2dcdee
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2dce68
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_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 0x17cc2f(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_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 0x2dda5e
movq %rax, %rdi
jmp 0x2ddff2
cmpl $0x7, %ecx
jne 0x2dda7b
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0x2dda89
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0x2dda6c
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0x2de10d
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array, float>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>&, 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 0x2ddbc9
leaq 0x185767(%rip), %rdx # 0x463218
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 0x2de214
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2de10d
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 0x2dfcfc
jmp 0x2ddbfe
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x2df426
jmp 0x2ddb5a
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x2df891
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 0x2de420
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2de520
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 0x2de320
jmp 0x2ddc22
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x2e01ee
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 0x2de63c
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2de10d
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 0x2de320
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2de73c
nop
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array, float>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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 0x2ddcc2
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 0x2dde5b
leaq 0x185560(%rip), %rdx # 0x463234
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 0x2e06e4
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2de10d
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 0x2e15b3
jmp 0x2dde44
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x2e0cdd
jmp 0x2ddd8c
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x2e1148
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 0x2e09e6
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2de520
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 0x2e086a
jmp 0x2dde6d
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 0x2e1aa5
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 0x2e0b62
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2de10d
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 0x2e086a
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2de73c
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false> const, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false> const&, baryonyx::bit_array const&) | int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x2de016
movq %rax, 0x20(%rdi)
movq 0x20(%rsp), %rsi
leaq 0x18(%rdi), %rax
movq %rdi, 0x28(%rsp)
xorl %ebx, %ebx
movq %rax, 0x18(%rsp)
movl 0x88(%rsi), %ecx
leaq 0x10(%rsi), %rdx
leaq 0x58(%rsi), %rbp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
cmpq 0x38(%rsp), %rbx
je 0x2de0ed
movq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebx, %edx
movq %rbx, 0x40(%rsp)
callq 0x3c868
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbx
xorl %r13d, %r13d
cmpq %r15, %rbx
je 0x2de09b
movl (%rbx), %esi
movq %rbp, %rdi
callq 0x2b9c1a
movl 0x4(%rbx), %esi
movq %r14, %rdi
movl %eax, %r12d
callq 0x3664a
imull %r12d, %eax
addq $0x8, %rbx
addl %eax, %r13d
jmp 0x2de071
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rbx
movq 0x70(%rax), %rcx
imulq $0xc, %rbx, %rdx
movl (%rcx,%rdx), %eax
subl %r13d, %eax
jle 0x2de0c3
shlq $0x20, %rax
orq %rbx, %rax
movq %rax, 0x8(%rsp)
jmp 0x2de0d6
subl 0x4(%rcx,%rdx), %r13d
jle 0x2de0e5
shlq $0x20, %r13
orq %rbx, %r13
movq %r13, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbx
jmp 0x2de043
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x48, %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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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 0x2de12b
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x88(%r15), %esi
je 0x2de161
movq %r15, %rdi
movq %r14, %rdx
callq 0x2de178
testb %al, %al
jne 0x2de159
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0x2de132
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_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 $0x28, %rsp
movq %rdx, %r14
movl %esi, %edx
leaq 0x10(%rdi), %rsi
leaq 0x18(%rsp), %r15
movq %rdi, %r12
movl %edx, 0xc(%rsp)
movq %r15, %rdi
callq 0x3c868
movq (%r15), %rbp
movq 0x8(%r15), %rbx
leaq 0x58(%r12), %r15
xorl %r13d, %r13d
movq %r12, 0x10(%rsp)
cmpq %rbp, %rbx
je 0x2de1e1
movl (%rbx), %esi
movq %r15, %rdi
callq 0x2b9c1a
movl 0x4(%rbx), %esi
movq %r14, %rdi
movl %eax, %r12d
callq 0x3664a
imull %r12d, %eax
addq $0x8, %rbx
addl %eax, %r13d
jmp 0x2de1b7
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq 0x70(%rax), %rax
imulq $0xc, %rcx, %rcx
cmpl %r13d, (%rax,%rcx)
jle 0x2de1fd
xorl %eax, %eax
jmp 0x2de205
cmpl 0x4(%rax,%rcx), %r13d
setle %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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);
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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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
movq (%rdx), %rax
leaq 0x10(%rdi), %r13
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 0x30(%rsp), %rcx
cmpq (%rcx), %rax
je 0x2de30b
movslq -0x4(%rax), %rbx
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x2de77e
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2de79c
movq %rax, 0x18(%rsp)
cltq
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2de8d9
movq 0x70(%r12), %rax
imulq $0xc, %rbx, %rcx
leaq 0x18(%rsp), %rsi
movq %r12, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2de90c
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movl 0x18(%rsp), %r9d
movq 0x28(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
callq 0x2de97d
orb %al, %bpl
movq (%r14), %rax
addq $-0x4, %rax
movq %rax, (%r14)
jmp 0x2de24b
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-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, float, float, float) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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), %r13
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
cmpq 0x30(%rsp), %r14
je 0x2de40a
movslq (%r14), %rbx
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x2de77e
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2de79c
movq %rax, 0x18(%rsp)
cltq
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2de8d9
movq 0x70(%r12), %rax
imulq $0xc, %rbx, %rcx
leaq 0x18(%rsp), %rsi
movq %r12, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2de90c
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movl 0x18(%rsp), %r9d
movq 0x28(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
callq 0x2de97d
orb %al, %bpl
addq $0x4, %r14
jmp 0x2de354
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-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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);
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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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), %r13
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
cmpq 0x30(%rsp), %r14
je 0x2de50a
movslq (%r14), %rbx
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x2de77e
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2de79c
movq %rax, 0x18(%rsp)
cltq
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2de8d9
movq 0x70(%r12), %rax
imulq $0xc, %rbx, %rcx
leaq 0x18(%rsp), %rsi
movq %r12, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2de90c
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movl 0x18(%rsp), %r9d
movq 0x28(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
callq 0x2de97d
orb %al, %bpl
addq $0x8, %r14
jmp 0x2de454
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-inequalities-101.cpp |
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>&, baryonyx::bit_array const&) | int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x2de544
movq %rax, 0x20(%rdi)
movq 0x20(%rsp), %rsi
leaq 0x18(%rdi), %rax
movq %rdi, 0x28(%rsp)
xorl %ebx, %ebx
movq %rax, 0x18(%rsp)
movl 0x88(%rsi), %ecx
leaq 0x10(%rsi), %rdx
leaq 0x58(%rsi), %rbp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
cmpq 0x38(%rsp), %rbx
je 0x2de61b
movq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebx, %edx
movq %rbx, 0x40(%rsp)
callq 0x3de66
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbx
xorl %r13d, %r13d
cmpq %r15, %rbx
je 0x2de5c9
movl (%rbx), %esi
movq %rbp, %rdi
callq 0x2b9c1a
movl 0x4(%rbx), %esi
movq %r14, %rdi
movl %eax, %r12d
callq 0x3664a
imull %r12d, %eax
addq $0x8, %rbx
addl %eax, %r13d
jmp 0x2de59f
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rbx
movq 0x70(%rax), %rcx
imulq $0xc, %rbx, %rdx
movl (%rcx,%rdx), %eax
subl %r13d, %eax
jle 0x2de5f1
shlq $0x20, %rax
orq %rbx, %rax
movq %rax, 0x8(%rsp)
jmp 0x2de604
subl 0x4(%rcx,%rdx), %r13d
jle 0x2de613
shlq $0x20, %r13
orq %rbx, %r13
movq %r13, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbx
jmp 0x2de571
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x48, %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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, float, float, float) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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), %r13
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
cmpq 0x30(%rsp), %r14
je 0x2de726
movslq (%r14), %rbx
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x2de77e
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2de79c
movq %rax, 0x18(%rsp)
cltq
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2de8d9
movq 0x70(%r12), %rax
imulq $0xc, %rbx, %rcx
leaq 0x18(%rsp), %rsi
movq %r12, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2de90c
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movl 0x18(%rsp), %r9d
movq 0x28(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
callq 0x2de97d
orb %al, %bpl
addq $0x4, %r14
jmp 0x2de670
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-inequalities-101.cpp |
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false> const&, baryonyx::bit_array const&) | int local_compute_violated_constraints(const Solver& slv, const Xtype& x)
{
int remaining = 0;
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
++remaining;
return remaining;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl 0x88(%r14), %r15d
je 0x2de771
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x2de178
xorb $0x1, %al
incl %r15d
movzbl %al, %eax
addl %eax, %ebp
jmp 0x2de74e
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::rc_data*>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::rc_data*, baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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 0x2decb7
vmovss (%rdi), %xmm0
leaq 0xc(%rsi), %r15
vucomiss (%rsi), %xmm0
movq %r15, %rsi
jne 0x2deca3
jnp 0x2dec8b
addq $-0xc, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2df24d
movq %r15, %rdi
jmp 0x2dec87
movq %rbx, %rdx
callq 0x2df24d
popq %rbx
popq %r14
popq %r15
retq
jmp 0x2decc7
movq %rax, %rdi
callq 0xeb9f
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, 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>>>>, 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);
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);
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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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, 0x14(%rsp)
vmovss %xmm2, 0x10(%rsp)
vmovss %xmm1, 0xc(%rsp)
vmovss %xmm0, 0x8(%rsp)
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
xorl %r12d, %r12d
movq %rax, 0x30(%rsp)
movq (%rdx), %rax
cmpq (%rbx), %rax
je 0x2e0832
movslq -0x4(%rax), %rbp
cmpl 0x88(%r13), %ebp
jge 0x2e0848
movq 0x30(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
vmovss 0x10(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x2de77e
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
movq %r15, %rcx
callq 0x2de79c
vmovss 0x14(%rsp), %xmm1
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rdx
movl %eax, %esi
imulq $0xc, %rsi, %rsi
xorl %r8d, %r8d
movq 0x68(%r13), %rdi
movq 0x80(%r13), %rcx
cmpq %r8, %rsi
je 0x2e07cc
movslq 0x8(%rdi,%r8), %r9
movq 0x8(%rcx), %r10
movslq 0x4(%rdx,%r9,8), %r9
vmovss (%r10,%r9,4), %xmm0
vfmadd213ss (%rdi,%r8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rdi,%r8)
addq $0xc, %r8
jmp 0x2e07a1
cltq
movq 0x8(%r13), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2de8d9
movq 0x70(%r13), %rax
imulq $0xc, %rbp, %rcx
leaq 0x28(%rsp), %rsi
movq %r13, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2de90c
vmovss 0x8(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm1
movl 0x28(%rsp), %r9d
movq 0x20(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %eax, %r8d
callq 0x2de97d
orb %al, %r12b
movq (%r14), %rax
addq $-0x4, %rax
movq %rax, (%r14)
jmp 0x2e0725
andb $0x1, %r12b
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17798f(%rip), %rdi # 0x4581de
leaq 0x179c24(%rip), %rsi # 0x45a47a
leaq 0x182e3b(%rip), %rdx # 0x463698
leaq 0x182ee3(%rip), %rcx # 0x463747
callq 0x2813f
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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);
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);
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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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, 0x14(%rsp)
vmovss %xmm2, 0x10(%rsp)
vmovss %xmm1, 0xc(%rsp)
vmovss %xmm0, 0x8(%rsp)
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
xorl %r15d, %r15d
movq %rax, 0x30(%rsp)
cmpq %rbx, %r14
je 0x2e09ae
movslq (%r14), %rbp
cmpl 0x88(%r13), %ebp
jge 0x2e09c4
movq 0x30(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
vmovss 0x10(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x2de77e
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0x2de79c
vmovss 0x14(%rsp), %xmm1
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rdx
movl %eax, %esi
imulq $0xc, %rsi, %rsi
xorl %r8d, %r8d
movq 0x68(%r13), %rdi
movq 0x80(%r13), %rcx
cmpq %r8, %rsi
je 0x2e094e
movslq 0x8(%rdi,%r8), %r9
movq 0x8(%rcx), %r10
movslq 0x4(%rdx,%r9,8), %r9
vmovss (%r10,%r9,4), %xmm0
vfmadd213ss (%rdi,%r8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rdi,%r8)
addq $0xc, %r8
jmp 0x2e0923
cltq
movq 0x8(%r13), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2de8d9
movq 0x70(%r13), %rax
imulq $0xc, %rbp, %rcx
leaq 0x28(%rsp), %rsi
movq %r13, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2de90c
vmovss 0x8(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm1
movl 0x28(%rsp), %r9d
movq 0x20(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %eax, %r8d
callq 0x2de97d
orb %al, %r15b
addq $0x4, %r14
jmp 0x2e08a8
andb $0x1, %r15b
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x177813(%rip), %rdi # 0x4581de
leaq 0x179aa8(%rip), %rsi # 0x45a47a
leaq 0x182cbf(%rip), %rdx # 0x463698
leaq 0x182d67(%rip), %rcx # 0x463747
callq 0x2813f
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, float, float, float, float) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float 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);
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);
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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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, 0x14(%rsp)
vmovss %xmm2, 0x10(%rsp)
vmovss %xmm1, 0xc(%rsp)
vmovss %xmm0, 0x8(%rsp)
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
xorl %r15d, %r15d
movq %rax, 0x30(%rsp)
cmpq %rbx, %r14
je 0x2e0b2a
movslq (%r14), %rbp
cmpl 0x88(%r13), %ebp
jge 0x2e0b40
movq 0x30(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
vmovss 0x10(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x2de77e
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0x2de79c
vmovss 0x14(%rsp), %xmm1
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rdx
movl %eax, %esi
imulq $0xc, %rsi, %rsi
xorl %r8d, %r8d
movq 0x68(%r13), %rdi
movq 0x80(%r13), %rcx
cmpq %r8, %rsi
je 0x2e0aca
movslq 0x8(%rdi,%r8), %r9
movq 0x8(%rcx), %r10
movslq 0x4(%rdx,%r9,8), %r9
vmovss (%r10,%r9,4), %xmm0
vfmadd213ss (%rdi,%r8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rdi,%r8)
addq $0xc, %r8
jmp 0x2e0a9f
cltq
movq 0x8(%r13), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2de8d9
movq 0x70(%r13), %rax
imulq $0xc, %rbp, %rcx
leaq 0x28(%rsp), %rsi
movq %r13, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2de90c
vmovss 0x8(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm1
movl 0x28(%rsp), %r9d
movq 0x20(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %eax, %r8d
callq 0x2de97d
orb %al, %r15b
addq $0x8, %r14
jmp 0x2e0a24
andb $0x1, %r15b
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x177697(%rip), %rdi # 0x4581de
leaq 0x17992c(%rip), %rsi # 0x45a47a
leaq 0x182b43(%rip), %rdx # 0x463698
leaq 0x182beb(%rip), %rcx # 0x463747
callq 0x2813f
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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);
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);
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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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, 0x14(%rsp)
vmovss %xmm2, 0x10(%rsp)
vmovss %xmm1, 0xc(%rsp)
vmovss %xmm0, 0x8(%rsp)
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
xorl %r15d, %r15d
movq %rax, 0x30(%rsp)
cmpq %rbx, %r14
je 0x2e0ca6
movslq (%r14), %rbp
cmpl 0x88(%r13), %ebp
jge 0x2e0cbc
movq 0x30(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
vmovss 0x10(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x2de77e
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0x2de79c
vmovss 0x14(%rsp), %xmm1
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rdx
movl %eax, %esi
imulq $0xc, %rsi, %rsi
xorl %r8d, %r8d
movq 0x68(%r13), %rdi
movq 0x80(%r13), %rcx
cmpq %r8, %rsi
je 0x2e0c46
movslq 0x8(%rdi,%r8), %r9
movq 0x8(%rcx), %r10
movslq 0x4(%rdx,%r9,8), %r9
vmovss (%r10,%r9,4), %xmm0
vfmadd213ss (%rdi,%r8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rdi,%r8)
addq $0xc, %r8
jmp 0x2e0c1b
cltq
movq 0x8(%r13), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2de8d9
movq 0x70(%r13), %rax
imulq $0xc, %rbp, %rcx
leaq 0x28(%rsp), %rsi
movq %r13, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2de90c
vmovss 0x8(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm1
movl 0x28(%rsp), %r9d
movq 0x20(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %eax, %r8d
callq 0x2de97d
orb %al, %r15b
addq $0x4, %r14
jmp 0x2e0ba0
andb $0x1, %r15b
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17751b(%rip), %rdi # 0x4581de
leaq 0x1797b0(%rip), %rsi # 0x45a47a
leaq 0x1829c7(%rip), %rdx # 0x463698
leaq 0x182a6f(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::pnm_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 $0x3b8, %rsp # imm = 0x3B8
vmovsd %xmm0, 0x60(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x30(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x88(%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, 0x50(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0x2e20a8
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x38a37
vmovss %xmm0, 0x1c(%rsp)
jmp 0x2e20b2
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x1c(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x78(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x70(%rsp)
vmovsd %xmm1, 0x68(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd0(%rsp), %rdi
leaq 0x88(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2dd7b2
movl 0xcc(%r12), %esi
leaq 0x98(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x84(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x10(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x160(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x2e2193
cmpl $0x1, %eax
je 0x2e216d
cmpl $0x2, %eax
jne 0x2e21a4
movq 0x18(%r14), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0x2e217e
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x160(%rsp), %rsi
vmovsd 0x171eb2(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x4f9c9
jmp 0x2e21a4
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x4f95d
vcvtsd2ss 0x50(%rsp), %xmm3, %xmm0
leaq 0x30(%rsp), %r15
movq %r13, 0x58(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
vmovss %xmm0, 0x2c(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x50(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x70(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x70(%rsp)
vcvtsd2ss 0x68(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
cmpl %ebx, %ebp
je 0x2e2216
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2e2212
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2e21ef
leaq 0x168(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x158(%rsp), %ecx
movl 0x15c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x10(%rsp)
leaq 0x178329(%rip), %rdx # 0x45a577
leaq 0x160(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x42b5a
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x2dda48
vcvtsd2ss 0x10(%rsp), %xmm3, %xmm0
vmovss 0xc(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x30(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x2e2387
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2dda8a
movq 0x120(%rsp), %rdx
movq 0x148(%rsp), %rcx
movl %eax, %ebx
leaq 0x160(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x42bbe
testl %ebx, %ebx
je 0x2e242f
cmpl %ebp, %ebx
jge 0x2e231d
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x2e344a
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0x2e2353
vcvtsi2ss %ebx, %xmm3, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0x2e2359
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2e2387
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2e3482
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0x2e2387
incq %r15
jmp 0x2e22a2
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2e23a9
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2e23da
movq 0x20(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x84(%rsp), %edx
movq %r14, %rdi
callq 0x4f485
leaq 0x160(%rsp), %rdi
callq 0x42cbc
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2ddeea
leaq 0x90(%rsp), %rdi
callq 0x35c1a
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rax
addq $0x3b8, %rsp # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x365d4
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2e33fc
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
leaq 0xd0(%rsp), %r15
leaq 0x30(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2e2396
vmovss %xmm0, 0x10(%rsp)
vmulss 0x70(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
vmovss 0x68(%rsp), %xmm3
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2ddc96
testl %eax, %eax
jne 0x2e24e7
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%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 0x2e33fc
movq %r14, %rdi
callq 0x2e3482
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0x2e2396
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2e260e
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2dda8a
testl %eax, %eax
je 0x2e25c4
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2e258b
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0x2e2597
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2e260e
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2e3482
testb %al, %al
jne 0x2e2602
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0x2e250c
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x365d4
movl 0xc0(%r12), %eax
imull 0x40(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2e33fc
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0x2e260e
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0x2e2478
jmp 0x2e2654
jmp 0x2e262d
jmp 0x2e2654
movq %rax, %r14
jmp 0x2e2664
movq %rax, %r14
jmp 0x2e2671
movq %rax, %r14
jmp 0x2e267e
movq %rax, %r14
jmp 0x2e268b
movq %rax, %r14
jmp 0x2e2695
jmp 0x2e2654
jmp 0x2e2654
jmp 0x2e2654
leaq 0x168(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2e2664
leaq 0x160(%rsp), %rdi
movq %rax, %r14
callq 0x42cbc
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2ddeea
leaq 0x90(%rsp), %rdi
callq 0x35c1a
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::file_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 $0x3b8, %rsp # imm = 0x3B8
vmovsd %xmm0, 0x60(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x30(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x88(%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, 0x50(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0x2e278c
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x38a37
vmovss %xmm0, 0x1c(%rsp)
jmp 0x2e2796
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x1c(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x78(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x70(%rsp)
vmovsd %xmm1, 0x68(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd0(%rsp), %rdi
leaq 0x88(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2dd7b2
movl 0xcc(%r12), %esi
leaq 0x98(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x84(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x10(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x160(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x2e2877
cmpl $0x1, %eax
je 0x2e2851
cmpl $0x2, %eax
jne 0x2e2888
movq 0x18(%r14), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0x2e2862
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x160(%rsp), %rsi
vmovsd 0x1717ce(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x4f9c9
jmp 0x2e2888
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x4f95d
vcvtsd2ss 0x50(%rsp), %xmm3, %xmm0
leaq 0x30(%rsp), %r15
movq %r13, 0x58(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
vmovss %xmm0, 0x2c(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x50(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x70(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x70(%rsp)
vcvtsd2ss 0x68(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
cmpl %ebx, %ebp
je 0x2e28fa
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2e28f6
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2e28d3
leaq 0x168(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x158(%rsp), %ecx
movl 0x15c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x10(%rsp)
leaq 0x177c45(%rip), %rdx # 0x45a577
leaq 0x160(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x2dda48
vcvtsd2ss 0x10(%rsp), %xmm3, %xmm0
vmovss 0xc(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x30(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x2e2a6b
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2dda8a
movq 0x120(%rsp), %rdx
movq 0x148(%rsp), %rcx
movl %eax, %ebx
leaq 0x160(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x434d2
testl %ebx, %ebx
je 0x2e2b13
cmpl %ebp, %ebx
jge 0x2e2a01
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x2e3530
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0x2e2a37
vcvtsi2ss %ebx, %xmm3, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0x2e2a3d
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2e2a6b
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2e3568
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0x2e2a6b
incq %r15
jmp 0x2e2986
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2e2a8d
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2e2abe
movq 0x20(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x84(%rsp), %edx
movq %r14, %rdi
callq 0x4f485
leaq 0x160(%rsp), %rdi
callq 0x435d0
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2ddeea
leaq 0x90(%rsp), %rdi
callq 0x35c1a
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rax
addq $0x3b8, %rsp # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x365d4
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2e34e2
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
leaq 0xd0(%rsp), %r15
leaq 0x30(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2e2a7a
vmovss %xmm0, 0x10(%rsp)
vmulss 0x70(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
vmovss 0x68(%rsp), %xmm3
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2ddc96
testl %eax, %eax
jne 0x2e2bcb
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%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 0x2e34e2
movq %r14, %rdi
callq 0x2e3568
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0x2e2a7a
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2e2cf2
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2dda8a
testl %eax, %eax
je 0x2e2ca8
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2e2c6f
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0x2e2c7b
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2e2cf2
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2e3568
testb %al, %al
jne 0x2e2ce6
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0x2e2bf0
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x365d4
movl 0xc0(%r12), %eax
imull 0x40(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2e34e2
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0x2e2cf2
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0x2e2b5c
jmp 0x2e2d38
jmp 0x2e2d11
jmp 0x2e2d38
movq %rax, %r14
jmp 0x2e2d48
movq %rax, %r14
jmp 0x2e2d55
movq %rax, %r14
jmp 0x2e2d62
movq %rax, %r14
jmp 0x2e2d6f
movq %rax, %r14
jmp 0x2e2d79
jmp 0x2e2d38
jmp 0x2e2d38
jmp 0x2e2d38
leaq 0x168(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2e2d48
leaq 0x160(%rsp), %rdi
movq %rax, %r14
callq 0x435d0
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2ddeea
leaq 0x90(%rsp), %rdi
callq 0x35c1a
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_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 0x90(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x38959
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x40(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0x4(%rsp)
jbe 0x2e2e70
movq 0x10(%r14), %rdi
leaq 0x90(%rsp), %rsi
movl %ebx, %edx
callq 0x38a37
vmovss %xmm0, 0x14(%rsp)
jmp 0x2e2e7a
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x14(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x70(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x68(%rsp)
vmovsd %xmm1, 0x60(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd8(%rsp), %rdi
leaq 0x90(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2dd7b2
movl 0xcc(%r12), %esi
leaq 0xa0(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x7c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x80(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x2e2f58
cmpl $0x1, %eax
je 0x2e2f32
cmpl $0x2, %eax
jne 0x2e2f69
movq 0x18(%r14), %rdx
leaq 0x80(%rsp), %rdi
leaq 0x28(%rsp), %rsi
jmp 0x2e2f43
movq 0x18(%r14), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x80(%rsp), %rsi
vmovsd 0x1710ed(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x4f9c9
jmp 0x2e2f69
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x4f95d
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 0x2e2fdb
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2e2fd7
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2e2fb4
leaq 0x88(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, 0x8(%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x2dda48
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 0x2e30fe
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0x2dda8a
movl %eax, %r13d
testl %eax, %eax
je 0x2e3196
cmpl %ebp, %r13d
jge 0x2e3093
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0x2e3616
movl %r13d, %ebp
cmpq 0x70(%rsp), %r15
jle 0x2e30ca
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 0x2e30d0
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x2e30fe
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0x2e364e
vmovss 0x8(%rsp), %xmm0
vmovss 0x4(%rsp), %xmm2
testb %al, %al
jne 0x2e30fe
incq %r15
jmp 0x2e3039
movq 0x18(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2e3120
movq 0x18(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2e314e
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 0x4f485
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2ddeea
leaq 0x98(%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 0x2e35c8
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
leaq 0xd8(%rsp), %r15
leaq 0x28(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x38(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2e310d
vmovss %xmm0, 0x8(%rsp)
vmulss 0x68(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
vmovss 0x60(%rsp), %xmm3
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2ddc96
testl %eax, %eax
jne 0x2e324e
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 0x2e35c8
movq %r14, %rdi
callq 0x2e364e
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
testb %al, %al
jne 0x2e310d
movl %ebx, 0x70(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2e3375
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0x2dda8a
testl %eax, %eax
je 0x2e332b
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2e32f2
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 0x2e32fe
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x2e3375
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0x2e364e
testb %al, %al
jne 0x2e3369
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
incl %ebx
jmp 0x2e3273
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 0x2e35c8
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
jmp 0x2e3375
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
movl 0x70(%rsp), %ebx
decl 0x38(%rsp)
incl %ebx
jmp 0x2e31df
jmp 0x2e33b6
jmp 0x2e338f
jmp 0x2e33b6
movq %rax, %r14
jmp 0x2e33c6
movq %rax, %r14
jmp 0x2e33d3
movq %rax, %r14
jmp 0x2e33e0
movq %rax, %r14
jmp 0x2e33ea
jmp 0x2e33b6
jmp 0x2e33b6
jmp 0x2e33b6
leaq 0x88(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2e33b9
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2ddeea
leaq 0x98(%rsp), %rdi
callq 0x35c1a
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long) | void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
} | vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2e3448
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2e34c2
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_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 0x2e352e
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2e35a8
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_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 0x1764ef(%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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_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 0x2e3614
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2e368e
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_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 0x176409(%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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::minimize_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 0x2e3713
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 0x2e3872
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x2e3872
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 0x58da6
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 0x2e38cd
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2e49b0
movl 0x8(%rsp), %eax
incl %eax
jmp 0x2e3849
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 0x2e3c68
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 0x2e3991
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 0x2e49fc
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 0x2e38ed
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 0x2e3a26
movq 0x60(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x2e39e7
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x2e39d1
leaq 0xe0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x60418
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 0x176037(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x2e39ac
vucomisd %xmm0, %xmm1
jbe 0x2e39ac
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xa0(%rsp), %rbx
movq 0xa8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x2e3a87
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x2e3a74
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 0x2e3be2
cmpl $0x1, %eax
je 0x2e3baa
cmpl $0x2, %eax
jne 0x2e3c01
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x2e3c01
movq 0x118(%rsp), %rax
movq (%rbx), %rsi
movl 0x4(%rsp), %edx
movslq (%rax,%r15,4), %rax
addq %r14, %rsi
imulq $0x38, %rax, %rdi
addq 0x130(%rsp), %rdi
callq 0x4f485
incq %r15
addq $0x20, %r14
jmp 0x2e3b70
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4f485
leaq 0xe0(%rsp), %rdi
callq 0x60496
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x2e3bf5
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x4f485
leaq 0xd8(%rsp), %rdi
movq %r13, %rsi
callq 0x58f0a
cmpq $0x0, 0x168(%r13)
je 0x2e3c2d
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x58f1e
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x2ea23c
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 0x2e3cc9
movq %rax, %rbx
jmp 0x2e3cd6
movq %rax, %rbx
jmp 0x2e3ce3
jmp 0x2e3cad
jmp 0x2e3c9e
jmp 0x2e3cbc
jmp 0x2e3cbc
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x2e3d04
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x2e3cfa
jmp 0x2e3cbc
jmp 0x2e3cbc
jmp 0x2e3cbc
jmp 0x2e3cbc
jmp 0x2e3cbc
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x58f1e
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x2ea23c
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::minimize_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 0x2e3d48
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 0x2e3e71
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0x2e3e71
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 0x2e3e98
cmpl $0x2, %eax
jne 0x2e3ee7
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2ea948
jmp 0x2e3f34
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 0x2e3f63
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2ea264
jmp 0x2e3f34
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2eb02c
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 0x2e3fcf
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 0x2e3ff1
jmp 0x2e3ff1
leaq 0x68(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x20(%rsp), %rdi
callq 0x4495c
jmp 0x2e4014
jmp 0x2e4011
movq %rax, %r14
jmp 0x2e401e
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::minimize_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 0x2e4094
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 0x2e41f3
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x2e41f3
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 0x58da6
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 0x2e424e
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2eb94e
movl 0x8(%rsp), %eax
incl %eax
jmp 0x2e41ca
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 0x2e45e9
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 0x2e4312
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 0x2eb99a
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 0x2e426e
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 0x2e43a7
movq 0x60(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x2e4368
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x2e4352
leaq 0xe0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x60418
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 0x1756b6(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x2e432d
vucomisd %xmm0, %xmm1
jbe 0x2e432d
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xa0(%rsp), %rbx
movq 0xa8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x2e4408
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x2e43f5
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 0x2e4563
cmpl $0x1, %eax
je 0x2e452b
cmpl $0x2, %eax
jne 0x2e4582
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x2e4582
movq 0x118(%rsp), %rax
movq (%rbx), %rsi
movl 0x4(%rsp), %edx
movslq (%rax,%r15,4), %rax
addq %r14, %rsi
imulq $0x38, %rax, %rdi
addq 0x130(%rsp), %rdi
callq 0x4f485
incq %r15
addq $0x20, %r14
jmp 0x2e44f1
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4f485
leaq 0xe0(%rsp), %rdi
callq 0x60496
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x2e4576
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x4f485
leaq 0xd8(%rsp), %rdi
movq %r13, %rsi
callq 0x58f0a
cmpq $0x0, 0x168(%r13)
je 0x2e45ae
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x58f1e
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x2f0ace
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 0x2e464a
movq %rax, %rbx
jmp 0x2e4657
movq %rax, %rbx
jmp 0x2e4664
jmp 0x2e462e
jmp 0x2e461f
jmp 0x2e463d
jmp 0x2e463d
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x2e4685
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x2e467b
jmp 0x2e463d
jmp 0x2e463d
jmp 0x2e463d
jmp 0x2e463d
jmp 0x2e463d
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x58f1e
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x2f0ace
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::minimize_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 0x2e46c9
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 0x2e47f2
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0x2e47f2
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 0x2e4819
cmpl $0x2, %eax
jne 0x2e4868
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2f11da
jmp 0x2e48b5
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 0x2e48e4
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2f0af6
jmp 0x2e48b5
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2f18be
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 0x2e4950
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 0x2e4972
jmp 0x2e4972
leaq 0x68(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x20(%rsp), %rdi
callq 0x4495c
jmp 0x2e4995
jmp 0x2e4992
movq %rax, %r14
jmp 0x2e499f
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, 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 $0x168, %rsp # imm = 0x168
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 0x2e4e85
movq 0x70(%rsp), %rax
movq (%rax), %rdi
leaq 0x80(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x8(%rsp)
jmp 0x2e4e8f
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 0x2e52de
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 0x2e5245
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 0x2e55a2
vcvtsd2ss (%rsp), %xmm3, %xmm0
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
vmovss %xmm0, 0x60(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x2e5046
cmpq 0xb0(%r13), %r14
je 0x2e5046
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 0x2e55e4
testl %eax, %eax
je 0x2e505e
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0x78(%rsp), %r14
jle 0x2e5031
vcvtsi2ss %eax, %xmm3, %xmm0
vcvtsi2ssl 0x160(%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 0x2e5036
vmovss (%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x2e5046
incq %r14
jmp 0x2e4fad
testl %ebx, %ebx
jg 0x2e5225
leaq 0x18(%rsp), %rbx
movq $0x0, 0x10(%rsp)
jmp 0x2e5090
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 0x2e4f3d
cmpl 0xbc(%r13), %r14d
jge 0x2e4f3d
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 0x2e57f0
testl %eax, %eax
jne 0x2e5124
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 0x2e51cf
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0x2e51cf
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 0x2e55e4
testl %eax, %eax
je 0x2e51d6
vcvtsi2sd %r12d, %xmm4, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0x2e51bb
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x160(%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 0x2e51c0
vmovss (%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x2e51cf
incl %ebx
jmp 0x2e512f
leaq 0x18(%rsp), %rbx
jmp 0x2e5219
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 0x2e509b
movq 0xb0(%r13), %r8
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0x5b64c
jmp 0x2e4f34
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2e5a44
leaq 0x80(%rsp), %rdi
callq 0x4495c
leaq 0x20(%rsp), %rdi
callq 0x357fe
addq $0x168, %rsp # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2e528f
movq %rax, %rbx
jmp 0x2e52b1
movq %rax, %rbx
jmp 0x2e52be
movq %rax, %rbx
jmp 0x2e52cb
jmp 0x2e52a1
jmp 0x2e52a1
jmp 0x2e52a1
jmp 0x2e52a1
leaq 0xa0(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2e5a44
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::solver_inequalities_101coeff(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_inequalities_101coeff(random_engine& rng_,
int m_,
int n_,
const cost_type& c_,
const std::vector<merged_constraint>& csts)
: logger("solver_inequalities_101coeff")
, rng(rng_)
, ap(csts, m_, n_)
, P(std::make_unique<Float[]>(ap.size()))
, A(static_cast<int>(ap.size()))
, R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts)))
, b(std::make_unique<bound_factor[]>(m_))
, pi(std::make_unique<Float[]>(m_))
, c(c_)
, m(m_)
, n(n_)
{
int id = 0;
for (int i = 0, e = length(csts); i != e; ++i) {
int lower = 0, upper = 0;
for (const auto& cst : csts[i].elements) {
bx_ensures(std::abs(cst.factor) == 1);
if (cst.factor > 0)
A.set(id++);
else
A.unset(id++);
if (cst.factor > 0)
upper++;
else
lower++;
}
if (csts[i].min == csts[i].max) {
b[i].min = csts[i].min;
b[i].max = csts[i].max;
} else {
b[i].min = std::max(-lower, csts[i].min);
b[i].max = std::min(upper, csts[i].max);
}
b[i].negative_factor = lower;
bx_ensures(b[i].min <= b[i].max);
bx_ensures(upper + lower == length(csts[i].elements));
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
leaq 0x17e386(%rip), %rdx # 0x46367b
movq %r9, %rbx
movq %r8, %r15
movl %ecx, %r13d
movq %rsi, %r14
movq %rdi, %r12
pushq $0x1c
popq %rsi
callq 0xb8418
movq %r14, 0x8(%r12)
leaq 0x10(%r12), %r14
movq %r14, %rdi
movq %rbx, 0x18(%rsp)
movq %rbx, %rsi
movl %ebp, %edx
movl %r13d, %ecx
callq 0x3a4ca
movl 0x38(%r12), %esi
leaq 0x50(%r12), %rbx
movq %rbx, %rdi
movq %r14, 0x20(%rsp)
callq 0x35bd8
movl 0x38(%r12), %esi
leaq 0x58(%r12), %r14
movq %r15, (%rsp)
movq %r14, %rdi
movq %rbx, 0x10(%rsp)
callq 0x368ae
movq 0x18(%rsp), %rdi
movl %r13d, %r15d
leaq 0x68(%r12), %r13
callq 0x3a89d
movq %r13, %rbx
movq %r13, %rdi
movq %rax, %rsi
callq 0x2e5a87
movslq %ebp, %r13
leaq 0x70(%r12), %rdi
movq %r13, %rsi
movq %rdi, 0x8(%rsp)
callq 0x2e5ac4
leaq 0x78(%r12), %rdi
movq %r13, %rsi
callq 0x35bd8
movq (%rsp), %rax
movq %rax, 0x80(%r12)
movq 0x18(%rsp), %rax
movl %ebp, 0x88(%r12)
movl %r15d, 0x8c(%r12)
movq (%rax), %rcx
movq 0x8(%rax), %rax
subq %rcx, %rax
pushq $0x28
popq %rsi
cqto
xorl %r9d, %r9d
xorl %ebp, %ebp
idivq %rsi
movl %eax, %eax
movq %rax, 0x10(%rsp)
cmpq 0x10(%rsp), %r9
je 0x2e54f4
imulq $0x28, %r9, %rax
movq %r9, (%rsp)
xorl %r15d, %r15d
xorl %ebx, %ebx
movq (%rcx,%rax), %r13
movq 0x8(%rcx,%rax), %r12
movq %rax, 0x20(%rsp)
cmpq %r12, %r13
je 0x2e544d
movl (%r13), %eax
leal 0x1(%rax), %ecx
testl $0xfffffffd, %ecx # imm = 0xFFFFFFFD
jne 0x2e5503
movq %r14, %rdi
movl %ebp, %esi
testl %eax, %eax
jle 0x2e542c
callq 0x369c8
jmp 0x2e5431
callq 0x36a06
incl %ebp
xorl %eax, %eax
xorl %ecx, %ecx
cmpl $0x0, (%r13)
setle %al
setg %cl
addq $0x8, %r13
addl %ecx, %r15d
addl %eax, %ebx
jmp 0x2e5404
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rsi
movq (%rax), %rcx
movl 0x18(%rcx,%rsi), %edx
leaq (%rcx,%rsi), %rax
cmpl 0x1c(%rcx,%rsi), %edx
jne 0x2e5485
movq 0x8(%rsp), %rsi
movq (%rsp), %r9
movq (%rsi), %rsi
imulq $0xc, %r9, %rdi
movl %edx, (%rsi,%rdi)
movl %edx, 0x4(%rsi,%rdi)
movl %ebx, 0x8(%rsi,%rdi)
jmp 0x2e54ba
movq 0x8(%rsp), %rdi
movq (%rsp), %r9
movl %ebx, %esi
negl %esi
cmpl %esi, %edx
cmovgl %edx, %esi
movq (%rdi), %rdx
imulq $0xc, %r9, %rdi
movl %esi, (%rdx,%rdi)
movl 0x1c(%rax), %r8d
cmpl %r15d, %r8d
cmovgel %r15d, %r8d
movl %r8d, 0x4(%rdx,%rdi)
movl %ebx, 0x8(%rdx,%rdi)
cmpl %r8d, %esi
jg 0x2e5524
movq 0x8(%rax), %rdx
addl %r15d, %ebx
incq %r9
subq (%rax), %rdx
shrq $0x3, %rdx
cmpl %edx, %ebx
je 0x2e53de
leaq 0x172f50(%rip), %rdi # 0x45842a
leaq 0x17e22c(%rip), %rsi # 0x46370d
leaq 0x17e1b0(%rip), %rdx # 0x463698
leaq 0x17e248(%rip), %rcx # 0x463737
callq 0x2813f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x172f20(%rip), %rdi # 0x45842a
leaq 0x174d1c(%rip), %rsi # 0x45a22d
leaq 0x17e180(%rip), %rdx # 0x463698
leaq 0x17e1e6(%rip), %rcx # 0x463705
callq 0x2813f
leaq 0x172eff(%rip), %rdi # 0x45842a
leaq 0x174d77(%rip), %rsi # 0x45a2a9
leaq 0x17e15f(%rip), %rdx # 0x463698
leaq 0x17e1c9(%rip), %rcx # 0x463709
callq 0x2813f
movq 0x8(%rsp), %rdi
movq %rax, %r14
callq 0x2e5b02
jmp 0x2e5557
movq %rax, %r14
movq %rbx, %rdi
callq 0x2e5b1c
jmp 0x2e5564
movq %rax, %r14
leaq 0x60(%r12), %rdi
callq 0x357fe
jmp 0x2e5573
movq %rax, %r14
movq 0x10(%rsp), %rdi
callq 0x35c1a
jmp 0x2e5582
movq %rax, %r14
movq 0x20(%rsp), %rdi
callq 0x3a954
movq %r12, %rdi
callq 0xb853a
movq %r14, %rdi
callq 0xb3d0
movq %rax, %r14
jmp 0x2e558c
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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 0x2e55b8
movq %rax, %rdi
jmp 0x2e5b52
cmpl $0x7, %ecx
jne 0x2e55d5
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0x2e55e3
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0x2e55c6
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0x2e5c6d
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array, float>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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 0x2e5723
leaq 0x17dc45(%rip), %rdx # 0x463250
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 0x2e5d74
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2e5c6d
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 0x2e7c08
jmp 0x2e5758
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x2e7332
jmp 0x2e56b4
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x2e779d
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 0x2e6148
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2e632c
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 0x2e5f64
jmp 0x2e577c
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x2e80fa
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 0x2e6448
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2e5c6d
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 0x2e5f64
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2e662c
nop
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array, float>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float, float) | int push_and_run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
bool pi_changed = 0;
int remaining = 0;
if (use_cycle)
order = next_state(order);
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.push_and_compute_update_row(x,
R.crbegin(),
R.crend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
}
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl 0x30(%rdi), %eax
cmpb $0x1, 0x34(%rdi)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
jne 0x2e581c
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 0x2e59b5
leaq 0x17da3e(%rip), %rdx # 0x46326c
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 0x2e85f0
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2e5c6d
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 0x2e9853
jmp 0x2e599e
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x2e8f7d
jmp 0x2e58e6
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x2e93e8
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 0x2e8abe
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2e632c
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 0x2e885e
jmp 0x2e59c7
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 0x2e9d45
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 0x2e8d1e
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2e5c6d
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 0x2e885e
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2e662c
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true> const, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, 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 $0x48, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x2e5b76
movq %rax, 0x20(%rdi)
movq 0x20(%rsp), %rsi
leaq 0x18(%rdi), %rax
movq %rdi, 0x28(%rsp)
xorl %ebx, %ebx
movq %rax, 0x18(%rsp)
movl 0x88(%rsi), %ecx
leaq 0x10(%rsi), %rdx
leaq 0x58(%rsi), %rbp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
cmpq 0x38(%rsp), %rbx
je 0x2e5c4d
movq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebx, %edx
movq %rbx, 0x40(%rsp)
callq 0x3c868
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbx
xorl %r13d, %r13d
cmpq %r15, %rbx
je 0x2e5bfb
movl (%rbx), %esi
movq %rbp, %rdi
callq 0x2b9c1a
movl 0x4(%rbx), %esi
movq %r14, %rdi
movl %eax, %r12d
callq 0x3664a
imull %r12d, %eax
addq $0x8, %rbx
addl %eax, %r13d
jmp 0x2e5bd1
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rbx
movq 0x70(%rax), %rcx
imulq $0xc, %rbx, %rdx
movl (%rcx,%rdx), %eax
subl %r13d, %eax
jle 0x2e5c23
shlq $0x20, %rax
orq %rbx, %rax
movq %rax, 0x8(%rsp)
jmp 0x2e5c36
subl 0x4(%rcx,%rdx), %r13d
jle 0x2e5c45
shlq $0x20, %r13
orq %rbx, %r13
movq %r13, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbx
jmp 0x2e5ba3
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x48, %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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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 0x2e5c8b
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x88(%r15), %esi
je 0x2e5cc1
movq %r15, %rdi
movq %r14, %rdx
callq 0x2e5cd8
testb %al, %al
jne 0x2e5cb9
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0x2e5c92
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_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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 $0x28, %rsp
movq %rdx, %r14
movl %esi, %edx
leaq 0x10(%rdi), %rsi
leaq 0x18(%rsp), %r15
movq %rdi, %r12
movl %edx, 0xc(%rsp)
movq %r15, %rdi
callq 0x3c868
movq (%r15), %rbp
movq 0x8(%r15), %rbx
leaq 0x58(%r12), %r15
xorl %r13d, %r13d
movq %r12, 0x10(%rsp)
cmpq %rbp, %rbx
je 0x2e5d41
movl (%rbx), %esi
movq %r15, %rdi
callq 0x2b9c1a
movl 0x4(%rbx), %esi
movq %r14, %rdi
movl %eax, %r12d
callq 0x3664a
imull %r12d, %eax
addq $0x8, %rbx
addl %eax, %r13d
jmp 0x2e5d17
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq 0x70(%rax), %rax
imulq $0xc, %rcx, %rcx
cmpl %r13d, (%rax,%rcx)
jle 0x2e5d5d
xorl %eax, %eax
jmp 0x2e5d65
cmpl 0x4(%rax,%rcx), %r13d
setle %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, float, float, float) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0x58, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %rbx
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
leaq 0x1765a4(%rip), %rdx # 0x45c344
movq %rsi, %r14
movq %rdi, %r12
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
movq %rbx, 0x40(%rsp)
xorl %edx, %edx
movq %rax, 0x38(%rsp)
movq (%rbx), %rax
pushq $0x16
popq %r15
leaq 0x17d960(%rip), %rbp # 0x46373b
pushq $0xb
popq %rbx
movq %r14, 0x30(%rsp)
movq 0x48(%rsp), %rcx
cmpq (%rcx), %rax
je 0x2e5f4f
movq %rdx, 0x50(%rsp)
movl -0x4(%rax), %edx
movq 0x38(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %edx, (%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x2e666e
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x2e668c
movq %rax, 0x8(%rsp)
cltq
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2e67e5
movslq (%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x2e6818
movslq (%rsp), %rcx
movl %eax, 0x4(%rsp)
leaq 0x17b1c0(%rip), %rdx # 0x461045
movq %r12, %rdi
movq %r15, %r13
movq %r15, %rsi
imulq $0xc, %rcx, %r8
addq 0x70(%r12), %r8
movq %rsp, %rcx
callq 0xb91c2
pushq $0x8
popq %r15
xorl %r14d, %r14d
movslq 0x8(%rsp), %rax
cmpq %rax, %r14
jge 0x2e5eda
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0x8(%rax,%r15), %r8
leaq -0x4(%rax,%r15), %rcx
leaq (%rax,%r15), %r9
callq 0x2ba7d2
incq %r14
addq $0xc, %r15
jmp 0x2e5ea6
movslq (%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x17b172(%rip), %rdx # 0x46105c
leaq 0x4(%rsp), %r8
movq %r12, %rdi
movq %r13, %r15
movq %r13, %rsi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
callq 0xb91c2
vmovss 0x1c(%rsp), %xmm0
vmovss 0x18(%rsp), %xmm1
movq 0x30(%rsp), %r14
movq 0x28(%rsp), %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
movl 0x8(%rsp), %r9d
movq %r12, %rdi
movq %r14, %rsi
callq 0x2e6889
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rcx
orb %al, %dl
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x2e5de3
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-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<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 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0x58, %rsp
movq %rcx, 0x40(%rsp)
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x1761ca(%rip), %rdx # 0x45c344
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
pushq $0x16
popq %r13
leaq 0x17d594(%rip), %rbp # 0x46373b
pushq $0xb
popq %rbx
movq %r15, 0x38(%rsp)
cmpq 0x40(%rsp), %r14
je 0x2e631a
movl (%r14), %edx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq %r14, 0x48(%rsp)
movl %edx, (%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x2e666e
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2e668c
movq %rax, 0x8(%rsp)
cltq
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2e67e5
movslq (%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x2e6818
movslq (%rsp), %rcx
movl %eax, 0x4(%rsp)
leaq 0x17adf2(%rip), %rdx # 0x461045
movq %r12, %rdi
movq %r13, %r14
movq %r13, %rsi
imulq $0xc, %rcx, %r8
addq 0x70(%r12), %r8
movq %rsp, %rcx
callq 0xb91c2
pushq $0x8
popq %r15
xorl %r13d, %r13d
movslq 0x8(%rsp), %rax
cmpq %rax, %r13
jge 0x2e62a8
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0x8(%rax,%r15), %r8
leaq -0x4(%rax,%r15), %rcx
leaq (%rax,%r15), %r9
callq 0x2ba7d2
incq %r13
addq $0xc, %r15
jmp 0x2e6274
movslq (%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x17ada4(%rip), %rdx # 0x46105c
leaq 0x4(%rsp), %r8
movq %r12, %rdi
movq %r14, %r13
movq %r14, %rsi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
callq 0xb91c2
vmovss 0x1c(%rsp), %xmm0
vmovss 0x18(%rsp), %xmm1
movq 0x38(%rsp), %r15
movq 0x28(%rsp), %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
movl 0x8(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x2e6889
movq 0x50(%rsp), %rcx
movq 0x48(%rsp), %r14
orb %al, %cl
addq $0x8, %r14
movq %rcx, %rax
jmp 0x2e61af
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-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<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 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].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({} {}) ", R[i].f, R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, 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 $0x58, %rsp
movq %rcx, 0x40(%rsp)
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x175eca(%rip), %rdx # 0x45c344
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
pushq $0x16
popq %r13
leaq 0x17d294(%rip), %rbp # 0x46373b
pushq $0xb
popq %rbx
movq %r15, 0x38(%rsp)
cmpq 0x40(%rsp), %r14
je 0x2e661a
movl (%r14), %edx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq %r14, 0x48(%rsp)
movl %edx, (%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x2e666e
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2e668c
movq %rax, 0x8(%rsp)
cltq
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2e67e5
movslq (%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x2e6818
movslq (%rsp), %rcx
movl %eax, 0x4(%rsp)
leaq 0x17aaf2(%rip), %rdx # 0x461045
movq %r12, %rdi
movq %r13, %r14
movq %r13, %rsi
imulq $0xc, %rcx, %r8
addq 0x70(%r12), %r8
movq %rsp, %rcx
callq 0xb91c2
pushq $0x8
popq %r15
xorl %r13d, %r13d
movslq 0x8(%rsp), %rax
cmpq %rax, %r13
jge 0x2e65a8
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0x8(%rax,%r15), %r8
leaq -0x4(%rax,%r15), %rcx
leaq (%rax,%r15), %r9
callq 0x2ba7d2
incq %r13
addq $0xc, %r15
jmp 0x2e6574
movslq (%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x17aaa4(%rip), %rdx # 0x46105c
leaq 0x4(%rsp), %r8
movq %r12, %rdi
movq %r14, %r13
movq %r14, %rsi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
callq 0xb91c2
vmovss 0x1c(%rsp), %xmm0
vmovss 0x18(%rsp), %xmm1
movq 0x38(%rsp), %r15
movq 0x28(%rsp), %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
movl 0x8(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x2e6889
movq 0x50(%rsp), %rcx
movq 0x48(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x2e64af
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-inequalities-101.cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.