name
stringlengths 1
473k
| code
stringlengths 7
647k
| asm
stringlengths 4
3.39M
| file
stringlengths 8
196
|
---|---|---|---|
baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::rc_size baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::compute_reduced_costs<baryonyx::bit_array>(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, baryonyx::bit_array const&) | rc_size compute_reduced_costs(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
const Xtype& x) noexcept
{
int r_size = 0;
int c_size = 0;
for (; begin != end; ++begin) {
Float sum_a_pi = 0;
Float sum_a_p = 0;
auto ht = ap.column(begin->column);
for (; std::get<0>(ht) != std::get<1>(ht); ++std::get<0>(ht)) {
auto a = static_cast<Float>(A.get(std::get<0>(ht)->value));
sum_a_pi += a * pi[std::get<0>(ht)->row];
sum_a_p += a * P[std::get<0>(ht)->value];
}
R[r_size].id = r_size;
R[r_size].value = c(begin->column, x) - sum_a_pi - sum_a_p;
R[r_size].f = A.get(begin->value);
if (R[r_size].is_negative_factor()) {
R[r_size].value = -R[r_size].value;
++c_size;
}
++r_size;
}
return { r_size, c_size };
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
leaq 0x58(%rdi), %rbp
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
movq $0x0, 0x10(%rsp)
movq %rax, 0x28(%rsp)
cmpq %r14, %r15
je 0x2e67c8
movl 0x4(%r15), %edx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0x3dede
movq 0x20(%rsp), %rax
vxorps %xmm1, %xmm1, %xmm1
vxorps %xmm0, %xmm0, %xmm0
vmovss %xmm0, 0x8(%rsp)
vmovss %xmm1, 0xc(%rsp)
cmpq 0x18(%rsp), %rax
je 0x2e6747
movl (%rax), %esi
movq %rbp, %rdi
callq 0x2b9c1a
vcvtsi2ss %eax, %xmm3, %xmm0
movq 0x20(%rsp), %rax
movq 0x78(%r12), %rsi
vmovss 0xc(%rsp), %xmm1
movq 0x50(%r12), %rdx
vmovss 0x8(%rsp), %xmm2
movslq 0x4(%rax), %rcx
vfmadd231ss (%rsi,%rcx,4), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
movslq (%rax), %rcx
addq $0x8, %rax
vfmadd231ss (%rdx,%rcx,4), %xmm0, %xmm2 # xmm2 = (xmm0 * mem) + xmm2
movq %rax, 0x20(%rsp)
vmovaps %xmm2, %xmm0
jmp 0x2e66e9
movq 0x68(%r12), %rax
imulq $0xc, %rbx, %r13
movq 0x30(%rsp), %rdx
movl %ebx, 0x8(%rax,%r13)
movq 0x80(%r12), %rdi
movl 0x4(%r15), %esi
callq 0x49ffa
vsubss 0xc(%rsp), %xmm0, %xmm0
movq 0x68(%r12), %rax
movq %rbp, %rdi
vsubss 0x8(%rsp), %xmm0, %xmm0
vmovss %xmm0, (%rax,%r13)
movl (%r15), %esi
callq 0x2b9c1a
movq 0x68(%r12), %rcx
movl %eax, 0x4(%rcx,%r13)
testl %eax, %eax
jns 0x2e67bc
addq %r13, %rcx
movq 0x10(%rsp), %rax
vmovss (%rcx), %xmm0
vxorps 0x16db4b(%rip){1to4}, %xmm0, %xmm0 # 0x4542fc
incl %eax
movq %rax, 0x10(%rsp)
vmovss %xmm0, (%rcx)
incq %rbx
addq $0x8, %r15
jmp 0x2e66c0
movq 0x10(%rsp), %rcx
movl %ebx, %eax
shlq $0x20, %rcx
orq %rcx, %rax
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 |
baryonyx::itm::solver_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>, 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 0x2ea348
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x1c(%rsp)
jmp 0x2ea352
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 0x2e52de
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 0x2ea433
cmpl $0x1, %eax
je 0x2ea40d
cmpl $0x2, %eax
jne 0x2ea444
movq 0x18(%r14), %rdx
leaq 0x170(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0x2ea41e
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x170(%rsp), %rsi
vmovsd 0x169c12(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x593ae
jmp 0x2ea444
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x59339
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 0x2ea4b6
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2ea4b2
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2ea48f
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 0x170089(%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 0x2e55a2
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 0x2ea627
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2e55e4
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 0x2ea6cf
cmpl %ebp, %ebx
jge 0x2ea5bd
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x2eb6ea
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0x2ea5f3
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 0x2ea5f9
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2ea627
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2eb722
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0x2ea627
incq %r15
jmp 0x2ea542
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2ea649
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2ea67a
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 0x170(%rsp), %rdi
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x2e5a44
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 0x2eb69c
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 0x2ea636
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 0x2e57f0
testl %eax, %eax
jne 0x2ea787
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 0x2eb69c
movq %r14, %rdi
callq 0x2eb722
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0x2ea636
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2ea8ae
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2e55e4
testl %eax, %eax
je 0x2ea864
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2ea82b
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 0x2ea837
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2ea8ae
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2eb722
testb %al, %al
jne 0x2ea8a2
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0x2ea7ac
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 0x2eb69c
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0x2ea8ae
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0x2ea718
jmp 0x2ea8f4
jmp 0x2ea8cd
jmp 0x2ea8f4
movq %rax, %r14
jmp 0x2ea904
movq %rax, %r14
jmp 0x2ea911
movq %rax, %r14
jmp 0x2ea91e
movq %rax, %r14
jmp 0x2ea92b
movq %rax, %r14
jmp 0x2ea935
jmp 0x2ea8f4
jmp 0x2ea8f4
jmp 0x2ea8f4
leaq 0x178(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2ea904
leaq 0x170(%rsp), %rdi
movq %rax, %r14
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x2e5a44
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::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::none_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 $0x178, %rsp # imm = 0x178
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 0x46c07
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 0x2eb110
movq 0x10(%r14), %rdi
leaq 0x90(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x14(%rsp)
jmp 0x2eb11a
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 0xe8(%rsp), %rdi
leaq 0x90(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2e52de
movl 0xcc(%r12), %esi
leaq 0xb0(%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 0x2eb1f8
cmpl $0x1, %eax
je 0x2eb1d2
cmpl $0x2, %eax
jne 0x2eb209
movq 0x18(%r14), %rdx
leaq 0x80(%rsp), %rdi
leaq 0x28(%rsp), %rsi
jmp 0x2eb1e3
movq 0x18(%r14), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x80(%rsp), %rsi
vmovsd 0x168e4d(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x593ae
jmp 0x2eb209
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x59339
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 0x2eb27b
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2eb277
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2eb254
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 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x2e55a2
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 0x2eb39e
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
movq %rbx, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0x2e55e4
movl %eax, %r13d
testl %eax, %eax
je 0x2eb436
cmpl %ebp, %r13d
jge 0x2eb333
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0x2eb8b6
movl %r13d, %ebp
cmpq 0x70(%rsp), %r15
jle 0x2eb36a
vcvtsi2ss %r13d, %xmm3, %xmm0
vcvtsi2ssl 0x170(%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 0x2eb370
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x2eb39e
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0x2eb8ee
vmovss 0x8(%rsp), %xmm0
vmovss 0x4(%rsp), %xmm2
testb %al, %al
jne 0x2eb39e
incq %r15
jmp 0x2eb2d9
movq 0x18(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2eb3c0
movq 0x18(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2eb3ee
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 0xb0(%rsp), %rdi
callq 0x393ac
leaq 0xe8(%rsp), %rdi
callq 0x2e5a44
leaq 0x90(%rsp), %rdi
callq 0x4495c
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%rsp), %rax
addq $0x178, %rsp # imm = 0x178
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 0x45118
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2eb868
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
leaq 0xe8(%rsp), %r15
leaq 0x28(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x38(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2eb3ad
vmovss %xmm0, 0x8(%rsp)
vmulss 0x68(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
vmovss 0x60(%rsp), %xmm3
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2e57f0
testl %eax, %eax
jne 0x2eb4ee
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%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 0x2eb868
movq %r14, %rdi
callq 0x2eb8ee
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
testb %al, %al
jne 0x2eb3ad
movl %ebx, 0x70(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2eb615
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0x2e55e4
testl %eax, %eax
je 0x2eb5cb
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2eb592
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x170(%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 0x2eb59e
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x2eb615
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0x2eb8ee
testb %al, %al
jne 0x2eb609
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
incl %ebx
jmp 0x2eb513
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0x45118
movl 0xc0(%r12), %eax
imull 0x38(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2eb868
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
jmp 0x2eb615
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
movl 0x70(%rsp), %ebx
decl 0x38(%rsp)
incl %ebx
jmp 0x2eb47f
jmp 0x2eb656
jmp 0x2eb62f
jmp 0x2eb656
movq %rax, %r14
jmp 0x2eb666
movq %rax, %r14
jmp 0x2eb673
movq %rax, %r14
jmp 0x2eb680
movq %rax, %r14
jmp 0x2eb68a
jmp 0x2eb656
jmp 0x2eb656
jmp 0x2eb656
leaq 0x88(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2eb659
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0x393ac
leaq 0xe8(%rsp), %rdi
callq 0x2e5a44
leaq 0x90(%rsp), %rdi
callq 0x4495c
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::quadratic_cost_type<float>, true>, float, baryonyx::itm::minimize_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 0x16e335(%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::quadratic_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::file_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x16e24f(%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_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<float>, float, baryonyx::itm::minimize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<float> const&, double) | void operator()(const std::atomic_bool& stop_task,
best_solution_recorder<Cost, Float, Mode>& best_recorder,
const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
bit_array x(variables);
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_local_ctx.rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const auto w_limit = static_cast<long int>(p.w);
Solver slv(m_local_ctx.rng,
length(constraints),
variables,
norm_costs,
constraints);
compute_order compute(p.order, variables);
bool is_a_solution = false;
while (!stop_task.load()) {
++m_call_number;
const auto kappa_start = static_cast<Float>(best_recorder.reinit(
m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x));
auto kappa = kappa_start;
compute.init(slv, x);
auto best_remaining = INT_MAX;
is_a_solution = false;
for (long int i = 0; !stop_task.load() && i != p.limit; ++i) {
auto remaining =
compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
i);
best_remaining = 0;
is_a_solution = true;
break;
} else {
best_remaining = std::min(remaining, best_remaining);
}
if (i > w_limit)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
if (best_remaining > 0) {
best_recorder.try_advance(
m_local_ctx, x, best_remaining, p.limit);
continue;
}
for (int push = 0; !stop_task.load() && push < p.pushes_limit;
++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_local_ctx.rng,
pushing_k_factor,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
is_a_solution = true;
}
kappa = kappa_start;
for (int iter = 0;
!stop_task.load() && iter < p.pushing_iteration_limit;
++iter) {
remaining = compute.run(
slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
is_a_solution = true;
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
}
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $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 0x2ebe23
movq 0x70(%rsp), %rax
movq (%rax), %rdi
leaq 0x80(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x8(%rsp)
jmp 0x2ebe2d
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 0x2ec27c
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 0x2ec1e3
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 0x2ec512
vcvtsd2ss (%rsp), %xmm3, %xmm0
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
vmovss %xmm0, 0x60(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x2ebfe4
cmpq 0xb0(%r13), %r14
je 0x2ebfe4
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 0x2ec554
testl %eax, %eax
je 0x2ebffc
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0x78(%rsp), %r14
jle 0x2ebfcf
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 0x2ebfd4
vmovss (%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x2ebfe4
incq %r14
jmp 0x2ebf4b
testl %ebx, %ebx
jg 0x2ec1c3
leaq 0x18(%rsp), %rbx
movq $0x0, 0x10(%rsp)
jmp 0x2ec02e
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 0x2ebedb
cmpl 0xbc(%r13), %r14d
jge 0x2ebedb
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 0x2ec760
testl %eax, %eax
jne 0x2ec0c2
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 0x2ec16d
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0x2ec16d
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 0x2ec554
testl %eax, %eax
je 0x2ec174
vcvtsi2sd %r12d, %xmm4, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0x2ec159
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 0x2ec15e
vmovss (%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x2ec16d
incl %ebx
jmp 0x2ec0cd
leaq 0x18(%rsp), %rbx
jmp 0x2ec1b7
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 0x2ec039
movq 0xb0(%r13), %r8
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0x5b64c
jmp 0x2ebed2
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2ec9b4
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 0x2ec22d
movq %rax, %rbx
jmp 0x2ec24f
movq %rax, %rbx
jmp 0x2ec25c
movq %rax, %rbx
jmp 0x2ec269
jmp 0x2ec23f
jmp 0x2ec23f
jmp 0x2ec23f
jmp 0x2ec23f
leaq 0xa0(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2ec9b4
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>, false>::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
andq $0x0, (%rdi)
leaq 0x10(%rdi), %r14
movq %rsi, 0x8(%rdi)
movq %rdi, %r13
movq %r8, %r15
movl %ecx, %r12d
movl %edx, %ebp
movq %r9, 0x18(%rsp)
movq %r9, %rsi
movq %r14, %rdi
callq 0x3a4ca
movl 0x38(%r13), %esi
leaq 0x50(%r13), %rbx
movq %rbx, %rdi
movq %r14, 0x20(%rsp)
callq 0x35bd8
movl 0x38(%r13), %esi
leaq 0x58(%r13), %r14
movq %r15, (%rsp)
movq %r14, %rdi
movq %rbx, 0x10(%rsp)
callq 0x368ae
movq 0x18(%rsp), %rdi
movl %r12d, %r15d
leaq 0x68(%r13), %r12
callq 0x3a89d
movq %r12, %rbx
movq %r12, %rdi
movq %rax, %rsi
callq 0x2ec9f2
movslq %ebp, %r12
leaq 0x70(%r13), %rdi
movq %r12, %rsi
movq %rdi, 0x8(%rsp)
callq 0x2eca2f
leaq 0x78(%r13), %rdi
movq %r12, %rsi
callq 0x35bd8
movq (%rsp), %rax
movq %rax, 0x80(%r13)
movq 0x18(%rsp), %rax
movl %ebp, 0x88(%r13)
movl %r15d, 0x8c(%r13)
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 0x2ec470
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 0x2ec3c9
movl (%r13), %eax
leal 0x1(%rax), %ecx
testl $0xfffffffd, %ecx # imm = 0xFFFFFFFD
jne 0x2ec47f
movq %r14, %rdi
movl %ebp, %esi
testl %eax, %eax
jle 0x2ec3a8
callq 0x369c8
jmp 0x2ec3ad
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 0x2ec380
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 0x2ec401
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 0x2ec436
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 0x2ec4a0
movq 0x8(%rax), %rdx
addl %r15d, %ebx
incq %r9
subq (%rax), %rdx
shrq $0x3, %rdx
cmpl %edx, %ebx
je 0x2ec35a
leaq 0x16bfd4(%rip), %rdi # 0x45842a
leaq 0x1772b0(%rip), %rsi # 0x46370d
leaq 0x177234(%rip), %rdx # 0x463698
leaq 0x1772cc(%rip), %rcx # 0x463737
callq 0x2813f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16bfa4(%rip), %rdi # 0x45842a
leaq 0x16dda0(%rip), %rsi # 0x45a22d
leaq 0x177204(%rip), %rdx # 0x463698
leaq 0x17726a(%rip), %rcx # 0x463705
callq 0x2813f
leaq 0x16bf83(%rip), %rdi # 0x45842a
leaq 0x16ddfb(%rip), %rsi # 0x45a2a9
leaq 0x1771e3(%rip), %rdx # 0x463698
leaq 0x17724d(%rip), %rcx # 0x463709
callq 0x2813f
movq 0x8(%rsp), %rdi
movq %rax, %r14
callq 0x2eca6c
jmp 0x2ec4d3
movq %rax, %r14
movq %rbx, %rdi
callq 0x2eca86
jmp 0x2ec4e0
movq %rax, %r14
addq $0x60, %r13
movq %r13, %rdi
callq 0x357fe
jmp 0x2ec4f1
movq %rax, %r14
movq 0x10(%rsp), %rdi
callq 0x35c1a
jmp 0x2ec500
movq %rax, %r14
movq 0x20(%rsp), %rdi
callq 0x3a954
movq %r14, %rdi
callq 0xb3d0
| /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>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false> const&, baryonyx::bit_array const&) | void init(const Solver& s, const Xtype& x)
{
switch (order) {
case solver_parameters::constraint_order::infeasibility_decr:
case solver_parameters::constraint_order::infeasibility_incr:
infeasibility_local_compute_violated_constraints(s, x);
break;
case solver_parameters::constraint_order::pi_sign_change:
std::iota(R.begin(), R.end(), 0);
break;
case solver_parameters::constraint_order::none:
case solver_parameters::constraint_order::reversing:
case solver_parameters::constraint_order::random_sorting:
case solver_parameters::constraint_order::lagrangian_decr:
case solver_parameters::constraint_order::lagrangian_incr:
default:
compute_violated_constraints(s, x, R);
break;
}
} | movl 0x30(%rdi), %ecx
movq %rdi, %rax
leal -0x3(%rcx), %edi
cmpl $0x2, %edi
jae 0x2ec528
movq %rax, %rdi
jmp 0x2ecabc
cmpl $0x7, %ecx
jne 0x2ec545
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0x2ec553
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0x2ec536
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0x2ecbd7
retq
| /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>, false>, baryonyx::bit_array, float>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float, float) | int push_and_run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
bool pi_changed = 0;
int remaining = 0;
if (use_cycle)
order = next_state(order);
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.push_and_compute_update_row(x,
R.crbegin(),
R.crend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
}
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl 0x30(%rdi), %eax
cmpb $0x1, 0x34(%rdi)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
jne 0x2ec78c
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 0x2ec925
leaq 0x176b06(%rip), %rdx # 0x4632a4
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 0x2ef1ca
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2ecbd7
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 0x2f00e6
jmp 0x2ec90e
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x2ef810
jmp 0x2ec856
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x2efc7b
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 0x2ef4f4
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2ecfea
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 0x2ef366
jmp 0x2ec937
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 0x2f05d8
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 0x2ef682
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2ecbd7
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 0x2ef366
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2ed206
| /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>, false> const, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_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 0x2ecae0
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 0x2ecbb7
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 0x2ecb65
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 0x2ecb3b
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rbx
movq 0x70(%rax), %rcx
imulq $0xc, %rbx, %rdx
movl (%rcx,%rdx), %eax
subl %r13d, %eax
jle 0x2ecb8d
shlq $0x20, %rax
orq %rbx, %rax
movq %rax, 0x8(%rsp)
jmp 0x2ecba0
subl 0x4(%rcx,%rdx), %r13d
jle 0x2ecbaf
shlq $0x20, %r13
orq %rbx, %r13
movq %r13, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbx
jmp 0x2ecb0d
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>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_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 0x2ecbf5
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x88(%r15), %esi
je 0x2ecc2b
movq %r15, %rdi
movq %r14, %rdx
callq 0x2ecc42
testb %al, %al
jne 0x2ecc23
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0x2ecbfc
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>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false> const&, int, baryonyx::bit_array const&) | bool
is_valid_constraint(const Solver& slv, int k, const Xtype& x)
{
typename sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = slv.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += slv.factor(it->value) * x[it->column];
return slv.bound_min(k) <= v && v <= slv.bound_max(k);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $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 0x2eccab
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 0x2ecc81
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq 0x70(%rax), %rax
imulq $0xc, %rcx, %rcx
cmpl %r13d, (%rax,%rcx)
jle 0x2eccc7
xorl %eax, %eax
jmp 0x2ecccf
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>, 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 0x2ecdd5
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 0x2ed248
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2ed266
movq %rax, 0x18(%rsp)
cltq
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2ed3bf
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 0x2ed3f2
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 0x2ed463
orb %al, %bpl
movq (%r14), %rax
addq $-0x4, %rax
movq %rax, (%r14)
jmp 0x2ecd15
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::quadratic_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 0x2eced4
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 0x2ed248
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2ed266
movq %rax, 0x18(%rsp)
cltq
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2ed3bf
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 0x2ed3f2
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 0x2ed463
orb %al, %bpl
addq $0x4, %r14
jmp 0x2ece1e
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::quadratic_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 0x2ecfd4
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 0x2ed248
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2ed266
movq %rax, 0x18(%rsp)
cltq
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2ed3bf
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 0x2ed3f2
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 0x2ed463
orb %al, %bpl
addq $0x8, %r14
jmp 0x2ecf1e
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::quadratic_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 0x2ed1f0
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 0x2ed248
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2ed266
movq %rax, 0x18(%rsp)
cltq
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2ed3bf
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 0x2ed3f2
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 0x2ed463
orb %al, %bpl
addq $0x4, %r14
jmp 0x2ed13a
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 |
baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::select_variables(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::rc_size const&, int, int) | int select_variables(const rc_size& sizes, int bkmin, int bkmax)
{
if (bkmin == bkmax)
return std::min(bkmin + sizes.c_size, sizes.r_size) - 1;
bkmin += sizes.c_size;
bkmax = std::min(bkmax + sizes.c_size, sizes.r_size);
for (int i = bkmin; i <= bkmax; ++i)
if (stop_iterating<Mode>(R[i].value, rng))
return i - 1;
return bkmax - 1;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rsi), %edi
leal (%rdi,%rdx), %eax
cmpl %ecx, %edx
jne 0x2ed412
movl (%rsi), %ecx
cmpl %eax, %ecx
cmovll %ecx, %eax
decl %eax
jmp 0x2ed45a
movl (%rsi), %esi
addl %edi, %ecx
movslq %eax, %r14
leal -0x1(%rdi,%rdx), %ebp
cmpl %ecx, %esi
cmovll %esi, %ecx
imulq $0xc, %r14, %r12
movslq %ecx, %r15
cmpq %r15, %r14
jg 0x2ed450
movq 0x68(%rbx), %rax
movq 0x8(%rbx), %rdi
vmovss (%rax,%r12), %xmm0
callq 0x53ae2
testb %al, %al
jne 0x2ed450
incq %r14
incl %ebp
addq $0xc, %r12
jmp 0x2ed429
leal -0x1(%r15), %eax
cmpq %r15, %r14
cmovlel %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::rc_data*>(baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::rc_data*, baryonyx::itm::solver_inequalities_101coeff<float, baryonyx::itm::minimize_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 0x2ed79d
vmovss (%rdi), %xmm0
leaq 0xc(%rsi), %r15
vucomiss (%rsi), %xmm0
movq %r15, %rsi
jne 0x2ed789
jnp 0x2ed771
addq $-0xc, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2edd33
movq %r15, %rdi
jmp 0x2ed76d
movq %rbx, %rdx
callq 0x2edd33
popq %rbx
popq %r14
popq %r15
retq
jmp 0x2ed7ad
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::quadratic_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 $0x48, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm3, 0x1c(%rsp)
vmovss %xmm2, 0x18(%rsp)
vmovss %xmm1, 0x14(%rsp)
vmovss %xmm0, 0x10(%rsp)
movq %rcx, 0x40(%rsp)
movq %rsi, %r15
movq %rdi, %r13
movq %rdx, 0x38(%rsp)
xorl %r12d, %r12d
movq %rax, 0x30(%rsp)
movq (%rdx), %rax
movq 0x40(%rsp), %rcx
cmpq (%rcx), %rax
je 0x2ef32f
movslq -0x4(%rax), %rbp
cmpl 0x88(%r13), %ebp
jge 0x2ef345
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
vmovss 0x18(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r13, %rdi
callq 0x2ed248
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r13, %rdi
movq %r15, %rcx
callq 0x2ed266
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
xorl %r14d, %r14d
movl %eax, %ecx
cmpq %rcx, %r14
je 0x2ef2c0
movq 0x68(%r13), %rax
movq 0x28(%rsp), %rcx
movq 0x80(%r13), %rdi
movq %r15, %rdx
movslq 0x8(%rax,%rbx), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x49ffa
movq 0x68(%r13), %rax
vmovss 0x1c(%rsp), %xmm1
incq %r14
vfmadd213ss (%rax,%rbx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rax,%rbx)
addq $0xc, %rbx
movl 0x8(%rsp), %eax
jmp 0x2ef276
movq 0x68(%r13), %rdi
cltq
movq 0x8(%r13), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2ed3bf
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 0x2ed3f2
vmovss 0x10(%rsp), %xmm0
vmovss 0x14(%rsp), %xmm1
movl 0x8(%rsp), %r9d
movq 0x28(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %eax, %r8d
callq 0x2ed463
movq 0x38(%rsp), %rcx
orb %al, %r12b
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x2ef20f
andb $0x1, %r12b
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x168e92(%rip), %rdi # 0x4581de
leaq 0x16b127(%rip), %rsi # 0x45a47a
leaq 0x17433e(%rip), %rdx # 0x463698
leaq 0x1743e6(%rip), %rcx # 0x463747
callq 0x2813f
| /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>, 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 0x2ef650
movslq (%r14), %rbp
cmpl 0x88(%r13), %ebp
jge 0x2ef661
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 0x2ed248
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0x2ed266
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
xorl %r15d, %r15d
movl %eax, %ecx
cmpq %rcx, %r15
je 0x2ef5e5
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 0x2ef59b
movq 0x68(%r13), %rdi
cltq
movq 0x8(%r13), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x2ed3bf
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 0x2ed3f2
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 0x2ed463
movq 0x40(%rsp), %rcx
addq $0x8, %r14
orb %al, %cl
movq %rcx, %rax
jmp 0x2ef533
andb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x168b76(%rip), %rdi # 0x4581de
leaq 0x16ae0b(%rip), %rsi # 0x45a47a
leaq 0x174022(%rip), %rdx # 0x463698
leaq 0x1740ca(%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::quadratic_cost_type<float>, false>, float, baryonyx::itm::minimize_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 0x2f0bda
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x1c(%rsp)
jmp 0x2f0be4
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 0x2ec27c
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 0x2f0cc5
cmpl $0x1, %eax
je 0x2f0c9f
cmpl $0x2, %eax
jne 0x2f0cd6
movq 0x18(%r14), %rdx
leaq 0x170(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0x2f0cb0
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x170(%rsp), %rsi
vmovsd 0x163380(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x593ae
jmp 0x2f0cd6
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x59339
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 0x2f0d48
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2f0d44
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2f0d21
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 0x1697f7(%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 0x2ec512
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 0x2f0eb9
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2ec554
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 0x2f0f61
cmpl %ebp, %ebx
jge 0x2f0e4f
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x2f1f7c
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0x2f0e85
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 0x2f0e8b
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2f0eb9
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2f1fb4
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0x2f0eb9
incq %r15
jmp 0x2f0dd4
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2f0edb
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2f0f0c
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 0x170(%rsp), %rdi
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x2ec9b4
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 0x2f1f2e
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 0x2f0ec8
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 0x2ec760
testl %eax, %eax
jne 0x2f1019
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 0x2f1f2e
movq %r14, %rdi
callq 0x2f1fb4
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0x2f0ec8
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2f1140
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2ec554
testl %eax, %eax
je 0x2f10f6
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2f10bd
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 0x2f10c9
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2f1140
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2f1fb4
testb %al, %al
jne 0x2f1134
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0x2f103e
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 0x2f1f2e
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0x2f1140
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0x2f0faa
jmp 0x2f1186
jmp 0x2f115f
jmp 0x2f1186
movq %rax, %r14
jmp 0x2f1196
movq %rax, %r14
jmp 0x2f11a3
movq %rax, %r14
jmp 0x2f11b0
movq %rax, %r14
jmp 0x2f11bd
movq %rax, %r14
jmp 0x2f11c7
jmp 0x2f1186
jmp 0x2f1186
jmp 0x2f1186
leaq 0x178(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2f1196
leaq 0x170(%rsp), %rdi
movq %rax, %r14
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x2ec9b4
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::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::file_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 0x2f12be
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x1c(%rsp)
jmp 0x2f12c8
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 0x2ec27c
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 0x2f13a9
cmpl $0x1, %eax
je 0x2f1383
cmpl $0x2, %eax
jne 0x2f13ba
movq 0x18(%r14), %rdx
leaq 0x170(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0x2f1394
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x170(%rsp), %rsi
vmovsd 0x162c9c(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x593ae
jmp 0x2f13ba
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x59339
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 0x2f142c
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2f1428
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2f1405
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 0x169113(%rip), %rdx # 0x45a577
leaq 0x170(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x2ec512
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 0x2f159d
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2ec554
movq 0x130(%rsp), %rdx
movq 0x158(%rsp), %rcx
movl %eax, %ebx
leaq 0x170(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x434d2
testl %ebx, %ebx
je 0x2f1645
cmpl %ebp, %ebx
jge 0x2f1533
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x2f2062
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0x2f1569
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 0x2f156f
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2f159d
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2f209a
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0x2f159d
incq %r15
jmp 0x2f14b8
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2f15bf
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2f15f0
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 0x170(%rsp), %rdi
callq 0x435d0
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x2ec9b4
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 0x2f2014
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 0x2f15ac
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 0x2ec760
testl %eax, %eax
jne 0x2f16fd
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 0x2f2014
movq %r14, %rdi
callq 0x2f209a
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0x2f15ac
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2f1824
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0x2ec554
testl %eax, %eax
je 0x2f17da
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2f17a1
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 0x2f17ad
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0x2f1824
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0x2f209a
testb %al, %al
jne 0x2f1818
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0x2f1722
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 0x2f2014
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0x2f1824
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0x2f168e
jmp 0x2f186a
jmp 0x2f1843
jmp 0x2f186a
movq %rax, %r14
jmp 0x2f187a
movq %rax, %r14
jmp 0x2f1887
movq %rax, %r14
jmp 0x2f1894
movq %rax, %r14
jmp 0x2f18a1
movq %rax, %r14
jmp 0x2f18ab
jmp 0x2f186a
jmp 0x2f186a
jmp 0x2f186a
leaq 0x178(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2f187a
leaq 0x170(%rsp), %rdi
movq %rax, %r14
callq 0x435d0
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x2ec9b4
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::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_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 0x2f1f7a
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2f1ff4
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::quadratic_cost_type<float>, false>, float, baryonyx::itm::minimize_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 0x167aa3(%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::quadratic_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long) | void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
} | vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2f2060
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2f20da
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::quadratic_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::file_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1679bd(%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::quadratic_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::none_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1678d7(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::result baryonyx::itm::solve_problem<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
solve_problem(const context& ctx, const problem& pb)
{
if (ctx.start)
ctx.start(ctx.parameters);
result ret;
auto variables = length(pb.vars.values);
auto constraints{ make_merged_constraints(ctx, pb) };
if (!constraints.empty() && !pb.vars.values.empty()) {
random_engine rng(init_random_generator_seed(ctx));
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
switch (ctx.parameters.observer) {
case solver_parameters::observer_type::pnm: {
using obs = pnm_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
case solver_parameters::observer_type::file: {
using obs = file_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
default: {
using obs = none_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
break;
}
}
} else {
ret.status = result_status::success;
ret.solutions.resize(1);
ret.solutions.back().value = pb.objective.value;
}
ret.strings = pb.strings;
ret.variable_name = std::move(pb.vars.names);
ret.affected_vars = std::move(pb.affected_vars);
ret.variables = variables;
ret.constraints = length(constraints);
if (ctx.finish)
ctx.finish(ret);
return ret;
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x130, %rsp # imm = 0x130
cmpq $0x0, 0x128(%rsi)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
je 0x2f286e
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 0x2f2997
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0x2f2997
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 0x625f0
vmovsd 0x40(%r15), %xmm0
movl 0xe4(%r14), %eax
vxorps %xmm1, %xmm1, %xmm1
leaq 0x30(%rsp), %rsi
cmpl $0x1, %eax
je 0x2f29be
cmpl $0x2, %eax
jne 0x2f2a0d
movabsq $-0x10000000000000, %r9 # imm = 0xFFF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2f936a
jmp 0x2f2a5a
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 0x2f2a89
movabsq $-0x10000000000000, %r9 # imm = 0xFFF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2f8cea
jmp 0x2f2a5a
movabsq $-0x10000000000000, %r9 # imm = 0xFFF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x2f99ea
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 0x29066
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 0x2f2af5
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 0x2f2b17
jmp 0x2f2b17
leaq 0x58(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x28(%rsp), %rdi
callq 0x29066
jmp 0x2f2b3a
jmp 0x2f2b37
movq %rax, %r14
jmp 0x2f2b44
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
optimize_problem(const context& ctx, const problem& pb)
{
result r;
if (ctx.start)
ctx.start(ctx.parameters);
auto constraints{ make_merged_constraints(ctx, pb) };
if (constraints.empty() || pb.vars.values.empty()) {
r.status = result_status::success;
r.solutions.resize(1);
r.solutions.back().value = pb.objective.value;
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
return r;
}
random_engine rng(init_random_generator_seed(ctx));
auto variables = length(pb.vars.values);
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
const auto thread = get_thread_number(ctx);
std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors;
std::vector<std::thread> pool(thread);
best_solution_recorder<Cost, Float, Mode> best_recorder(
rng,
thread,
cost,
cost_constant,
variables,
constraints,
ctx.parameters.init_population_size);
auto seeds = generate_seed(rng, thread);
std::atomic_bool stop_task;
stop_task.store(false);
for (unsigned i = 0u; i != thread; ++i)
functors.emplace_back(ctx, i, seeds[i]);
for (unsigned i = 0u; i != thread; ++i)
pool[i] = std::thread(std::ref(functors[i]),
std::ref(stop_task),
std::ref(best_recorder),
std::cref(constraints),
variables,
std::cref(cost),
cost_constant);
const auto start = std::chrono::steady_clock::now();
auto end = start;
do {
std::this_thread::sleep_for(std::chrono::seconds{ 1L });
if (ctx.update) {
auto call_number = 0L;
for (auto i = 0u; i != thread; ++i)
call_number += functors[i].m_call_number;
int constraints_remaining;
long int loop;
double value;
double duration;
best_recorder.get_best(
constraints_remaining, value, duration, loop);
ctx.update(
constraints_remaining, value, loop, duration, call_number);
}
end = std::chrono::steady_clock::now();
} while (!is_time_limit(ctx.parameters.time_limit, start, end));
stop_task.store(true);
for (auto& t : pool)
t.join();
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
r.variables = variables;
r.constraints = length(constraints);
const auto& first = best_recorder.get_best(0);
if (!first.is_solution())
r.status = result_status::time_limit_reached;
else
r.status = result_status::success;
r.duration = first.duration;
r.loop = first.loop;
r.remaining_constraints = first.remaining_constraints;
switch (ctx.parameters.storage) {
case solver_parameters::storage_type::one: {
r.solutions.resize(1);
convert(first, r.solutions[0], variables);
} break;
case solver_parameters::storage_type::bound: {
r.solutions.resize(2);
convert(first, r.solutions[0], variables);
convert(best_recorder.get_worst(), r.solutions[1], variables);
} break;
case solver_parameters::storage_type::five: {
r.solutions.resize(5);
for (int i = 0; i != 5; ++i)
convert(best_recorder.get_best(i), r.solutions[i], variables);
} break;
}
best_recorder.show_population(ctx);
if (ctx.finish)
ctx.finish(r);
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $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 0x2f2bba
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 0x2f2d16
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x2f2d16
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 0x625f0
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 0x62666
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 0x2f2d71
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2fa28a
movl 0x8(%rsp), %eax
incl %eax
jmp 0x2f2ced
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 0x2f3106
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 0x2f2e32
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 0x2fa2d6
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 0x2f2d91
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 0x2f2ec7
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x2f2e88
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x2f2e72
leaq 0xd0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x6ae6e
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 0x166b96(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x2f2e4d
vucomisd %xmm0, %xmm1
jbe 0x2f2e4d
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x2f2f28
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x2f2f15
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 0x2f3083
cmpl $0x1, %eax
je 0x2f304b
cmpl $0x2, %eax
jne 0x2f30a2
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x2f30a2
movq 0x108(%rsp), %rax
movq (%rbx), %rsi
movl 0x4(%rsp), %edx
movslq (%rax,%r15,4), %rax
addq %r14, %rsi
imulq $0x38, %rax, %rdi
addq 0x120(%rsp), %rdi
callq 0x35781
incq %r15
addq $0x20, %r14
jmp 0x2f3011
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x35781
leaq 0xd0(%rsp), %rdi
callq 0x6aeec
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x2f3096
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x35781
leaq 0xc8(%rsp), %rdi
movq %r13, %rsi
callq 0x627ca
cmpq $0x0, 0x168(%r13)
je 0x2f30ce
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0x627de
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x2ff29c
leaq 0x68(%rsp), %rdi
callq 0x29066
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 0x2f3167
movq %rax, %rbx
jmp 0x2f3174
movq %rax, %rbx
jmp 0x2f3181
jmp 0x2f314b
jmp 0x2f313c
jmp 0x2f315a
jmp 0x2f315a
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x2f319f
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x2f3195
jmp 0x2f315a
jmp 0x2f315a
jmp 0x2f315a
jmp 0x2f315a
jmp 0x2f315a
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0x627de
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x2ff29c
leaq 0x68(%rsp), %rdi
callq 0x29066
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::itm::optimize_functor<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<double>, double, baryonyx::itm::maximize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<double> const&, double) | void operator()(const std::atomic_bool& stop_task,
best_solution_recorder<Cost, Float, Mode>& best_recorder,
const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
bit_array x(variables);
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_local_ctx.rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const auto w_limit = static_cast<long int>(p.w);
Solver slv(m_local_ctx.rng,
length(constraints),
variables,
norm_costs,
constraints);
compute_order compute(p.order, variables);
bool is_a_solution = false;
while (!stop_task.load()) {
++m_call_number;
const auto kappa_start = static_cast<Float>(best_recorder.reinit(
m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x));
auto kappa = kappa_start;
compute.init(slv, x);
auto best_remaining = INT_MAX;
is_a_solution = false;
for (long int i = 0; !stop_task.load() && i != p.limit; ++i) {
auto remaining =
compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
i);
best_remaining = 0;
is_a_solution = true;
break;
} else {
best_remaining = std::min(remaining, best_remaining);
}
if (i > w_limit)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
if (best_remaining > 0) {
best_recorder.try_advance(
m_local_ctx, x, best_remaining, p.limit);
continue;
}
for (int push = 0; !stop_task.load() && push < p.pushes_limit;
++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_local_ctx.rng,
pushing_k_factor,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
is_a_solution = true;
}
kappa = kappa_start;
for (int iter = 0;
!stop_task.load() && iter < p.pushing_iteration_limit;
++iter) {
remaining = compute.run(
slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
is_a_solution = true;
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
}
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp # imm = 0x168
movq %rdi, %rbp
leaq 0x8(%rsp), %rdi
movq %rsi, %r15
movl %r8d, %esi
vmovsd %xmm0, 0x48(%rsp)
movq %r9, %r12
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x18(%rsp)
callq 0x368ae
movq (%rbp), %r13
movq %rbp, 0x50(%rsp)
addq $0x8, %rbp
leaq 0x78(%rsp), %rdi
movq %r13, %rsi
movq %r12, 0x40(%rsp)
movq %r12, %rdx
movq %rbp, %rcx
movl %ebx, %r8d
callq 0x64935
vmovsd 0x20(%r13), %xmm0
vmovsd 0x10(%r13), %xmm1
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x28(%r13), %xmm0
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x70(%rsp)
vmovsd 0x30(%r13), %xmm0
vmovsd %xmm0, 0x60(%rsp)
vmovsd 0x8(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x2f39a4
movq 0x50(%rsp), %rax
movq (%rax), %rdi
vmovsd 0x38(%rsp), %xmm0
leaq 0x78(%rsp), %rsi
movl %ebx, %edx
callq 0x64a13
vmovsd %xmm0, 0x30(%rsp)
vcvttsd2si 0xa0(%r13), %rax
vmovsd 0x38(%r13), %xmm0
vmovsd 0x40(%r13), %xmm1
movq %rax, 0x88(%rsp)
movq 0x8(%r14), %rax
vmovsd %xmm0, 0x98(%rsp)
vmovsd %xmm1, 0x90(%rsp)
subq (%r14), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd8(%rsp), %rdi
leaq 0x78(%rsp), %r8
movq %rbp, %rsi
movl %eax, %edx
movl %ebx, %ecx
movq %r14, %r9
callq 0x2f3dc2
movl 0xcc(%r13), %esi
leaq 0xa0(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq $0x0, (%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x2f3d2a
movq 0x50(%rsp), %rax
incq 0xb0(%rax)
vmovsd 0x18(%r13), %xmm0
vmovsd 0x28(%r13), %xmm1
movzbl (%rsp), %edx
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rbx
movq %rbp, %rsi
movq %rbx, %rcx
andl $0x1, %edx
callq 0x64cb4
vmovsd %xmm0, 0x58(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdx
callq 0x2f4086
vmovsd 0x58(%rsp), %xmm0
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movb (%r15), %al
testb $0x1, %al
jne 0x2f3b26
cmpq 0xb0(%r13), %r14
je 0x2f3b26
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbp, %rcx
vmovsd %xmm0, 0x20(%rsp)
callq 0x2f40c8
testl %eax, %eax
je 0x2f3b3d
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0x88(%rsp), %r14
jle 0x2f3b10
vcvtsi2sd %eax, %xmm3, %xmm0
vcvtsi2sdl 0x160(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x20(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x2f3b16
vmovsd 0x20(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x2f3b26
incq %r14
jmp 0x2f3a87
testl %ebx, %ebx
jg 0x2f3d0a
leaq 0x8(%rsp), %rbx
movq $0x0, (%rsp)
jmp 0x2f3b6e
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x62f18
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x65002
movb $0x1, %al
movq %rax, (%rsp)
xorl %r14d, %r14d
movl $0x0, 0x2c(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x2f3a1c
cmpl 0xbc(%r13), %r14d
jge 0x2f3a1c
vmovsd 0x98(%rsp), %xmm0
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
vmovsd 0x90(%rsp), %xmm3
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x2f42d4
testl %eax, %eax
jne 0x2f3c07
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x62f18
movl 0xc0(%r13), %eax
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
imull %r14d, %eax
notl %eax
movslq %eax, %rcx
callq 0x65002
movb $0x1, %al
movq %rax, (%rsp)
pushq $0x1
popq %rax
vmovsd 0x58(%rsp), %xmm0
movl %eax, %ebx
movb (%r15), %al
testb $0x1, %al
jne 0x2f3cb5
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0x2f3cb5
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbp, %rcx
vmovsd %xmm0, 0x20(%rsp)
callq 0x2f40c8
testl %eax, %eax
je 0x2f3cbc
vcvtsi2sd %r12d, %xmm4, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0x2f3ca0
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x160(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x20(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x2f3ca6
vmovsd 0x20(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x2f3cb5
incl %ebx
jmp 0x2f3c12
leaq 0x8(%rsp), %rbx
jmp 0x2f3cfe
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0x62f18
movl 0xc0(%r13), %eax
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
imull 0x2c(%rsp), %eax
subl %ebx, %eax
movq %r12, %rbx
movslq %eax, %rcx
callq 0x65002
movb $0x1, %al
movq %rax, (%rsp)
decl 0x2c(%rsp)
incl %r14d
jmp 0x2f3b79
movq 0xb0(%r13), %r8
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0x6508a
jmp 0x2f3a14
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2f4528
leaq 0x80(%rsp), %rdi
callq 0x29066
leaq 0x10(%rsp), %rdi
callq 0x357fe
addq $0x168, %rsp # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2f3d74
movq %rax, %rbx
jmp 0x2f3d96
movq %rax, %rbx
jmp 0x2f3da3
movq %rax, %rbx
jmp 0x2f3db0
jmp 0x2f3d86
jmp 0x2f3d86
jmp 0x2f3d86
jmp 0x2f3d86
leaq 0xa0(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2f4528
leaq 0x80(%rsp), %rdi
callq 0x29066
leaq 0x10(%rsp), %rdi
callq 0x357fe
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>::solver_inequalities_101coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::default_cost_type<double> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&) | solver_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 0x16f8a2(%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 0x2900a
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 0x2f456b
movslq %ebp, %r13
leaq 0x70(%r12), %rdi
movq %r13, %rsi
movq %rdi, 0x8(%rsp)
callq 0x2f45ab
leaq 0x78(%r12), %rdi
movq %r13, %rsi
callq 0x2900a
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 0x2f3fd8
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 0x2f3f31
movl (%r13), %eax
leal 0x1(%rax), %ecx
testl $0xfffffffd, %ecx # imm = 0xFFFFFFFD
jne 0x2f3fe7
movq %r14, %rdi
movl %ebp, %esi
testl %eax, %eax
jle 0x2f3f10
callq 0x369c8
jmp 0x2f3f15
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 0x2f3ee8
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 0x2f3f69
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 0x2f3f9e
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 0x2f4008
movq 0x8(%rax), %rdx
addl %r15d, %ebx
incq %r9
subq (%rax), %rdx
shrq $0x3, %rdx
cmpl %edx, %ebx
je 0x2f3ec2
leaq 0x16446c(%rip), %rdi # 0x45842a
leaq 0x16f748(%rip), %rsi # 0x46370d
leaq 0x16f6cc(%rip), %rdx # 0x463698
leaq 0x16f764(%rip), %rcx # 0x463737
callq 0x2813f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16443c(%rip), %rdi # 0x45842a
leaq 0x166238(%rip), %rsi # 0x45a22d
leaq 0x16f69c(%rip), %rdx # 0x463698
leaq 0x16f702(%rip), %rcx # 0x463705
callq 0x2813f
leaq 0x16441b(%rip), %rdi # 0x45842a
leaq 0x166293(%rip), %rsi # 0x45a2a9
leaq 0x16f67b(%rip), %rdx # 0x463698
leaq 0x16f6e5(%rip), %rcx # 0x463709
callq 0x2813f
movq 0x8(%rsp), %rdi
movq %rax, %r14
callq 0x2f45e8
jmp 0x2f403b
movq %rax, %r14
movq %rbx, %rdi
callq 0x2f4602
jmp 0x2f4048
movq %rax, %r14
leaq 0x60(%r12), %rdi
callq 0x357fe
jmp 0x2f4057
movq %rax, %r14
movq 0x10(%rsp), %rdi
callq 0x29066
jmp 0x2f4066
movq %rax, %r14
movq 0x20(%rsp), %rdi
callq 0x3a954
movq %r12, %rdi
callq 0xb853a
movq %r14, %rdi
callq 0xb3d0
movq %rax, %r14
jmp 0x2f4070
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true> const, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true> const&, baryonyx::bit_array const&) | int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x2f465c
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 0x2f4733
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 0x2f46e1
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 0x2f46b7
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rbx
movq 0x70(%rax), %rcx
imulq $0xc, %rbx, %rdx
movl (%rcx,%rdx), %eax
subl %r13d, %eax
jle 0x2f4709
shlq $0x20, %rax
orq %rbx, %rax
movq %rax, 0x8(%rsp)
jmp 0x2f471c
subl 0x4(%rcx,%rdx), %r13d
jle 0x2f472b
shlq $0x20, %r13
orq %rbx, %r13
movq %r13, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbx
jmp 0x2f4689
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 |
bool baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, double, double, double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto 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 $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x60(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x50(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x1678c0(%rip), %rdx # 0x45c344
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
pushq $0x16
popq %r13
leaq 0x16ec8a(%rip), %rbp # 0x46373b
pushq $0xb
popq %rbx
movq %r15, 0x30(%rsp)
cmpq 0x38(%rsp), %r14
je 0x2f4c2c
movl (%r14), %edx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movq %rax, 0x48(%rsp)
movq %r14, 0x40(%rsp)
movl %edx, 0x8(%rsp)
callq 0x3de66
vmovsd 0x50(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x2f5174
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2f5192
movq %rax, 0x10(%rsp)
movslq %eax, %rsi
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x2f52d6
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x2f530a
movslq 0x8(%rsp), %rcx
movl %eax, 0xc(%rsp)
leaq 0x16c4e4(%rip), %rdx # 0x461045
movq %r12, %rdi
movq %r13, %r14
movq %r13, %rsi
imulq $0xc, %rcx, %r8
addq 0x70(%r12), %r8
leaq 0x8(%rsp), %rcx
callq 0xb91c2
pushq $0xc
popq %r15
xorl %r13d, %r13d
movslq 0x10(%rsp), %rax
cmpq %rax, %r13
jge 0x2f4bb8
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0xc(%rax,%r15), %r8
leaq -0x4(%rax,%r15), %rcx
leaq (%rax,%r15), %r9
callq 0x2f537e
incq %r13
addq $0x10, %r15
jmp 0x2f4b84
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x16c493(%rip), %rdx # 0x46105c
leaq 0xc(%rsp), %r8
movq %r12, %rdi
movq %r14, %r13
movq %r14, %rsi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x30(%rsp), %r15
movq 0x20(%rsp), %rdx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x2f53af
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x2f4ab9
andb $0x1, %al
addq $0x68, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<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>>>>, double, double, double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto 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 $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x60(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x50(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x1676d4(%rip), %rdx # 0x45c344
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
pushq $0x16
popq %r13
leaq 0x16ea9e(%rip), %rbp # 0x46373b
pushq $0xb
popq %rbx
movq %r15, 0x30(%rsp)
cmpq 0x38(%rsp), %r14
je 0x2f4e18
movl (%r14), %edx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movq %rax, 0x48(%rsp)
movq %r14, 0x40(%rsp)
movl %edx, 0x8(%rsp)
callq 0x3de66
vmovsd 0x50(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x2f5174
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2f5192
movq %rax, 0x10(%rsp)
movslq %eax, %rsi
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x2f52d6
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x2f530a
movslq 0x8(%rsp), %rcx
movl %eax, 0xc(%rsp)
leaq 0x16c2f8(%rip), %rdx # 0x461045
movq %r12, %rdi
movq %r13, %r14
movq %r13, %rsi
imulq $0xc, %rcx, %r8
addq 0x70(%r12), %r8
leaq 0x8(%rsp), %rcx
callq 0xb91c2
pushq $0xc
popq %r15
xorl %r13d, %r13d
movslq 0x10(%rsp), %rax
cmpq %rax, %r13
jge 0x2f4da4
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0xc(%rax,%r15), %r8
leaq -0x4(%rax,%r15), %rcx
leaq (%rax,%r15), %r9
callq 0x2f537e
incq %r13
addq $0x10, %r15
jmp 0x2f4d70
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x16c2a7(%rip), %rdx # 0x46105c
leaq 0xc(%rsp), %r8
movq %r12, %rdi
movq %r14, %r13
movq %r14, %rsi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x30(%rsp), %r15
movq 0x20(%rsp), %rdx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x2f53af
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %r14
orb %al, %cl
addq $0x8, %r14
movq %rcx, %rax
jmp 0x2f4ca5
andb $0x1, %al
addq $0x68, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, double, double, double, double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float 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 $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x60(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x50(%rsp), %r9
movq %rdx, %r14
vmovsd %xmm3, 0x30(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x164dc3(%rip), %rdx # 0x45c33f
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
pushq $0x16
popq %r13
leaq 0x16c192(%rip), %rbp # 0x46373b
pushq $0xb
popq %rbx
movq %r15, 0x28(%rsp)
cmpq 0x38(%rsp), %r14
je 0x2f7772
movl (%r14), %edx
movl %edx, (%rsp)
cmpl 0x88(%r12), %edx
jge 0x2f7783
movq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdi
movq %rax, 0x48(%rsp)
callq 0x3de66
vmovsd 0x50(%rsp), %xmm0
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r12, %rdi
callq 0x2f5174
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2f5192
vmovsd 0x30(%rsp), %xmm1
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdx
movl %eax, %esi
shlq $0x4, %rsi
xorl %r8d, %r8d
movq 0x68(%r12), %rdi
movq 0x80(%r12), %rcx
cmpq %r8, %rsi
je 0x2f7662
movslq 0xc(%rdi,%r8), %r9
movq 0x8(%rcx), %r10
movslq 0x4(%rdx,%r9,8), %r9
vmovsd (%r10,%r9,8), %xmm0
vfmadd213sd (%rdi,%r8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rdi,%r8)
addq $0x10, %r8
jmp 0x2f7637
movq 0x8(%r12), %rdx
movslq %eax, %rsi
movq %r14, 0x40(%rsp)
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x2f52d6
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 0x2f530a
movslq (%rsp), %rcx
movl %eax, 0x4(%rsp)
leaq 0x16999a(%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 $0xc
popq %r15
xorl %r13d, %r13d
movslq 0x8(%rsp), %rax
cmpq %rax, %r13
jge 0x2f7700
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0xc(%rax,%r15), %r8
leaq -0x4(%rax,%r15), %rcx
leaq (%rax,%r15), %r9
callq 0x2f537e
incq %r13
addq $0x10, %r15
jmp 0x2f76cc
movslq (%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x16994c(%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
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x28(%rsp), %r15
movq 0x18(%rsp), %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
movl 0x8(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x2f53af
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %r14
orb %al, %cl
addq $0x8, %r14
movq %rcx, %rax
jmp 0x2f75b1
andb $0x1, %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x160a54(%rip), %rdi # 0x4581de
leaq 0x162ce9(%rip), %rsi # 0x45a47a
leaq 0x16bf00(%rip), %rdx # 0x463698
leaq 0x16bfa8(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3b8, %rsp # imm = 0x3B8
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x20(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x64935
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm1
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x28(%r12), %xmm0
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x70(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x60(%rsp)
vmovsd 0x8(%r12), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x2f9452
movq 0x10(%r14), %rdi
vmovsd 0x38(%rsp), %xmm0
leaq 0x78(%rsp), %rsi
movl %ebx, %edx
callq 0x64a13
vmovsd %xmm0, 0x30(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x50(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x90(%rsp)
vmovsd %xmm1, 0x88(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd0(%rsp), %rdi
leaq 0x78(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2f3dc2
movl 0xcc(%r12), %esi
leaq 0x98(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x5c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x160(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x2f9533
cmpl $0x1, %eax
je 0x2f950d
cmpl $0x2, %eax
jne 0x2f9544
movq 0x18(%r14), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x20(%rsp), %rsi
jmp 0x2f951e
movq 0x18(%r14), %rdx
leaq 0x20(%rsp), %rdi
leaq 0x160(%rsp), %rsi
vmovsd 0x15ab12(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x62c65
jmp 0x2f9544
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x62bf9
leaq 0x20(%rsp), %r15
movq %r13, 0x40(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x2f957a
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2f9576
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2f9553
leaq 0x168(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x158(%rsp), %ecx
movl 0x15c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x8(%rsp)
leaq 0x160fc5(%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 0x20(%rsp), %rdx
callq 0x2f4086
vmovsd 0x8(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x20(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x2f96e5
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq %r13, %rdx
vmovsd %xmm0, 0x8(%rsp)
callq 0x2f40c8
movq 0x120(%rsp), %rdx
movq 0x148(%rsp), %rcx
movl %eax, %ebx
leaq 0x160(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x6c6c0
testl %ebx, %ebx
je 0x2f978a
cmpl %ebp, %ebx
jge 0x2f9681
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x2fa110
movl %ebx, %ebp
cmpq 0x50(%rsp), %r15
jle 0x2f96b7
vcvtsi2sd %ebx, %xmm3, %xmm0
vcvtsi2sdl 0x158(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x2f96bd
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x2f96e5
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x2fa148
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x2f96e5
incq %r15
jmp 0x2f9600
movq 0x10(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2f9707
movq 0x10(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2f9735
movq 0x10(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x5c(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x160(%rsp), %rdi
callq 0x435d0
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2f4528
leaq 0x80(%rsp), %rdi
callq 0x29066
leaq 0x28(%rsp), %rdi
callq 0x357fe
movq 0x10(%rsp), %rax
addq $0x3b8, %rsp # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x62f18
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2fa0c6
vmovsd 0x8(%rsp), %xmm0
leaq 0xd0(%rsp), %r15
leaq 0x20(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x1c(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2f96f4
vmovsd %xmm0, 0x8(%rsp)
vmulsd 0x90(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
vmovsd 0x88(%rsp), %xmm3
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2f42d4
testl %eax, %eax
jne 0x2f9848
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x62f18
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2fa0c6
movq %r14, %rdi
callq 0x2fa148
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x2f96f4
movl %ebx, 0x50(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2f9951
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovsd %xmm0, 0x8(%rsp)
callq 0x2f40c8
testl %eax, %eax
je 0x2f9913
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2f98e6
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x158(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x2f98ec
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x2f9951
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x2fa148
testb %al, %al
jne 0x2f994b
vmovsd 0x8(%rsp), %xmm0
incl %ebx
jmp 0x2f9867
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x62f18
movl 0xc0(%r12), %eax
imull 0x1c(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2fa0c6
vmovsd 0x8(%rsp), %xmm0
jmp 0x2f9951
vmovsd 0x8(%rsp), %xmm0
movl 0x50(%rsp), %ebx
decl 0x1c(%rsp)
incl %ebx
jmp 0x2f97cd
jmp 0x2f9997
jmp 0x2f9970
jmp 0x2f9997
movq %rax, %r14
jmp 0x2f99a7
movq %rax, %r14
jmp 0x2f99b4
movq %rax, %r14
jmp 0x2f99c1
movq %rax, %r14
jmp 0x2f99ce
movq %rax, %r14
jmp 0x2f99d8
jmp 0x2f9997
jmp 0x2f9997
jmp 0x2f9997
leaq 0x168(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2f99a7
leaq 0x160(%rsp), %rdi
movq %rax, %r14
callq 0x435d0
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2f4528
leaq 0x80(%rsp), %rdi
callq 0x29066
leaq 0x28(%rsp), %rdi
callq 0x357fe
movq 0x10(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long) | inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
} | vucomisd 0x30(%rdi), %xmm0
jbe 0x2fa10e
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2fa188
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::none_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x15f82d(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false> const&, baryonyx::bit_array const&) | void init(const Solver& s, const Xtype& x)
{
switch (order) {
case solver_parameters::constraint_order::infeasibility_decr:
case solver_parameters::constraint_order::infeasibility_incr:
infeasibility_local_compute_violated_constraints(s, x);
break;
case solver_parameters::constraint_order::pi_sign_change:
std::iota(R.begin(), R.end(), 0);
break;
case solver_parameters::constraint_order::none:
case solver_parameters::constraint_order::reversing:
case solver_parameters::constraint_order::random_sorting:
case solver_parameters::constraint_order::lagrangian_decr:
case solver_parameters::constraint_order::lagrangian_incr:
default:
compute_violated_constraints(s, x, R);
break;
}
} | movl 0x30(%rdi), %ecx
movq %rdi, %rax
leal -0x3(%rcx), %edi
cmpl $0x2, %edi
jae 0x2fae2e
movq %rax, %rdi
jmp 0x2fb3c6
cmpl $0x7, %ecx
jne 0x2fae4b
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0x2fae59
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0x2fae3c
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0x2fb4e1
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array, double>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, double, double, double) | int run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta)
{
bool pi_changed = false;
int remaining = 0;
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.compute_update_row(
x, R.crbegin(), R.crend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
}
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl 0x30(%rdi), %eax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decl %eax
cmpl $0x6, %eax
ja 0x2faf99
leaq 0x168477(%rip), %rdx # 0x4632f8
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
callq 0x2fb5e8
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2fb4e1
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x2fcffc
jmp 0x2fafce
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x2fc726
jmp 0x2faf2a
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x2fcb91
vmovsd 0x8(%rsp), %xmm0
vmovsd 0x10(%rsp), %xmm1
vmovsd 0x18(%rsp), %xmm2
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2fb7ee
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2fb8ea
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x3ceed
vmovsd 0x8(%rsp), %xmm0
vmovsd 0x10(%rsp), %xmm1
vmovsd 0x18(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2fb6f2
jmp 0x2faff2
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x2fd4ee
vmovsd 0x8(%rsp), %xmm0
vmovsd 0x10(%rsp), %xmm1
vmovsd 0x18(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2fba06
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2fb4e1
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x3ceed
vmovsd 0x8(%rsp), %xmm0
vmovsd 0x10(%rsp), %xmm1
vmovsd 0x18(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2fb6f2
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2fbb02
nop
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, double, double, double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto 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
vmovsd %xmm2, 0x28(%rsp)
vmovsd %xmm1, 0x20(%rsp)
vmovsd %xmm0, 0x18(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
cmpq 0x30(%rsp), %r14
je 0x2fb8d5
movslq (%r14), %rbx
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x3de66
vmovsd 0x28(%rsp), %xmm0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x2fbb44
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2fbb62
movq %rax, (%rsp)
movslq %eax, %rsi
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x2fbca6
movq 0x70(%r12), %rax
imulq $0xc, %rbx, %rcx
movq %r12, %rdi
movq %rsp, %rsi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2fbcda
vmovsd 0x18(%rsp), %xmm0
vmovsd 0x20(%rsp), %xmm1
movl (%rsp), %r9d
movq 0x10(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
callq 0x2fbd4e
orb %al, %bpl
addq $0x8, %r14
jmp 0x2fb822
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 |
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>&, baryonyx::bit_array const&) | int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x2fb90e
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 0x2fb9e5
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 0x2fb993
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 0x2fb969
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rbx
movq 0x70(%rax), %rcx
imulq $0xc, %rbx, %rdx
movl (%rcx,%rdx), %eax
subl %r13d, %eax
jle 0x2fb9bb
shlq $0x20, %rax
orq %rbx, %rax
movq %rax, 0x8(%rsp)
jmp 0x2fb9ce
subl 0x4(%rcx,%rdx), %r13d
jle 0x2fb9dd
shlq $0x20, %r13
orq %rbx, %r13
movq %r13, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbx
jmp 0x2fb93b
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::affect<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, double>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, double, double) | bool
affect(Solver& slv,
Xtype& x,
Iterator it,
int k,
int selected,
int r_size,
const Float kappa,
const Float delta)
{
constexpr Float one{ 1 };
constexpr Float two{ 2 };
constexpr Float middle{ (two + one) / two };
const auto old_pi = slv.pi[k];
auto d = delta;
if (selected < 0) {
// slv.pi[k] += slv.R[0].value / two;
d += (kappa / (one - kappa)) * (slv.R[0].value / two);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
} else if (selected + 1 >= r_size) {
// slv.pi[k] += slv.R[selected].value * middle;
d += (kappa / (one - kappa)) * (slv.R[selected].value * middle);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
} else {
slv.pi[k] +=
((slv.R[selected].value + slv.R[selected + 1].value) / two);
d += (kappa / (one - kappa)) *
(slv.R[selected + 1].value - slv.R[selected].value);
int i = 0;
for (; i <= selected; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
for (; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
}
// TODO job: develops is_valid_constraint for all the solvers
bx_expects(is_valid_constraint(slv, k, x));
return is_signbit_change(old_pi, slv.pi[k]);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x78(%rdi), %rax
movl %ecx, 0xc(%rsp)
movslq %ecx, %rcx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rcx, 0x10(%rsp)
vmovsd (%rax,%rcx,8), %xmm2
vmovaps %xmm2, 0x20(%rsp)
testl %r8d, %r8d
js 0x2fbe57
leal 0x1(%r8), %ecx
cmpl %r9d, %ecx
jge 0x2fbee6
movq 0x68(%rbx), %rsi
movl %r8d, %edx
shlq $0x4, %rdx
movl %ecx, %ebp
movq %rbp, 0x18(%rsp)
shlq $0x4, %rbp
movq 0x10(%rsp), %rcx
xorl %r13d, %r13d
movl %r9d, 0x8(%rsp)
vmovsd (%rsi,%rdx), %xmm2
vaddsd (%rsi,%rbp), %xmm2, %xmm2
vmulsd 0x15cbad(%rip), %xmm2, %xmm2 # 0x458978
vaddsd 0x20(%rsp), %xmm2, %xmm2
vmovsd %xmm2, (%rax,%rcx,8)
vmovsd 0x15825a(%rip), %xmm2 # 0x454038
vsubsd %xmm0, %xmm2, %xmm2
vdivsd %xmm2, %xmm0, %xmm0
vmovsd (%rsi,%rbp), %xmm2
vsubsd (%rsi,%rdx), %xmm2, %xmm2
vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovsd %xmm2, (%rsp)
cmpq %r13, %rbp
je 0x2fbf7d
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq 0xc(%rax,%r13), %r12
cmpl $0x0, 0x8(%rax,%r13)
movl 0x4(%r15,%r12,8), %esi
js 0x2fbe35
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
jmp 0x2fbe4c
callq 0x36a06
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
addq $0x10, %r13
jmp 0x2fbdfa
vmovsd 0x1581d9(%rip), %xmm2 # 0x454038
movq 0x68(%rbx), %rax
movl %r9d, %r12d
shlq $0x4, %r12
xorl %ebp, %ebp
vsubsd %xmm0, %xmm2, %xmm2
vdivsd %xmm2, %xmm0, %xmm0
vmovsd (%rax), %xmm2
vmulsd 0x15caf8(%rip), %xmm2, %xmm2 # 0x458978
vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovsd %xmm2, (%rsp)
cmpq %rbp, %r12
je 0x2fbfe3
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq 0xc(%rax,%rbp), %r13
cmpl $0x0, 0x8(%rax,%rbp)
movl 0x4(%r15,%r13,8), %esi
js 0x2fbec4
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
jmp 0x2fbedb
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
addq $0x10, %rbp
jmp 0x2fbe8a
vmovsd 0x15814a(%rip), %xmm2 # 0x454038
movq 0x68(%rbx), %rcx
movl %r8d, %eax
shlq $0x4, %rax
movl %r9d, %r12d
shlq $0x4, %r12
xorl %ebp, %ebp
vsubsd %xmm0, %xmm2, %xmm2
vdivsd %xmm2, %xmm0, %xmm0
vmovsd (%rcx,%rax), %xmm2
vmulsd 0x15fda9(%rip), %xmm2, %xmm2 # 0x45bcc0
vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovsd %xmm2, (%rsp)
cmpq %rbp, %r12
je 0x2fbfe3
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq 0xc(%rax,%rbp), %r13
cmpl $0x0, 0x8(%rax,%rbp)
movl 0x4(%r15,%r13,8), %esi
js 0x2fbf5b
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
jmp 0x2fbf72
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
addq $0x10, %rbp
jmp 0x2fbf21
movl 0x8(%rsp), %r12d
orq $0xc, %rbp
subq 0x18(%rsp), %r12
subq $0x1, %r12
jb 0x2fbfe3
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq (%rax,%rbp), %r13
cmpl $0x0, -0x4(%rax,%rbp)
movl 0x4(%r15,%r13,8), %esi
js 0x2fbfc1
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
jmp 0x2fbfd8
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
addq $0x10, %rbp
jmp 0x2fbf8b
movl 0xc(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2fb54c
testb %al, %al
je 0x2fc024
vmovapd 0x20(%rsp), %xmm0
movq 0x78(%rbx), %rcx
movq 0x10(%rsp), %rdx
vmovmskpd %xmm0, %eax
shlq $0x3f, %rax
xorq (%rcx,%rdx,8), %rax
shrq $0x3f, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15c1b3(%rip), %rdi # 0x4581de
leaq 0x1602ea(%rip), %rsi # 0x45c31c
leaq 0x15df53(%rip), %rdx # 0x459f8c
leaq 0x1602fb(%rip), %rcx # 0x45c33b
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::rc_data*>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::rc_data*, baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::rc_data*, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&) | inline void
random_shuffle_unique(iteratorT begin,
iteratorT end,
random_engine& rng) noexcept
{
auto ret = begin++;
for (; begin != end; ++begin) {
if (ret->value != begin->value) {
std::shuffle(ret, begin, rng);
ret = begin;
}
}
std::shuffle(ret, begin, rng);
} | pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x10(%rdi), %rsi
cmpq %r14, %rsi
je 0x2fc080
vmovsd (%rdi), %xmm0
leaq 0x10(%rsi), %r15
vucomisd (%rsi), %xmm0
movq %r15, %rsi
jne 0x2fc06c
jnp 0x2fc054
addq $-0x10, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2fc5a1
movq %r15, %rdi
jmp 0x2fc050
movq %rbx, %rdx
callq 0x2fc5a1
popq %rbx
popq %r14
popq %r15
retq
jmp 0x2fc090
movq %rax, %rdi
callq 0xeb9f
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::push_and_compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, double, double, double, double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float 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
vmovsd %xmm3, 0x40(%rsp)
vmovsd %xmm2, 0x38(%rsp)
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x28(%rsp)
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
xorl %r12d, %r12d
movq %rax, 0x20(%rsp)
movq (%rdx), %rax
cmpq (%rbx), %rax
je 0x2fdb33
movslq -0x4(%rax), %rbp
cmpl 0x88(%r13), %ebp
jge 0x2fdb49
movq 0x20(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
vmovsd 0x38(%rsp), %xmm0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0x2fbb44
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
movq %r15, %rcx
callq 0x2fbb62
vmovsd 0x40(%rsp), %xmm1
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rdx
movl %eax, %esi
shlq $0x4, %rsi
xorl %r8d, %r8d
movq 0x68(%r13), %rdi
movq 0x80(%r13), %rcx
cmpq %r8, %rsi
je 0x2fdacc
movslq 0xc(%rdi,%r8), %r9
movq 0x8(%rcx), %r10
movslq 0x4(%rdx,%r9,8), %r9
vmovsd (%r10,%r9,8), %xmm0
vfmadd213sd (%rdi,%r8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rdi,%r8)
addq $0x10, %r8
jmp 0x2fdaa1
movq 0x8(%r13), %rdx
movslq %eax, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x2fbca6
movq 0x70(%r13), %rax
imulq $0xc, %rbp, %rcx
leaq 0x18(%rsp), %rsi
movq %r13, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2fbcda
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x30(%rsp), %xmm1
movl 0x18(%rsp), %r9d
movq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %eax, %r8d
callq 0x2fbd4e
orb %al, %r12b
movq (%r14), %rax
addq $-0x4, %rax
movq %rax, (%r14)
jmp 0x2fda25
andb $0x1, %r12b
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15a68e(%rip), %rdi # 0x4581de
leaq 0x15c923(%rip), %rsi # 0x45a47a
leaq 0x165b3a(%rip), %rdx # 0x463698
leaq 0x165be2(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, double, double, double, double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float 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
vmovsd %xmm3, 0x40(%rsp)
vmovsd %xmm2, 0x38(%rsp)
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x28(%rsp)
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
xorl %r15d, %r15d
movq %rax, 0x20(%rsp)
cmpq %rbx, %r14
je 0x2fdcaf
movslq (%r14), %rbp
cmpl 0x88(%r13), %ebp
jge 0x2fdcc5
movq 0x20(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
vmovsd 0x38(%rsp), %xmm0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0x2fbb44
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0x2fbb62
vmovsd 0x40(%rsp), %xmm1
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rdx
movl %eax, %esi
shlq $0x4, %rsi
xorl %r8d, %r8d
movq 0x68(%r13), %rdi
movq 0x80(%r13), %rcx
cmpq %r8, %rsi
je 0x2fdc4e
movslq 0xc(%rdi,%r8), %r9
movq 0x8(%rcx), %r10
movslq 0x4(%rdx,%r9,8), %r9
vmovsd (%r10,%r9,8), %xmm0
vfmadd213sd (%rdi,%r8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rdi,%r8)
addq $0x10, %r8
jmp 0x2fdc23
movq 0x8(%r13), %rdx
movslq %eax, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x2fbca6
movq 0x70(%r13), %rax
imulq $0xc, %rbp, %rcx
leaq 0x18(%rsp), %rsi
movq %r13, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2fbcda
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x30(%rsp), %xmm1
movl 0x18(%rsp), %r9d
movq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %eax, %r8d
callq 0x2fbd4e
orb %al, %r15b
addq $0x4, %r14
jmp 0x2fdba8
andb $0x1, %r15b
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15a512(%rip), %rdi # 0x4581de
leaq 0x15c7a7(%rip), %rsi # 0x45a47a
leaq 0x1659be(%rip), %rdx # 0x463698
leaq 0x165a66(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, double, double, double, double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float 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
vmovsd %xmm3, 0x40(%rsp)
vmovsd %xmm2, 0x38(%rsp)
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x28(%rsp)
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
xorl %r15d, %r15d
movq %rax, 0x20(%rsp)
cmpq %rbx, %r14
je 0x2fde2b
movslq (%r14), %rbp
cmpl 0x88(%r13), %ebp
jge 0x2fde41
movq 0x20(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
vmovsd 0x38(%rsp), %xmm0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0x2fbb44
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0x2fbb62
vmovsd 0x40(%rsp), %xmm1
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rdx
movl %eax, %esi
shlq $0x4, %rsi
xorl %r8d, %r8d
movq 0x68(%r13), %rdi
movq 0x80(%r13), %rcx
cmpq %r8, %rsi
je 0x2fddca
movslq 0xc(%rdi,%r8), %r9
movq 0x8(%rcx), %r10
movslq 0x4(%rdx,%r9,8), %r9
vmovsd (%r10,%r9,8), %xmm0
vfmadd213sd (%rdi,%r8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rdi,%r8)
addq $0x10, %r8
jmp 0x2fdd9f
movq 0x8(%r13), %rdx
movslq %eax, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x2fbca6
movq 0x70(%r13), %rax
imulq $0xc, %rbp, %rcx
leaq 0x18(%rsp), %rsi
movq %r13, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2fbcda
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x30(%rsp), %xmm1
movl 0x18(%rsp), %r9d
movq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %eax, %r8d
callq 0x2fbd4e
orb %al, %r15b
addq $0x8, %r14
jmp 0x2fdd24
andb $0x1, %r15b
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15a396(%rip), %rdi # 0x4581de
leaq 0x15c62b(%rip), %rsi # 0x45a47a
leaq 0x165842(%rip), %rdx # 0x463698
leaq 0x1658ea(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, double, double, double, double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float 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
vmovsd %xmm3, 0x40(%rsp)
vmovsd %xmm2, 0x38(%rsp)
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x28(%rsp)
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
xorl %r15d, %r15d
movq %rax, 0x20(%rsp)
cmpq %rbx, %r14
je 0x2fdfa7
movslq (%r14), %rbp
cmpl 0x88(%r13), %ebp
jge 0x2fdfbd
movq 0x20(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
vmovsd 0x38(%rsp), %xmm0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0x2fbb44
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0x2fbb62
vmovsd 0x40(%rsp), %xmm1
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rdx
movl %eax, %esi
shlq $0x4, %rsi
xorl %r8d, %r8d
movq 0x68(%r13), %rdi
movq 0x80(%r13), %rcx
cmpq %r8, %rsi
je 0x2fdf46
movslq 0xc(%rdi,%r8), %r9
movq 0x8(%rcx), %r10
movslq 0x4(%rdx,%r9,8), %r9
vmovsd (%r10,%r9,8), %xmm0
vfmadd213sd (%rdi,%r8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rdi,%r8)
addq $0x10, %r8
jmp 0x2fdf1b
movq 0x8(%r13), %rdx
movslq %eax, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x2fbca6
movq 0x70(%r13), %rax
imulq $0xc, %rbp, %rcx
leaq 0x18(%rsp), %rsi
movq %r13, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x2fbcda
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x30(%rsp), %xmm1
movl 0x18(%rsp), %r9d
movq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %eax, %r8d
callq 0x2fbd4e
orb %al, %r15b
addq $0x4, %r14
jmp 0x2fdea0
andb $0x1, %r15b
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15a21a(%rip), %rdi # 0x4581de
leaq 0x15c4af(%rip), %rsi # 0x45a47a
leaq 0x1656c6(%rip), %rdx # 0x463698
leaq 0x16576e(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3b8, %rsp # imm = 0x3B8
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x20(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x64935
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm1
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x28(%r12), %xmm0
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x70(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x60(%rsp)
vmovsd 0x8(%r12), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x2ff3ac
movq 0x10(%r14), %rdi
vmovsd 0x38(%rsp), %xmm0
leaq 0x78(%rsp), %rsi
movl %ebx, %edx
callq 0x64a13
vmovsd %xmm0, 0x30(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x50(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x90(%rsp)
vmovsd %xmm1, 0x88(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd0(%rsp), %rdi
leaq 0x78(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2fab82
movl 0xcc(%r12), %esi
leaq 0x98(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x5c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x160(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x2ff48d
cmpl $0x1, %eax
je 0x2ff467
cmpl $0x2, %eax
jne 0x2ff49e
movq 0x18(%r14), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x20(%rsp), %rsi
jmp 0x2ff478
movq 0x18(%r14), %rdx
leaq 0x20(%rsp), %rdi
leaq 0x160(%rsp), %rsi
vmovsd 0x154bb8(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x62c65
jmp 0x2ff49e
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x62bf9
leaq 0x20(%rsp), %r15
movq %r13, 0x40(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x2ff4d4
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2ff4d0
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2ff4ad
leaq 0x168(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x158(%rsp), %ecx
movl 0x15c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x8(%rsp)
leaq 0x15b06b(%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 0x20(%rsp), %rdx
callq 0x2fae18
vmovsd 0x8(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x20(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x2ff63f
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq %r13, %rdx
vmovsd %xmm0, 0x8(%rsp)
callq 0x2fae5a
movq 0x120(%rsp), %rdx
movq 0x148(%rsp), %rcx
movl %eax, %ebx
leaq 0x160(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x6c2be
testl %ebx, %ebx
je 0x2ff6e4
cmpl %ebp, %ebx
jge 0x2ff5db
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x300608
movl %ebx, %ebp
cmpq 0x50(%rsp), %r15
jle 0x2ff611
vcvtsi2sd %ebx, %xmm3, %xmm0
vcvtsi2sdl 0x158(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x2ff617
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x2ff63f
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x300640
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x2ff63f
incq %r15
jmp 0x2ff55a
movq 0x10(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2ff661
movq 0x10(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2ff68f
movq 0x10(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x5c(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x160(%rsp), %rdi
callq 0x42cbc
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2fb2ba
leaq 0x80(%rsp), %rdi
callq 0x29066
leaq 0x28(%rsp), %rdi
callq 0x357fe
movq 0x10(%rsp), %rax
addq $0x3b8, %rsp # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x62f18
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3005be
vmovsd 0x8(%rsp), %xmm0
leaq 0xd0(%rsp), %r15
leaq 0x20(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x1c(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2ff64e
vmovsd %xmm0, 0x8(%rsp)
vmulsd 0x90(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
vmovsd 0x88(%rsp), %xmm3
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2fb066
testl %eax, %eax
jne 0x2ff7a2
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x62f18
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3005be
movq %r14, %rdi
callq 0x300640
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x2ff64e
movl %ebx, 0x50(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2ff8ab
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovsd %xmm0, 0x8(%rsp)
callq 0x2fae5a
testl %eax, %eax
je 0x2ff86d
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2ff840
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x158(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x2ff846
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x2ff8ab
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x300640
testb %al, %al
jne 0x2ff8a5
vmovsd 0x8(%rsp), %xmm0
incl %ebx
jmp 0x2ff7c1
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x62f18
movl 0xc0(%r12), %eax
imull 0x1c(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3005be
vmovsd 0x8(%rsp), %xmm0
jmp 0x2ff8ab
vmovsd 0x8(%rsp), %xmm0
movl 0x50(%rsp), %ebx
decl 0x1c(%rsp)
incl %ebx
jmp 0x2ff727
jmp 0x2ff8f1
jmp 0x2ff8ca
jmp 0x2ff8f1
movq %rax, %r14
jmp 0x2ff901
movq %rax, %r14
jmp 0x2ff90e
movq %rax, %r14
jmp 0x2ff91b
movq %rax, %r14
jmp 0x2ff928
movq %rax, %r14
jmp 0x2ff932
jmp 0x2ff8f1
jmp 0x2ff8f1
jmp 0x2ff8f1
leaq 0x168(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2ff901
leaq 0x160(%rsp), %rdi
movq %rax, %r14
callq 0x42cbc
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2fb2ba
leaq 0x80(%rsp), %rdi
callq 0x29066
leaq 0x28(%rsp), %rdi
callq 0x357fe
movq 0x10(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3b8, %rsp # imm = 0x3B8
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x20(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x64935
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm1
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x28(%r12), %xmm0
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x70(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x60(%rsp)
vmovsd 0x8(%r12), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x2ffa2c
movq 0x10(%r14), %rdi
vmovsd 0x38(%rsp), %xmm0
leaq 0x78(%rsp), %rsi
movl %ebx, %edx
callq 0x64a13
vmovsd %xmm0, 0x30(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x50(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x90(%rsp)
vmovsd %xmm1, 0x88(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd0(%rsp), %rdi
leaq 0x78(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2fab82
movl 0xcc(%r12), %esi
leaq 0x98(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x5c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x160(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x2ffb0d
cmpl $0x1, %eax
je 0x2ffae7
cmpl $0x2, %eax
jne 0x2ffb1e
movq 0x18(%r14), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x20(%rsp), %rsi
jmp 0x2ffaf8
movq 0x18(%r14), %rdx
leaq 0x20(%rsp), %rdi
leaq 0x160(%rsp), %rsi
vmovsd 0x154538(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x62c65
jmp 0x2ffb1e
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x62bf9
leaq 0x20(%rsp), %r15
movq %r13, 0x40(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x2ffb54
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2ffb50
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x2ffb2d
leaq 0x168(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x158(%rsp), %ecx
movl 0x15c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x8(%rsp)
leaq 0x15a9eb(%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 0x20(%rsp), %rdx
callq 0x2fae18
vmovsd 0x8(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x20(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x2ffcbf
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq %r13, %rdx
vmovsd %xmm0, 0x8(%rsp)
callq 0x2fae5a
movq 0x120(%rsp), %rdx
movq 0x148(%rsp), %rcx
movl %eax, %ebx
leaq 0x160(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x6c6c0
testl %ebx, %ebx
je 0x2ffd64
cmpl %ebp, %ebx
jge 0x2ffc5b
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x3006ea
movl %ebx, %ebp
cmpq 0x50(%rsp), %r15
jle 0x2ffc91
vcvtsi2sd %ebx, %xmm3, %xmm0
vcvtsi2sdl 0x158(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x2ffc97
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x2ffcbf
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x300722
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x2ffcbf
incq %r15
jmp 0x2ffbda
movq 0x10(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2ffce1
movq 0x10(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x2ffd0f
movq 0x10(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x5c(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x160(%rsp), %rdi
callq 0x435d0
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2fb2ba
leaq 0x80(%rsp), %rdi
callq 0x29066
leaq 0x28(%rsp), %rdi
callq 0x357fe
movq 0x10(%rsp), %rax
addq $0x3b8, %rsp # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x62f18
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3006a0
vmovsd 0x8(%rsp), %xmm0
leaq 0xd0(%rsp), %r15
leaq 0x20(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x1c(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2ffcce
vmovsd %xmm0, 0x8(%rsp)
vmulsd 0x90(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
vmovsd 0x88(%rsp), %xmm3
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2fb066
testl %eax, %eax
jne 0x2ffe22
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x62f18
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3006a0
movq %r14, %rdi
callq 0x300722
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x2ffcce
movl %ebx, 0x50(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2fff2b
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovsd %xmm0, 0x8(%rsp)
callq 0x2fae5a
testl %eax, %eax
je 0x2ffeed
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2ffec0
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x158(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x2ffec6
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x2fff2b
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x300722
testb %al, %al
jne 0x2fff25
vmovsd 0x8(%rsp), %xmm0
incl %ebx
jmp 0x2ffe41
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x62f18
movl 0xc0(%r12), %eax
imull 0x1c(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3006a0
vmovsd 0x8(%rsp), %xmm0
jmp 0x2fff2b
vmovsd 0x8(%rsp), %xmm0
movl 0x50(%rsp), %ebx
decl 0x1c(%rsp)
incl %ebx
jmp 0x2ffda7
jmp 0x2fff71
jmp 0x2fff4a
jmp 0x2fff71
movq %rax, %r14
jmp 0x2fff81
movq %rax, %r14
jmp 0x2fff8e
movq %rax, %r14
jmp 0x2fff9b
movq %rax, %r14
jmp 0x2fffa8
movq %rax, %r14
jmp 0x2fffb2
jmp 0x2fff71
jmp 0x2fff71
jmp 0x2fff71
leaq 0x168(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x2fff81
leaq 0x160(%rsp), %rdi
movq %rax, %r14
callq 0x435d0
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x2fb2ba
leaq 0x80(%rsp), %rdi
callq 0x29066
leaq 0x28(%rsp), %rdi
callq 0x357fe
movq 0x10(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp # imm = 0x168
vmovsd %xmm0, 0x40(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x18(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x80(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x64935
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm1
vmovsd %xmm0, 0x60(%rsp)
vmovsd 0x28(%r12), %xmm0
vmovsd %xmm1, 0x28(%rsp)
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x58(%rsp)
vmovsd 0x8(%r12), %xmm0
vmovsd %xmm0, 0x30(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x3000b2
movq 0x10(%r14), %rdi
vmovsd 0x30(%rsp), %xmm0
leaq 0x80(%rsp), %rsi
movl %ebx, %edx
callq 0x64a13
vmovsd %xmm0, 0x28(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x48(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x98(%rsp)
vmovsd %xmm1, 0x90(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd8(%rsp), %rdi
leaq 0x80(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x2fab82
movl 0xcc(%r12), %esi
leaq 0xa0(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x54(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, (%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x70(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x30018c
cmpl $0x1, %eax
je 0x300169
cmpl $0x2, %eax
jne 0x30019d
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rsi
jmp 0x300177
movq 0x18(%r14), %rdx
leaq 0x18(%rsp), %rdi
leaq 0x70(%rsp), %rsi
vmovsd 0x153eb9(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x62c65
jmp 0x30019d
leaq 0x18(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x62bf9
leaq 0x18(%rsp), %r15
movq %r13, 0x38(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x3001d2
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd (%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x3001ce
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x3001ac
leaq 0x78(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, (%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x2fae18
vmovsd (%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x18(%rsp), %rbx
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x3002e5
movq 0x18(%r14), %rcx
vmovsd 0x28(%rsp), %xmm1
vmovsd 0x30(%rsp), %xmm2
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdx
vmovsd %xmm0, (%rsp)
callq 0x2fae5a
movl %eax, %r13d
testl %eax, %eax
je 0x30037d
cmpl %ebp, %r13d
jge 0x300284
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0x3007cc
movl %r13d, %ebp
cmpq 0x48(%rsp), %r15
jle 0x3002ba
vcvtsi2sd %r13d, %xmm3, %xmm0
vcvtsi2sdl 0x160(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x58(%rsp), %xmm1
callq 0xb1f0
vmovsd (%rsp), %xmm1
vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x3002bf
vmovsd (%rsp), %xmm0
vucomisd 0x68(%rsp), %xmm0
ja 0x3002e5
movq %r14, %rdi
vmovsd %xmm0, (%rsp)
callq 0x300804
vmovsd (%rsp), %xmm0
testb %al, %al
jne 0x3002e5
incq %r15
jmp 0x300225
movq 0x8(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x300307
movq 0x8(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x300335
movq 0x8(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x54(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2fb2ba
leaq 0x88(%rsp), %rdi
callq 0x29066
leaq 0x20(%rsp), %rdi
callq 0x357fe
movq 0x8(%rsp), %rax
addq $0x168, %rsp # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x40(%rsp), %xmm0
movq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x62f18
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x300782
vmovsd (%rsp), %xmm0
leaq 0xd8(%rsp), %r15
leaq 0x18(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x14(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x3002f4
vmovsd %xmm0, (%rsp)
vmulsd 0x98(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovsd 0x28(%rsp), %xmm1
vmovsd 0x30(%rsp), %xmm2
vmovsd 0x90(%rsp), %xmm3
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2fb066
testl %eax, %eax
jne 0x300439
vmovsd 0x40(%rsp), %xmm0
movq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x62f18
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x300782
movq %r14, %rdi
callq 0x300804
vmovsd (%rsp), %xmm0
testb %al, %al
jne 0x3002f4
movl %ebx, 0x48(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x30053a
movq 0x18(%r14), %rcx
vmovsd 0x28(%rsp), %xmm1
vmovsd 0x30(%rsp), %xmm2
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovsd %xmm0, (%rsp)
callq 0x2fae5a
testl %eax, %eax
je 0x3004fe
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x3004d4
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x160(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x58(%rsp), %xmm1
callq 0xb1f0
vmovsd (%rsp), %xmm1
vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x3004d9
vmovsd (%rsp), %xmm0
vucomisd 0x68(%rsp), %xmm0
ja 0x30053a
movq %r14, %rdi
vmovsd %xmm0, (%rsp)
callq 0x300804
testb %al, %al
jne 0x300535
vmovsd (%rsp), %xmm0
incl %ebx
jmp 0x300457
vmovsd 0x40(%rsp), %xmm0
movq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x62f18
movl 0xc0(%r12), %eax
imull 0x14(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x300782
vmovsd (%rsp), %xmm0
jmp 0x30053a
vmovsd (%rsp), %xmm0
movl 0x48(%rsp), %ebx
decl 0x14(%rsp)
incl %ebx
jmp 0x3003bf
jmp 0x300578
jmp 0x300554
jmp 0x300578
movq %rax, %r14
jmp 0x300588
movq %rax, %r14
jmp 0x300595
movq %rax, %r14
jmp 0x3005a2
movq %rax, %r14
jmp 0x3005ac
jmp 0x300578
jmp 0x300578
jmp 0x300578
leaq 0x78(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x30057b
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x2fb2ba
leaq 0x88(%rsp), %rdi
callq 0x29066
leaq 0x20(%rsp), %rdi
callq 0x357fe
movq 0x8(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long) | inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
} | vucomisd 0x30(%rdi), %xmm0
jbe 0x300606
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x300680
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::pnm_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x159417(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long) | inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
} | vucomisd 0x30(%rdi), %xmm0
jbe 0x3006e8
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x300762
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::file_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x159335(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::none_observer>::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 0x3007ca
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x300844
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::none_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x159253(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
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 0x3008c9
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 0x300a28
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x300a28
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0xb8(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x6d526
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x70(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x60(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xe0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0xc0(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0x6d740
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x60(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x88(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0x300a83
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x301b66
movl 0x8(%rsp), %eax
incl %eax
jmp 0x3009ff
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 0x300e1e
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 0x300b47
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 0x301bb2
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 0x300aa3
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 0x300bdc
movq 0x60(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x300b9d
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x300b87
leaq 0xe0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x7611c
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x20(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movl 0x18(%rsp), %esi
movq %r12, %rdi
movq %r14, %rcx
callq 0x35736
callq 0xb5a0
vmovsd (%r13), %xmm0
subq %rbx, %rax
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm0, %xmm1
vcvtsi2sd %rax, %xmm2, %xmm1
vdivsd 0x158e81(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x300b62
vucomisd %xmm0, %xmm1
jbe 0x300b62
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xa0(%rsp), %rbx
movq 0xa8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x300c3d
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x300c2a
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 0x300d98
cmpl $0x1, %eax
je 0x300d60
cmpl $0x2, %eax
jne 0x300db7
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x300db7
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 0x300d26
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x35781
leaq 0xe0(%rsp), %rdi
callq 0x7619a
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x300dab
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x35781
leaq 0xd8(%rsp), %rdi
movq %r13, %rsi
callq 0x6d8a4
cmpq $0x0, 0x168(%r13)
je 0x300de3
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x6d8b8
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x307314
leaq 0xb8(%rsp), %rdi
callq 0x6d8d6
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x198, %rsp # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x300e7f
movq %rax, %rbx
jmp 0x300e8c
movq %rax, %rbx
jmp 0x300e99
jmp 0x300e63
jmp 0x300e54
jmp 0x300e72
jmp 0x300e72
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x300eba
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x300eb0
jmp 0x300e72
jmp 0x300e72
jmp 0x300e72
jmp 0x300e72
jmp 0x300e72
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x6d8b8
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x307314
leaq 0xb8(%rsp), %rdi
callq 0x6d8d6
leaq 0x48(%rsp), %rdi
callq 0x35858
movq 0x10(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
baryonyx::result baryonyx::itm::solve_problem<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
solve_problem(const context& ctx, const problem& pb)
{
if (ctx.start)
ctx.start(ctx.parameters);
result ret;
auto variables = length(pb.vars.values);
auto constraints{ make_merged_constraints(ctx, pb) };
if (!constraints.empty() && !pb.vars.values.empty()) {
random_engine rng(init_random_generator_seed(ctx));
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
switch (ctx.parameters.observer) {
case solver_parameters::observer_type::pnm: {
using obs = pnm_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
case solver_parameters::observer_type::file: {
using obs = file_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
default: {
using obs = none_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
break;
}
}
} else {
ret.status = result_status::success;
ret.solutions.resize(1);
ret.solutions.back().value = pb.objective.value;
}
ret.strings = pb.strings;
ret.variable_name = std::move(pb.vars.names);
ret.affected_vars = std::move(pb.affected_vars);
ret.variables = variables;
ret.constraints = length(constraints);
if (ctx.finish)
ctx.finish(ret);
return ret;
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x140, %rsp # imm = 0x140
cmpq $0x0, 0x128(%rsi)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
je 0x300efe
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 0x301027
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0x301027
movq %r14, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
leaq 0x10(%r15), %rsi
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, (%rsp)
leaq 0x20(%rsp), %rdi
movl %r12d, %edx
callq 0x6d526
vmovsd 0x40(%r15), %xmm0
movl 0xe4(%r14), %eax
vxorps %xmm1, %xmm1, %xmm1
leaq 0x40(%rsp), %rsi
cmpl $0x1, %eax
je 0x30104e
cmpl $0x2, %eax
jne 0x30109d
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 0x3079c0
jmp 0x3010ea
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 0x301119
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 0x30733c
jmp 0x3010ea
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 0x308044
leaq 0x98(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x41d9e
movq %r13, %rdi
callq 0xea60
leaq 0x68(%rsp), %rdi
callq 0x357fe
leaq 0x20(%rsp), %rdi
callq 0x6d8d6
leaq 0x90(%r15), %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31d28
leaq 0x50(%rbx), %rdi
movq %r13, %rsi
callq 0x352ec
addq $0xc0, %r15
leaq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x352c2
movq 0x10(%rsp), %rax
movl %r12d, 0x90(%rbx)
subq 0x8(%rsp), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
movl %eax, 0x94(%rbx)
cmpq $0x0, 0x168(%r14)
je 0x301185
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 0x3011a7
jmp 0x3011a7
leaq 0x68(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x20(%rsp), %rdi
callq 0x6d8d6
jmp 0x3011ca
jmp 0x3011c7
movq %rax, %r14
jmp 0x3011d4
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, false>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
optimize_problem(const context& ctx, const problem& pb)
{
result r;
if (ctx.start)
ctx.start(ctx.parameters);
auto constraints{ make_merged_constraints(ctx, pb) };
if (constraints.empty() || pb.vars.values.empty()) {
r.status = result_status::success;
r.solutions.resize(1);
r.solutions.back().value = pb.objective.value;
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
return r;
}
random_engine rng(init_random_generator_seed(ctx));
auto variables = length(pb.vars.values);
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
const auto thread = get_thread_number(ctx);
std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors;
std::vector<std::thread> pool(thread);
best_solution_recorder<Cost, Float, Mode> best_recorder(
rng,
thread,
cost,
cost_constant,
variables,
constraints,
ctx.parameters.init_population_size);
auto seeds = generate_seed(rng, thread);
std::atomic_bool stop_task;
stop_task.store(false);
for (unsigned i = 0u; i != thread; ++i)
functors.emplace_back(ctx, i, seeds[i]);
for (unsigned i = 0u; i != thread; ++i)
pool[i] = std::thread(std::ref(functors[i]),
std::ref(stop_task),
std::ref(best_recorder),
std::cref(constraints),
variables,
std::cref(cost),
cost_constant);
const auto start = std::chrono::steady_clock::now();
auto end = start;
do {
std::this_thread::sleep_for(std::chrono::seconds{ 1L });
if (ctx.update) {
auto call_number = 0L;
for (auto i = 0u; i != thread; ++i)
call_number += functors[i].m_call_number;
int constraints_remaining;
long int loop;
double value;
double duration;
best_recorder.get_best(
constraints_remaining, value, duration, loop);
ctx.update(
constraints_remaining, value, loop, duration, call_number);
}
end = std::chrono::steady_clock::now();
} while (!is_time_limit(ctx.parameters.time_limit, start, end));
stop_task.store(true);
for (auto& t : pool)
t.join();
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
r.variables = variables;
r.constraints = length(constraints);
const auto& first = best_recorder.get_best(0);
if (!first.is_solution())
r.status = result_status::time_limit_reached;
else
r.status = result_status::success;
r.duration = first.duration;
r.loop = first.loop;
r.remaining_constraints = first.remaining_constraints;
switch (ctx.parameters.storage) {
case solver_parameters::storage_type::one: {
r.solutions.resize(1);
convert(first, r.solutions[0], variables);
} break;
case solver_parameters::storage_type::bound: {
r.solutions.resize(2);
convert(first, r.solutions[0], variables);
convert(best_recorder.get_worst(), r.solutions[1], variables);
} break;
case solver_parameters::storage_type::five: {
r.solutions.resize(5);
for (int i = 0; i != 5; ++i)
convert(best_recorder.get_best(i), r.solutions[i], variables);
} break;
}
best_recorder.show_population(ctx);
if (ctx.finish)
ctx.finish(r);
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp # imm = 0x198
vxorpd %xmm0, %xmm0, %xmm0
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
cmpq $0x0, 0x128(%rsi)
je 0x30124a
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 0x3013a9
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x3013a9
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0xb8(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x6d526
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x70(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x60(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xe0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0xc0(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0x6d740
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x60(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x88(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0x301404
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3088e4
movl 0x8(%rsp), %eax
incl %eax
jmp 0x301380
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 0x30179f
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 0x3014c8
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 0x308930
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 0x301424
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 0x30155d
movq 0x60(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x30151e
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x301508
leaq 0xe0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x7611c
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x20(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movl 0x18(%rsp), %esi
movq %r12, %rdi
movq %r14, %rcx
callq 0x35736
callq 0xb5a0
vmovsd (%r13), %xmm0
subq %rbx, %rax
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm0, %xmm1
vcvtsi2sd %rax, %xmm2, %xmm1
vdivsd 0x158500(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x3014e3
vucomisd %xmm0, %xmm1
jbe 0x3014e3
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xa0(%rsp), %rbx
movq 0xa8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x3015be
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x3015ab
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 0x301719
cmpl $0x1, %eax
je 0x3016e1
cmpl $0x2, %eax
jne 0x301738
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x301738
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 0x3016a7
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x35781
leaq 0xe0(%rsp), %rdi
callq 0x7619a
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x30172c
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x35781
leaq 0xd8(%rsp), %rdi
movq %r13, %rsi
callq 0x6d8a4
cmpq $0x0, 0x168(%r13)
je 0x301764
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x6d8b8
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x30d962
leaq 0xb8(%rsp), %rdi
callq 0x6d8d6
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x198, %rsp # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x301800
movq %rax, %rbx
jmp 0x30180d
movq %rax, %rbx
jmp 0x30181a
jmp 0x3017e4
jmp 0x3017d5
jmp 0x3017f3
jmp 0x3017f3
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x30183b
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x301831
jmp 0x3017f3
jmp 0x3017f3
jmp 0x3017f3
jmp 0x3017f3
jmp 0x3017f3
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x6d8b8
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0x30d962
leaq 0xb8(%rsp), %rdi
callq 0x6d8d6
leaq 0x48(%rsp), %rdi
callq 0x35858
movq 0x10(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
baryonyx::itm::optimize_functor<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<double>, double, baryonyx::itm::maximize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<double> const&, double) | void operator()(const std::atomic_bool& stop_task,
best_solution_recorder<Cost, Float, Mode>& best_recorder,
const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
bit_array x(variables);
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_local_ctx.rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const auto w_limit = static_cast<long int>(p.w);
Solver slv(m_local_ctx.rng,
length(constraints),
variables,
norm_costs,
constraints);
compute_order compute(p.order, variables);
bool is_a_solution = false;
while (!stop_task.load()) {
++m_call_number;
const auto kappa_start = static_cast<Float>(best_recorder.reinit(
m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x));
auto kappa = kappa_start;
compute.init(slv, x);
auto best_remaining = INT_MAX;
is_a_solution = false;
for (long int i = 0; !stop_task.load() && i != p.limit; ++i) {
auto remaining =
compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
i);
best_remaining = 0;
is_a_solution = true;
break;
} else {
best_remaining = std::min(remaining, best_remaining);
}
if (i > w_limit)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
if (best_remaining > 0) {
best_recorder.try_advance(
m_local_ctx, x, best_remaining, p.limit);
continue;
}
for (int push = 0; !stop_task.load() && push < p.pushes_limit;
++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_local_ctx.rng,
pushing_k_factor,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
is_a_solution = true;
}
kappa = kappa_start;
for (int iter = 0;
!stop_task.load() && iter < p.pushing_iteration_limit;
++iter) {
remaining = compute.run(
slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
is_a_solution = true;
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
}
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp # imm = 0x178
movq %rdi, %rbp
leaq 0x8(%rsp), %rdi
movq %rsi, %r15
movl %r8d, %esi
vmovsd %xmm0, 0x48(%rsp)
movq %r9, %r12
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x18(%rsp)
callq 0x368ae
movq (%rbp), %r13
movq %rbp, 0x50(%rsp)
addq $0x8, %rbp
leaq 0x90(%rsp), %rdi
movq %r13, %rsi
movq %r12, 0x40(%rsp)
movq %r12, %rdx
movq %rbp, %rcx
movl %ebx, %r8d
callq 0x6fb57
vmovsd 0x20(%r13), %xmm0
vmovsd 0x10(%r13), %xmm1
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x28(%r13), %xmm0
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x70(%rsp)
vmovsd 0x30(%r13), %xmm0
vmovsd %xmm0, 0x60(%rsp)
vmovsd 0x8(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x302046
movq 0x50(%rsp), %rax
movq (%rax), %rdi
vmovsd 0x38(%rsp), %xmm0
leaq 0x90(%rsp), %rsi
movl %ebx, %edx
callq 0x6fc31
vmovsd %xmm0, 0x30(%rsp)
vcvttsd2si 0xa0(%r13), %rax
vmovsd 0x38(%r13), %xmm0
vmovsd 0x40(%r13), %xmm1
movq %rax, 0x78(%rsp)
movq 0x8(%r14), %rax
vmovsd %xmm0, 0x88(%rsp)
vmovsd %xmm1, 0x80(%rsp)
subq (%r14), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xe8(%rsp), %rdi
leaq 0x90(%rsp), %r8
movq %rbp, %rsi
movl %eax, %edx
movl %ebx, %ecx
movq %r14, %r9
callq 0x302462
movl 0xcc(%r13), %esi
leaq 0xb0(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq $0x0, (%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x3023c9
movq 0x50(%rsp), %rax
incq 0xb0(%rax)
vmovsd 0x18(%r13), %xmm0
vmovsd 0x28(%r13), %xmm1
movzbl (%rsp), %edx
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rbx
movq %rbp, %rsi
movq %rbx, %rcx
andl $0x1, %edx
callq 0x6fed2
vmovsd %xmm0, 0x58(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
movq %rbx, %rdx
callq 0x302726
vmovsd 0x58(%rsp), %xmm0
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movb (%r15), %al
testb $0x1, %al
jne 0x3021c5
cmpq 0xb0(%r13), %r14
je 0x3021c5
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbp, %rcx
vmovsd %xmm0, 0x20(%rsp)
callq 0x302768
testl %eax, %eax
je 0x3021dc
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0x78(%rsp), %r14
jle 0x3021af
vcvtsi2sd %eax, %xmm3, %xmm0
vcvtsi2sdl 0x170(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x20(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x3021b5
vmovsd 0x20(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x3021c5
incq %r14
jmp 0x302129
testl %ebx, %ebx
jg 0x3023a9
leaq 0x8(%rsp), %rbx
movq $0x0, (%rsp)
jmp 0x30220d
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x6e096
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x70220
movb $0x1, %al
movq %rax, (%rsp)
xorl %r14d, %r14d
movl $0x0, 0x2c(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x3020be
cmpl 0xbc(%r13), %r14d
jge 0x3020be
vmovsd 0x88(%rsp), %xmm0
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
vmovsd 0x80(%rsp), %xmm3
leaq 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x302974
testl %eax, %eax
jne 0x3022a6
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x6e096
movl 0xc0(%r13), %eax
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
imull %r14d, %eax
notl %eax
movslq %eax, %rcx
callq 0x70220
movb $0x1, %al
movq %rax, (%rsp)
pushq $0x1
popq %rax
vmovsd 0x58(%rsp), %xmm0
movl %eax, %ebx
movb (%r15), %al
testb $0x1, %al
jne 0x302354
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0x302354
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbp, %rcx
vmovsd %xmm0, 0x20(%rsp)
callq 0x302768
testl %eax, %eax
je 0x30235b
vcvtsi2sd %r12d, %xmm4, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0x30233f
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x170(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x20(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x302345
vmovsd 0x20(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x302354
incl %ebx
jmp 0x3022b1
leaq 0x8(%rsp), %rbx
jmp 0x30239d
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0x6e096
movl 0xc0(%r13), %eax
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
imull 0x2c(%rsp), %eax
subl %ebx, %eax
movq %r12, %rbx
movslq %eax, %rcx
callq 0x70220
movb $0x1, %al
movq %rax, (%rsp)
decl 0x2c(%rsp)
incl %r14d
jmp 0x302218
movq 0xb0(%r13), %r8
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0x702a8
jmp 0x3020b6
leaq 0xb0(%rsp), %rdi
callq 0x393ac
leaq 0xe8(%rsp), %rdi
callq 0x302bc8
leaq 0x90(%rsp), %rdi
callq 0x6d8d6
leaq 0x10(%rsp), %rdi
callq 0x357fe
addq $0x178, %rsp # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x302413
movq %rax, %rbx
jmp 0x302435
movq %rax, %rbx
jmp 0x302442
movq %rax, %rbx
jmp 0x30244f
jmp 0x302425
jmp 0x302425
jmp 0x302425
jmp 0x302425
leaq 0xb0(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0xe8(%rsp), %rdi
callq 0x302bc8
leaq 0x90(%rsp), %rdi
callq 0x6d8d6
leaq 0x10(%rsp), %rdi
callq 0x357fe
movq %rbx, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::solver_inequalities_101coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::quadratic_cost_type<double> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&) | solver_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 0x161202(%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 0x2900a
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 0x302c0b
movslq %ebp, %r13
leaq 0x70(%r12), %rdi
movq %r13, %rsi
movq %rdi, 0x8(%rsp)
callq 0x302c4b
leaq 0x78(%r12), %rdi
movq %r13, %rsi
callq 0x2900a
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 0x302678
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 0x3025d1
movl (%r13), %eax
leal 0x1(%rax), %ecx
testl $0xfffffffd, %ecx # imm = 0xFFFFFFFD
jne 0x302687
movq %r14, %rdi
movl %ebp, %esi
testl %eax, %eax
jle 0x3025b0
callq 0x369c8
jmp 0x3025b5
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 0x302588
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 0x302609
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 0x30263e
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 0x3026a8
movq 0x8(%rax), %rdx
addl %r15d, %ebx
incq %r9
subq (%rax), %rdx
shrq $0x3, %rdx
cmpl %edx, %ebx
je 0x302562
leaq 0x155dcc(%rip), %rdi # 0x45842a
leaq 0x1610a8(%rip), %rsi # 0x46370d
leaq 0x16102c(%rip), %rdx # 0x463698
leaq 0x1610c4(%rip), %rcx # 0x463737
callq 0x2813f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x155d9c(%rip), %rdi # 0x45842a
leaq 0x157b98(%rip), %rsi # 0x45a22d
leaq 0x160ffc(%rip), %rdx # 0x463698
leaq 0x161062(%rip), %rcx # 0x463705
callq 0x2813f
leaq 0x155d7b(%rip), %rdi # 0x45842a
leaq 0x157bf3(%rip), %rsi # 0x45a2a9
leaq 0x160fdb(%rip), %rdx # 0x463698
leaq 0x161045(%rip), %rcx # 0x463709
callq 0x2813f
movq 0x8(%rsp), %rdi
movq %rax, %r14
callq 0x302c88
jmp 0x3026db
movq %rax, %r14
movq %rbx, %rdi
callq 0x302ca2
jmp 0x3026e8
movq %rax, %r14
leaq 0x60(%r12), %rdi
callq 0x357fe
jmp 0x3026f7
movq %rax, %r14
movq 0x10(%rsp), %rdi
callq 0x29066
jmp 0x302706
movq %rax, %r14
movq 0x20(%rsp), %rdi
callq 0x3a954
movq %r12, %rdi
callq 0xb853a
movq %r14, %rdi
callq 0xb3d0
movq %rax, %r14
jmp 0x302710
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true> const&, baryonyx::bit_array const&) | void init(const Solver& s, const Xtype& x)
{
switch (order) {
case solver_parameters::constraint_order::infeasibility_decr:
case solver_parameters::constraint_order::infeasibility_incr:
infeasibility_local_compute_violated_constraints(s, x);
break;
case solver_parameters::constraint_order::pi_sign_change:
std::iota(R.begin(), R.end(), 0);
break;
case solver_parameters::constraint_order::none:
case solver_parameters::constraint_order::reversing:
case solver_parameters::constraint_order::random_sorting:
case solver_parameters::constraint_order::lagrangian_decr:
case solver_parameters::constraint_order::lagrangian_incr:
default:
compute_violated_constraints(s, x, R);
break;
}
} | movl 0x30(%rdi), %ecx
movq %rdi, %rax
leal -0x3(%rcx), %edi
cmpl $0x2, %edi
jae 0x30273c
movq %rax, %rdi
jmp 0x302cd8
cmpl $0x7, %ecx
jne 0x302759
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0x302767
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0x30274a
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0x302df3
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array, double>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, double, double, double) | int run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta)
{
bool pi_changed = false;
int remaining = 0;
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.compute_update_row(
x, R.crbegin(), R.crend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
}
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl 0x30(%rdi), %eax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decl %eax
cmpl $0x6, %eax
ja 0x3028a7
leaq 0x160ba1(%rip), %rdx # 0x463330
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
callq 0x302efa
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x302df3
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x304ce0
jmp 0x3028dc
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x30440a
jmp 0x302838
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x304875
vmovsd 0x8(%rsp), %xmm0
vmovsd 0x10(%rsp), %xmm1
vmovsd 0x18(%rsp), %xmm2
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3032de
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x3034ca
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x3ceed
vmovsd 0x8(%rsp), %xmm0
vmovsd 0x10(%rsp), %xmm1
vmovsd 0x18(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3030f2
jmp 0x302900
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x3051d2
vmovsd 0x8(%rsp), %xmm0
vmovsd 0x10(%rsp), %xmm1
vmovsd 0x18(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3035e6
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x302df3
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovsd %xmm2, 0x18(%rsp)
vmovsd %xmm1, 0x10(%rsp)
vmovsd %xmm0, 0x8(%rsp)
callq 0x3ceed
vmovsd 0x8(%rsp), %xmm0
vmovsd 0x10(%rsp), %xmm1
vmovsd 0x18(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3030f2
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x3037d2
nop
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array, double>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, double, double, double, double) | int push_and_run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
bool pi_changed = 0;
int remaining = 0;
if (use_cycle)
order = next_state(order);
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.push_and_compute_update_row(x,
R.crbegin(),
R.crend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
}
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl 0x30(%rdi), %eax
cmpb $0x1, 0x34(%rdi)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
jne 0x3029a0
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 0x302b39
leaq 0x16099a(%rip), %rdx # 0x46334c
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
callq 0x3056c8
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x302df3
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovsd %xmm3, 0x18(%rsp)
vmovsd %xmm2, 0x10(%rsp)
vmovsd %xmm1, 0x8(%rsp)
vmovsd %xmm0, (%rsp)
callq 0x30692c
jmp 0x302b22
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovsd %xmm3, 0x18(%rsp)
vmovsd %xmm2, 0x10(%rsp)
vmovsd %xmm1, 0x8(%rsp)
vmovsd %xmm0, (%rsp)
callq 0x306056
jmp 0x302a6a
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovsd %xmm3, 0x18(%rsp)
vmovsd %xmm2, 0x10(%rsp)
vmovsd %xmm1, 0x8(%rsp)
vmovsd %xmm0, (%rsp)
callq 0x3064c1
vmovsd (%rsp), %xmm0
vmovsd 0x8(%rsp), %xmm1
vmovsd 0x10(%rsp), %xmm2
vmovsd 0x18(%rsp), %xmm3
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x305b96
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x3034ca
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovsd %xmm3, 0x18(%rsp)
vmovsd %xmm2, 0x10(%rsp)
vmovsd %xmm1, 0x8(%rsp)
vmovsd %xmm0, (%rsp)
callq 0x3ceed
vmovsd (%rsp), %xmm0
vmovsd 0x8(%rsp), %xmm1
vmovsd 0x10(%rsp), %xmm2
vmovsd 0x18(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x305936
jmp 0x302b4b
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovsd %xmm3, 0x18(%rsp)
vmovsd %xmm2, 0x10(%rsp)
vmovsd %xmm1, 0x8(%rsp)
vmovsd %xmm0, (%rsp)
callq 0x306e1e
vmovsd (%rsp), %xmm0
vmovsd 0x8(%rsp), %xmm1
vmovsd 0x10(%rsp), %xmm2
vmovsd 0x18(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x305df6
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x302df3
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovsd %xmm3, 0x18(%rsp)
vmovsd %xmm2, 0x10(%rsp)
vmovsd %xmm1, 0x8(%rsp)
vmovsd %xmm0, (%rsp)
callq 0x3ceed
vmovsd (%rsp), %xmm0
vmovsd 0x8(%rsp), %xmm1
vmovsd 0x10(%rsp), %xmm2
vmovsd 0x18(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x305936
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x3037d2
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true> const, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true> const&, baryonyx::bit_array const&) | int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x302cfc
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 0x302dd3
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 0x302d81
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 0x302d57
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rbx
movq 0x70(%rax), %rcx
imulq $0xc, %rbx, %rdx
movl (%rcx,%rdx), %eax
subl %r13d, %eax
jle 0x302da9
shlq $0x20, %rax
orq %rbx, %rax
movq %rax, 0x8(%rsp)
jmp 0x302dbc
subl 0x4(%rcx,%rdx), %r13d
jle 0x302dcb
shlq $0x20, %r13
orq %rbx, %r13
movq %r13, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbx
jmp 0x302d29
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true> const&, baryonyx::bit_array const&, std::vector<int, std::allocator<int>>&) | int
compute_violated_constraints(const Solver& slv,
const Xtype& x,
std::vector<int>& out)
{
out.clear();
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
out.emplace_back(k);
return length(out);
} | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdx), %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rax, 0x8(%rdx)
je 0x302e11
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x88(%r15), %esi
je 0x302e47
movq %r15, %rdi
movq %r14, %rdx
callq 0x302e5e
testb %al, %al
jne 0x302e3f
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0x302e18
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true> const&, int, baryonyx::bit_array const&) | bool
is_valid_constraint(const Solver& slv, int k, const Xtype& x)
{
typename sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = slv.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += slv.factor(it->value) * x[it->column];
return slv.bound_min(k) <= v && v <= slv.bound_max(k);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $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 0x302ec7
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 0x302e9d
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq 0x70(%rax), %rax
imulq $0xc, %rcx, %rcx
cmpl %r13d, (%rax,%rcx)
jle 0x302ee3
xorl %eax, %eax
jmp 0x302eeb
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, double, double, double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto 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 $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x60(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x50(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x159220(%rip), %rdx # 0x45c344
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
pushq $0x16
popq %r13
leaq 0x1605ea(%rip), %rbp # 0x46373b
pushq $0xb
popq %rbx
movq %r15, 0x30(%rsp)
cmpq 0x38(%rsp), %r14
je 0x3032cc
movl (%r14), %edx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movq %rax, 0x48(%rsp)
movq %r14, 0x40(%rsp)
movl %edx, 0x8(%rsp)
callq 0x3de66
vmovsd 0x50(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x303814
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x303832
movq %rax, 0x10(%rsp)
movslq %eax, %rsi
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x30398a
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x3039be
movslq 0x8(%rsp), %rcx
movl %eax, 0xc(%rsp)
leaq 0x15de44(%rip), %rdx # 0x461045
movq %r12, %rdi
movq %r13, %r14
movq %r13, %rsi
imulq $0xc, %rcx, %r8
addq 0x70(%r12), %r8
leaq 0x8(%rsp), %rcx
callq 0xb91c2
pushq $0xc
popq %r15
xorl %r13d, %r13d
movslq 0x10(%rsp), %rax
cmpq %rax, %r13
jge 0x303258
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0xc(%rax,%r15), %r8
leaq -0x4(%rax,%r15), %rcx
leaq (%rax,%r15), %r9
callq 0x2f537e
incq %r13
addq $0x10, %r15
jmp 0x303224
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x15ddf3(%rip), %rdx # 0x46105c
leaq 0xc(%rsp), %r8
movq %r12, %rdi
movq %r14, %r13
movq %r14, %rsi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x30(%rsp), %r15
movq 0x20(%rsp), %rdx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x303a32
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x303159
andb $0x1, %al
addq $0x68, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<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>>>>, double, double, double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto 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 $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x60(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x50(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x159034(%rip), %rdx # 0x45c344
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
pushq $0x16
popq %r13
leaq 0x1603fe(%rip), %rbp # 0x46373b
pushq $0xb
popq %rbx
movq %r15, 0x30(%rsp)
cmpq 0x38(%rsp), %r14
je 0x3034b8
movl (%r14), %edx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movq %rax, 0x48(%rsp)
movq %r14, 0x40(%rsp)
movl %edx, 0x8(%rsp)
callq 0x3de66
vmovsd 0x50(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x303814
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x303832
movq %rax, 0x10(%rsp)
movslq %eax, %rsi
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x30398a
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x3039be
movslq 0x8(%rsp), %rcx
movl %eax, 0xc(%rsp)
leaq 0x15dc58(%rip), %rdx # 0x461045
movq %r12, %rdi
movq %r13, %r14
movq %r13, %rsi
imulq $0xc, %rcx, %r8
addq 0x70(%r12), %r8
leaq 0x8(%rsp), %rcx
callq 0xb91c2
pushq $0xc
popq %r15
xorl %r13d, %r13d
movslq 0x10(%rsp), %rax
cmpq %rax, %r13
jge 0x303444
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0xc(%rax,%r15), %r8
leaq -0x4(%rax,%r15), %rcx
leaq (%rax,%r15), %r9
callq 0x2f537e
incq %r13
addq $0x10, %r15
jmp 0x303410
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x15dc07(%rip), %rdx # 0x46105c
leaq 0xc(%rsp), %r8
movq %r12, %rdi
movq %r14, %r13
movq %r14, %rsi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x30(%rsp), %r15
movq 0x20(%rsp), %rdx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x303a32
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %r14
orb %al, %cl
addq $0x8, %r14
movq %rcx, %rax
jmp 0x303345
andb $0x1, %al
addq $0x68, %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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<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 $0x48, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x3034ee
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 0x3035c5
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 0x303573
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 0x303549
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rbx
movq 0x70(%rax), %rcx
imulq $0xc, %rbx, %rdx
movl (%rcx,%rdx), %eax
subl %r13d, %eax
jle 0x30359b
shlq $0x20, %rax
orq %rbx, %rax
movq %rax, 0x8(%rsp)
jmp 0x3035ae
subl 0x4(%rcx,%rdx), %r13d
jle 0x3035bd
shlq $0x20, %r13
orq %rbx, %r13
movq %r13, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbx
jmp 0x30351b
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 |
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true> const&, baryonyx::bit_array const&) | int local_compute_violated_constraints(const Solver& slv, const Xtype& x)
{
int remaining = 0;
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
++remaining;
return remaining;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl 0x88(%r14), %r15d
je 0x303807
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x302e5e
xorb $0x1, %al
incl %r15d
movzbl %al, %eax
addl %eax, %ebp
jmp 0x3037e4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::rc_size baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::compute_reduced_costs<baryonyx::bit_array>(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, baryonyx::bit_array const&) | rc_size compute_reduced_costs(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
const Xtype& x) noexcept
{
int r_size = 0;
int c_size = 0;
for (; begin != end; ++begin) {
Float sum_a_pi = 0;
Float sum_a_p = 0;
auto ht = ap.column(begin->column);
for (; std::get<0>(ht) != std::get<1>(ht); ++std::get<0>(ht)) {
auto a = static_cast<Float>(A.get(std::get<0>(ht)->value));
sum_a_pi += a * pi[std::get<0>(ht)->row];
sum_a_p += a * P[std::get<0>(ht)->value];
}
R[r_size].id = r_size;
R[r_size].value = c(begin->column, x) - sum_a_pi - sum_a_p;
R[r_size].f = A.get(begin->value);
if (R[r_size].is_negative_factor()) {
R[r_size].value = -R[r_size].value;
++c_size;
}
++r_size;
}
return { r_size, c_size };
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
leaq 0x58(%rdi), %rbp
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
movq $0x0, (%rsp)
movq %rax, 0x28(%rsp)
cmpq %r14, %r15
je 0x30396d
movl 0x4(%r15), %edx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0x3dede
movq 0x20(%rsp), %rax
vxorpd %xmm1, %xmm1, %xmm1
vxorpd %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 0x8(%rsp)
vmovsd %xmm1, 0x10(%rsp)
cmpq 0x18(%rsp), %rax
je 0x3038ed
movl (%rax), %esi
movq %rbp, %rdi
callq 0x2b9c1a
vcvtsi2sd %eax, %xmm3, %xmm0
movq 0x20(%rsp), %rax
movq 0x78(%r12), %rsi
vmovsd 0x10(%rsp), %xmm1
movq 0x50(%r12), %rdx
vmovsd 0x8(%rsp), %xmm2
movslq 0x4(%rax), %rcx
vfmadd231sd (%rsi,%rcx,8), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
movslq (%rax), %rcx
addq $0x8, %rax
vfmadd231sd (%rdx,%rcx,8), %xmm0, %xmm2 # xmm2 = (xmm0 * mem) + xmm2
movq %rax, 0x20(%rsp)
vmovapd %xmm2, %xmm0
jmp 0x30388f
movq 0x68(%r12), %rax
movq %r13, %rbx
shlq $0x4, %rbx
movq 0x30(%rsp), %rdx
movl %r13d, 0xc(%rax,%rbx)
movq 0x80(%r12), %rdi
movl 0x4(%r15), %esi
callq 0x73084
vsubsd 0x10(%rsp), %xmm0, %xmm0
movq 0x68(%r12), %rax
movq %rbp, %rdi
vsubsd 0x8(%rsp), %xmm0, %xmm0
vmovsd %xmm0, (%rax,%rbx)
movl (%r15), %esi
callq 0x2b9c1a
movq 0x68(%r12), %rcx
movl %eax, 0x8(%rcx,%rbx)
testl %eax, %eax
jns 0x303961
addq %rbx, %rcx
movq (%rsp), %rax
vmovsd (%rcx), %xmm0
vxorpd 0x1506d1(%rip){1to2}, %xmm0, %xmm0 # 0x454028
incl %eax
movq %rax, (%rsp)
vmovlpd %xmm0, (%rcx)
incq %r13
addq $0x8, %r15
jmp 0x303866
movq (%rsp), %rcx
movl %r13d, %eax
shlq $0x20, %rcx
orq %rcx, %rax
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 |
baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::select_variables(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::rc_size const&, int, int) | int select_variables(const rc_size& sizes, int bkmin, int bkmax)
{
if (bkmin == bkmax)
return std::min(bkmin + sizes.c_size, sizes.r_size) - 1;
bkmin += sizes.c_size;
bkmax = std::min(bkmax + sizes.c_size, sizes.r_size);
for (int i = bkmin; i <= bkmax; ++i)
if (stop_iterating<Mode>(R[i].value, rng))
return i - 1;
return bkmax - 1;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rsi), %edi
leal (%rdi,%rdx), %eax
cmpl %ecx, %edx
jne 0x3039de
movl (%rsi), %ecx
cmpl %eax, %ecx
cmovll %ecx, %eax
decl %eax
jmp 0x303a29
movl (%rsi), %esi
addl %edi, %ecx
movslq %eax, %r14
leal -0x1(%rdi,%rdx), %ebp
movq %r14, %r12
cmpl %ecx, %esi
cmovll %esi, %ecx
shlq $0x4, %r12
movslq %ecx, %r15
cmpq %r15, %r14
jg 0x303a1f
movq 0x68(%rbx), %rax
movq 0x8(%rbx), %rdi
vmovsd (%rax,%r12), %xmm0
callq 0x67e58
testb %al, %al
jne 0x303a1f
incq %r14
incl %ebp
addq $0x10, %r12
jmp 0x3039f8
leal -0x1(%r15), %eax
cmpq %r15, %r14
cmovlel %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::affect<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, double>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, double, double) | bool
affect(Solver& slv,
Xtype& x,
Iterator it,
int k,
int selected,
int r_size,
const Float kappa,
const Float delta)
{
constexpr Float one{ 1 };
constexpr Float two{ 2 };
constexpr Float middle{ (two + one) / two };
const auto old_pi = slv.pi[k];
auto d = delta;
if (selected < 0) {
// slv.pi[k] += slv.R[0].value / two;
d += (kappa / (one - kappa)) * (slv.R[0].value / two);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
} else if (selected + 1 >= r_size) {
// slv.pi[k] += slv.R[selected].value * middle;
d += (kappa / (one - kappa)) * (slv.R[selected].value * middle);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
} else {
slv.pi[k] +=
((slv.R[selected].value + slv.R[selected + 1].value) / two);
d += (kappa / (one - kappa)) *
(slv.R[selected + 1].value - slv.R[selected].value);
int i = 0;
for (; i <= selected; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
for (; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
}
// TODO job: develops is_valid_constraint for all the solvers
bx_expects(is_valid_constraint(slv, k, x));
return is_signbit_change(old_pi, slv.pi[k]);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x78(%rdi), %rax
movl %ecx, 0xc(%rsp)
movslq %ecx, %rcx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rcx, 0x10(%rsp)
vmovsd (%rax,%rcx,8), %xmm2
vmovaps %xmm2, 0x20(%rsp)
testl %r8d, %r8d
js 0x303b3b
leal 0x1(%r8), %ecx
cmpl %r9d, %ecx
jge 0x303bca
movq 0x68(%rbx), %rsi
movl %r8d, %edx
shlq $0x4, %rdx
movl %ecx, %ebp
movq %rbp, 0x18(%rsp)
shlq $0x4, %rbp
movq 0x10(%rsp), %rcx
xorl %r13d, %r13d
movl %r9d, 0x8(%rsp)
vmovsd (%rsi,%rdx), %xmm2
vaddsd (%rsi,%rbp), %xmm2, %xmm2
vmulsd 0x154ec9(%rip), %xmm2, %xmm2 # 0x458978
vaddsd 0x20(%rsp), %xmm2, %xmm2
vmovsd %xmm2, (%rax,%rcx,8)
vmovsd 0x150576(%rip), %xmm2 # 0x454038
vsubsd %xmm0, %xmm2, %xmm2
vdivsd %xmm2, %xmm0, %xmm0
vmovsd (%rsi,%rbp), %xmm2
vsubsd (%rsi,%rdx), %xmm2, %xmm2
vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovsd %xmm2, (%rsp)
cmpq %r13, %rbp
je 0x303c61
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq 0xc(%rax,%r13), %r12
cmpl $0x0, 0x8(%rax,%r13)
movl 0x4(%r15,%r12,8), %esi
js 0x303b19
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
jmp 0x303b30
callq 0x36a06
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
addq $0x10, %r13
jmp 0x303ade
vmovsd 0x1504f5(%rip), %xmm2 # 0x454038
movq 0x68(%rbx), %rax
movl %r9d, %r12d
shlq $0x4, %r12
xorl %ebp, %ebp
vsubsd %xmm0, %xmm2, %xmm2
vdivsd %xmm2, %xmm0, %xmm0
vmovsd (%rax), %xmm2
vmulsd 0x154e14(%rip), %xmm2, %xmm2 # 0x458978
vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovsd %xmm2, (%rsp)
cmpq %rbp, %r12
je 0x303cc7
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq 0xc(%rax,%rbp), %r13
cmpl $0x0, 0x8(%rax,%rbp)
movl 0x4(%r15,%r13,8), %esi
js 0x303ba8
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
jmp 0x303bbf
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
addq $0x10, %rbp
jmp 0x303b6e
vmovsd 0x150466(%rip), %xmm2 # 0x454038
movq 0x68(%rbx), %rcx
movl %r8d, %eax
shlq $0x4, %rax
movl %r9d, %r12d
shlq $0x4, %r12
xorl %ebp, %ebp
vsubsd %xmm0, %xmm2, %xmm2
vdivsd %xmm2, %xmm0, %xmm0
vmovsd (%rcx,%rax), %xmm2
vmulsd 0x1580c5(%rip), %xmm2, %xmm2 # 0x45bcc0
vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovsd %xmm2, (%rsp)
cmpq %rbp, %r12
je 0x303cc7
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq 0xc(%rax,%rbp), %r13
cmpl $0x0, 0x8(%rax,%rbp)
movl 0x4(%r15,%r13,8), %esi
js 0x303c3f
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
jmp 0x303c56
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
addq $0x10, %rbp
jmp 0x303c05
movl 0x8(%rsp), %r12d
orq $0xc, %rbp
subq 0x18(%rsp), %r12
subq $0x1, %r12
jb 0x303cc7
movq 0x68(%rbx), %rax
movq %r14, %rdi
movslq (%rax,%rbp), %r13
cmpl $0x0, -0x4(%rax,%rbp)
movl 0x4(%r15,%r13,8), %esi
js 0x303ca5
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
jmp 0x303cbc
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
addq $0x10, %rbp
jmp 0x303c6f
movl 0xc(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x302e5e
testb %al, %al
je 0x303d08
vmovapd 0x20(%rsp), %xmm0
movq 0x78(%rbx), %rcx
movq 0x10(%rsp), %rdx
vmovmskpd %xmm0, %eax
shlq $0x3f, %rax
xorq (%rcx,%rdx,8), %rax
shrq $0x3f, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1544cf(%rip), %rdi # 0x4581de
leaq 0x158606(%rip), %rsi # 0x45c31c
leaq 0x15626f(%rip), %rdx # 0x459f8c
leaq 0x158617(%rip), %rcx # 0x45c33b
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::rc_data*>(baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::rc_data*, baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::rc_data*, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&) | inline void
random_shuffle_unique(iteratorT begin,
iteratorT end,
random_engine& rng) noexcept
{
auto ret = begin++;
for (; begin != end; ++begin) {
if (ret->value != begin->value) {
std::shuffle(ret, begin, rng);
ret = begin;
}
}
std::shuffle(ret, begin, rng);
} | pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x10(%rdi), %rsi
cmpq %r14, %rsi
je 0x303d64
vmovsd (%rdi), %xmm0
leaq 0x10(%rsi), %r15
vucomisd (%rsi), %xmm0
movq %r15, %rsi
jne 0x303d50
jnp 0x303d38
addq $-0x10, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x304285
movq %r15, %rdi
jmp 0x303d34
movq %rbx, %rdx
callq 0x304285
popq %rbx
popq %r14
popq %r15
retq
jmp 0x303d74
movq %rax, %rdi
callq 0xeb9f
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::push_and_compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, double, double, double, double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float 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 $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x60(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x50(%rsp), %r9
movq %rdx, %rbx
vmovsd %xmm3, 0x48(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x156c3f(%rip), %rdx # 0x45c33f
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
leaq 0x15e019(%rip), %rbp # 0x46373b
movq %rbx, 0x30(%rsp)
xorl %esi, %esi
movq %rax, 0x28(%rsp)
movq (%rbx), %rax
pushq $0xb
popq %rbx
movq 0x38(%rsp), %rcx
cmpq (%rcx), %rax
je 0x305900
movl -0x4(%rax), %edx
movl %edx, 0x8(%rsp)
cmpl 0x88(%r12), %edx
jge 0x305915
movq %rsi, 0x40(%rsp)
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0x3de66
vmovsd 0x50(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x303814
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x303832
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
xorl %r13d, %r13d
movl %eax, %ecx
cmpq %rcx, %r13
je 0x3057f1
movq 0x68(%r12), %rax
movq 0x20(%rsp), %rcx
movq 0x80(%r12), %rdi
movq %r15, %rdx
movslq 0xc(%rax,%r14), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x73084
movq 0x68(%r12), %rax
vmovsd 0x48(%rsp), %xmm1
incq %r13
vfmadd213sd (%rax,%r14), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rax,%r14)
addq $0x10, %r14
movl 0x10(%rsp), %eax
jmp 0x3057a3
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x30398a
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x3039be
movslq 0x8(%rsp), %rsi
movl %eax, 0xc(%rsp)
movq %r12, %rdi
imulq $0xc, %rsi, %r8
addq 0x70(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x15b7fa(%rip), %rdx # 0x461045
leaq 0x8(%rsp), %rcx
callq 0xb91c2
pushq $0xc
popq %r14
xorl %r13d, %r13d
movslq 0x10(%rsp), %rax
cmpq %rax, %r13
jge 0x305890
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0xc(%rax,%r14), %r8
leaq -0x4(%rax,%r14), %rcx
leaq (%rax,%r14), %r9
callq 0x2f537e
incq %r13
addq $0x10, %r14
jmp 0x30585c
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
movq %r12, %rdi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
pushq $0x16
popq %rsi
leaq 0x15b7ac(%rip), %rdx # 0x46105c
leaq 0xc(%rsp), %r8
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x303a32
movq 0x40(%rsp), %rsi
movq 0x30(%rsp), %rcx
orb %al, %sil
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x305734
andb $0x1, %sil
movl %esi, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1528c2(%rip), %rdi # 0x4581de
leaq 0x154b57(%rip), %rsi # 0x45a47a
leaq 0x15dd6e(%rip), %rdx # 0x463698
leaq 0x15de16(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, double, double, double, double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float 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 $0x68, %rsp
movq %rcx, 0x30(%rsp)
leaq 0x60(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x50(%rsp), %r9
movq %rdx, %r14
vmovsd %xmm3, 0x48(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x1569d1(%rip), %rdx # 0x45c33f
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
leaq 0x15ddab(%rip), %rbp # 0x46373b
movq %rax, 0x28(%rsp)
xorl %eax, %eax
pushq $0xb
popq %rbx
cmpq 0x30(%rsp), %r14
je 0x305b64
movl (%r14), %edx
movl %edx, 0x8(%rsp)
cmpl 0x88(%r12), %edx
jge 0x305b75
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movq %rax, 0x38(%rsp)
movq %r14, 0x40(%rsp)
callq 0x3de66
vmovsd 0x50(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x303814
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x303832
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
movl %eax, %ecx
cmpq %rcx, %r14
je 0x305a59
movq 0x68(%r12), %rax
movq 0x20(%rsp), %rcx
movq 0x80(%r12), %rdi
movq %r15, %rdx
movslq 0xc(%rax,%r13), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x73084
movq 0x68(%r12), %rax
vmovsd 0x48(%rsp), %xmm1
incq %r14
vfmadd213sd (%rax,%r13), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rax,%r13)
addq $0x10, %r13
movl 0x10(%rsp), %eax
jmp 0x305a0b
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x30398a
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x3039be
movslq 0x8(%rsp), %rsi
movl %eax, 0xc(%rsp)
movq %r12, %rdi
imulq $0xc, %rsi, %r8
addq 0x70(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x15b592(%rip), %rdx # 0x461045
leaq 0x8(%rsp), %rcx
callq 0xb91c2
pushq $0xc
popq %r14
xorl %r13d, %r13d
movslq 0x10(%rsp), %rax
cmpq %rax, %r13
jge 0x305af8
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0xc(%rax,%r14), %r8
leaq -0x4(%rax,%r14), %rcx
leaq (%rax,%r14), %r9
callq 0x2f537e
incq %r13
addq $0x10, %r14
jmp 0x305ac4
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
movq %r12, %rdi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
pushq $0x16
popq %rsi
leaq 0x15b544(%rip), %rdx # 0x46105c
leaq 0xc(%rsp), %r8
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x303a32
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x30599a
andb $0x1, %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x152662(%rip), %rdi # 0x4581de
leaq 0x1548f7(%rip), %rsi # 0x45a47a
leaq 0x15db0e(%rip), %rdx # 0x463698
leaq 0x15dbb6(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, double, double, double, double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float 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 $0x68, %rsp
movq %rcx, 0x30(%rsp)
leaq 0x60(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x50(%rsp), %r9
movq %rdx, %r14
vmovsd %xmm3, 0x48(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x156771(%rip), %rdx # 0x45c33f
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
leaq 0x15db4b(%rip), %rbp # 0x46373b
movq %rax, 0x28(%rsp)
xorl %eax, %eax
pushq $0xb
popq %rbx
cmpq 0x30(%rsp), %r14
je 0x305dc4
movl (%r14), %edx
movl %edx, 0x8(%rsp)
cmpl 0x88(%r12), %edx
jge 0x305dd5
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movq %rax, 0x38(%rsp)
movq %r14, 0x40(%rsp)
callq 0x3de66
vmovsd 0x50(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x303814
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x303832
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
movl %eax, %ecx
cmpq %rcx, %r14
je 0x305cb9
movq 0x68(%r12), %rax
movq 0x20(%rsp), %rcx
movq 0x80(%r12), %rdi
movq %r15, %rdx
movslq 0xc(%rax,%r13), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x73084
movq 0x68(%r12), %rax
vmovsd 0x48(%rsp), %xmm1
incq %r14
vfmadd213sd (%rax,%r13), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rax,%r13)
addq $0x10, %r13
movl 0x10(%rsp), %eax
jmp 0x305c6b
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x30398a
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x3039be
movslq 0x8(%rsp), %rsi
movl %eax, 0xc(%rsp)
movq %r12, %rdi
imulq $0xc, %rsi, %r8
addq 0x70(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x15b332(%rip), %rdx # 0x461045
leaq 0x8(%rsp), %rcx
callq 0xb91c2
pushq $0xc
popq %r14
xorl %r13d, %r13d
movslq 0x10(%rsp), %rax
cmpq %rax, %r13
jge 0x305d58
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0xc(%rax,%r14), %r8
leaq -0x4(%rax,%r14), %rcx
leaq (%rax,%r14), %r9
callq 0x2f537e
incq %r13
addq $0x10, %r14
jmp 0x305d24
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
movq %r12, %rdi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
pushq $0x16
popq %rsi
leaq 0x15b2e4(%rip), %rdx # 0x46105c
leaq 0xc(%rsp), %r8
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x303a32
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %r14
orb %al, %cl
addq $0x8, %r14
movq %rcx, %rax
jmp 0x305bfa
andb $0x1, %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x152402(%rip), %rdi # 0x4581de
leaq 0x154697(%rip), %rsi # 0x45a47a
leaq 0x15d8ae(%rip), %rdx # 0x463698
leaq 0x15d956(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, double, double, double, double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float 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 $0x68, %rsp
movq %rcx, 0x30(%rsp)
leaq 0x60(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x50(%rsp), %r9
movq %rdx, %r14
vmovsd %xmm3, 0x48(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x156511(%rip), %rdx # 0x45c33f
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
leaq 0x15d8eb(%rip), %rbp # 0x46373b
movq %rax, 0x28(%rsp)
xorl %eax, %eax
pushq $0xb
popq %rbx
cmpq 0x30(%rsp), %r14
je 0x306024
movl (%r14), %edx
movl %edx, 0x8(%rsp)
cmpl 0x88(%r12), %edx
jge 0x306035
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movq %rax, 0x38(%rsp)
movq %r14, 0x40(%rsp)
callq 0x3de66
vmovsd 0x50(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x303814
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x303832
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
movl %eax, %ecx
cmpq %rcx, %r14
je 0x305f19
movq 0x68(%r12), %rax
movq 0x20(%rsp), %rcx
movq 0x80(%r12), %rdi
movq %r15, %rdx
movslq 0xc(%rax,%r13), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x73084
movq 0x68(%r12), %rax
vmovsd 0x48(%rsp), %xmm1
incq %r14
vfmadd213sd (%rax,%r13), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rax,%r13)
addq $0x10, %r13
movl 0x10(%rsp), %eax
jmp 0x305ecb
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x30398a
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x3039be
movslq 0x8(%rsp), %rsi
movl %eax, 0xc(%rsp)
movq %r12, %rdi
imulq $0xc, %rsi, %r8
addq 0x70(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x15b0d2(%rip), %rdx # 0x461045
leaq 0x8(%rsp), %rcx
callq 0xb91c2
pushq $0xc
popq %r14
xorl %r13d, %r13d
movslq 0x10(%rsp), %rax
cmpq %rax, %r13
jge 0x305fb8
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0xc(%rax,%r14), %r8
leaq -0x4(%rax,%r14), %rcx
leaq (%rax,%r14), %r9
callq 0x2f537e
incq %r13
addq $0x10, %r14
jmp 0x305f84
movslq 0x8(%rsp), %rax
movq 0x70(%r12), %rcx
movq %r12, %rdi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
pushq $0x16
popq %rsi
leaq 0x15b084(%rip), %rdx # 0x46105c
leaq 0xc(%rsp), %r8
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x303a32
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x305e5a
andb $0x1, %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1521a2(%rip), %rdi # 0x4581de
leaq 0x154437(%rip), %rsi # 0x45a47a
leaq 0x15d64e(%rip), %rdx # 0x463698
leaq 0x15d6f6(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3c8, %rsp # imm = 0x3C8
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x20(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x6fb57
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm1
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x28(%r12), %xmm0
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x70(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x60(%rsp)
vmovsd 0x8(%r12), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x30742a
movq 0x10(%r14), %rdi
vmovsd 0x38(%rsp), %xmm0
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x6fc31
vmovsd %xmm0, 0x30(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x50(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x80(%rsp)
vmovsd %xmm1, 0x78(%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 0x302462
movl 0xcc(%r12), %esi
leaq 0xa8(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x5c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x170(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x30750b
cmpl $0x1, %eax
je 0x3074e5
cmpl $0x2, %eax
jne 0x30751c
movq 0x18(%r14), %rdx
leaq 0x170(%rsp), %rdi
leaq 0x20(%rsp), %rsi
jmp 0x3074f6
movq 0x18(%r14), %rdx
leaq 0x20(%rsp), %rdi
leaq 0x170(%rsp), %rsi
vmovsd 0x14cb3a(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x6ddd4
jmp 0x30751c
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x6dd5f
leaq 0x20(%rsp), %r15
movq %r13, 0x40(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x307552
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x30754e
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x30752b
leaq 0x178(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x168(%rsp), %ecx
movl 0x16c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x8(%rsp)
leaq 0x152fed(%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 0x20(%rsp), %rdx
callq 0x302726
vmovsd 0x8(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x20(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x3076bd
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movq %r13, %rdx
vmovsd %xmm0, 0x8(%rsp)
callq 0x302768
movq 0x130(%rsp), %rdx
movq 0x158(%rsp), %rcx
movl %eax, %ebx
leaq 0x170(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x6c2be
testl %ebx, %ebx
je 0x307762
cmpl %ebp, %ebx
jge 0x307659
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x308688
movl %ebx, %ebp
cmpq 0x50(%rsp), %r15
jle 0x30768f
vcvtsi2sd %ebx, %xmm3, %xmm0
vcvtsi2sdl 0x168(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x307695
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x3076bd
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x3086c0
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x3076bd
incq %r15
jmp 0x3075d8
movq 0x10(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x3076df
movq 0x10(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x30770d
movq 0x10(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x5c(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x170(%rsp), %rdi
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x302bc8
leaq 0x88(%rsp), %rdi
callq 0x6d8d6
leaq 0x28(%rsp), %rdi
callq 0x357fe
movq 0x10(%rsp), %rax
addq $0x3c8, %rsp # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x6e096
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x30863e
vmovsd 0x8(%rsp), %xmm0
leaq 0xe0(%rsp), %r15
leaq 0x20(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x1c(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x3076cc
vmovsd %xmm0, 0x8(%rsp)
vmulsd 0x80(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
vmovsd 0x78(%rsp), %xmm3
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x302974
testl %eax, %eax
jne 0x30781d
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x6e096
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x30863e
movq %r14, %rdi
callq 0x3086c0
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x3076cc
movl %ebx, 0x50(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x307926
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovsd %xmm0, 0x8(%rsp)
callq 0x302768
testl %eax, %eax
je 0x3078e8
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x3078bb
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x168(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x3078c1
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x307926
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x3086c0
testb %al, %al
jne 0x307920
vmovsd 0x8(%rsp), %xmm0
incl %ebx
jmp 0x30783c
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x6e096
movl 0xc0(%r12), %eax
imull 0x1c(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x30863e
vmovsd 0x8(%rsp), %xmm0
jmp 0x307926
vmovsd 0x8(%rsp), %xmm0
movl 0x50(%rsp), %ebx
decl 0x1c(%rsp)
incl %ebx
jmp 0x3077a5
jmp 0x30796c
jmp 0x307945
jmp 0x30796c
movq %rax, %r14
jmp 0x30797c
movq %rax, %r14
jmp 0x307989
movq %rax, %r14
jmp 0x307996
movq %rax, %r14
jmp 0x3079a3
movq %rax, %r14
jmp 0x3079ad
jmp 0x30796c
jmp 0x30796c
jmp 0x30796c
leaq 0x178(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x30797c
leaq 0x170(%rsp), %rdi
movq %rax, %r14
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x302bc8
leaq 0x88(%rsp), %rdi
callq 0x6d8d6
leaq 0x28(%rsp), %rdi
callq 0x357fe
movq 0x10(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3c8, %rsp # imm = 0x3C8
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x20(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x6fb57
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm1
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x28(%r12), %xmm0
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x70(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x60(%rsp)
vmovsd 0x8(%r12), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x307aae
movq 0x10(%r14), %rdi
vmovsd 0x38(%rsp), %xmm0
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x6fc31
vmovsd %xmm0, 0x30(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x50(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x80(%rsp)
vmovsd %xmm1, 0x78(%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 0x302462
movl 0xcc(%r12), %esi
leaq 0xa8(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x5c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x170(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x307b8f
cmpl $0x1, %eax
je 0x307b69
cmpl $0x2, %eax
jne 0x307ba0
movq 0x18(%r14), %rdx
leaq 0x170(%rsp), %rdi
leaq 0x20(%rsp), %rsi
jmp 0x307b7a
movq 0x18(%r14), %rdx
leaq 0x20(%rsp), %rdi
leaq 0x170(%rsp), %rsi
vmovsd 0x14c4b6(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x6ddd4
jmp 0x307ba0
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x6dd5f
leaq 0x20(%rsp), %r15
movq %r13, 0x40(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x307bd6
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x307bd2
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x307baf
leaq 0x178(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x168(%rsp), %ecx
movl 0x16c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x8(%rsp)
leaq 0x152969(%rip), %rdx # 0x45a577
leaq 0x170(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x302726
vmovsd 0x8(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x20(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x307d41
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movq %r13, %rdx
vmovsd %xmm0, 0x8(%rsp)
callq 0x302768
movq 0x130(%rsp), %rdx
movq 0x158(%rsp), %rcx
movl %eax, %ebx
leaq 0x170(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x6c6c0
testl %ebx, %ebx
je 0x307de6
cmpl %ebp, %ebx
jge 0x307cdd
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x30876a
movl %ebx, %ebp
cmpq 0x50(%rsp), %r15
jle 0x307d13
vcvtsi2sd %ebx, %xmm3, %xmm0
vcvtsi2sdl 0x168(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x307d19
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x307d41
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x3087a2
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x307d41
incq %r15
jmp 0x307c5c
movq 0x10(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x307d63
movq 0x10(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x307d91
movq 0x10(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x5c(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x170(%rsp), %rdi
callq 0x435d0
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x302bc8
leaq 0x88(%rsp), %rdi
callq 0x6d8d6
leaq 0x28(%rsp), %rdi
callq 0x357fe
movq 0x10(%rsp), %rax
addq $0x3c8, %rsp # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x6e096
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x308720
vmovsd 0x8(%rsp), %xmm0
leaq 0xe0(%rsp), %r15
leaq 0x20(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x1c(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x307d50
vmovsd %xmm0, 0x8(%rsp)
vmulsd 0x80(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
vmovsd 0x78(%rsp), %xmm3
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x302974
testl %eax, %eax
jne 0x307ea1
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x6e096
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x308720
movq %r14, %rdi
callq 0x3087a2
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x307d50
movl %ebx, 0x50(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x307faa
movq 0x18(%r14), %rcx
vmovsd 0x30(%rsp), %xmm1
vmovsd 0x38(%rsp), %xmm2
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovsd %xmm0, 0x8(%rsp)
callq 0x302768
testl %eax, %eax
je 0x307f6c
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x307f3f
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x168(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x307f45
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x307faa
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x3087a2
testb %al, %al
jne 0x307fa4
vmovsd 0x8(%rsp), %xmm0
incl %ebx
jmp 0x307ec0
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x6e096
movl 0xc0(%r12), %eax
imull 0x1c(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x308720
vmovsd 0x8(%rsp), %xmm0
jmp 0x307faa
vmovsd 0x8(%rsp), %xmm0
movl 0x50(%rsp), %ebx
decl 0x1c(%rsp)
incl %ebx
jmp 0x307e29
jmp 0x307ff0
jmp 0x307fc9
jmp 0x307ff0
movq %rax, %r14
jmp 0x308000
movq %rax, %r14
jmp 0x30800d
movq %rax, %r14
jmp 0x30801a
movq %rax, %r14
jmp 0x308027
movq %rax, %r14
jmp 0x308031
jmp 0x307ff0
jmp 0x307ff0
jmp 0x307ff0
leaq 0x178(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x308000
leaq 0x170(%rsp), %rdi
movq %rax, %r14
callq 0x435d0
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0x302bc8
leaq 0x88(%rsp), %rdi
callq 0x6d8d6
leaq 0x28(%rsp), %rdi
callq 0x357fe
movq 0x10(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp # imm = 0x178
vmovsd %xmm0, 0x40(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x18(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x90(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x6fb57
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm1
vmovsd %xmm0, 0x60(%rsp)
vmovsd 0x28(%r12), %xmm0
vmovsd %xmm1, 0x28(%rsp)
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x58(%rsp)
vmovsd 0x8(%r12), %xmm0
vmovsd %xmm0, 0x30(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x308132
movq 0x10(%r14), %rdi
vmovsd 0x30(%rsp), %xmm0
leaq 0x90(%rsp), %rsi
movl %ebx, %edx
callq 0x6fc31
vmovsd %xmm0, 0x28(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x48(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x88(%rsp)
vmovsd %xmm1, 0x80(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xe8(%rsp), %rdi
leaq 0x90(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x302462
movl 0xcc(%r12), %esi
leaq 0xb0(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x54(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, (%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x70(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x30820c
cmpl $0x1, %eax
je 0x3081e9
cmpl $0x2, %eax
jne 0x30821d
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rsi
jmp 0x3081f7
movq 0x18(%r14), %rdx
leaq 0x18(%rsp), %rdi
leaq 0x70(%rsp), %rsi
vmovsd 0x14be39(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x6ddd4
jmp 0x30821d
leaq 0x18(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x6dd5f
leaq 0x18(%rsp), %r15
movq %r13, 0x38(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x308252
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd (%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x30824e
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x30822c
leaq 0x78(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, (%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x302726
vmovsd (%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x18(%rsp), %rbx
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x308365
movq 0x18(%r14), %rcx
vmovsd 0x28(%rsp), %xmm1
vmovsd 0x30(%rsp), %xmm2
leaq 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
movq %rbx, %rdx
vmovsd %xmm0, (%rsp)
callq 0x302768
movl %eax, %r13d
testl %eax, %eax
je 0x3083fd
cmpl %ebp, %r13d
jge 0x308304
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0x30884c
movl %r13d, %ebp
cmpq 0x48(%rsp), %r15
jle 0x30833a
vcvtsi2sd %r13d, %xmm3, %xmm0
vcvtsi2sdl 0x170(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x58(%rsp), %xmm1
callq 0xb1f0
vmovsd (%rsp), %xmm1
vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x30833f
vmovsd (%rsp), %xmm0
vucomisd 0x68(%rsp), %xmm0
ja 0x308365
movq %r14, %rdi
vmovsd %xmm0, (%rsp)
callq 0x308884
vmovsd (%rsp), %xmm0
testb %al, %al
jne 0x308365
incq %r15
jmp 0x3082a5
movq 0x8(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x308387
movq 0x8(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x3083b5
movq 0x8(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x54(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0xb0(%rsp), %rdi
callq 0x393ac
leaq 0xe8(%rsp), %rdi
callq 0x302bc8
leaq 0x90(%rsp), %rdi
callq 0x6d8d6
leaq 0x20(%rsp), %rdi
callq 0x357fe
movq 0x8(%rsp), %rax
addq $0x178, %rsp # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x40(%rsp), %xmm0
movq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x6e096
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x308802
vmovsd (%rsp), %xmm0
leaq 0xe8(%rsp), %r15
leaq 0x18(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x14(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x308374
vmovsd %xmm0, (%rsp)
vmulsd 0x88(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovsd 0x28(%rsp), %xmm1
vmovsd 0x30(%rsp), %xmm2
vmovsd 0x80(%rsp), %xmm3
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x302974
testl %eax, %eax
jne 0x3084b9
vmovsd 0x40(%rsp), %xmm0
movq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x6e096
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x308802
movq %r14, %rdi
callq 0x308884
vmovsd (%rsp), %xmm0
testb %al, %al
jne 0x308374
movl %ebx, 0x48(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x3085ba
movq 0x18(%r14), %rcx
vmovsd 0x28(%rsp), %xmm1
vmovsd 0x30(%rsp), %xmm2
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovsd %xmm0, (%rsp)
callq 0x302768
testl %eax, %eax
je 0x30857e
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x308554
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x170(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x58(%rsp), %xmm1
callq 0xb1f0
vmovsd (%rsp), %xmm1
vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x308559
vmovsd (%rsp), %xmm0
vucomisd 0x68(%rsp), %xmm0
ja 0x3085ba
movq %r14, %rdi
vmovsd %xmm0, (%rsp)
callq 0x308884
testb %al, %al
jne 0x3085b5
vmovsd (%rsp), %xmm0
incl %ebx
jmp 0x3084d7
vmovsd 0x40(%rsp), %xmm0
movq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x6e096
movl 0xc0(%r12), %eax
imull 0x14(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x308802
vmovsd (%rsp), %xmm0
jmp 0x3085ba
vmovsd (%rsp), %xmm0
movl 0x48(%rsp), %ebx
decl 0x14(%rsp)
incl %ebx
jmp 0x30843f
jmp 0x3085f8
jmp 0x3085d4
jmp 0x3085f8
movq %rax, %r14
jmp 0x308608
movq %rax, %r14
jmp 0x308615
movq %rax, %r14
jmp 0x308622
movq %rax, %r14
jmp 0x30862c
jmp 0x3085f8
jmp 0x3085f8
jmp 0x3085f8
leaq 0x78(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x3085fb
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0x393ac
leaq 0xe8(%rsp), %rdi
callq 0x302bc8
leaq 0x90(%rsp), %rdi
callq 0x6d8d6
leaq 0x20(%rsp), %rdi
callq 0x357fe
movq 0x8(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long) | inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
} | vucomisd 0x30(%rdi), %xmm0
jbe 0x308686
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x308700
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::pnm_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x151397(%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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long) | inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
} | vucomisd 0x30(%rdi), %xmm0
jbe 0x308768
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x3087e2
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<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::file_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1512b5(%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_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_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 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 $0xb8, %rsp
movq %rcx, 0x58(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x12b279(%rip), %rdx # 0x45c33f
fldt 0x120(%rsp)
fstpt 0x74(%rsp)
fldt 0x110(%rsp)
fldt 0x100(%rsp)
fldt 0xf0(%rsp)
fstpt 0xa0(%rsp)
fstpt 0x90(%rsp)
fstpt 0x80(%rsp)
pushq $0x19
popq %rsi
leaq 0xa0(%rsp), %rcx
leaq 0x90(%rsp), %r8
leaq 0x80(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
movq %rax, 0x50(%rsp)
xorl %eax, %eax
pushq $0x16
popq %r13
leaq 0x132609(%rip), %rbp # 0x46373b
pushq $0xb
popq %rbx
movq %r15, 0x48(%rsp)
cmpq 0x58(%rsp), %r14
je 0x331311
movl (%r14), %edx
movl %edx, 0x28(%rsp)
cmpl 0x88(%r12), %edx
jge 0x331325
movq 0x50(%rsp), %rsi
leaq 0x38(%rsp), %rdi
movq %rax, 0x60(%rsp)
callq 0x3de66
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
fldt 0x80(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x32edda
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x32ee00
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rdx
movl %eax, %esi
shlq $0x5, %rsi
xorl %r8d, %r8d
movq 0x68(%r12), %rdi
movq 0x80(%r12), %rcx
fldt 0x74(%rsp)
cmpq %r8, %rsi
je 0x3311f0
movslq 0x14(%rdi,%r8), %r9
movq 0x8(%rcx), %r10
movslq 0x4(%rdx,%r9,8), %r9
shlq $0x4, %r9
fldt (%r10,%r9)
fmul %st(1), %st
fldt (%rdi,%r8)
faddp %st, %st(1)
fstpt (%rdi,%r8)
addq $0x20, %r8
jmp 0x3311c3
fstp %st(0)
movq 0x8(%r12), %rdx
movslq %eax, %rsi
movq %r14, 0x68(%rsp)
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x32ef38
movslq 0x28(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x30(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x32ef6c
movslq 0x28(%rsp), %rcx
movl %eax, 0x2c(%rsp)
leaq 0x12fe08(%rip), %rdx # 0x461045
movq %r12, %rdi
movq %r13, %r14
movq %r13, %rsi
imulq $0xc, %rcx, %r8
addq 0x70(%r12), %r8
leaq 0x28(%rsp), %rcx
callq 0xb91c2
pushq $0x14
popq %r15
xorl %r13d, %r13d
movslq 0x30(%rsp), %rax
cmpq %rax, %r13
jge 0x331294
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0x14(%rax,%r15), %r8
leaq -0x4(%rax,%r15), %rcx
leaq (%rax,%r15), %r9
callq 0x32efea
incq %r13
addq $0x20, %r15
jmp 0x331260
movslq 0x28(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x12fdb7(%rip), %rdx # 0x46105c
leaq 0x2c(%rsp), %r8
movq %r12, %rdi
movq %r14, %r13
movq %r14, %rsi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
callq 0xb91c2
movq 0x40(%rsp), %rdx
movl 0x28(%rsp), %ecx
movl 0x2c(%rsp), %r8d
movl 0x30(%rsp), %r9d
fldt 0xa0(%rsp)
fldt 0x90(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq 0x48(%rsp), %r15
movq %r15, %rsi
callq 0x32f01b
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x33113a
andb $0x1, %al
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x126eb2(%rip), %rdi # 0x4581de
leaq 0x129147(%rip), %rsi # 0x45a47a
leaq 0x13235e(%rip), %rdx # 0x463698
leaq 0x132406(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, 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 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 $0xb8, %rsp
movq %rcx, 0x58(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x12ad2d(%rip), %rdx # 0x45c33f
fldt 0x120(%rsp)
fstpt 0x74(%rsp)
fldt 0x110(%rsp)
fldt 0x100(%rsp)
fldt 0xf0(%rsp)
fstpt 0xa0(%rsp)
fstpt 0x90(%rsp)
fstpt 0x80(%rsp)
pushq $0x19
popq %rsi
leaq 0xa0(%rsp), %rcx
leaq 0x90(%rsp), %r8
leaq 0x80(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
movq %rax, 0x50(%rsp)
xorl %eax, %eax
pushq $0x16
popq %r13
leaq 0x1320bd(%rip), %rbp # 0x46373b
pushq $0xb
popq %rbx
movq %r15, 0x48(%rsp)
cmpq 0x58(%rsp), %r14
je 0x33185d
movl (%r14), %edx
movl %edx, 0x28(%rsp)
cmpl 0x88(%r12), %edx
jge 0x331871
movq 0x50(%rsp), %rsi
leaq 0x38(%rsp), %rdi
movq %rax, 0x60(%rsp)
callq 0x3de66
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
fldt 0x80(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x32edda
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x32ee00
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rdx
movl %eax, %esi
shlq $0x5, %rsi
xorl %r8d, %r8d
movq 0x68(%r12), %rdi
movq 0x80(%r12), %rcx
fldt 0x74(%rsp)
cmpq %r8, %rsi
je 0x33173c
movslq 0x14(%rdi,%r8), %r9
movq 0x8(%rcx), %r10
movslq 0x4(%rdx,%r9,8), %r9
shlq $0x4, %r9
fldt (%r10,%r9)
fmul %st(1), %st
fldt (%rdi,%r8)
faddp %st, %st(1)
fstpt (%rdi,%r8)
addq $0x20, %r8
jmp 0x33170f
fstp %st(0)
movq 0x8(%r12), %rdx
movslq %eax, %rsi
movq %r14, 0x68(%rsp)
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x32ef38
movslq 0x28(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x30(%rsp), %rsi
movq %r12, %rdi
imulq $0xc, %rax, %rax
movl (%rcx,%rax), %edx
movl 0x4(%rcx,%rax), %ecx
callq 0x32ef6c
movslq 0x28(%rsp), %rcx
movl %eax, 0x2c(%rsp)
leaq 0x12f8bc(%rip), %rdx # 0x461045
movq %r12, %rdi
movq %r13, %r14
movq %r13, %rsi
imulq $0xc, %rcx, %r8
addq 0x70(%r12), %r8
leaq 0x28(%rsp), %rcx
callq 0xb91c2
pushq $0x14
popq %r15
xorl %r13d, %r13d
movslq 0x30(%rsp), %rax
cmpq %rax, %r13
jge 0x3317e0
movq 0x68(%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq -0x14(%rax,%r15), %r8
leaq -0x4(%rax,%r15), %rcx
leaq (%rax,%r15), %r9
callq 0x32efea
incq %r13
addq $0x20, %r15
jmp 0x3317ac
movslq 0x28(%rsp), %rax
movq 0x70(%r12), %rcx
leaq 0x12f86b(%rip), %rdx # 0x46105c
leaq 0x2c(%rsp), %r8
movq %r12, %rdi
movq %r14, %r13
movq %r14, %rsi
imulq $0xc, %rax, %rax
leaq 0x4(%rcx,%rax), %rcx
callq 0xb91c2
movq 0x40(%rsp), %rdx
movl 0x28(%rsp), %ecx
movl 0x2c(%rsp), %r8d
movl 0x30(%rsp), %r9d
fldt 0xa0(%rsp)
fldt 0x90(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq 0x48(%rsp), %r15
movq %r15, %rsi
callq 0x32f01b
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x331686
andb $0x1, %al
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x126966(%rip), %rdi # 0x4581de
leaq 0x128bfb(%rip), %rsi # 0x45a47a
leaq 0x131e12(%rip), %rdx # 0x463698
leaq 0x131eba(%rip), %rcx # 0x463747
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, 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 $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 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 0x333462
movq 0x10(%r14), %rdi
leaq 0xb8(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x8d304
fstpt 0x9c(%rsp)
jmp 0x33347b
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 0x32d902
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, 0x1e0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x33355d
cmpl $0x1, %eax
je 0x333537
cmpl $0x2, %eax
jne 0x33356e
movq 0x18(%r14), %rdx
leaq 0x1e0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
jmp 0x333548
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
vmovsd 0x120ae8(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x8b497
jmp 0x33356e
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 0x3335a7
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x48(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x3335a3
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x333580
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 0x126f98(%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 0x118(%rsp), %rdi
leaq 0x150(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x32dbc6
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 0x333750
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 0x32dc08
movq 0x1a0(%rsp), %rdx
movq 0x1c8(%rsp), %rcx
movl %eax, %ebx
leaq 0x1e0(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x95692
testl %ebx, %ebx
je 0x333804
cmpl %ebp, %ebx
jge 0x3336c8
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x3342be
movl %ebx, %ebp
cmpq 0x90(%rsp), %r15
jle 0x333719
movl %ebx, 0xb0(%rsp)
fildl 0xb0(%rsp)
movl 0x1d8(%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 0x33371d
fldt 0x48(%rsp)
fldt 0xe4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x333750
fstp %st(0)
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x3342f6
fldt 0x48(%rsp)
fldt 0x54(%rsp)
testb %al, %al
jne 0x333750
incq %r15
jmp 0x333641
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 0x33377e
movq 0x60(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x3337af
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 0x1e0(%rsp), %rdi
callq 0x435d0
leaq 0x118(%rsp), %rdi
callq 0x393ac
leaq 0x150(%rsp), %rdi
callq 0x32e0dc
leaq 0xc0(%rsp), %rdi
callq 0x8affa
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 0x8b74a
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x334274
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 0x333767
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 0x32de38
testl %eax, %eax
jne 0x3338da
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 0x334274
movq %r14, %rdi
callq 0x3342f6
fldt 0x54(%rsp)
fldt 0x48(%rsp)
testb %al, %al
jne 0x333767
movl %ebx, 0x90(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x333a23
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 0x32dc08
testl %eax, %eax
je 0x3339d3
vcvtsi2sd %r13d, %xmm1, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x3339a1
movl %eax, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x1d8(%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 0x3339a5
fldt 0x48(%rsp)
fldt 0xe4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x333a13
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x3342f6
testb %al, %al
jne 0x333a1b
fldt 0x54(%rsp)
fldt 0x48(%rsp)
incl %ebx
jmp 0x3338fe
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 0x334274
fldt 0x54(%rsp)
fldt 0x48(%rsp)
jmp 0x333a23
fldt 0x54(%rsp)
fxch %st(1)
jmp 0x333a23
fldt 0x54(%rsp)
fldt 0x48(%rsp)
movl 0x90(%rsp), %ebx
decl 0x6c(%rsp)
incl %ebx
jmp 0x33384f
jmp 0x333a70
jmp 0x333a49
fstp %st(1)
fstp %st(0)
jmp 0x333a70
movq %rax, %rbx
jmp 0x333a80
movq %rax, %rbx
jmp 0x333a8d
movq %rax, %rbx
jmp 0x333a9a
movq %rax, %rbx
jmp 0x333aa7
movq %rax, %rbx
jmp 0x333ab1
jmp 0x333a70
jmp 0x333a70
jmp 0x333a70
leaq 0x1e8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x333a80
leaq 0x1e0(%rsp), %rdi
movq %rax, %rbx
callq 0x435d0
leaq 0x118(%rsp), %rdi
callq 0x393ac
leaq 0x150(%rsp), %rdi
callq 0x32e0dc
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_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, 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 0x3341da
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x334254
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<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, 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 0x3342bc
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x334336
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<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, 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 0x33439e
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x334418
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::optimize_functor<baryonyx::itm::solver_inequalities_101coeff<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>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<long double>, long double, baryonyx::itm::maximize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double) | void operator()(const std::atomic_bool& stop_task,
best_solution_recorder<Cost, Float, Mode>& best_recorder,
const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
bit_array x(variables);
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_local_ctx.rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const auto w_limit = static_cast<long int>(p.w);
Solver slv(m_local_ctx.rng,
length(constraints),
variables,
norm_costs,
constraints);
compute_order compute(p.order, variables);
bool is_a_solution = false;
while (!stop_task.load()) {
++m_call_number;
const auto kappa_start = static_cast<Float>(best_recorder.reinit(
m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x));
auto kappa = kappa_start;
compute.init(slv, x);
auto best_remaining = INT_MAX;
is_a_solution = false;
for (long int i = 0; !stop_task.load() && i != p.limit; ++i) {
auto remaining =
compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
i);
best_remaining = 0;
is_a_solution = true;
break;
} else {
best_remaining = std::min(remaining, best_remaining);
}
if (i > w_limit)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
if (best_remaining > 0) {
best_recorder.try_advance(
m_local_ctx, x, best_remaining, p.limit);
continue;
}
for (int push = 0; !stop_task.load() && push < p.pushes_limit;
++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_local_ctx.rng,
pushing_k_factor,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
is_a_solution = true;
}
kappa = kappa_start;
for (int iter = 0;
!stop_task.load() && iter < p.pushing_iteration_limit;
++iter) {
remaining = compute.run(
slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
is_a_solution = true;
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
}
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $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 0xc0(%rsp), %rdi
movq %r13, %rsi
movq %r12, 0x88(%rsp)
movq %r12, %rdx
movq %rbp, %rcx
movl %ebx, %r8d
callq 0x8d226
fldl 0x20(%r13)
fstpt 0xe8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r13)
fstpt 0xf4(%rsp)
fldl 0x30(%r13)
fstpt 0xdc(%rsp)
fldl 0x8(%r13)
vmovsd 0x10(%r13), %xmm0
fld %st(0)
fstpt 0x4c(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x334919
movq 0xb8(%rsp), %rax
movq (%rax), %rdi
leaq 0xc0(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x8d304
fstpt 0x9c(%rsp)
jmp 0x334932
fstp %st(0)
vmovsd %xmm0, 0x110(%rsp)
fldl 0x110(%rsp)
fstpt 0x9c(%rsp)
fldl 0x38(%r13)
fstpt 0x124(%rsp)
fldl 0x40(%r13)
fstpt 0x118(%rsp)
vcvttsd2si 0xa0(%r13), %rax
movq %rax, 0x100(%rsp)
movq 0x8(%r14), %rax
subq (%r14), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x168(%rsp), %rdi
leaq 0xc0(%rsp), %r8
movq %rbp, %rsi
movl %eax, %edx
movl %ebx, %ecx
movq %r14, %r9
callq 0x334dfe
movl 0xcc(%r13), %esi
leaq 0x130(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq $0x0, 0x58(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x334d66
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 0x8d5a0
vmovsd %xmm0, 0x108(%rsp)
fldl 0x108(%rsp)
fstpt 0xd0(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x168(%rsp), %rsi
movq %rbx, %rdx
callq 0x335094
fldt 0xd0(%rsp)
fldt 0x4c(%rsp)
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movb (%r15), %al
testb $0x1, %al
jne 0x334afb
cmpq 0xb0(%r13), %r14
je 0x334afb
fstpt 0x20(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x168(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %rbp, %rcx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x7c(%rsp)
fstpt (%rsp)
callq 0x3350d6
testl %eax, %eax
je 0x334b15
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0x100(%rsp), %r14
jle 0x334ada
movl %eax, 0xb0(%rsp)
fildl 0xb0(%rsp)
movl 0x1f0(%rsp), %eax
movl %eax, 0xb4(%rsp)
fidivl 0xb4(%rsp)
fldt 0xdc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xe8(%rsp)
fmulp %st, %st(1)
fldt 0x7c(%rsp)
faddp %st, %st(1)
fldt 0x4c(%rsp)
jmp 0x334ae4
fldt 0x4c(%rsp)
fldt 0x7c(%rsp)
fxch %st(1)
fldt 0xf4(%rsp)
fxch %st(2)
fucomi %st(2), %st
fstp %st(2)
ja 0x334afb
incq %r14
jmp 0x334a2b
fstp %st(1)
testl %ebx, %ebx
jg 0x334d44
movq $0x0, 0x58(%rsp)
leaq 0x60(%rsp), %rbx
jmp 0x334b51
vmovsd 0x90(%rsp), %xmm0
movq 0x88(%rsp), %rdi
leaq 0x60(%rsp), %rbx
movq %rbx, %rsi
callq 0x8b74a
movq 0x70(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x8d912
movb $0x1, %al
movq %rax, 0x58(%rsp)
fldt 0x4c(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x78(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x334d3d
cmpl 0xbc(%r13), %r14d
jge 0x334d3d
fldt 0x118(%rsp)
fstpt 0x30(%rsp)
fstpt 0x20(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x168(%rsp), %rsi
movq %rbx, %rdx
movq %rbp, %rcx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fldt 0x124(%rsp)
fstpt (%rsp)
callq 0x335306
testl %eax, %eax
jne 0x334bf7
vmovsd 0x90(%rsp), %xmm0
movq 0x88(%rsp), %rdi
movq %rbx, %rsi
callq 0x8b74a
movl 0xc0(%r13), %eax
movq 0x70(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
imull %r14d, %eax
notl %eax
movslq %eax, %rcx
callq 0x8d912
movb $0x1, %al
movq %rax, 0x58(%rsp)
pushq $0x1
popq %rax
fldt 0xd0(%rsp)
fldt 0x4c(%rsp)
movl %eax, %ebx
movb (%r15), %al
testb $0x1, %al
jne 0x334cdb
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0x334cdb
fstpt 0x20(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x168(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %rbp, %rcx
fldt 0x9c(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x7c(%rsp)
fstpt (%rsp)
callq 0x3350d6
testl %eax, %eax
je 0x334ce4
vcvtsi2sd %r12d, %xmm2, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0x334cbb
movl %eax, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x1f0(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xdc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xe8(%rsp)
fmulp %st, %st(1)
fldt 0x7c(%rsp)
faddp %st, %st(1)
fldt 0x4c(%rsp)
jmp 0x334cc5
fldt 0x4c(%rsp)
fldt 0x7c(%rsp)
fxch %st(1)
fldt 0xf4(%rsp)
fxch %st(2)
fucomi %st(2), %st
fstp %st(2)
ja 0x334cdb
incl %ebx
jmp 0x334c07
fstp %st(1)
leaq 0x60(%rsp), %rbx
jmp 0x334d31
vmovsd 0x90(%rsp), %xmm0
movq 0x88(%rsp), %rdi
leaq 0x60(%rsp), %r12
movq %r12, %rsi
callq 0x8b74a
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 0x8d912
movb $0x1, %al
movq %rax, 0x58(%rsp)
fldt 0x4c(%rsp)
decl 0x78(%rsp)
incl %r14d
jmp 0x334b5c
fstp %st(0)
jmp 0x3349a6
fstp %st(0)
movq 0xb0(%r13), %r8
movq 0x70(%rsp), %rdi
leaq 0x60(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0x8d99a
jmp 0x33499d
leaq 0x130(%rsp), %rdi
callq 0x393ac
leaq 0x168(%rsp), %rdi
callq 0x3355aa
leaq 0xc8(%rsp), %rdi
callq 0x8affa
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 0x334db0
movq %rax, %rbx
jmp 0x334dd2
movq %rax, %rbx
jmp 0x334ddf
movq %rax, %rbx
jmp 0x334dec
jmp 0x334dc2
jmp 0x334dc2
jmp 0x334dc2
jmp 0x334dc2
leaq 0x130(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0x168(%rsp), %rdi
callq 0x3355aa
leaq 0xc8(%rsp), %rdi
callq 0x8affa
leaq 0x68(%rsp), %rdi
callq 0x357fe
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false> const&, baryonyx::bit_array const&) | void init(const Solver& s, const Xtype& x)
{
switch (order) {
case solver_parameters::constraint_order::infeasibility_decr:
case solver_parameters::constraint_order::infeasibility_incr:
infeasibility_local_compute_violated_constraints(s, x);
break;
case solver_parameters::constraint_order::pi_sign_change:
std::iota(R.begin(), R.end(), 0);
break;
case solver_parameters::constraint_order::none:
case solver_parameters::constraint_order::reversing:
case solver_parameters::constraint_order::random_sorting:
case solver_parameters::constraint_order::lagrangian_decr:
case solver_parameters::constraint_order::lagrangian_incr:
default:
compute_violated_constraints(s, x, R);
break;
}
} | movl 0x30(%rdi), %ecx
movq %rdi, %rax
leal -0x3(%rcx), %edi
cmpl $0x2, %edi
jae 0x3350aa
movq %rax, %rdi
jmp 0x3356b6
cmpl $0x7, %ecx
jne 0x3350c7
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0x3350d5
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0x3350b8
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0x3357d1
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array, long double>(baryonyx::itm::solver_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>&, 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 0x335351
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 0x335468
leaq 0x12e171(%rip), %rdx # 0x4634d4
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 0x337e3a
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3357d1
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 0x338d96
jmp 0x3354f5
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x3384c0
jmp 0x33541c
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x33892b
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 0x338184
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x335c20
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fxch %st(3)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
jmp 0x335518
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 0x337fe6
jmp 0x335526
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %r15, %rdx
fstpt 0x40(%rsp)
callq 0x3392ea
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 0x338322
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x3357d1
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 0x337fe6
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x335e50
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false> const&, baryonyx::bit_array const&, std::vector<int, std::allocator<int>>&) | int
compute_violated_constraints(const Solver& slv,
const Xtype& x,
std::vector<int>& out)
{
out.clear();
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
out.emplace_back(k);
return length(out);
} | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdx), %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rax, 0x8(%rdx)
je 0x3357ef
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x88(%r15), %esi
je 0x335825
movq %r15, %rdi
movq %r14, %rdx
callq 0x33583c
testb %al, %al
jne 0x33581d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0x3357f6
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto 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 $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x10(%rdi), %r13
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
fldt 0xc0(%rsp)
fstpt 0x5c(%rsp)
fldt 0xb0(%rsp)
fstpt 0x50(%rsp)
fldt 0xa0(%rsp)
fstpt 0x44(%rsp)
movq (%rdx), %rax
movq 0x38(%rsp), %rcx
cmpq (%rcx), %rax
je 0x3359e3
movslq -0x4(%rax), %rbx
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x5c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x335e92
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x335eb8
movq %rax, 0x20(%rsp)
movslq %eax, %rsi
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x335ff0
movq 0x70(%r12), %rax
imulq $0xc, %rbx, %rcx
leaq 0x20(%rsp), %rsi
movq %r12, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x336024
movl 0x20(%rsp), %r9d
movq 0x30(%rsp), %rdx
fldt 0x50(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
fldt 0x44(%rsp)
fstpt (%rsp)
callq 0x3360a1
orb %al, %bpl
movq (%r14), %rax
addq $-0x4, %rax
movq %rax, (%r14)
jmp 0x33591e
andb $0x1, %bpl
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto 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 $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x10(%rdi), %r13
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
fldt 0xc0(%rsp)
fstpt 0x5c(%rsp)
fldt 0xb0(%rsp)
fstpt 0x50(%rsp)
fldt 0xa0(%rsp)
fstpt 0x44(%rsp)
cmpq 0x38(%rsp), %r14
je 0x335c0a
movslq (%r14), %rbx
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x5c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x335e92
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x335eb8
movq %rax, 0x20(%rsp)
movslq %eax, %rsi
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x335ff0
movq 0x70(%r12), %rax
imulq $0xc, %rbx, %rcx
leaq 0x20(%rsp), %rsi
movq %r12, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x336024
movl 0x20(%rsp), %r9d
movq 0x30(%rsp), %rdx
fldt 0x50(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
fldt 0x44(%rsp)
fstpt (%rsp)
callq 0x3360a1
orb %al, %bpl
addq $0x8, %r14
jmp 0x335b4f
andb $0x1, %bpl
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
bool baryonyx::itm::solver_inequalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, 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 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 $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x10(%rdi), %r13
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
fldt 0xc0(%rsp)
fstpt 0x5c(%rsp)
fldt 0xb0(%rsp)
fstpt 0x50(%rsp)
fldt 0xa0(%rsp)
fstpt 0x44(%rsp)
cmpq 0x38(%rsp), %r14
je 0x335e3a
movslq (%r14), %rbx
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x5c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x335e92
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x335eb8
movq %rax, 0x20(%rsp)
movslq %eax, %rsi
movq 0x68(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x335ff0
movq 0x70(%r12), %rax
imulq $0xc, %rbx, %rcx
leaq 0x20(%rsp), %rsi
movq %r12, %rdi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x336024
movl 0x20(%rsp), %r9d
movq 0x30(%rsp), %rdx
fldt 0x50(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
fldt 0x44(%rsp)
fstpt (%rsp)
callq 0x3360a1
orb %al, %bpl
addq $0x4, %r14
jmp 0x335d7f
andb $0x1, %bpl
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-101.cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.