name
stringlengths 1
473k
| code
stringlengths 7
647k
| asm
stringlengths 4
3.39M
| file
stringlengths 8
196
|
---|---|---|---|
bool baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto sizes =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng);
int selected = select_variables(sizes, b[k].value);
logger::log("constraints {}: {} = ", k, b[k].value);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(*this,
x,
std::get<0>(it),
k,
selected,
sizes.r_size,
kappa,
delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x48(%rsp)
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
leaq 0x2ed3ac(%rip), %rdx # 0x45c344
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
movq %rbx, 0x40(%rsp)
xorl %esi, %esi
movq %rax, 0x30(%rsp)
movq (%rbx), %rax
leaq 0x2ed34a(%rip), %rbx # 0x45c313
pushq $0x8
popq %rbp
movq %r14, 0x38(%rsp)
movq 0x48(%rsp), %rcx
cmpq (%rcx), %rax
je 0x16f127
movl -0x4(%rax), %edx
movl %edx, 0xc(%rsp)
cmpl 0x80(%r12), %edx
jge 0x16f13c
movq %rsi, 0x50(%rsp)
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x16f85e
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x16f87c
movq 0x60(%r12), %rdi
movq %rax, %r15
movslq %r15d, %r14
movq 0x8(%r12), %rdx
movq %rax, %r13
shrq $0x20, %r13
imulq $0xc, %r14, %rsi
addq %rdi, %rsi
callq 0x16f9a2
movslq 0xc(%rsp), %rax
movq 0x68(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,8), %r8
addl (%r8), %r13d
cmpl %r13d, %r14d
cmovll %r15d, %r13d
decl %r13d
movl %r13d, 0x10(%rsp)
pushq $0x15
popq %rsi
leaq 0x2ed278(%rip), %rdx # 0x45c2fd
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
xorl %r13d, %r13d
andnl %r14d, %eax, %eax
imulq $0xc, %rax, %r14
cmpq %r13, %r14
je 0x16f0c7
movq 0x60(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x8(%rcx,%r13), %r8
addq %r13, %rcx
callq 0xb91f0
addq $0xc, %r13
jmp 0x16f0a1
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x2f1f8d(%rip), %rdx # 0x461061
leaq 0x10(%rsp), %rcx
callq 0xb921e
vmovss 0x1c(%rsp), %xmm0
vmovss 0x18(%rsp), %xmm1
movq 0x38(%rsp), %r14
movq 0x28(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
movq %r12, %rdi
movl %r15d, %r9d
movq %r14, %rsi
callq 0x16f9d5
movq 0x50(%rsp), %rsi
movq 0x40(%rsp), %rcx
orb %al, %sil
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x16efd1
andb $0x1, %sil
movl %esi, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2e909b(%rip), %rdi # 0x4581de
leaq 0x2eb330(%rip), %rsi # 0x45a47a
leaq 0x2ef824(%rip), %rdx # 0x45e975
leaq 0x2ef890(%rip), %rcx # 0x45e9e8
callq 0x2813f
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
bool baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto sizes =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng);
int selected = select_variables(sizes, b[k].value);
logger::log("constraints {}: {} = ", k, b[k].value);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(*this,
x,
std::get<0>(it),
k,
selected,
sizes.r_size,
kappa,
delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x40(%rsp)
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x2ed1b4(%rip), %rdx # 0x45c344
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
leaq 0x2ed161(%rip), %rbx # 0x45c313
movq %rax, 0x30(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbp
movq %r13, 0x38(%rsp)
cmpq 0x40(%rsp), %r14
je 0x16f315
movl (%r14), %edx
movl %edx, 0xc(%rsp)
cmpl 0x80(%r12), %edx
jge 0x16f326
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movq %rax, 0x48(%rsp)
movq %r14, 0x50(%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x16f85e
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x16f87c
movq 0x60(%r12), %rdi
movq %rax, %r15
movslq %r15d, %r13
movq 0x8(%r12), %rdx
movq %rax, %r14
shrq $0x20, %r14
imulq $0xc, %r13, %rsi
addq %rdi, %rsi
callq 0x16f9a2
movslq 0xc(%rsp), %rax
movq 0x68(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,8), %r8
addl (%r8), %r14d
cmpl %r14d, %r13d
cmovll %r15d, %r14d
decl %r14d
movl %r14d, 0x10(%rsp)
pushq $0x15
popq %rsi
leaq 0x2ed086(%rip), %rdx # 0x45c2fd
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %eax
imulq $0xc, %rax, %r13
cmpq %r14, %r13
je 0x16f2b9
movq 0x60(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x8(%rcx,%r14), %r8
addq %r14, %rcx
callq 0xb91f0
addq $0xc, %r14
jmp 0x16f293
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x2f1d9b(%rip), %rdx # 0x461061
leaq 0x10(%rsp), %rcx
callq 0xb921e
vmovss 0x1c(%rsp), %xmm0
vmovss 0x18(%rsp), %xmm1
movq 0x38(%rsp), %r13
movq 0x28(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
movq %r12, %rdi
movl %r15d, %r9d
movq %r13, %rsi
callq 0x16f9d5
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x16f1c1
andb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2e8eb1(%rip), %rdi # 0x4581de
leaq 0x2eb146(%rip), %rsi # 0x45a47a
leaq 0x2ef63a(%rip), %rdx # 0x45e975
leaq 0x2ef6a6(%rip), %rcx # 0x45e9e8
callq 0x2813f
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
bool baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::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);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto sizes =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng);
int selected = select_variables(sizes, b[k].value);
logger::log("constraints {}: {} = ", k, b[k].value);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(*this,
x,
std::get<0>(it),
k,
selected,
sizes.r_size,
kappa,
delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, 0x38(%rsp)
leaq 0x10(%rdi), %rax
vmovss %xmm2, 0x14(%rsp)
vmovss %xmm1, 0x10(%rsp)
vmovss %xmm0, 0xc(%rsp)
movq %rcx, 0x40(%rsp)
movq %rdi, %r12
movq %rdx, 0x30(%rsp)
xorl %ebp, %ebp
movq %rax, 0x28(%rsp)
movq (%rdx), %rax
movq 0x38(%rsp), %r14
movq 0x40(%rsp), %rcx
cmpq (%rcx), %rax
je 0x175cc7
movslq -0x4(%rax), %rbx
cmpl 0x80(%r12), %ebx
jge 0x175cdc
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x1761f4
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x176212
movq 0x60(%r12), %rdi
movq %rax, %r15
movslq %r15d, %r13
movq 0x8(%r12), %rdx
shrq $0x20, %r15
imulq $0xc, %r13, %rsi
addq %rdi, %rsi
callq 0x176338
movq 0x68(%r12), %rax
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r14, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
addl (%rax,%rbx,8), %r15d
cmpl %r15d, %r13d
cmovll %r13d, %r15d
decl %r15d
movl %r15d, %r8d
callq 0x17636b
movq 0x30(%rsp), %rcx
orb %al, %bpl
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x175bfb
andb $0x1, %bpl
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2e24fb(%rip), %rdi # 0x4581de
leaq 0x2e4790(%rip), %rsi # 0x45a47a
leaq 0x2e8c84(%rip), %rdx # 0x45e975
leaq 0x2e8cf0(%rip), %rcx # 0x45e9e8
callq 0x2813f
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>&, baryonyx::bit_array const&)
|
int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
cmpq %rax, 0x20(%rdi)
je 0x175f98
movq %rax, 0x20(%rdi)
leaq 0x18(%rdi), %rax
leaq 0x10(%r15), %rcx
xorl %r12d, %r12d
movq %rdi, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movl 0x80(%r15), %eax
movq %rcx, 0x18(%rsp)
movq %rax, 0x28(%rsp)
cmpq 0x28(%rsp), %r12
je 0x17605a
movq 0x18(%rsp), %rsi
movq %rsp, %rdi
movl %r12d, %edx
movq %r12, 0x30(%rsp)
callq 0x3de66
movq (%rsp), %r13
movq 0x8(%rsp), %r12
xorl %ebx, %ebx
cmpq %r13, %r12
je 0x176011
movslq (%r12), %rax
movq 0x58(%r15), %rcx
movl 0x4(%r12), %esi
movq %r14, %rdi
movl (%rcx,%rax,4), %ebp
callq 0x3664a
imull %ebp, %eax
addq $0x8, %r12
addl %eax, %ebx
jmp 0x175fe9
movq 0x68(%r15), %rax
movq 0x30(%rsp), %r12
movl (%rax,%r12,8), %eax
movl %eax, %ecx
subl %ebx, %ecx
jle 0x176031
shlq $0x20, %rcx
orq %r12, %rcx
movq %rcx, (%rsp)
jmp 0x176040
jge 0x17604d
subl %eax, %ebx
shlq $0x20, %rbx
orq %r12, %rbx
movq %rbx, (%rsp)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x3c8c2
movq 0x20(%rsp), %rdi
incq %r12
jmp 0x175fbe
movq 0x20(%rdi), %rax
subq 0x18(%rdi), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_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);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto sizes =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng);
int selected = select_variables(sizes, b[k].value);
logger::log("constraints {}: {} = ", k, b[k].value);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(*this,
x,
std::get<0>(it),
k,
selected,
sizes.r_size,
kappa,
delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, 0x30(%rsp)
leaq 0x10(%rdi), %rax
vmovss %xmm2, 0x14(%rsp)
vmovss %xmm1, 0x10(%rsp)
vmovss %xmm0, 0xc(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdi, %r12
xorl %r14d, %r14d
movq 0x30(%rsp), %rbp
movq %rax, 0x28(%rsp)
cmpq 0x38(%rsp), %rdx
je 0x17617b
movslq (%rdx), %rbx
cmpl 0x80(%r12), %ebx
jge 0x176191
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movq %rdx, 0x40(%rsp)
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x1761f4
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %rbp, %rcx
callq 0x176212
movq 0x60(%r12), %rdi
movq %rax, %r15
movslq %r15d, %r13
movq 0x8(%r12), %rdx
shrq $0x20, %r15
imulq $0xc, %r13, %rsi
addq %rdi, %rsi
callq 0x176338
movq 0x68(%r12), %rax
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %rbp, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
addl (%rax,%rbx,8), %r15d
cmpl %r15d, %r13d
cmovll %r13d, %r15d
decl %r15d
movl %r15d, %r8d
callq 0x17636b
movq 0x40(%rsp), %rdx
orb %al, %r14b
addq $0x4, %rdx
jmp 0x1760b4
andb $0x1, %r14b
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2e2046(%rip), %rdi # 0x4581de
leaq 0x2e42db(%rip), %rsi # 0x45a47a
leaq 0x2e87cf(%rip), %rdx # 0x45e975
leaq 0x2e883b(%rip), %rcx # 0x45e9e8
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
bool baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, float, float, float, float)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float obj_amp)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto sizes =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != sizes.r_size; ++i)
R[i].value +=
obj_amp * c((std::get<0>(it) + R[i].id)->column, x);
calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng);
int selected = select_variables(sizes, b[k].value);
logger::log("constraints {}: {} = ", k, b[k].value);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(*this,
x,
std::get<0>(it),
k,
selected,
sizes.r_size,
kappa,
delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
movq %rcx, 0x28(%rsp)
movq %rsi, %r12
movq %rdi, %r13
movq %rax, 0x20(%rsp)
xorl %eax, %eax
cmpq 0x28(%rsp), %rdx
je 0x178644
movl (%rdx), %ecx
movq 0x20(%rsp), %rsi
movq %rdx, 0x40(%rsp)
leaq 0x10(%rsp), %rdi
movq %rax, 0x38(%rsp)
movslq %ecx, %rdx
movq %rdx, 0x30(%rsp)
callq 0x3de66
vmovss 0x8(%rsp), %xmm0
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0x1761f4
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0x176212
movq %rax, %rbx
movq %rax, %r15
movl %r15d, %eax
imulq $0xc, %rax, %r14
shrq $0x20, %rbx
xorl %ebp, %ebp
cmpq %rbp, %r14
je 0x1785df
movq 0x60(%r13), %rax
movq 0x18(%rsp), %rcx
movq 0x78(%r13), %rdi
movq %r12, %rdx
movslq 0x8(%rax,%rbp), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x49ffa
movq 0x60(%r13), %rax
vmovss 0xc(%rsp), %xmm1
vfmadd213ss (%rax,%rbp), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rax,%rbp)
addq $0xc, %rbp
jmp 0x1785a1
movq 0x60(%r13), %rdi
movslq %r15d, %rax
movq 0x8(%r13), %rdx
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x176338
movq 0x68(%r13), %rax
movq 0x30(%rsp), %rcx
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
movq 0x18(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %r15d, %r9d
addl (%rax,%rcx,8), %ebx
cmpl %ebx, %r15d
cmovll %r15d, %ebx
decl %ebx
movl %ebx, %r8d
callq 0x17636b
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rdx
orb %al, %cl
addq $0x4, %rdx
movq %rcx, %rax
jmp 0x178533
andb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::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 $0x3b8, %rsp # imm = 0x3B8
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 0x80(%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 0x17a0fe
movq 0x10(%r14), %rdi
leaq 0x80(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x14(%rsp)
jmp 0x17a108
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x14(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x70(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x68(%rsp)
vmovsd %xmm1, 0x60(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd8(%rsp), %rdi
leaq 0x80(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x175258
movl 0xcc(%r12), %esi
leaq 0xa0(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x7c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x160(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x17a1e6
cmpl $0x1, %eax
je 0x17a1c0
cmpl $0x2, %eax
jne 0x17a1f7
movq 0x18(%r14), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x28(%rsp), %rsi
jmp 0x17a1d1
movq 0x18(%r14), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x160(%rsp), %rsi
vmovsd 0x2d9e5f(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x44e5a
jmp 0x17a1f7
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x44de5
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 0x17a269
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x17a265
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x17a242
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 0x2e02d6(%rip), %rdx # 0x45a577
leaq 0x160(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x175422
vcvtsd2ss 0x8(%rsp), %xmm3, %xmm0
vmovss 0x4(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x28(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x17a3da
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0x175464
movq 0x128(%rsp), %rdx
movq 0x148(%rsp), %rcx
movl %eax, %ebx
leaq 0x160(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x434d2
testl %ebx, %ebx
je 0x17a47f
cmpl %ebp, %ebx
jge 0x17a370
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x17ae94
movl %ebx, %ebp
cmpq 0x70(%rsp), %r15
jle 0x17a3a6
vcvtsi2ss %ebx, %xmm3, %xmm0
vcvtsi2ssl 0x158(%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 0x17a3ac
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x17a3da
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0x17aecc
vmovss 0x8(%rsp), %xmm0
vmovss 0x4(%rsp), %xmm2
testb %al, %al
jne 0x17a3da
incq %r15
jmp 0x17a2f5
movq 0x18(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x17a3fc
movq 0x18(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x17a42a
movq 0x18(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x7c(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x160(%rsp), %rdi
callq 0x435d0
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x1758c4
leaq 0x80(%rsp), %rdi
callq 0x4495c
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%rsp), %rax
addq $0x3b8, %rsp # imm = 0x3B8
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 0x17ae4a
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
leaq 0xd8(%rsp), %r15
leaq 0x28(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x38(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x17a3e9
vmovss %xmm0, 0x8(%rsp)
vmulss 0x68(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
vmovss 0x60(%rsp), %xmm3
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x175670
testl %eax, %eax
jne 0x17a537
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 0x17ae4a
movq %r14, %rdi
callq 0x17aecc
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
testb %al, %al
jne 0x17a3e9
movl %ebx, 0x70(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x17a65e
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0x175464
testl %eax, %eax
je 0x17a614
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x17a5db
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x158(%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 0x17a5e7
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x17a65e
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0x17aecc
testb %al, %al
jne 0x17a652
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
incl %ebx
jmp 0x17a55c
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 0x17ae4a
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
jmp 0x17a65e
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
movl 0x70(%rsp), %ebx
decl 0x38(%rsp)
incl %ebx
jmp 0x17a4c8
jmp 0x17a6a4
jmp 0x17a67d
jmp 0x17a6a4
movq %rax, %r14
jmp 0x17a6b4
movq %rax, %r14
jmp 0x17a6c1
movq %rax, %r14
jmp 0x17a6ce
movq %rax, %r14
jmp 0x17a6db
movq %rax, %r14
jmp 0x17a6e5
jmp 0x17a6a4
jmp 0x17a6a4
jmp 0x17a6a4
leaq 0x168(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x17a6b4
leaq 0x160(%rsp), %rdi
movq %rax, %r14
callq 0x435d0
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x1758c4
leaq 0x80(%rsp), %rdi
callq 0x4495c
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%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_equalities_101coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::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 0x17adb0
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x17ae2a
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::result baryonyx::itm::solve_problem<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>>(baryonyx::context const&, baryonyx::problem const&)
|
inline result
solve_problem(const context& ctx, const problem& pb)
{
if (ctx.start)
ctx.start(ctx.parameters);
result ret;
auto variables = length(pb.vars.values);
auto constraints{ make_merged_constraints(ctx, pb) };
if (!constraints.empty() && !pb.vars.values.empty()) {
random_engine rng(init_random_generator_seed(ctx));
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
switch (ctx.parameters.observer) {
case solver_parameters::observer_type::pnm: {
using obs = pnm_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
case solver_parameters::observer_type::file: {
using obs = file_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
default: {
using obs = none_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
break;
}
}
} else {
ret.status = result_status::success;
ret.solutions.resize(1);
ret.solutions.back().value = pb.objective.value;
}
ret.strings = pb.strings;
ret.variable_name = std::move(pb.vars.names);
ret.affected_vars = std::move(pb.affected_vars);
ret.variables = variables;
ret.constraints = length(constraints);
if (ctx.finish)
ctx.finish(ret);
return ret;
}
|
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x130, %rsp # imm = 0x130
cmpq $0x0, 0x128(%rsi)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
je 0x17c011
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 0x17c13a
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0x17c13a
movq %r14, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
leaq 0x10(%r15), %rsi
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, (%rsp)
leaq 0x20(%rsp), %rdi
movl %r12d, %edx
callq 0x353d2
vmovsd 0x40(%r15), %xmm0
movl 0xe4(%r14), %eax
vxorps %xmm1, %xmm1, %xmm1
leaq 0x30(%rsp), %rsi
cmpl $0x1, %eax
je 0x17c161
cmpl $0x2, %eax
jne 0x17c1b0
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x1885be
jmp 0x17c1fd
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 0x17c22c
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x187ee0
jmp 0x17c1fd
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x188c9c
leaq 0x88(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x41d9e
movq %r13, %rdi
callq 0xea60
leaq 0x58(%rsp), %rdi
callq 0x357fe
leaq 0x28(%rsp), %rdi
callq 0x35c1a
leaq 0x90(%r15), %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31d28
leaq 0x50(%rbx), %rdi
movq %r13, %rsi
callq 0x352ec
addq $0xc0, %r15
leaq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x352c2
movq 0x10(%rsp), %rax
movl %r12d, 0x90(%rbx)
subq 0x8(%rsp), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
movl %eax, 0x94(%rbx)
cmpq $0x0, 0x168(%r14)
je 0x17c298
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 0x17c2ba
jmp 0x17c2ba
leaq 0x58(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x28(%rsp), %rdi
callq 0x35c1a
jmp 0x17c2dd
jmp 0x17c2da
movq %rax, %r14
jmp 0x17c2e7
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x35858
movq %rbx, %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::solver_equalities_101coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::default_cost_type<float> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&)
|
solver_equalities_101coeff(random_engine& rng_,
int m_,
int n_,
const cost_type& c_,
const std::vector<merged_constraint>& csts)
: logger("solver_equalities_101coeff")
, rng(rng_)
, ap(csts, m_, n_)
, P(std::make_unique<Float[]>(ap.size()))
, A(std::make_unique<int[]>(ap.size()))
, R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts)))
, b(std::make_unique<bound_factor[]>(m_))
, pi(std::make_unique<Float[]>(m_))
, c(c_)
, m(m_)
, n(n_)
{
int id = 0;
for (int i = 0; i != m; ++i) {
b[i].negative_factor = 0;
b[i].value = csts[i].min;
for (const auto& cst : csts[i].elements) {
bx_ensures(std::abs(cst.factor) == 1);
A[id++] = cst.factor;
if (cst.factor < 0)
++b[i].negative_factor;
}
bx_ensures(csts[i].min == csts[i].max);
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r12d
leaq 0x2e1d0c(%rip), %rdx # 0x45e95a
movq %r9, %r13
movq %rdi, %rbx
movq %r8, 0x20(%rsp)
movl %ecx, %ebp
movq %rsi, %r14
pushq $0x1a
popq %rsi
callq 0xb8418
leaq 0x10(%rbx), %r15
movq %r14, 0x8(%rbx)
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %ebp, %ecx
movl %ebp, 0x4(%rsp)
callq 0x3a4ca
movl 0x38(%rbx), %esi
leaq 0x50(%rbx), %rbp
movq %rbp, %rdi
movq %r15, 0x18(%rsp)
callq 0x35bd8
movl 0x38(%rbx), %esi
leaq 0x58(%rbx), %r14
movq %r14, %rdi
movq %rbp, 0x10(%rsp)
callq 0x28eb6
movq %r13, %rdi
leaq 0x60(%rbx), %r15
callq 0x3a89d
movq %r15, 0x8(%rsp)
movq %r15, %rdi
movq %rax, %rsi
callq 0x17d303
leaq 0x68(%rbx), %r15
movslq %r12d, %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x17d340
leaq 0x70(%rbx), %rdi
movq %rbp, %rsi
callq 0x35bd8
movq 0x20(%rsp), %rax
movl 0x4(%rsp), %ecx
xorl %edx, %edx
xorl %esi, %esi
movq %rax, 0x78(%rbx)
movl %r12d, 0x80(%rbx)
movl %ecx, 0x84(%rbx)
movq 0x68(%rbx), %rax
movq (%r13), %rcx
movl 0x80(%rbx), %edi
cmpq %rdi, %rdx
je 0x17cd93
imulq $0x28, %rdx, %r9
andl $0x0, 0x4(%rax,%rdx,8)
movslq %esi, %rsi
movl 0x18(%rcx,%r9), %r8d
leaq (%rcx,%r9), %rdi
movl %r8d, (%rax,%rdx,8)
movq (%rcx,%r9), %r8
movq 0x8(%rcx,%r9), %r9
movq (%r14), %r10
cmpq %r9, %r8
je 0x17cd65
movl (%r8), %r11d
leal 0x1(%r11), %ebp
testl $0xfffffffd, %ebp # imm = 0xFFFFFFFD
jne 0x17cda2
movl %r11d, (%r10,%rsi,4)
cmpl $0x0, (%r8)
jns 0x17cd5c
incl 0x4(%rax,%rdx,8)
addq $0x8, %r8
incq %rsi
jmp 0x17cd3a
movl 0x18(%rdi), %r8d
incq %rdx
cmpl 0x1c(%rdi), %r8d
je 0x17cd0a
leaq 0x2db6b1(%rip), %rdi # 0x45842a
leaq 0x2df555(%rip), %rsi # 0x45c2d5
leaq 0x2e1bee(%rip), %rdx # 0x45e975
leaq 0x2e1c56(%rip), %rcx # 0x45e9e4
callq 0x2813f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2db681(%rip), %rdi # 0x45842a
leaq 0x2dd47d(%rip), %rsi # 0x45a22d
leaq 0x2e1bbe(%rip), %rdx # 0x45e975
leaq 0x2e1c22(%rip), %rcx # 0x45e9e0
callq 0x2813f
movq %r15, %rdi
movq %rax, %r12
callq 0x17d382
jmp 0x17cdd3
movq %rax, %r12
movq 0x8(%rsp), %rdi
callq 0x17d39c
jmp 0x17cde2
movq %rax, %r12
movq %r14, %rdi
callq 0x28fb6
jmp 0x17cdef
movq %rax, %r12
movq 0x10(%rsp), %rdi
callq 0x35c1a
jmp 0x17cdfe
movq %rax, %r12
movq 0x18(%rsp), %rdi
callq 0x3a954
movq %rbx, %rdi
callq 0xb853a
movq %r12, %rdi
callq 0xb3d0
movq %rax, %r12
jmp 0x17ce08
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true> const, baryonyx::bit_array>(baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true> const&, baryonyx::bit_array const&)
|
int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
cmpq %rax, 0x20(%rdi)
je 0x17d3f4
movq %rax, 0x20(%rdi)
leaq 0x18(%rdi), %rax
leaq 0x10(%r15), %rcx
xorl %r12d, %r12d
movq %rdi, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movl 0x80(%r15), %eax
movq %rcx, 0x18(%rsp)
movq %rax, 0x28(%rsp)
cmpq 0x28(%rsp), %r12
je 0x17d4b6
movq 0x18(%rsp), %rsi
movq %rsp, %rdi
movl %r12d, %edx
movq %r12, 0x30(%rsp)
callq 0x3c868
movq (%rsp), %r13
movq 0x8(%rsp), %r12
xorl %ebx, %ebx
cmpq %r13, %r12
je 0x17d46d
movslq (%r12), %rax
movq 0x58(%r15), %rcx
movl 0x4(%r12), %esi
movq %r14, %rdi
movl (%rcx,%rax,4), %ebp
callq 0x3664a
imull %ebp, %eax
addq $0x8, %r12
addl %eax, %ebx
jmp 0x17d445
movq 0x68(%r15), %rax
movq 0x30(%rsp), %r12
movl (%rax,%r12,8), %eax
movl %eax, %ecx
subl %ebx, %ecx
jle 0x17d48d
shlq $0x20, %rcx
orq %r12, %rcx
movq %rcx, (%rsp)
jmp 0x17d49c
jge 0x17d4a9
subl %eax, %ebx
shlq $0x20, %rbx
orq %r12, %rbx
movq %rbx, (%rsp)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x3c8c2
movq 0x20(%rsp), %rdi
incq %r12
jmp 0x17d41a
movq 0x20(%rdi), %rax
subq 0x18(%rdi), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto sizes =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng);
int selected = select_variables(sizes, b[k].value);
logger::log("constraints {}: {} = ", k, b[k].value);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(*this,
x,
std::get<0>(it),
k,
selected,
sizes.r_size,
kappa,
delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x48(%rsp)
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
leaq 0x2ded5a(%rip), %rdx # 0x45c344
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
movq %rbx, 0x40(%rsp)
xorl %esi, %esi
movq %rax, 0x30(%rsp)
movq (%rbx), %rax
leaq 0x2decf8(%rip), %rbx # 0x45c313
pushq $0x8
popq %rbp
movq %r14, 0x38(%rsp)
movq 0x48(%rsp), %rcx
cmpq (%rcx), %rax
je 0x17d779
movl -0x4(%rax), %edx
movl %edx, 0xc(%rsp)
cmpl 0x80(%r12), %edx
jge 0x17d78e
movq %rsi, 0x50(%rsp)
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x17deb0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x17dece
movq 0x60(%r12), %rdi
movq %rax, %r15
movslq %r15d, %r14
movq 0x8(%r12), %rdx
movq %rax, %r13
shrq $0x20, %r13
imulq $0xc, %r14, %rsi
addq %rdi, %rsi
callq 0x17dfbf
movslq 0xc(%rsp), %rax
movq 0x68(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,8), %r8
addl (%r8), %r13d
cmpl %r13d, %r14d
cmovll %r15d, %r13d
decl %r13d
movl %r13d, 0x10(%rsp)
pushq $0x15
popq %rsi
leaq 0x2dec26(%rip), %rdx # 0x45c2fd
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
xorl %r13d, %r13d
andnl %r14d, %eax, %eax
imulq $0xc, %rax, %r14
cmpq %r13, %r14
je 0x17d719
movq 0x60(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x8(%rcx,%r13), %r8
addq %r13, %rcx
callq 0xb91f0
addq $0xc, %r13
jmp 0x17d6f3
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x2e393b(%rip), %rdx # 0x461061
leaq 0x10(%rsp), %rcx
callq 0xb921e
vmovss 0x1c(%rsp), %xmm0
vmovss 0x18(%rsp), %xmm1
movq 0x38(%rsp), %r14
movq 0x28(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
movq %r12, %rdi
movl %r15d, %r9d
movq %r14, %rsi
callq 0x17dff2
movq 0x50(%rsp), %rsi
movq 0x40(%rsp), %rcx
orb %al, %sil
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x17d623
andb $0x1, %sil
movl %esi, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2daa49(%rip), %rdi # 0x4581de
leaq 0x2dccde(%rip), %rsi # 0x45a47a
leaq 0x2e11d2(%rip), %rdx # 0x45e975
leaq 0x2e123e(%rip), %rcx # 0x45e9e8
callq 0x2813f
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
bool baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto sizes =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng);
int selected = select_variables(sizes, b[k].value);
logger::log("constraints {}: {} = ", k, b[k].value);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(*this,
x,
std::get<0>(it),
k,
selected,
sizes.r_size,
kappa,
delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x40(%rsp)
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x2de978(%rip), %rdx # 0x45c344
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
leaq 0x2de925(%rip), %rbx # 0x45c313
movq %rax, 0x30(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbp
movq %r13, 0x38(%rsp)
cmpq 0x40(%rsp), %r14
je 0x17db51
movl (%r14), %edx
movl %edx, 0xc(%rsp)
cmpl 0x80(%r12), %edx
jge 0x17db62
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movq %rax, 0x48(%rsp)
movq %r14, 0x50(%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x17deb0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x17dece
movq 0x60(%r12), %rdi
movq %rax, %r15
movslq %r15d, %r13
movq 0x8(%r12), %rdx
movq %rax, %r14
shrq $0x20, %r14
imulq $0xc, %r13, %rsi
addq %rdi, %rsi
callq 0x17dfbf
movslq 0xc(%rsp), %rax
movq 0x68(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,8), %r8
addl (%r8), %r14d
cmpl %r14d, %r13d
cmovll %r15d, %r14d
decl %r14d
movl %r14d, 0x10(%rsp)
pushq $0x15
popq %rsi
leaq 0x2de84a(%rip), %rdx # 0x45c2fd
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %eax
imulq $0xc, %rax, %r13
cmpq %r14, %r13
je 0x17daf5
movq 0x60(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x8(%rcx,%r14), %r8
addq %r14, %rcx
callq 0xb91f0
addq $0xc, %r14
jmp 0x17dacf
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x2e355f(%rip), %rdx # 0x461061
leaq 0x10(%rsp), %rcx
callq 0xb921e
vmovss 0x1c(%rsp), %xmm0
vmovss 0x18(%rsp), %xmm1
movq 0x38(%rsp), %r13
movq 0x28(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
movq %r12, %rdi
movl %r15d, %r9d
movq %r13, %rsi
callq 0x17dff2
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r14
orb %al, %cl
addq $0x8, %r14
movq %rcx, %rax
jmp 0x17d9fd
andb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2da675(%rip), %rdi # 0x4581de
leaq 0x2dc90a(%rip), %rsi # 0x45a47a
leaq 0x2e0dfe(%rip), %rdx # 0x45e975
leaq 0x2e0e6a(%rip), %rcx # 0x45e9e8
callq 0x2813f
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>&, baryonyx::bit_array const&)
|
int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
cmpq %rax, 0x20(%rdi)
je 0x17dba6
movq %rax, 0x20(%rdi)
leaq 0x18(%rdi), %rax
leaq 0x10(%r15), %rcx
xorl %r12d, %r12d
movq %rdi, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movl 0x80(%r15), %eax
movq %rcx, 0x18(%rsp)
movq %rax, 0x28(%rsp)
cmpq 0x28(%rsp), %r12
je 0x17dc68
movq 0x18(%rsp), %rsi
movq %rsp, %rdi
movl %r12d, %edx
movq %r12, 0x30(%rsp)
callq 0x3de66
movq (%rsp), %r13
movq 0x8(%rsp), %r12
xorl %ebx, %ebx
cmpq %r13, %r12
je 0x17dc1f
movslq (%r12), %rax
movq 0x58(%r15), %rcx
movl 0x4(%r12), %esi
movq %r14, %rdi
movl (%rcx,%rax,4), %ebp
callq 0x3664a
imull %ebp, %eax
addq $0x8, %r12
addl %eax, %ebx
jmp 0x17dbf7
movq 0x68(%r15), %rax
movq 0x30(%rsp), %r12
movl (%rax,%r12,8), %eax
movl %eax, %ecx
subl %ebx, %ecx
jle 0x17dc3f
shlq $0x20, %rcx
orq %r12, %rcx
movq %rcx, (%rsp)
jmp 0x17dc4e
jge 0x17dc5b
subl %eax, %ebx
shlq $0x20, %rbx
orq %r12, %rbx
movq %rbx, (%rsp)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x3c8c2
movq 0x20(%rsp), %rdi
incq %r12
jmp 0x17dbcc
movq 0x20(%rdi), %rax
subq 0x18(%rdi), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::rc_size baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_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[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[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 $0x18, %rsp
leaq 0x10(%rdi), %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebp, %ebp
xorl %r13d, %r13d
cmpq %rbx, %r14
je 0x17dfa7
movl 0x4(%r14), %edx
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x3dede
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdx
movq 0x50(%r15), %rsi
movq 0x58(%r15), %rax
movq 0x70(%r15), %rdi
vxorps %xmm0, %xmm0, %xmm0
vxorps %xmm1, %xmm1, %xmm1
cmpq %rcx, %rdx
je 0x17df4f
movslq (%rdx), %r8
movslq 0x4(%rdx), %r9
addq $0x8, %rdx
vcvtsi2ssl (%rax,%r8,4), %xmm3, %xmm2
vfmadd231ss (%rdi,%r9,4), %xmm2, %xmm0 # xmm0 = (xmm2 * mem) + xmm0
vfmadd231ss (%rsi,%r8,4), %xmm2, %xmm1 # xmm1 = (xmm2 * mem) + xmm1
movq %rdx, 0x10(%rsp)
jmp 0x17df26
movq 0x60(%r15), %rcx
imulq $0xc, %rbp, %rdx
movl %ebp, 0x8(%rcx,%rdx)
movq 0x78(%r15), %rsi
movslq 0x4(%r14), %rdi
movq 0x8(%rsi), %rsi
vmovss (%rsi,%rdi,4), %xmm2
vsubss %xmm0, %xmm2, %xmm0
vsubss %xmm1, %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rdx)
movslq (%r14), %rsi
movl (%rax,%rsi,4), %eax
movl %eax, 0x4(%rcx,%rdx)
testl %eax, %eax
jns 0x17df9b
vxorps 0x2d636b(%rip){1to4}, %xmm0, %xmm0 # 0x4542fc
addq %rdx, %rcx
incl %r13d
vmovss %xmm0, (%rcx)
incq %rbp
addq $0x8, %r14
jmp 0x17deee
shlq $0x20, %r13
movl %ebp, %eax
orq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::rc_data*>(baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::rc_data*, baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::rc_data*, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&)
|
inline void
random_shuffle_unique(iteratorT begin,
iteratorT end,
random_engine& rng) noexcept
{
auto ret = begin++;
for (; begin != end; ++begin) {
if (ret->value != begin->value) {
std::shuffle(ret, begin, rng);
ret = begin;
}
}
std::shuffle(ret, begin, rng);
}
|
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0xc(%rdi), %rsi
cmpq %r14, %rsi
je 0x17e32c
vmovss (%rdi), %xmm0
leaq 0xc(%rsi), %r15
vucomiss (%rsi), %xmm0
movq %r15, %rsi
jne 0x17e318
jnp 0x17e300
addq $-0xc, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x17e8c2
movq %r15, %rdi
jmp 0x17e2fc
movq %rbx, %rdx
callq 0x17e8c2
popq %rbx
popq %r14
popq %r15
retq
jmp 0x17e33c
movq %rax, %rdi
callq 0xeb9f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, 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>>>, float, float, float, float)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float obj_amp)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto sizes =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != sizes.r_size; ++i)
R[i].value +=
obj_amp * c((std::get<0>(it) + R[i].id)->column, x);
calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng);
int selected = select_variables(sizes, b[k].value);
logger::log("constraints {}: {} = ", k, b[k].value);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(*this,
x,
std::get<0>(it),
k,
selected,
sizes.r_size,
kappa,
delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x40(%rsp)
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rdx, %r14
vmovss %xmm3, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x2dbf95(%rip), %rdx # 0x45c33f
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
leaq 0x2dbf47(%rip), %rbx # 0x45c313
movq %rax, 0x30(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbp
movq %r15, 0x38(%rsp)
cmpq 0x40(%rsp), %r14
je 0x180564
movl (%r14), %edx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movq %rax, 0x48(%rsp)
movl %edx, 0x8(%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x17deb0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x17dece
vmovss 0x10(%rsp), %xmm1
movq %rax, %r15
movq %rax, %r13
movq 0x60(%r12), %rdi
movq 0x78(%r12), %rax
movq 0x28(%rsp), %rcx
movl %r13d, %edx
imulq $0xc, %rdx, %rdx
shrq $0x20, %r15
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x180480
movslq 0x8(%rdi,%rsi), %r8
movq 0x8(%rax), %r9
movslq 0x4(%rcx,%r8,8), %r8
vmovss (%r9,%r8,4), %xmm0
vfmadd213ss (%rdi,%rsi), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rdi,%rsi)
addq $0xc, %rsi
jmp 0x180456
movslq %r13d, %rax
movq 0x8(%r12), %rdx
movq %r14, 0x50(%rsp)
imulq $0xc, %rax, %rsi
addq %rdi, %rsi
callq 0x17dfbf
movslq 0x8(%rsp), %rax
movq 0x68(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,8), %r8
addl (%r8), %r15d
cmpl %r15d, %r13d
cmovll %r13d, %r15d
decl %r15d
movl %r15d, 0xc(%rsp)
pushq $0x15
popq %rsi
leaq 0x2dbe37(%rip), %rdx # 0x45c2fd
leaq 0x8(%rsp), %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %eax
imulq $0xc, %rax, %r15
cmpq %r14, %r15
je 0x180508
movq 0x60(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x8(%rcx,%r14), %r8
addq %r14, %rcx
callq 0xb91f0
addq $0xc, %r14
jmp 0x1804e2
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x2e0b4c(%rip), %rdx # 0x461061
leaq 0xc(%rsp), %rcx
callq 0xb921e
vmovss 0x1c(%rsp), %xmm0
vmovss 0x18(%rsp), %xmm1
movq 0x38(%rsp), %r15
movq 0x28(%rsp), %rdx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movq %r12, %rdi
movl %r13d, %r9d
movq %r15, %rsi
callq 0x17dff2
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x1803db
andb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<float> const&, double)
|
result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3a8, %rsp # imm = 0x3A8
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 0x80(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x38959
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x40(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0x4(%rsp)
jbe 0x181940
movq 0x10(%r14), %rdi
leaq 0x80(%rsp), %rsi
movl %ebx, %edx
callq 0x38a37
vmovss %xmm0, 0x14(%rsp)
jmp 0x18194a
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 0xc8(%rsp), %rdi
leaq 0x80(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x17cc36
movl 0xcc(%r12), %esi
leaq 0x90(%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, 0x150(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x181a28
cmpl $0x1, %eax
je 0x181a02
cmpl $0x2, %eax
jne 0x181a39
movq 0x18(%r14), %rdx
leaq 0x150(%rsp), %rdi
leaq 0x28(%rsp), %rsi
jmp 0x181a13
movq 0x18(%r14), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x150(%rsp), %rsi
vmovsd 0x2d261d(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x4f9c9
jmp 0x181a39
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x4f95d
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
leaq 0x28(%rsp), %r15
movq %r13, 0x50(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
vmovss %xmm0, 0x24(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x38(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x40(%rsp)
vcvtsd2ss 0x68(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
vcvtsd2ss 0x60(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x60(%rsp)
cmpl %ebx, %ebp
je 0x181aab
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x181aa7
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x181a84
leaq 0x158(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x148(%rsp), %ecx
movl 0x14c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x8(%rsp)
leaq 0x2d8a94(%rip), %rdx # 0x45a577
leaq 0x150(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x42b5a
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x90(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x17ce1e
vcvtsd2ss 0x8(%rsp), %xmm3, %xmm0
vmovss 0x4(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x28(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x181c1c
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0x90(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0x17ce60
movq 0x118(%rsp), %rdx
movq 0x138(%rsp), %rcx
movl %eax, %ebx
leaq 0x150(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x42bbe
testl %ebx, %ebx
je 0x181cc1
cmpl %ebp, %ebx
jge 0x181bb2
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x182cd6
movl %ebx, %ebp
cmpq 0x70(%rsp), %r15
jle 0x181be8
vcvtsi2ss %ebx, %xmm3, %xmm0
vcvtsi2ssl 0x148(%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 0x181bee
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x181c1c
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0x182d0e
vmovss 0x8(%rsp), %xmm0
vmovss 0x4(%rsp), %xmm2
testb %al, %al
jne 0x181c1c
incq %r15
jmp 0x181b37
movq 0x18(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x181c3e
movq 0x18(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x181c6c
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 0x150(%rsp), %rdi
callq 0x42cbc
leaq 0x90(%rsp), %rdi
callq 0x393ac
leaq 0xc8(%rsp), %rdi
callq 0x17d2c0
leaq 0x88(%rsp), %rdi
callq 0x35c1a
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%rsp), %rax
addq $0x3a8, %rsp # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rbx
movq %rbx, %rsi
callq 0x365d4
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x182c88
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
leaq 0xc8(%rsp), %r15
leaq 0x28(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x38(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x181c2b
vmovss %xmm0, 0x8(%rsp)
vmulss 0x68(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
vmovss 0x60(%rsp), %xmm3
leaq 0x90(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x17d06c
testl %eax, %eax
jne 0x181d79
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0x365d4
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x182c88
movq %r14, %rdi
callq 0x182d0e
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
testb %al, %al
jne 0x181c2b
movl %ebx, 0x70(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x181ea0
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0x90(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0x17ce60
testl %eax, %eax
je 0x181e56
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x181e1d
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x148(%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 0x181e29
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0x181ea0
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0x182d0e
testb %al, %al
jne 0x181e94
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
incl %ebx
jmp 0x181d9e
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0x365d4
movl 0xc0(%r12), %eax
imull 0x38(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x182c88
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
jmp 0x181ea0
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
movl 0x70(%rsp), %ebx
decl 0x38(%rsp)
incl %ebx
jmp 0x181d0a
jmp 0x181ee6
jmp 0x181ebf
jmp 0x181ee6
movq %rax, %r14
jmp 0x181ef6
movq %rax, %r14
jmp 0x181f03
movq %rax, %r14
jmp 0x181f10
movq %rax, %r14
jmp 0x181f1d
movq %rax, %r14
jmp 0x181f27
jmp 0x181ee6
jmp 0x181ee6
jmp 0x181ee6
leaq 0x158(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x181ef6
leaq 0x150(%rsp), %rdi
movq %rax, %r14
callq 0x42cbc
leaq 0x90(%rsp), %rdi
callq 0x393ac
leaq 0xc8(%rsp), %rdi
callq 0x17d2c0
leaq 0x88(%rsp), %rdi
callq 0x35c1a
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%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_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::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 0x182cd4
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x182d4e
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_101coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::none_observer>::store_if_better(baryonyx::bit_array const&, double, long)
|
void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
}
|
vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x182ea0
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x182f1a
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
|
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_equalities_101coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_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 0x1a03dc
movq %rax, %rdi
jmp 0x1a0978
cmpl $0x7, %ecx
jne 0x1a03f9
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0x1a0407
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0x1a03ea
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0x1a0a77
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_equalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, false> const&, int, baryonyx::bit_array const&)
|
bool
is_valid_constraint(const Solver& slv, int k, const Xtype& x)
{
typename sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = slv.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += slv.factor(it->value) * x[it->column];
return slv.bound_min(k) <= v && v <= slv.bound_max(k);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movl %esi, %edx
leaq 0x10(%rdi), %rsi
leaq 0x8(%rsp), %r15
movq %rdi, %rbx
movl %edx, 0x4(%rsp)
movq %r15, %rdi
callq 0x3c868
movq (%r15), %r12
movq 0x8(%r15), %r13
xorl %r15d, %r15d
cmpq %r12, %r13
je 0x1bcdad
movslq (%r13), %rax
movq 0x58(%rbx), %rcx
movl 0x4(%r13), %esi
movq %r14, %rdi
movl (%rcx,%rax,4), %ebp
callq 0x3664a
imull %ebp, %eax
addq $0x8, %r13
addl %eax, %r15d
jmp 0x1bcd85
movslq 0x4(%rsp), %rax
movq 0x68(%rbx), %rcx
cmpl (%rcx,%rax,8), %r15d
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, double, double, double)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto sizes =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng);
int selected = select_variables(sizes, b[k].value);
logger::log("constraints {}: {} = ", k, b[k].value);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(*this,
x,
std::get<0>(it),
k,
selected,
sizes.r_size,
kappa,
delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, 0x18(%rsp)
leaq 0x10(%rdi), %rax
vmovsd %xmm2, 0x30(%rsp)
vmovsd %xmm1, 0x28(%rsp)
vmovsd %xmm0, 0x20(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdi, %r12
xorl %r14d, %r14d
movq 0x18(%rsp), %rbp
movq %rax, 0x10(%rsp)
cmpq 0x38(%rsp), %rdx
je 0x1bd016
movslq (%rdx), %rbx
cmpl 0x80(%r12), %ebx
jge 0x1bd02c
movq 0x10(%rsp), %rsi
movq %rdx, 0x40(%rsp)
movq %rsp, %rdi
movl %ebx, %edx
callq 0x3de66
vmovsd 0x30(%rsp), %xmm0
movq (%rsp), %rdx
movq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x1bd408
movq (%rsp), %rdx
movq 0x8(%rsp), %rsi
movq %r12, %rdi
movq %rbp, %rcx
callq 0x1bd426
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
movq %rax, %r15
movslq %r15d, %r13
shrq $0x20, %r15
movq %r13, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x1bd51a
movq 0x68(%r12), %rax
vmovsd 0x20(%rsp), %xmm0
vmovsd 0x28(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movq %r12, %rdi
movq %rbp, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
addl (%rax,%rbx,8), %r15d
cmpl %r15d, %r13d
cmovll %r13d, %r15d
decl %r15d
movl %r15d, %r8d
callq 0x1bd54d
movq 0x40(%rsp), %rdx
orb %al, %r14b
addq $0x4, %rdx
jmp 0x1bcf50
andb $0x1, %r14b
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x29b1ab(%rip), %rdi # 0x4581de
leaq 0x29d440(%rip), %rsi # 0x45a47a
leaq 0x2a1934(%rip), %rdx # 0x45e975
leaq 0x2a19a0(%rip), %rcx # 0x45e9e8
callq 0x2813f
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
bool baryonyx::itm::solver_equalities_101coeff<double, baryonyx::itm::minimize_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);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto sizes =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != sizes.r_size; ++i)
R[i].value +=
obj_amp * c((std::get<0>(it) + R[i].id)->column, x);
calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng);
int selected = select_variables(sizes, b[k].value);
logger::log("constraints {}: {} = ", k, b[k].value);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(*this,
x,
std::get<0>(it),
k,
selected,
sizes.r_size,
kappa,
delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x10(%rdi), %rax
vmovsd %xmm3, 0x38(%rsp)
vmovsd %xmm2, 0x30(%rsp)
vmovsd %xmm1, 0x28(%rsp)
vmovsd %xmm0, 0x20(%rsp)
movq %rcx, 0x40(%rsp)
movq %rdx, %r14
movq %rsi, 0x10(%rsp)
movq %rdi, %r13
xorl %r15d, %r15d
movq %rax, 0x18(%rsp)
cmpq 0x40(%rsp), %r14
je 0x1bf702
movl (%r14), %eax
movq 0x18(%rsp), %rsi
movq %rsp, %rdi
movslq %eax, %rbp
movl %ebp, %edx
callq 0x3de66
vmovsd 0x30(%rsp), %xmm0
movq (%rsp), %rdx
movq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x1bd408
movq (%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rcx
movq %r13, %rdi
callq 0x1bd426
vmovsd 0x38(%rsp), %xmm1
movq %rax, %rbx
movq %rax, %r12
movq 0x60(%r13), %rdi
movq 0x78(%r13), %rax
movq 0x8(%rsp), %rcx
movl %r12d, %edx
shrq $0x20, %rbx
shlq $0x4, %rdx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x1bf6ad
movslq 0xc(%rdi,%rsi), %r8
movq 0x8(%rax), %r9
movslq 0x4(%rcx,%r8,8), %r8
vmovsd (%r9,%r8,8), %xmm0
vfmadd213sd (%rdi,%rsi), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rdi,%rsi)
addq $0x10, %rsi
jmp 0x1bf683
movq 0x8(%r13), %rdx
movslq %r12d, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x1bd51a
movq 0x68(%r13), %rax
vmovsd 0x20(%rsp), %xmm0
vmovsd 0x28(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
movl %ebp, %ecx
movl %r12d, %r9d
addl (%rax,%rbp,8), %ebx
cmpl %ebx, %r12d
cmovll %r12d, %ebx
decl %ebx
movl %ebx, %r8d
callq 0x1bd54d
orb %al, %r15b
addq $0x4, %r14
jmp 0x1bf610
andb $0x1, %r15b
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
baryonyx::itm::optimize_functor<baryonyx::itm::solver_equalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::minimize_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::minimize_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 0x10(%rsp), %rdi
movq %rsi, %r15
movl %r8d, %esi
vmovsd %xmm0, 0x50(%rsp)
movq %r9, %r12
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x20(%rsp)
callq 0x368ae
movq (%rbp), %r13
movq %rbp, 0x58(%rsp)
addq $0x8, %rbp
leaq 0x98(%rsp), %rdi
movq %r13, %rsi
movq %r12, 0x48(%rsp)
movq %r12, %rdx
movq %rbp, %rcx
movl %ebx, %r8d
callq 0x6fb57
vmovsd 0x20(%r13), %xmm0
vmovsd 0x10(%r13), %xmm1
vmovsd %xmm0, 0x70(%rsp)
vmovsd 0x28(%r13), %xmm0
vmovsd %xmm1, 0x38(%rsp)
vmovsd %xmm0, 0x78(%rsp)
vmovsd 0x30(%r13), %xmm0
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x8(%r13), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x1c375c
movq 0x58(%rsp), %rax
movq (%rax), %rdi
vmovsd 0x40(%rsp), %xmm0
leaq 0x98(%rsp), %rsi
movl %ebx, %edx
callq 0x6fc31
vmovsd %xmm0, 0x38(%rsp)
vcvttsd2si 0xa0(%r13), %rax
vmovsd 0x38(%r13), %xmm0
vmovsd 0x40(%r13), %xmm1
movq %rax, 0x80(%rsp)
movq 0x8(%r14), %rax
vmovsd %xmm0, 0x90(%rsp)
vmovsd %xmm1, 0x88(%rsp)
subq (%r14), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xf0(%rsp), %rdi
leaq 0x98(%rsp), %r8
movq %rbp, %rsi
movl %eax, %edx
movl %ebx, %ecx
movq %r14, %r9
callq 0x1c3b84
movl 0xcc(%r13), %esi
leaq 0xb8(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq $0x0, 0x8(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x1c3aeb
movq 0x58(%rsp), %rax
incq 0xb0(%rax)
vmovsd 0x18(%r13), %xmm0
vmovsd 0x28(%r13), %xmm1
movzbl 0x8(%rsp), %edx
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rbx
movq %rbp, %rsi
movq %rbx, %rcx
andl $0x1, %edx
callq 0x83c1a
vmovsd %xmm0, 0x60(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
movq %rbx, %rdx
callq 0x1c3d6c
vmovsd 0x60(%rsp), %xmm0
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movb (%r15), %al
testb $0x1, %al
jne 0x1c38e3
cmpq 0xb0(%r13), %r14
je 0x1c38e3
vmovsd 0x38(%rsp), %xmm1
vmovsd 0x40(%rsp), %xmm2
leaq 0xb8(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbp, %rcx
vmovsd %xmm0, 0x28(%rsp)
callq 0x1c3dae
testl %eax, %eax
je 0x1c38fb
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0x80(%rsp), %r14
jle 0x1c38cd
vcvtsi2sd %eax, %xmm3, %xmm0
vcvtsi2sdl 0x170(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x68(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x28(%rsp), %xmm1
vfmadd231sd 0x70(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x1c38d3
vmovsd 0x28(%rsp), %xmm0
vucomisd 0x78(%rsp), %xmm0
ja 0x1c38e3
incq %r14
jmp 0x1c3844
testl %ebx, %ebx
jg 0x1c3acb
leaq 0x10(%rsp), %rbx
movq $0x0, 0x8(%rsp)
jmp 0x1c392d
vmovsd 0x50(%rsp), %xmm0
movq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x6e096
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x83f68
movb $0x1, %al
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x34(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x1c37d8
cmpl 0xbc(%r13), %r14d
jge 0x1c37d8
vmovsd 0x90(%rsp), %xmm0
vmovsd 0x38(%rsp), %xmm1
vmovsd 0x40(%rsp), %xmm2
vmovsd 0x88(%rsp), %xmm3
leaq 0xb8(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x1c3fba
testl %eax, %eax
jne 0x1c39c7
vmovsd 0x50(%rsp), %xmm0
movq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x6e096
movl 0xc0(%r13), %eax
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
imull %r14d, %eax
notl %eax
movslq %eax, %rcx
callq 0x83f68
movb $0x1, %al
movq %rax, 0x8(%rsp)
pushq $0x1
popq %rax
vmovsd 0x60(%rsp), %xmm0
movl %eax, %ebx
movb (%r15), %al
testb $0x1, %al
jne 0x1c3a75
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0x1c3a75
vmovsd 0x38(%rsp), %xmm1
vmovsd 0x40(%rsp), %xmm2
leaq 0xb8(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbp, %rcx
vmovsd %xmm0, 0x28(%rsp)
callq 0x1c3dae
testl %eax, %eax
je 0x1c3a7c
vcvtsi2sd %r12d, %xmm4, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0x1c3a60
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x170(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x68(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x28(%rsp), %xmm1
vfmadd231sd 0x70(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x1c3a66
vmovsd 0x28(%rsp), %xmm0
vucomisd 0x78(%rsp), %xmm0
ja 0x1c3a75
incl %ebx
jmp 0x1c39d2
leaq 0x10(%rsp), %rbx
jmp 0x1c3abf
vmovsd 0x50(%rsp), %xmm0
movq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %r12
movq %r12, %rsi
callq 0x6e096
movl 0xc0(%r13), %eax
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
imull 0x34(%rsp), %eax
subl %ebx, %eax
movq %r12, %rbx
movslq %eax, %rcx
callq 0x83f68
movb $0x1, %al
movq %rax, 0x8(%rsp)
decl 0x34(%rsp)
incl %r14d
jmp 0x1c3938
movq 0xb0(%r13), %r8
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0x83ff0
jmp 0x1c37cf
leaq 0xb8(%rsp), %rdi
callq 0x393ac
leaq 0xf0(%rsp), %rdi
callq 0x1c420e
leaq 0x98(%rsp), %rdi
callq 0x6d8d6
leaq 0x18(%rsp), %rdi
callq 0x357fe
addq $0x178, %rsp # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1c3b35
movq %rax, %rbx
jmp 0x1c3b57
movq %rax, %rbx
jmp 0x1c3b64
movq %rax, %rbx
jmp 0x1c3b71
jmp 0x1c3b47
jmp 0x1c3b47
jmp 0x1c3b47
jmp 0x1c3b47
leaq 0xb8(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0xf0(%rsp), %rdi
callq 0x1c420e
leaq 0x98(%rsp), %rdi
callq 0x6d8d6
leaq 0x18(%rsp), %rdi
callq 0x357fe
movq %rbx, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
|
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_equalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_101coeff<double, baryonyx::itm::minimize_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 0x1c443f
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x80(%r15), %esi
je 0x1c4475
movq %r15, %rdi
movq %r14, %rdx
callq 0x1c448c
testb %al, %al
jne 0x1c446d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0x1c4446
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_101coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, double, double, double)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto sizes =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + sizes.r_size, rng);
int selected = select_variables(sizes, b[k].value);
logger::log("constraints {}: {} = ", k, b[k].value);
for (int i = 0; i < sizes.r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(*this,
x,
std::get<0>(it),
k,
selected,
sizes.r_size,
kappa,
delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x30(%rsp)
leaq 0x50(%rsp), %rcx
leaq 0x48(%rsp), %r8
leaq 0x40(%rsp), %r9
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
leaq 0x297e0a(%rip), %rdx # 0x45c344
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
movq %rbx, 0x28(%rsp)
xorl %esi, %esi
movq %rax, 0x18(%rsp)
movq (%rbx), %rax
leaq 0x297da8(%rip), %rbx # 0x45c313
pushq $0x8
popq %rbp
movq %r14, 0x20(%rsp)
movq 0x30(%rsp), %rcx
cmpq (%rcx), %rax
je 0x1c46c7
movl -0x4(%rax), %edx
movl %edx, (%rsp)
cmpl 0x80(%r12), %edx
jge 0x1c46dc
movq %rsi, 0x38(%rsp)
movq 0x18(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x3de66
vmovsd 0x40(%rsp), %xmm0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x1c4df8
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x1c4e16
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
movq %rax, %r15
movslq %r15d, %r14
movq %rax, %r13
shrq $0x20, %r13
movq %r14, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x1c4f43
movslq (%rsp), %rax
movq 0x68(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,8), %r8
addl (%r8), %r13d
cmpl %r13d, %r14d
cmovll %r15d, %r13d
decl %r13d
movl %r13d, 0x4(%rsp)
pushq $0x15
popq %rsi
leaq 0x297cd5(%rip), %rdx # 0x45c2fd
movq %rsp, %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
xorl %r13d, %r13d
andnl %r14d, %eax, %r14d
shlq $0x4, %r14
cmpq %r13, %r14
je 0x1c4668
movq 0x60(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0xc(%rcx,%r13), %r8
addq %r13, %rcx
callq 0xefe5a
addq $0x10, %r13
jmp 0x1c4642
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x29c9ec(%rip), %rdx # 0x461061
leaq 0x4(%rsp), %rcx
callq 0xb921e
vmovsd 0x50(%rsp), %xmm0
vmovsd 0x48(%rsp), %xmm1
movq 0x20(%rsp), %r14
movq 0x10(%rsp), %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
movq %r12, %rdi
movl %r15d, %r9d
movq %r14, %rsi
callq 0x1c4f76
movq 0x38(%rsp), %rsi
movq 0x28(%rsp), %rcx
orb %al, %sil
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x1c4573
andb $0x1, %sil
movl %esi, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x293afb(%rip), %rdi # 0x4581de
leaq 0x295d90(%rip), %rsi # 0x45a47a
leaq 0x29a284(%rip), %rdx # 0x45e975
leaq 0x29a2f0(%rip), %rcx # 0x45e9e8
callq 0x2813f
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
baryonyx::itm::solver_equalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::decrease_preference(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, long double)
|
void decrease_preference(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
Float theta) noexcept
{
for (; begin != end; ++begin)
P[begin->value] *= theta;
}
|
fldt 0x8(%rsp)
movq 0x50(%rdi), %rax
cmpq %rdx, %rsi
je 0x1d3196
movslq (%rsi), %rcx
addq $0x8, %rsi
shlq $0x4, %rcx
fldt (%rax,%rcx)
fmul %st(1), %st
fstpt (%rax,%rcx)
jmp 0x1d317c
fstp %st(0)
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-101.cpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_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>, 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 0x27ab45(%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
|
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_equalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, baryonyx::bit_array, long double>(baryonyx::itm::solver_equalities_101coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double, long double)
|
int push_and_run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
bool pi_changed = 0;
int remaining = 0;
if (use_cycle)
order = next_state(order);
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.push_and_compute_update_row(x,
R.crbegin(),
R.crend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
fldt 0xd0(%rsp)
fldt 0xc0(%rsp)
fldt 0xb0(%rsp)
fldt 0xa0(%rsp)
movl 0x30(%rdi), %eax
cmpb $0x1, 0x34(%rdi)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
jne 0x1e10df
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 0x1e11f6
leaq 0x27d71b(%rip), %rdx # 0x45e80c
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 0x1e3eee
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1e154b
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 0x1e50af
jmp 0x1e1283
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x1e47d9
jmp 0x1e11aa
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x1e4c44
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 0x1e436a
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1e1c76
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fxch %st(3)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
jmp 0x1e12a6
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 0x1e4132
jmp 0x1e12b4
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %r15, %rdx
fstpt 0x40(%rsp)
callq 0x1e5603
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 0x1e45a2
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1e154b
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 0x1e4132
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1e1f88
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_101coeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::store_if_better(baryonyx::bit_array const&, double, long)
|
void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
}
|
vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x1f6172
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x1f61ec
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
|
bool baryonyx::itm::affect<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, double>(baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<double>, false>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, double, double)
|
bool
affect(Solver& slv,
Xtype& x,
Iterator it,
int k,
int selected,
int r_size,
const Float kappa,
const Float delta)
{
constexpr Float one{ 1 };
constexpr Float two{ 2 };
constexpr Float middle{ (two + one) / two };
const auto old_pi = slv.pi[k];
auto d = delta;
if (selected < 0) {
// slv.pi[k] += slv.R[0].value / two;
d += (kappa / (one - kappa)) * (slv.R[0].value / two);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
} else if (selected + 1 >= r_size) {
// slv.pi[k] += slv.R[selected].value * middle;
d += (kappa / (one - kappa)) * (slv.R[selected].value * middle);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
} else {
slv.pi[k] +=
((slv.R[selected].value + slv.R[selected + 1].value) / two);
d += (kappa / (one - kappa)) *
(slv.R[selected + 1].value - slv.R[selected].value);
int i = 0;
for (; i <= selected; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
for (; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
}
// TODO job: develops is_valid_constraint for all the solvers
bx_expects(is_valid_constraint(slv, k, x));
return is_signbit_change(old_pi, slv.pi[k]);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x68(%rbx), %rax
movslq %ecx, %rdi
movq %rdx, %r15
movq %rsi, %r14
movl %ecx, 0xc(%rsp)
movq %rdi, 0x18(%rsp)
vmovsd (%rax,%rdi,8), %xmm3
vmovapd %xmm3, 0x20(%rsp)
testl %r8d, %r8d
js 0x24d41b
leal 0x1(%r8), %ecx
cmpl %r9d, %ecx
jge 0x24d48a
movq 0x58(%rbx), %rsi
movl %r8d, %edx
shlq $0x4, %rdx
movl %ecx, %ebp
movq %rbp, 0x10(%rsp)
shlq $0x4, %rbp
xorl %r13d, %r13d
movl %r9d, 0x8(%rsp)
vmovsd (%rsi,%rdx), %xmm2
vaddsd (%rsi,%rbp), %xmm2, %xmm2
vmulsd 0x20b5c6(%rip), %xmm2, %xmm2 # 0x458978
vaddsd %xmm2, %xmm3, %xmm2
vmovsd %xmm2, (%rax,%rdi,8)
vmovsd 0x206c75(%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 0x24d4fd
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x8(%rax,%r13), %r12
movl 0x4(%r15,%r12,8), %esi
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
addq $0x10, %r13
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
jmp 0x24d3df
vmovsd 0x206c15(%rip), %xmm2 # 0x454038
movq 0x58(%rbx), %rax
movl %r9d, %r12d
shlq $0x4, %r12
xorl %ebp, %ebp
vsubsd %xmm0, %xmm2, %xmm2
vdivsd %xmm2, %xmm0, %xmm0
vmovsd (%rax), %xmm2
vmulsd 0x20b534(%rip), %xmm2, %xmm2 # 0x458978
vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovsd %xmm2, (%rsp)
cmpq %rbp, %r12
je 0x24d543
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x8(%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
addq $0x10, %rbp
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
jmp 0x24d44e
vmovsd 0x206ba6(%rip), %xmm2 # 0x454038
movq 0x58(%rbx), %rcx
movl %r8d, %eax
shlq $0x4, %rax
movl %r9d, %r12d
shlq $0x4, %r12
xorl %ebp, %ebp
vsubsd %xmm0, %xmm2, %xmm2
vdivsd %xmm2, %xmm0, %xmm0
vmovsd (%rcx,%rax), %xmm2
vmulsd 0x20e805(%rip), %xmm2, %xmm2 # 0x45bcc0
vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovsd %xmm2, (%rsp)
cmpq %rbp, %r12
je 0x24d543
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x8(%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
addq $0x10, %rbp
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
jmp 0x24d4c5
movl 0x8(%rsp), %r12d
orq $0x8, %rbp
subq 0x10(%rsp), %r12
subq $0x1, %r12
jb 0x24d543
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq (%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
addq $0x10, %rbp
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
jmp 0x24d50b
movl 0xc(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x24cc2b
testb %al, %al
je 0x24d584
vmovapd 0x20(%rsp), %xmm0
movq 0x68(%rbx), %rcx
movq 0x18(%rsp), %rdx
vmovmskpd %xmm0, %eax
shlq $0x3f, %rax
xorq (%rcx,%rdx,8), %rax
shrq $0x3f, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20ac53(%rip), %rdi # 0x4581de
leaq 0x20ed8a(%rip), %rsi # 0x45c31c
leaq 0x20c9f3(%rip), %rdx # 0x459f8c
leaq 0x20ed9b(%rip), %rcx # 0x45c33b
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<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 $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x25483c
movq %rax, 0x20(%rdi)
movq 0x20(%rsp), %rcx
leaq 0x18(%rdi), %rax
movq %rdi, 0x28(%rsp)
xorl %ebp, %ebp
movq %rax, 0x18(%rsp)
movl 0x78(%rcx), %r12d
leaq 0x10(%rcx), %rax
movq %rax, 0x30(%rsp)
cmpq %r12, %rbp
je 0x2548dd
movq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r13
xorl %ebx, %ebx
cmpq %r15, %r13
je 0x254899
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0x254880
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rcx
movl (%rcx,%rbp,8), %eax
subl %ebx, %eax
jle 0x2548b7
shlq $0x20, %rax
orq %rbp, %rax
movq %rax, 0x8(%rsp)
jmp 0x2548c9
subl 0x4(%rcx,%rbp,8), %ebx
jle 0x2548d8
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0x25485e
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<double>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, double, double, double, double)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
leaq 0x10(%rdi), %rax
vmovsd %xmm3, 0x50(%rsp)
vmovsd %xmm2, 0x30(%rsp)
vmovsd %xmm1, 0x28(%rsp)
vmovsd %xmm0, 0x20(%rsp)
movq %rcx, 0x38(%rsp)
movq %rsi, %r12
movq %rdi, %r13
movq %rax, 0x18(%rsp)
xorl %eax, %eax
cmpq 0x38(%rsp), %rdx
je 0x25d354
movslq (%rdx), %rbp
cmpl 0x78(%r13), %ebp
jge 0x25d365
movq 0x18(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movq %rdx, 0x48(%rsp)
movl %ebp, %edx
movq %rax, 0x40(%rsp)
callq 0x3de66
vmovsd 0x30(%rsp), %xmm0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0x25b178
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0x25b196
movl %eax, %r15d
shlq $0x4, %r15
movl %eax, %ebx
xorl %r14d, %r14d
cmpq %r14, %r15
je 0x25d2ec
movq 0x58(%r13), %rax
movq 0x70(%r13), %rdi
movq %r12, %rdx
movl 0x8(%rax,%r14), %esi
callq 0x73084
movq 0x58(%r13), %rax
vmovsd 0x50(%rsp), %xmm1
vfmadd213sd (%rax,%r14), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rax,%r14)
addq $0x10, %r14
jmp 0x25d2b6
movq 0x58(%r13), %rdi
movq 0x8(%r13), %rdx
movslq %ebx, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x25b26c
movq 0x60(%r13), %rax
movq %r13, %rdi
movl %ebx, %esi
movl (%rax,%rbp,8), %edx
movl 0x4(%rax,%rbp,8), %ecx
callq 0x25b2a0
vmovsd 0x20(%rsp), %xmm0
vmovsd 0x28(%rsp), %xmm1
movq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %eax, %r8d
movl %ebx, %r9d
callq 0x25b308
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rdx
orb %al, %cl
addq $0x8, %rdx
movq %rcx, %rax
jmp 0x25d24a
andb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1fae72(%rip), %rdi # 0x4581de
leaq 0x1fd107(%rip), %rsi # 0x45a47a
leaq 0x203c5b(%rip), %rdx # 0x460fd5
leaq 0x203cf2(%rip), %rcx # 0x461073
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
bool baryonyx::itm::affect<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, true>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, double>(baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, true>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, double, double)
|
bool
affect(Solver& slv,
Xtype& x,
Iterator it,
int k,
int selected,
int r_size,
const Float kappa,
const Float delta)
{
constexpr Float one{ 1 };
constexpr Float two{ 2 };
constexpr Float middle{ (two + one) / two };
const auto old_pi = slv.pi[k];
auto d = delta;
if (selected < 0) {
// slv.pi[k] += slv.R[0].value / two;
d += (kappa / (one - kappa)) * (slv.R[0].value / two);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
} else if (selected + 1 >= r_size) {
// slv.pi[k] += slv.R[selected].value * middle;
d += (kappa / (one - kappa)) * (slv.R[selected].value * middle);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
} else {
slv.pi[k] +=
((slv.R[selected].value + slv.R[selected + 1].value) / two);
d += (kappa / (one - kappa)) *
(slv.R[selected + 1].value - slv.R[selected].value);
int i = 0;
for (; i <= selected; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
for (; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
}
// TODO job: develops is_valid_constraint for all the solvers
bx_expects(is_valid_constraint(slv, k, x));
return is_signbit_change(old_pi, slv.pi[k]);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x68(%rbx), %rax
movslq %ecx, %rdi
movq %rdx, %r15
movq %rsi, %r14
movl %ecx, 0xc(%rsp)
movq %rdi, 0x18(%rsp)
vmovsd (%rax,%rdi,8), %xmm3
vmovapd %xmm3, 0x20(%rsp)
testl %r8d, %r8d
js 0x262d7d
leal 0x1(%r8), %ecx
cmpl %r9d, %ecx
jge 0x262dec
movq 0x58(%rbx), %rsi
movl %r8d, %edx
shlq $0x4, %rdx
movl %ecx, %ebp
movq %rbp, 0x10(%rsp)
shlq $0x4, %rbp
xorl %r13d, %r13d
movl %r9d, 0x8(%rsp)
vmovsd (%rsi,%rdx), %xmm2
vaddsd (%rsi,%rbp), %xmm2, %xmm2
vmulsd 0x1f5c64(%rip), %xmm2, %xmm2 # 0x458978
vaddsd %xmm2, %xmm3, %xmm2
vmovsd %xmm2, (%rax,%rdi,8)
vmovsd 0x1f1313(%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 0x262e5f
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x8(%rax,%r13), %r12
movl 0x4(%r15,%r12,8), %esi
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
addq $0x10, %r13
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
jmp 0x262d41
vmovsd 0x1f12b3(%rip), %xmm2 # 0x454038
movq 0x58(%rbx), %rax
movl %r9d, %r12d
shlq $0x4, %r12
xorl %ebp, %ebp
vsubsd %xmm0, %xmm2, %xmm2
vdivsd %xmm2, %xmm0, %xmm0
vmovsd (%rax), %xmm2
vmulsd 0x1f5bd2(%rip), %xmm2, %xmm2 # 0x458978
vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovsd %xmm2, (%rsp)
cmpq %rbp, %r12
je 0x262ea5
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x8(%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
addq $0x10, %rbp
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
jmp 0x262db0
vmovsd 0x1f1244(%rip), %xmm2 # 0x454038
movq 0x58(%rbx), %rcx
movl %r8d, %eax
shlq $0x4, %rax
movl %r9d, %r12d
shlq $0x4, %r12
xorl %ebp, %ebp
vsubsd %xmm0, %xmm2, %xmm2
vdivsd %xmm2, %xmm0, %xmm0
vmovsd (%rcx,%rax), %xmm2
vmulsd 0x1f8ea3(%rip), %xmm2, %xmm2 # 0x45bcc0
vfmadd213sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovsd %xmm2, (%rsp)
cmpq %rbp, %r12
je 0x262ea5
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x8(%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovsd (%rsp), %xmm0
addq $0x10, %rbp
vaddsd (%rcx,%rax,8), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
jmp 0x262e27
movl 0x8(%rsp), %r12d
orq $0x8, %rbp
subq 0x10(%rsp), %r12
subq $0x1, %r12
jb 0x262ea5
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq (%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
addq $0x10, %rbp
vmovsd (%rcx,%rax,8), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
jmp 0x262e6d
movl 0xc(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x262231
testb %al, %al
je 0x262ee6
vmovapd 0x20(%rsp), %xmm0
movq 0x68(%rbx), %rcx
movq 0x18(%rsp), %rdx
vmovmskpd %xmm0, %eax
shlq $0x3f, %rax
xorq (%rcx,%rdx,8), %rax
shrq $0x3f, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f52f1(%rip), %rdi # 0x4581de
leaq 0x1f9428(%rip), %rsi # 0x45c31c
leaq 0x1f7091(%rip), %rdx # 0x459f8c
leaq 0x1f9439(%rip), %rcx # 0x45c33b
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, true>::push_and_compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, double, double, double, double)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, 0x40(%rsp)
leaq 0x60(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x50(%rsp), %r9
movq %rdx, %rbx
vmovsd %xmm3, 0x38(%rsp)
movq %rsi, %r14
movq %rdi, %r12
leaq 0x1f7a63(%rip), %rdx # 0x45c33f
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
movq %rbx, 0x30(%rsp)
xorl %esi, %esi
movq %rax, 0x20(%rsp)
movq (%rbx), %rax
pushq $0x16
popq %r13
leaq 0x1fee2d(%rip), %rbp # 0x46373e
pushq $0x8
popq %rbx
movq %r14, 0x28(%rsp)
movq 0x40(%rsp), %rcx
cmpq (%rcx), %rax
je 0x264abf
movl -0x4(%rax), %edx
movl %edx, 0x8(%rsp)
cmpl 0x78(%r12), %edx
jge 0x264ad4
movq %rsi, 0x48(%rsp)
movq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x3de66
vmovsd 0x50(%rsp), %xmm0
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r12, %rdi
callq 0x262b1c
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x262b3a
vmovsd 0x38(%rsp), %xmm1
movl %eax, %r15d
movq 0x58(%r12), %rdi
movq 0x70(%r12), %rax
movl %r15d, %ecx
shlq $0x4, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x2649bb
movslq 0x8(%rdi,%rdx), %rsi
movq 0x8(%rax), %r8
vmovsd (%r8,%rsi,8), %xmm0
vfmadd213sd (%rdi,%rdx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rdi,%rdx)
addq $0x10, %rdx
jmp 0x264996
movq 0x8(%r12), %rdx
movslq %r15d, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x262c00
movslq 0x8(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r15d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x262c34
movslq 0x8(%rsp), %r8
movl %eax, 0xc(%rsp)
leaq 0x1fc64a(%rip), %rdx # 0x461045
leaq 0x8(%rsp), %rcx
movq %r12, %rdi
movq %r13, %rsi
shlq $0x3, %r8
addq 0x60(%r12), %r8
callq 0xb91c2
movl %r15d, %eax
sarl $0x1f, %eax
xorl %r13d, %r13d
andnl %r15d, %eax, %r14d
shlq $0x4, %r14
cmpq %r13, %r14
je 0x264a4c
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x8(%rcx,%r13), %r8
addq %r13, %rcx
callq 0xefe5a
addq $0x10, %r13
jmp 0x264a26
movslq 0x8(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %r13
leaq 0x1fc5f3(%rip), %rdx # 0x46105c
leaq 0xc(%rsp), %r8
movq %r13, %rsi
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x28(%rsp), %r14
movq 0x18(%rsp), %rdx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movq %r12, %rdi
movl %r15d, %r9d
movq %r14, %rsi
callq 0x262c9c
movq 0x48(%rsp), %rsi
movq 0x30(%rsp), %rcx
orb %al, %sil
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x264919
andb $0x1, %sil
movl %esi, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f3703(%rip), %rdi # 0x4581de
leaq 0x1f5998(%rip), %rsi # 0x45a47a
leaq 0x1fc4ec(%rip), %rdx # 0x460fd5
leaq 0x1fc583(%rip), %rcx # 0x461073
callq 0x2813f
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<double> const&, double)
|
result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3a8, %rsp # imm = 0x3A8
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x20(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x64935
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm1
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x28(%r12), %xmm0
vmovsd %xmm1, 0x30(%rsp)
vmovsd %xmm0, 0x70(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x60(%rsp)
vmovsd 0x8(%r12), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x266578
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 0x26196e
movl 0xcc(%r12), %esi
leaq 0x98(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x5c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x150(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x266659
cmpl $0x1, %eax
je 0x266633
cmpl $0x2, %eax
jne 0x26666a
movq 0x18(%r14), %rdx
leaq 0x150(%rsp), %rdi
leaq 0x20(%rsp), %rsi
jmp 0x266644
movq 0x18(%r14), %rdx
leaq 0x20(%rsp), %rdi
leaq 0x150(%rsp), %rsi
vmovsd 0x1ed9ec(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x78789
jmp 0x26666a
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x7871d
leaq 0x20(%rsp), %r15
movq %r13, 0x40(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x2666a0
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x26669c
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x266679
leaq 0x158(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x148(%rsp), %ecx
movl 0x14c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x8(%rsp)
leaq 0x1f3e9f(%rip), %rdx # 0x45a577
leaq 0x150(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x42b5a
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x261b36
vmovsd 0x8(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x20(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x26680b
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 0x261b78
movq 0x120(%rsp), %rdx
movq 0x138(%rsp), %rcx
movl %eax, %ebx
leaq 0x150(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x6c2be
testl %ebx, %ebx
je 0x2668b0
cmpl %ebp, %ebx
jge 0x2667a7
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x2677d8
movl %ebx, %ebp
cmpq 0x50(%rsp), %r15
jle 0x2667dd
vcvtsi2sd %ebx, %xmm3, %xmm0
vcvtsi2sdl 0x148(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x2667e3
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x26680b
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x267810
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x26680b
incq %r15
jmp 0x266726
movq 0x10(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x26682d
movq 0x10(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x26685b
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 0x4f485
leaq 0x150(%rsp), %rdi
callq 0x42cbc
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x261fd8
leaq 0x80(%rsp), %rdi
callq 0x29066
leaq 0x28(%rsp), %rdi
callq 0x357fe
movq 0x10(%rsp), %rax
addq $0x3a8, %rsp # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x62f18
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x26778a
vmovsd 0x8(%rsp), %xmm0
leaq 0xd0(%rsp), %r15
leaq 0x20(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x1c(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x26681a
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 0x261d84
testl %eax, %eax
jne 0x26696e
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 0x26778a
movq %r14, %rdi
callq 0x267810
vmovsd 0x8(%rsp), %xmm0
testb %al, %al
jne 0x26681a
movl %ebx, 0x50(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x266a77
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 0x261b78
testl %eax, %eax
je 0x266a39
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x266a0c
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x148(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x60(%rsp), %xmm1
callq 0xb1f0
vmovsd 0x8(%rsp), %xmm1
vfmadd231sd 0x68(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x266a12
vmovsd 0x8(%rsp), %xmm0
vucomisd 0x70(%rsp), %xmm0
ja 0x266a77
movq %r14, %rdi
vmovsd %xmm0, 0x8(%rsp)
callq 0x267810
testb %al, %al
jne 0x266a71
vmovsd 0x8(%rsp), %xmm0
incl %ebx
jmp 0x26698d
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 0x26778a
vmovsd 0x8(%rsp), %xmm0
jmp 0x266a77
vmovsd 0x8(%rsp), %xmm0
movl 0x50(%rsp), %ebx
decl 0x1c(%rsp)
incl %ebx
jmp 0x2668f3
jmp 0x266abd
jmp 0x266a96
jmp 0x266abd
movq %rax, %r14
jmp 0x266acd
movq %rax, %r14
jmp 0x266ada
movq %rax, %r14
jmp 0x266ae7
movq %rax, %r14
jmp 0x266af4
movq %rax, %r14
jmp 0x266afe
jmp 0x266abd
jmp 0x266abd
jmp 0x266abd
leaq 0x158(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x266acd
leaq 0x150(%rsp), %rdi
movq %rax, %r14
callq 0x42cbc
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0x261fd8
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_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<double> const&, double)
|
result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp # imm = 0x158
vmovsd %xmm0, 0x40(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x18(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x80(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x64935
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm1
vmovsd %xmm0, 0x60(%rsp)
vmovsd 0x28(%r12), %xmm0
vmovsd %xmm1, 0x28(%rsp)
vmovsd %xmm0, 0x68(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x58(%rsp)
vmovsd 0x8(%r12), %xmm0
vmovsd %xmm0, 0x30(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vucomisd %xmm1, %xmm0
jbe 0x26727e
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 0x26196e
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 0x267358
cmpl $0x1, %eax
je 0x267335
cmpl $0x2, %eax
jne 0x267369
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rsi
jmp 0x267343
movq 0x18(%r14), %rdx
leaq 0x18(%rsp), %rdi
leaq 0x70(%rsp), %rsi
vmovsd 0x1ecced(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x78789
jmp 0x267369
leaq 0x18(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x7871d
leaq 0x18(%rsp), %r15
movq %r13, 0x38(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x26739e
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd (%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x26739a
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x267378
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 0x261b36
vmovsd (%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x18(%rsp), %rbx
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0x2674b1
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 0x261b78
movl %eax, %r13d
testl %eax, %eax
je 0x267549
cmpl %ebp, %r13d
jge 0x267450
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0x2679a4
movl %r13d, %ebp
cmpq 0x48(%rsp), %r15
jle 0x267486
vcvtsi2sd %r13d, %xmm3, %xmm0
vcvtsi2sdl 0x150(%rsp), %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x58(%rsp), %xmm1
callq 0xb1f0
vmovsd (%rsp), %xmm1
vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x26748b
vmovsd (%rsp), %xmm0
vucomisd 0x68(%rsp), %xmm0
ja 0x2674b1
movq %r14, %rdi
vmovsd %xmm0, (%rsp)
callq 0x2679dc
vmovsd (%rsp), %xmm0
testb %al, %al
jne 0x2674b1
incq %r15
jmp 0x2673f1
movq 0x8(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0x2674d3
movq 0x8(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x267501
movq 0x8(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x54(%rsp), %edx
movq %r14, %rdi
callq 0x4f485
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x261fd8
leaq 0x88(%rsp), %rdi
callq 0x29066
leaq 0x20(%rsp), %rdi
callq 0x357fe
movq 0x8(%rsp), %rax
addq $0x158, %rsp # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x40(%rsp), %xmm0
movq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x62f18
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x267956
vmovsd (%rsp), %xmm0
leaq 0xd8(%rsp), %r15
leaq 0x18(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x14(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x2674c0
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 0x261d84
testl %eax, %eax
jne 0x267605
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 0x267956
movq %r14, %rdi
callq 0x2679dc
vmovsd (%rsp), %xmm0
testb %al, %al
jne 0x2674c0
movl %ebx, 0x48(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x267706
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 0x261b78
testl %eax, %eax
je 0x2676ca
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x2676a0
vcvtsi2sd %eax, %xmm4, %xmm0
vcvtsi2sdl 0x150(%rsp), %xmm4, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x58(%rsp), %xmm1
callq 0xb1f0
vmovsd (%rsp), %xmm1
vfmadd231sd 0x60(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovapd %xmm1, %xmm0
jmp 0x2676a5
vmovsd (%rsp), %xmm0
vucomisd 0x68(%rsp), %xmm0
ja 0x267706
movq %r14, %rdi
vmovsd %xmm0, (%rsp)
callq 0x2679dc
testb %al, %al
jne 0x267701
vmovsd (%rsp), %xmm0
incl %ebx
jmp 0x267623
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 0x267956
vmovsd (%rsp), %xmm0
jmp 0x267706
vmovsd (%rsp), %xmm0
movl 0x48(%rsp), %ebx
decl 0x14(%rsp)
incl %ebx
jmp 0x26758b
jmp 0x267744
jmp 0x267720
jmp 0x267744
movq %rax, %r14
jmp 0x267754
movq %rax, %r14
jmp 0x267761
movq %rax, %r14
jmp 0x26776e
movq %rax, %r14
jmp 0x267778
jmp 0x267744
jmp 0x267744
jmp 0x267744
leaq 0x78(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0x267747
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0x261fd8
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_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long)
|
void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
}
|
vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2677d6
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x267850
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, true>, double, baryonyx::itm::minimize_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 0x1f2247(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, false>::solver_inequalities_01coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::default_cost_type<double> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&)
|
solver_inequalities_01coeff(random_engine& rng_,
int m_,
int n_,
const cost_type& c_,
const std::vector<merged_constraint>& csts)
: logger("solver_inequalities_01coeff")
, rng(rng_)
, ap(csts, m_, n_)
, P(std::make_unique<Float[]>(ap.size()))
, R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts)))
, b(std::make_unique<bound_factor[]>(m_))
, pi(std::make_unique<Float[]>(m_))
, c(c_)
, m(m_)
, n(n_)
{
for (int i = 0; i != m; ++i) {
#if !defined(BARYONYX_FULL_OPTIMIZATION)
// mscv 15.9.6 fail to build this line:
// for ([[maybe_unused]] const auto& cst : csts[i].elements)
// bx_ensures(cst.factor == 1);
for (const auto& cst : csts[i].elements)
bx_ensures(cst.factor == 1);
#endif
if (csts[i].min == csts[i].max) {
b[i].min = csts[i].min;
b[i].max = csts[i].max;
} else {
b[i].min = std::max(0, csts[i].min);
b[i].max = std::min(length(csts[i].elements), csts[i].max);
}
bx_ensures(b[i].min <= b[i].max);
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
andq $0x0, (%rdi)
leaq 0x10(%rdi), %rbx
movq %rsi, 0x8(%rdi)
movq %rdi, %r13
movq %r9, %r15
movq %r8, 0x20(%rsp)
movl %ecx, %r12d
movl %edx, %ebp
movq %r9, %rsi
movq %rbx, %rdi
callq 0x3a4ca
movl 0x38(%r13), %esi
leaq 0x50(%r13), %r14
movq %r14, %rdi
movq %rbx, 0x18(%rsp)
callq 0x2900a
movq %r15, %rdi
movq %r14, 0x10(%rsp)
leaq 0x58(%r13), %rbx
callq 0x3a89d
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2689b5
leaq 0x60(%r13), %rbx
movslq %ebp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2689f5
leaq 0x68(%r13), %rdi
movq %r14, %rsi
callq 0x2900a
movq 0x20(%rsp), %rax
movl %ebp, %edx
xorl %esi, %esi
movq %rax, 0x70(%r13)
movl %ebp, 0x78(%r13)
movl %r12d, 0x7c(%r13)
movq (%r15), %rax
movq 0x60(%r13), %rcx
cmpq %rdx, %rsi
je 0x26846d
imulq $0x28, %rsi, %rdi
movq (%rax,%rdi), %r9
leaq (%rax,%rdi), %r8
movq 0x8(%rax,%rdi), %rdi
movq %r9, %r10
cmpq %rdi, %r10
je 0x268407
cmpl $0x1, (%r10)
leaq 0x8(%r10), %r10
je 0x2683f6
jmp 0x26847c
movl 0x18(%r8), %r11d
cmpl 0x1c(%r8), %r11d
jne 0x26841a
movl %r11d, (%rcx,%rsi,8)
movl %r11d, %r10d
jmp 0x26843f
movl %r11d, %r10d
sarl $0x1f, %r10d
subq %r9, %rdi
andnl %r11d, %r10d, %r10d
shrq $0x3, %rdi
movl %r10d, (%rcx,%rsi,8)
movl 0x1c(%r8), %r8d
cmpl %edi, %r8d
cmovll %r8d, %edi
movl %edi, %r11d
movl %r11d, 0x4(%rcx,%rsi,8)
incq %rsi
cmpl %r11d, %r10d
jle 0x2683d9
leaq 0x1effd7(%rip), %rdi # 0x45842a
leaq 0x1f1e4f(%rip), %rsi # 0x45a2a9
leaq 0x1f8b74(%rip), %rdx # 0x460fd5
leaq 0x1f8bd9(%rip), %rcx # 0x461041
callq 0x2813f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1effa7(%rip), %rdi # 0x45842a
leaq 0x1f3dd1(%rip), %rsi # 0x45c25b
leaq 0x1f8b44(%rip), %rdx # 0x460fd5
leaq 0x1f2180(%rip), %rcx # 0x45a618
callq 0x2813f
movq %rbx, %rdi
movq %rax, %r15
callq 0x268a36
jmp 0x2684ad
movq %rax, %r15
movq 0x8(%rsp), %rdi
callq 0x268a50
jmp 0x2684bc
movq %rax, %r15
movq 0x10(%rsp), %rdi
callq 0x29066
jmp 0x2684cb
movq %rax, %r15
movq 0x18(%rsp), %rdi
callq 0x3a954
movq %r15, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, false> const&, baryonyx::bit_array const&)
|
int local_compute_violated_constraints(const Solver& slv, const Xtype& x)
{
int remaining = 0;
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
++remaining;
return remaining;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl 0x78(%r14), %r15d
je 0x269154
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x268bd3
xorb $0x1, %al
incl %r15d
movzbl %al, %eax
addl %eax, %ebp
jmp 0x269134
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<double>, false>, double, baryonyx::itm::minimize_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 0x1ebda5(%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_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::minimize_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 0x26e3ac
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 0x26e4d5
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0x26e4d5
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 0x26e4fc
cmpl $0x2, %eax
jne 0x26e54b
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x274ade
jmp 0x26e598
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 0x26e5c7
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x27445a
jmp 0x26e598
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x275162
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 0x26e633
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 0x26e655
jmp 0x26e655
leaq 0x68(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x20(%rsp), %rdi
callq 0x6d8d6
jmp 0x26e678
jmp 0x26e675
movq %rax, %r14
jmp 0x26e682
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
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true> const, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true> const&, baryonyx::bit_array const&)
|
int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x2700aa
movq %rax, 0x20(%rdi)
movq 0x20(%rsp), %rcx
leaq 0x18(%rdi), %rax
movq %rdi, 0x28(%rsp)
xorl %ebp, %ebp
movq %rax, 0x18(%rsp)
movl 0x78(%rcx), %r12d
leaq 0x10(%rcx), %rax
movq %rax, 0x30(%rsp)
cmpq %r12, %rbp
je 0x27014b
movq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x3c868
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r13
xorl %ebx, %ebx
cmpq %r15, %r13
je 0x270107
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0x2700ee
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rcx
movl (%rcx,%rbp,8), %eax
subl %ebx, %eax
jle 0x270125
shlq $0x20, %rax
orq %rbp, %rax
movq %rax, 0x8(%rsp)
jmp 0x270137
subl 0x4(%rcx,%rbp,8), %ebx
jle 0x270146
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0x2700cc
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true> const&, int, baryonyx::bit_array const&)
|
bool
is_valid_constraint(const Solver& slv, int k, const Xtype& x)
{
typename sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = slv.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += slv.factor(it->value) * x[it->column];
return slv.bound_min(k) <= v && v <= slv.bound_max(k);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
leaq 0x10(%rdi), %rsi
leaq 0x8(%rsp), %r15
movq %rdx, %r14
movq %rdi, %rbx
movl %ebp, %edx
movq %r15, %rdi
callq 0x3c868
movq (%r15), %r12
movq 0x8(%r15), %r13
xorl %r15d, %r15d
cmpq %r12, %r13
je 0x270220
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %r15d
addq $0x8, %r13
jmp 0x270206
movq 0x60(%rbx), %rcx
movslq %ebp, %rax
cmpl %r15d, (%rcx,%rax,8)
jle 0x270231
xorl %eax, %eax
jmp 0x270239
cmpl 0x4(%rcx,%rax,8), %r15d
setle %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, double, double, double)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, 0x40(%rsp)
movq %rdx, %rbx
leaq 0x60(%rsp), %rcx
leaq 0x58(%rsp), %r8
leaq 0x50(%rsp), %r9
leaq 0x1ec0d0(%rip), %rdx # 0x45c344
movq %rsi, %r14
movq %rdi, %r12
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
movq %rbx, 0x38(%rsp)
xorl %edx, %edx
movq %rax, 0x28(%rsp)
movq (%rbx), %rax
pushq $0x16
popq %r13
leaq 0x1f348f(%rip), %rbp # 0x46373e
pushq $0x8
popq %rbx
movq %r14, 0x30(%rsp)
movq 0x40(%rsp), %rcx
cmpq (%rcx), %rax
je 0x270420
movq %rdx, 0x48(%rsp)
movl -0x4(%rax), %edx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %edx, 0xc(%rsp)
callq 0x3de66
vmovsd 0x50(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x270abe
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0x270adc
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r14
movl %eax, 0x14(%rsp)
movq %r14, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x270bb2
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r14d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x270be6
movslq 0xc(%rsp), %r8
movl %eax, 0x10(%rsp)
leaq 0x1f0cec(%rip), %rdx # 0x461045
leaq 0xc(%rsp), %rcx
movq %r12, %rdi
movq %r13, %r15
movq %r13, %rsi
shlq $0x3, %r8
addq 0x60(%r12), %r8
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
xorl %r13d, %r13d
andnl %r14d, %eax, %r14d
shlq $0x4, %r14
cmpq %r13, %r14
je 0x2703ad
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x8(%rcx,%r13), %r8
addq %r13, %rcx
callq 0xefe5a
addq $0x10, %r13
jmp 0x270387
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
leaq 0x1f0c9e(%rip), %rdx # 0x46105c
leaq 0x10(%rsp), %r8
movq %r12, %rdi
movq %r15, %r13
movq %r15, %rsi
leaq 0x4(%rcx,%rax,8), %rcx
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x30(%rsp), %r14
movq 0x20(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
movl 0x14(%rsp), %r9d
movq %r12, %rdi
movq %r14, %rsi
callq 0x270c4e
movq 0x48(%rsp), %rdx
movq 0x38(%rsp), %rcx
orb %al, %dl
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x2702b7
andb $0x1, %dl
movl %edx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
bool baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, double, double, double)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x28(%rsp)
leaq 0x50(%rsp), %rcx
leaq 0x48(%rsp), %r8
leaq 0x40(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1ebede(%rip), %rdx # 0x45c344
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
leaq 0x1f32b6(%rip), %rbp # 0x46373e
movq %rax, 0x18(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x20(%rsp)
cmpq 0x28(%rsp), %r14
je 0x2705ef
movl (%r14), %edx
movq 0x18(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movq %rax, 0x30(%rsp)
movq %r14, 0x38(%rsp)
movl %edx, (%rsp)
callq 0x3de66
vmovsd 0x40(%rsp), %xmm0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x270abe
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x270adc
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movl %eax, %r15d
movq %r13, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x270bb2
movslq (%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x270be6
movslq (%rsp), %r8
movl %eax, 0x4(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1f0aff(%rip), %rdx # 0x461045
movq %rsp, %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %r13d
shlq $0x4, %r13
cmpq %r14, %r13
je 0x270586
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x8(%rcx,%r14), %r8
addq %r14, %rcx
callq 0xefe5a
addq $0x10, %r14
jmp 0x270560
movslq (%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1f0abb(%rip), %rdx # 0x46105c
leaq 0x4(%rsp), %r8
callq 0xb91c2
vmovsd 0x50(%rsp), %xmm0
vmovsd 0x48(%rsp), %xmm1
movq 0x20(%rsp), %r13
movq 0x10(%rsp), %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
movq %r12, %rdi
movl %r15d, %r9d
movq %r13, %rsi
callq 0x270c4e
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x270497
andb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
bool baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, double, double, double)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x28(%rsp)
leaq 0x50(%rsp), %rcx
leaq 0x48(%rsp), %r8
leaq 0x40(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1eba60(%rip), %rdx # 0x45c344
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
leaq 0x1f2e38(%rip), %rbp # 0x46373e
movq %rax, 0x18(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x20(%rsp)
cmpq 0x28(%rsp), %r14
je 0x270a6d
movl (%r14), %edx
movq 0x18(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movq %rax, 0x30(%rsp)
movq %r14, 0x38(%rsp)
movl %edx, (%rsp)
callq 0x3de66
vmovsd 0x40(%rsp), %xmm0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x270abe
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x270adc
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movl %eax, %r15d
movq %r13, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x270bb2
movslq (%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x270be6
movslq (%rsp), %r8
movl %eax, 0x4(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1f0681(%rip), %rdx # 0x461045
movq %rsp, %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %r13d
shlq $0x4, %r13
cmpq %r14, %r13
je 0x270a04
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x8(%rcx,%r14), %r8
addq %r14, %rcx
callq 0xefe5a
addq $0x10, %r14
jmp 0x2709de
movslq (%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1f063d(%rip), %rdx # 0x46105c
leaq 0x4(%rsp), %r8
callq 0xb91c2
vmovsd 0x50(%rsp), %xmm0
vmovsd 0x48(%rsp), %xmm1
movq 0x20(%rsp), %r13
movq 0x10(%rsp), %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
movq %r12, %rdi
movl %r15d, %r9d
movq %r13, %rsi
callq 0x270c4e
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x270915
andb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
int baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_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&)
|
int compute_reduced_costs(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
const Xtype& x) noexcept
{
int r_size = 0;
for (; begin != end; ++begin) {
Float sum_a_pi = 0;
Float sum_a_p = 0;
auto ht = ap.column(begin->column);
for (; std::get<0>(ht) != std::get<1>(ht); ++std::get<0>(ht)) {
sum_a_pi += pi[std::get<0>(ht)->row];
sum_a_p += P[std::get<0>(ht)->value];
}
R[r_size].id = r_size;
R[r_size].value = c(begin->column, x) - sum_a_pi - sum_a_p;
++r_size;
}
return r_size;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x10(%rdi), %rbp
movq %rcx, (%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
xorl %ebx, %ebx
cmpq %r14, %r15
je 0x270ba1
movl 0x4(%r15), %edx
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x3dede
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x50(%r13), %rdx
movq 0x68(%r13), %rsi
vxorpd %xmm0, %xmm0, %xmm0
vxorpd %xmm1, %xmm1, %xmm1
cmpq %rax, %rcx
je 0x270b52
movslq 0x4(%rcx), %rdi
vaddsd (%rsi,%rdi,8), %xmm0, %xmm0
movslq (%rcx), %rdi
addq $0x8, %rcx
vaddsd (%rdx,%rdi,8), %xmm1, %xmm1
movq %rcx, 0x20(%rsp)
jmp 0x270b31
movq 0x58(%r13), %rax
movq %rbx, %r12
shlq $0x4, %r12
movq (%rsp), %rdx
vmovsd %xmm0, 0x8(%rsp)
vmovsd %xmm1, 0x10(%rsp)
movl %ebx, 0x8(%rax,%r12)
movq 0x70(%r13), %rdi
movl 0x4(%r15), %esi
callq 0x73084
vsubsd 0x8(%rsp), %xmm0, %xmm0
movq 0x58(%r13), %rax
incq %rbx
addq $0x8, %r15
vsubsd 0x10(%rsp), %xmm0, %xmm0
vmovsd %xmm0, (%rax,%r12)
jmp 0x270afd
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::rc_data*>(baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true>::rc_data*, baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_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 0x270ef4
vmovsd (%rdi), %xmm0
leaq 0x10(%rsi), %r15
vucomisd (%rsi), %xmm0
movq %r15, %rsi
jne 0x270ee0
jnp 0x270ec8
addq $-0x10, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x271413
movq %r15, %rdi
jmp 0x270ec4
movq %rbx, %rdx
callq 0x271413
popq %rbx
popq %r14
popq %r15
retq
jmp 0x270f04
movq %rax, %rdi
callq 0xeb9f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_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 objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $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 0x1e9ab1(%rip), %rdx # 0x45c33f
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
leaq 0x1f0e8e(%rip), %rbp # 0x46373e
movq %rbx, 0x30(%rsp)
xorl %esi, %esi
movq %rax, 0x28(%rsp)
movq (%rbx), %rax
pushq $0x8
popq %rbx
movq 0x38(%rsp), %rcx
cmpq (%rcx), %rax
je 0x272a71
movl -0x4(%rax), %edx
movl %edx, 0xc(%rsp)
cmpl 0x78(%r12), %edx
jge 0x272a86
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 0x270abe
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x270adc
movl %eax, %r13d
shlq $0x4, %r13
xorl %r14d, %r14d
movl %eax, 0x10(%rsp)
cmpq %r14, %r13
je 0x27296a
movq 0x58(%r12), %rax
movq 0x70(%r12), %rdi
movq %r15, %rdx
movl 0x8(%rax,%r14), %esi
callq 0x73084
movq 0x58(%r12), %rax
vmovsd 0x48(%rsp), %xmm1
vfmadd213sd (%rax,%r14), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rax,%r14)
addq $0x10, %r14
jmp 0x272931
movl 0x10(%rsp), %r14d
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %r14d, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x270bb2
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r14d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x270be6
movslq 0xc(%rsp), %r8
movl %eax, 0x14(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1ee682(%rip), %rdx # 0x461045
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
andnl %r14d, %eax, %r13d
xorl %r14d, %r14d
shlq $0x4, %r13
cmpq %r14, %r13
je 0x272a05
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x8(%rcx,%r14), %r8
addq %r14, %rcx
callq 0xefe5a
addq $0x10, %r14
jmp 0x2729df
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1ee63b(%rip), %rdx # 0x46105c
leaq 0x14(%rsp), %r8
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl 0x14(%rsp), %r8d
movl 0x10(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x270c4e
movq 0x40(%rsp), %rsi
movq 0x30(%rsp), %rcx
orb %al, %sil
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x2728c2
andb $0x1, %sil
movl %esi, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e5751(%rip), %rdi # 0x4581de
leaq 0x1e79e6(%rip), %rsi # 0x45a47a
leaq 0x1ee53a(%rip), %rdx # 0x460fd5
leaq 0x1ee5d1(%rip), %rcx # 0x461073
callq 0x2813f
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
bool baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_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 objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $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 0x1e961b(%rip), %rdx # 0x45c33f
vmovsd %xmm0, (%rcx)
vmovsd %xmm1, (%r8)
vmovsd %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xefd10
leaq 0x10(%r12), %rax
leaq 0x1f09f8(%rip), %rbp # 0x46373e
movq %rax, 0x28(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
cmpq 0x30(%rsp), %r14
je 0x272efd
movl (%r14), %edx
movl %edx, 0xc(%rsp)
cmpl 0x78(%r12), %edx
jge 0x272f0e
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 0x270abe
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x270adc
movl %eax, %r14d
shlq $0x4, %r14
xorl %r13d, %r13d
movl %eax, 0x10(%rsp)
cmpq %r13, %r14
je 0x272dfa
movq 0x58(%r12), %rax
movq 0x70(%r12), %rdi
movq %r15, %rdx
movl 0x8(%rax,%r13), %esi
callq 0x73084
movq 0x58(%r12), %rax
vmovsd 0x48(%rsp), %xmm1
vfmadd213sd (%rax,%r13), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd %xmm0, (%rax,%r13)
addq $0x10, %r13
jmp 0x272dc1
movl 0x10(%rsp), %r14d
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %r14d, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x270bb2
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r14d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x270be6
movslq 0xc(%rsp), %r8
movl %eax, 0x14(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1ee1f2(%rip), %rdx # 0x461045
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
xorl %r13d, %r13d
andnl %r14d, %eax, %r14d
shlq $0x4, %r14
cmpq %r13, %r14
je 0x272e95
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x8(%rcx,%r13), %r8
addq %r13, %rcx
callq 0xefe5a
addq $0x10, %r13
jmp 0x272e6f
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1ee1ab(%rip), %rdx # 0x46105c
leaq 0x14(%rsp), %r8
callq 0xb91c2
vmovsd 0x60(%rsp), %xmm0
vmovsd 0x58(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl 0x14(%rsp), %r8d
movl 0x10(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x270c4e
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %r14
orb %al, %cl
addq $0x8, %r14
movq %rcx, %rax
jmp 0x272d50
andb $0x1, %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e52c9(%rip), %rdi # 0x4581de
leaq 0x1e755e(%rip), %rsi # 0x45a47a
leaq 0x1ee0b2(%rip), %rdx # 0x460fd5
leaq 0x1ee149(%rip), %rcx # 0x461073
callq 0x2813f
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, true>, double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::none_observer>::store_if_better(baryonyx::bit_array const&, double, long)
|
void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
}
|
vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x275974
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2759ee
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, false>, double, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<double>, baryonyx::none_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1ddd5f(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::result baryonyx::itm::optimize_problem<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&)
|
inline result
optimize_problem(const context& ctx, const problem& pb)
{
result r;
if (ctx.start)
ctx.start(ctx.parameters);
auto constraints{ make_merged_constraints(ctx, pb) };
if (constraints.empty() || pb.vars.values.empty()) {
r.status = result_status::success;
r.solutions.resize(1);
r.solutions.back().value = pb.objective.value;
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
return r;
}
random_engine rng(init_random_generator_seed(ctx));
auto variables = length(pb.vars.values);
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
const auto thread = get_thread_number(ctx);
std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors;
std::vector<std::thread> pool(thread);
best_solution_recorder<Cost, Float, Mode> best_recorder(
rng,
thread,
cost,
cost_constant,
variables,
constraints,
ctx.parameters.init_population_size);
auto seeds = generate_seed(rng, thread);
std::atomic_bool stop_task;
stop_task.store(false);
for (unsigned i = 0u; i != thread; ++i)
functors.emplace_back(ctx, i, seeds[i]);
for (unsigned i = 0u; i != thread; ++i)
pool[i] = std::thread(std::ref(functors[i]),
std::ref(stop_task),
std::ref(best_recorder),
std::cref(constraints),
variables,
std::cref(cost),
cost_constant);
const auto start = std::chrono::steady_clock::now();
auto end = start;
do {
std::this_thread::sleep_for(std::chrono::seconds{ 1L });
if (ctx.update) {
auto call_number = 0L;
for (auto i = 0u; i != thread; ++i)
call_number += functors[i].m_call_number;
int constraints_remaining;
long int loop;
double value;
double duration;
best_recorder.get_best(
constraints_remaining, value, duration, loop);
ctx.update(
constraints_remaining, value, loop, duration, call_number);
}
end = std::chrono::steady_clock::now();
} while (!is_time_limit(ctx.parameters.time_limit, start, end));
stop_task.store(true);
for (auto& t : pool)
t.join();
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
r.variables = variables;
r.constraints = length(constraints);
const auto& first = best_recorder.get_best(0);
if (!first.is_solution())
r.status = result_status::time_limit_reached;
else
r.status = result_status::success;
r.duration = first.duration;
r.loop = first.loop;
r.remaining_constraints = first.remaining_constraints;
switch (ctx.parameters.storage) {
case solver_parameters::storage_type::one: {
r.solutions.resize(1);
convert(first, r.solutions[0], variables);
} break;
case solver_parameters::storage_type::bound: {
r.solutions.resize(2);
convert(first, r.solutions[0], variables);
convert(best_recorder.get_worst(), r.solutions[1], variables);
} break;
case solver_parameters::storage_type::five: {
r.solutions.resize(5);
for (int i = 0; i != 5; ++i)
convert(best_recorder.get_best(i), r.solutions[i], variables);
} break;
}
best_recorder.show_population(ctx);
if (ctx.finish)
ctx.finish(r);
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp # imm = 0x188
vxorpd %xmm0, %xmm0, %xmm0
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
cmpq $0x0, 0x128(%rsi)
je 0x27bdbd
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 0x27bf19
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x27bf19
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0x60(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x8adb0
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x70(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0x8ae24
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x70(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x98(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0x27bf74
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x27d042
movl 0x8(%rsp), %eax
incl %eax
jmp 0x27bef0
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 0x27c309
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 0x27c035
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 0x27d08e
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 0x27bf94
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 0x27c0ca
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x27c08b
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x27c075
leaq 0xd0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x93ba8
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x20(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movl 0x18(%rsp), %esi
movq %r12, %rdi
movq %r14, %rcx
callq 0x35736
callq 0xb5a0
vmovsd (%r13), %xmm0
subq %rbx, %rax
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm0, %xmm1
vcvtsi2sd %rax, %xmm2, %xmm1
vdivsd 0x1dd993(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x27c050
vucomisd %xmm0, %xmm1
jbe 0x27c050
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x27c12b
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x27c118
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 0x27c286
cmpl $0x1, %eax
je 0x27c24e
cmpl $0x2, %eax
jne 0x27c2a5
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x27c2a5
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 0x27c214
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x35781
leaq 0xd0(%rsp), %rdi
callq 0x93c26
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x27c299
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x35781
leaq 0xc8(%rsp), %rdi
movq %r13, %rsi
callq 0x8af88
cmpq $0x0, 0x168(%r13)
je 0x27c2d1
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0x8af9c
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x2828da
leaq 0x68(%rsp), %rdi
callq 0x8affa
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x188, %rsp # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x27c36a
movq %rax, %rbx
jmp 0x27c377
movq %rax, %rbx
jmp 0x27c384
jmp 0x27c34e
jmp 0x27c33f
jmp 0x27c35d
jmp 0x27c35d
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x27c3a2
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x27c398
jmp 0x27c35d
jmp 0x27c35d
jmp 0x27c35d
jmp 0x27c35d
jmp 0x27c35d
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0x8af9c
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x2828da
leaq 0x68(%rsp), %rdi
callq 0x8affa
leaq 0x48(%rsp), %rdi
callq 0x35858
movq 0x10(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
|
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
|
baryonyx::itm::optimize_functor<baryonyx::itm::solver_inequalities_01coeff<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>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<long double>, long double, baryonyx::itm::maximize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double)
|
void operator()(const std::atomic_bool& stop_task,
best_solution_recorder<Cost, Float, Mode>& best_recorder,
const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
bit_array x(variables);
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_local_ctx.rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const auto w_limit = static_cast<long int>(p.w);
Solver slv(m_local_ctx.rng,
length(constraints),
variables,
norm_costs,
constraints);
compute_order compute(p.order, variables);
bool is_a_solution = false;
while (!stop_task.load()) {
++m_call_number;
const auto kappa_start = static_cast<Float>(best_recorder.reinit(
m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x));
auto kappa = kappa_start;
compute.init(slv, x);
auto best_remaining = INT_MAX;
is_a_solution = false;
for (long int i = 0; !stop_task.load() && i != p.limit; ++i) {
auto remaining =
compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
i);
best_remaining = 0;
is_a_solution = true;
break;
} else {
best_remaining = std::min(remaining, best_remaining);
}
if (i > w_limit)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
if (best_remaining > 0) {
best_recorder.try_advance(
m_local_ctx, x, best_remaining, p.limit);
continue;
}
for (int push = 0; !stop_task.load() && push < p.pushes_limit;
++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_local_ctx.rng,
pushing_k_factor,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
is_a_solution = true;
}
kappa = kappa_start;
for (int iter = 0;
!stop_task.load() && iter < p.pushing_iteration_limit;
++iter) {
remaining = compute.run(
slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
is_a_solution = true;
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
}
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp # imm = 0x1E8
movq %rdi, %rbp
leaq 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 0x27d523
movq 0xb8(%rsp), %rax
movq (%rax), %rdi
leaq 0xc0(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x8d304
fstpt 0x9c(%rsp)
jmp 0x27d53c
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 0x27da08
movl 0xcc(%r13), %esi
leaq 0x130(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq $0x0, 0x58(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x27d970
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 0x27dbd0
fldt 0xd0(%rsp)
fldt 0x4c(%rsp)
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movb (%r15), %al
testb $0x1, %al
jne 0x27d705
cmpq 0xb0(%r13), %r14
je 0x27d705
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 0x27dc12
testl %eax, %eax
je 0x27d71f
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0x100(%rsp), %r14
jle 0x27d6e4
movl %eax, 0xb0(%rsp)
fildl 0xb0(%rsp)
movl 0x1e0(%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 0x27d6ee
fldt 0x4c(%rsp)
fldt 0x7c(%rsp)
fxch %st(1)
fldt 0xf4(%rsp)
fxch %st(2)
fucomi %st(2), %st
fstp %st(2)
ja 0x27d705
incq %r14
jmp 0x27d635
fstp %st(1)
testl %ebx, %ebx
jg 0x27d94e
movq $0x0, 0x58(%rsp)
leaq 0x60(%rsp), %rbx
jmp 0x27d75b
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 0x27d947
cmpl 0xbc(%r13), %r14d
jge 0x27d947
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 0x27de42
testl %eax, %eax
jne 0x27d801
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 0x27d8e5
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0x27d8e5
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 0x27dc12
testl %eax, %eax
je 0x27d8ee
vcvtsi2sd %r12d, %xmm2, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0x27d8c5
movl %eax, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x1e0(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xdc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xe8(%rsp)
fmulp %st, %st(1)
fldt 0x7c(%rsp)
faddp %st, %st(1)
fldt 0x4c(%rsp)
jmp 0x27d8cf
fldt 0x4c(%rsp)
fldt 0x7c(%rsp)
fxch %st(1)
fldt 0xf4(%rsp)
fxch %st(2)
fucomi %st(2), %st
fstp %st(2)
ja 0x27d8e5
incl %ebx
jmp 0x27d811
fstp %st(1)
leaq 0x60(%rsp), %rbx
jmp 0x27d93b
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 0x27d766
fstp %st(0)
jmp 0x27d5b0
fstp %st(0)
movq 0xb0(%r13), %r8
movq 0x70(%rsp), %rdi
leaq 0x60(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0x8d99a
jmp 0x27d5a7
leaq 0x130(%rsp), %rdi
callq 0x393ac
leaq 0x168(%rsp), %rdi
callq 0x27e0e6
leaq 0xc8(%rsp), %rdi
callq 0x8affa
leaq 0x68(%rsp), %rdi
callq 0x357fe
addq $0x1e8, %rsp # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27d9ba
movq %rax, %rbx
jmp 0x27d9dc
movq %rax, %rbx
jmp 0x27d9e9
movq %rax, %rbx
jmp 0x27d9f6
jmp 0x27d9cc
jmp 0x27d9cc
jmp 0x27d9cc
jmp 0x27d9cc
leaq 0x130(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0x168(%rsp), %rdi
callq 0x27e0e6
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
|
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array, long double>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double)
|
int run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta)
{
bool pi_changed = false;
int remaining = 0;
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.compute_update_row(
x, R.crbegin(), R.crend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
fldt 0xb0(%rsp)
fldt 0xa0(%rsp)
fldt 0x90(%rsp)
movl 0x30(%rdi), %eax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decl %eax
cmpl $0x6, %eax
ja 0x27dd33
leaq 0x1e3172(%rip), %rdx # 0x460dc0
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x68(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
fxch %st(2)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x27e3b4
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x27e2d7
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %r15, %rdx
fstpt 0x3c(%rsp)
callq 0x2800e5
jmp 0x27dda7
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
fstpt 0x3c(%rsp)
callq 0x27f80f
jmp 0x27dcf2
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
fstpt 0x3c(%rsp)
callq 0x27fc7a
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x27e7ca
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x27e9c4
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fxch %st(2)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
jmp 0x27dd7c
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %rcx, %rdx
fstpt 0x3c(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x27e5d0
jmp 0x27ddd0
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %r15, %rdx
fstpt 0x3c(%rsp)
callq 0x280639
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x27eaaa
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x27e2d7
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %rcx, %rdx
fstpt 0x3c(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x27e5d0
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x27eca4
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true> const, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true> const&, baryonyx::bit_array const&)
|
int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x27e216
movq %rax, 0x20(%rdi)
movq 0x20(%rsp), %rcx
leaq 0x18(%rdi), %rax
movq %rdi, 0x28(%rsp)
xorl %ebp, %ebp
movq %rax, 0x18(%rsp)
movl 0x78(%rcx), %r12d
leaq 0x10(%rcx), %rax
movq %rax, 0x30(%rsp)
cmpq %r12, %rbp
je 0x27e2b7
movq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x3c868
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r13
xorl %ebx, %ebx
cmpq %r15, %r13
je 0x27e273
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0x27e25a
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rcx
movl (%rcx,%rbp,8), %eax
subl %ebx, %eax
jle 0x27e291
shlq $0x20, %rax
orq %rbp, %rax
movq %rax, 0x8(%rsp)
jmp 0x27e2a3
subl 0x4(%rcx,%rbp,8), %ebx
jle 0x27e2b2
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0x27e238
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true> const&, baryonyx::bit_array const&, std::vector<int, std::allocator<int>>&)
|
int
compute_violated_constraints(const Solver& slv,
const Xtype& x,
std::vector<int>& out)
{
out.clear();
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
out.emplace_back(k);
return length(out);
}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdx), %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rax, 0x8(%rdx)
je 0x27e2f5
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x78(%r15), %esi
je 0x27e328
movq %r15, %rdi
movq %r14, %rdx
callq 0x27e33f
testb %al, %al
jne 0x27e320
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0x27e2fc
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true> const&, int, baryonyx::bit_array const&)
|
bool
is_valid_constraint(const Solver& slv, int k, const Xtype& x)
{
typename sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = slv.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += slv.factor(it->value) * x[it->column];
return slv.bound_min(k) <= v && v <= slv.bound_max(k);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
leaq 0x10(%rdi), %rsi
leaq 0x8(%rsp), %r15
movq %rdx, %r14
movq %rdi, %rbx
movl %ebp, %edx
movq %r15, %rdi
callq 0x3c868
movq (%r15), %r12
movq 0x8(%r15), %r13
xorl %r15d, %r15d
cmpq %r12, %r13
je 0x27e38c
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %r15d
addq $0x8, %r13
jmp 0x27e372
movq 0x60(%rbx), %rcx
movslq %ebp, %rax
cmpl %r15d, (%rcx,%rax,8)
jle 0x27e39d
xorl %eax, %eax
jmp 0x27e3a5
cmpl 0x4(%rcx,%rax,8), %r15d
setle %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, long double, long double, long double)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1ddd4e(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1e50fe(%rip), %rbp # 0x46373e
movq %rax, 0x38(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x40(%rsp)
cmpq 0x48(%rsp), %r14
je 0x27e7b5
movl (%r14), %edx
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq %r14, 0x58(%rsp)
movl %edx, 0x20(%rsp)
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x27ece4
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x27ed0a
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movl %eax, %r15d
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x27edd0
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x27ee04
movslq 0x20(%rsp), %r8
movl %eax, 0x24(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1e2943(%rip), %rdx # 0x461045
leaq 0x20(%rsp), %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %r13d
shlq $0x5, %r13
cmpq %r14, %r13
je 0x27e744
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r14), %r8
addq %r14, %rcx
callq 0x126d84
addq $0x20, %r14
jmp 0x27e71e
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1e28fc(%rip), %rdx # 0x46105c
leaq 0x24(%rsp), %r8
callq 0xb91c2
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %r8d
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movl %r15d, %r9d
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x27ee75
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x27e64f
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, long double, long double, long double)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1ddb54(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1e4f04(%rip), %rbp # 0x46373e
movq %rax, 0x38(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x40(%rsp)
cmpq 0x48(%rsp), %r14
je 0x27e9af
movl (%r14), %edx
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq %r14, 0x58(%rsp)
movl %edx, 0x20(%rsp)
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x27ece4
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x27ed0a
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movl %eax, %r15d
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x27edd0
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x27ee04
movslq 0x20(%rsp), %r8
movl %eax, 0x24(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1e2749(%rip), %rdx # 0x461045
leaq 0x20(%rsp), %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %r13d
shlq $0x5, %r13
cmpq %r14, %r13
je 0x27e93e
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r14), %r8
addq %r14, %rcx
callq 0x126d84
addq $0x20, %r14
jmp 0x27e918
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1e2702(%rip), %rdx # 0x46105c
leaq 0x24(%rsp), %r8
callq 0xb91c2
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %r8d
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movl %r15d, %r9d
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x27ee75
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x8, %r14
movq %rcx, %rax
jmp 0x27e849
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>&, baryonyx::bit_array const&)
|
int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x27e9e8
movq %rax, 0x20(%rdi)
movq 0x20(%rsp), %rcx
leaq 0x18(%rdi), %rax
movq %rdi, 0x28(%rsp)
xorl %ebp, %ebp
movq %rax, 0x18(%rsp)
movl 0x78(%rcx), %r12d
leaq 0x10(%rcx), %rax
movq %rax, 0x30(%rsp)
cmpq %r12, %rbp
je 0x27ea89
movq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r13
xorl %ebx, %ebx
cmpq %r15, %r13
je 0x27ea45
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0x27ea2c
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rcx
movl (%rcx,%rbp,8), %eax
subl %ebx, %eax
jle 0x27ea63
shlq $0x20, %rax
orq %rbp, %rax
movq %rax, 0x8(%rsp)
jmp 0x27ea75
subl 0x4(%rcx,%rbp,8), %ebx
jle 0x27ea84
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0x27ea0a
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, long double, long double, long double)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1dd874(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1e4c24(%rip), %rbp # 0x46373e
movq %rax, 0x38(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x40(%rsp)
cmpq 0x48(%rsp), %r14
je 0x27ec8f
movl (%r14), %edx
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq %r14, 0x58(%rsp)
movl %edx, 0x20(%rsp)
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x27ece4
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x27ed0a
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movl %eax, %r15d
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x27edd0
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x27ee04
movslq 0x20(%rsp), %r8
movl %eax, 0x24(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1e2469(%rip), %rdx # 0x461045
leaq 0x20(%rsp), %rcx
callq 0xb91c2
movl %r13d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r13d, %eax, %r13d
shlq $0x5, %r13
cmpq %r14, %r13
je 0x27ec1e
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r14), %r8
addq %r14, %rcx
callq 0x126d84
addq $0x20, %r14
jmp 0x27ebf8
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1e2422(%rip), %rdx # 0x46105c
leaq 0x24(%rsp), %r8
callq 0xb91c2
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %r8d
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movl %r15d, %r9d
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x27ee75
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x27eb29
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true> const&, baryonyx::bit_array const&)
|
int local_compute_violated_constraints(const Solver& slv, const Xtype& x)
{
int remaining = 0;
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
++remaining;
return remaining;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl 0x78(%r14), %r15d
je 0x27ecd6
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x27e33f
xorb $0x1, %al
incl %r15d
movzbl %al, %eax
addl %eax, %ebp
jmp 0x27ecb6
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::decrease_preference(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, long double)
|
void decrease_preference(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
Float theta) noexcept
{
for (; begin != end; ++begin)
P[begin->value] *= theta;
}
|
fldt 0x8(%rsp)
movq 0x50(%rdi), %rax
cmpq %rdx, %rsi
je 0x27ed06
movslq (%rsi), %rcx
addq $0x8, %rsi
shlq $0x4, %rcx
fldt (%rax,%rcx)
fmul %st(1), %st
fstpt (%rax,%rcx)
jmp 0x27ecec
fstp %st(0)
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::select_variables(int, int, int)
|
int select_variables(const int r_size, int bkmin, int bkmax)
{
if (bkmin == bkmax)
return std::min(bkmin, r_size) - 1;
bkmin = std::min(bkmin, r_size);
bkmax = std::min(bkmax, r_size);
for (int i = bkmin; i <= bkmax; ++i)
if (stop_iterating<Mode>(R[i].value, rng))
return i - 1;
return bkmax - 1;
}
|
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpl %ecx, %edx
jne 0x27ee1e
cmpl %edx, %esi
cmovll %esi, %edx
movl %edx, %ebx
jmp 0x27ee63
cmpl %ecx, %esi
movl %ecx, %ebx
movq %rdi, %r14
cmovll %esi, %ebx
cmpl %esi, %edx
cmovll %edx, %esi
movslq %ebx, %r12
movslq %esi, %r15
movq %r15, %r13
shlq $0x5, %r13
cmpq %r12, %r15
jg 0x27ee63
movq 0x8(%r14), %rdi
movq 0x58(%r14), %rax
fldt (%rax,%r13)
fstpt (%rsp)
callq 0x9098a
testb %al, %al
jne 0x27ee60
incq %r15
addq $0x20, %r13
jmp 0x27ee3a
movl %r15d, %ebx
decl %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, long double, long double, long double, long double)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1db509(%rip), %rdx # 0x45c33f
fldt 0x110(%rsp)
fstpt 0x64(%rsp)
fldt 0x100(%rsp)
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fstpt 0x90(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
pushq $0x19
popq %rsi
leaq 0x90(%rsp), %rcx
leaq 0x80(%rsp), %r8
leaq 0x70(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1e28ad(%rip), %rbp # 0x46373e
movq %rax, 0x38(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x40(%rsp)
cmpq 0x48(%rsp), %r14
je 0x28104b
movl (%r14), %edx
movl %edx, 0x20(%rsp)
cmpl 0x78(%r12), %edx
jge 0x28105f
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rax, 0x50(%rsp)
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x70(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x27ece4
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x27ed0a
movl %eax, %r15d
movq 0x58(%r12), %rdi
movq 0x70(%r12), %rax
fldt 0x64(%rsp)
movl %r15d, %ecx
shlq $0x5, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x280f3f
movslq 0x10(%rdi,%rdx), %rsi
movq 0x8(%rax), %r8
shlq $0x4, %rsi
fldt (%r8,%rsi)
fmul %st(1), %st
fldt (%rdi,%rdx)
faddp %st, %st(1)
fstpt (%rdi,%rdx)
addq $0x20, %rdx
jmp 0x280f19
fstp %st(0)
movq 0x8(%r12), %rdx
movslq %r15d, %rsi
movq %r14, 0x58(%rsp)
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x27edd0
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r15d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x27ee04
movslq 0x20(%rsp), %r8
movl %eax, 0x24(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1e00b0(%rip), %rdx # 0x461045
leaq 0x20(%rsp), %rcx
callq 0xb91c2
movl %r15d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r15d, %eax, %r13d
shlq $0x5, %r13
cmpq %r14, %r13
je 0x280fd7
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r14), %r8
addq %r14, %rcx
callq 0x126d84
addq $0x20, %r14
jmp 0x280fb1
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1e0069(%rip), %rdx # 0x46105c
leaq 0x24(%rsp), %r8
callq 0xb91c2
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %r8d
fldt 0x90(%rsp)
fldt 0x80(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movl %r15d, %r9d
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x27ee75
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x280ea0
andb $0x1, %al
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d7178(%rip), %rdi # 0x4581de
leaq 0x1d940d(%rip), %rsi # 0x45a47a
leaq 0x1dff61(%rip), %rdx # 0x460fd5
leaq 0x1dfff8(%rip), %rcx # 0x461073
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, 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>>>>, long double, long double, long double, long double)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1db299(%rip), %rdx # 0x45c33f
fldt 0x110(%rsp)
fstpt 0x64(%rsp)
fldt 0x100(%rsp)
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fstpt 0x90(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
pushq $0x19
popq %rsi
leaq 0x90(%rsp), %rcx
leaq 0x80(%rsp), %r8
leaq 0x70(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1e263d(%rip), %rbp # 0x46373e
movq %rax, 0x38(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x40(%rsp)
cmpq 0x48(%rsp), %r14
je 0x2812bb
movl (%r14), %edx
movl %edx, 0x20(%rsp)
cmpl 0x78(%r12), %edx
jge 0x2812cf
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rax, 0x50(%rsp)
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x70(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x27ece4
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x27ed0a
movl %eax, %r15d
movq 0x58(%r12), %rdi
movq 0x70(%r12), %rax
fldt 0x64(%rsp)
movl %r15d, %ecx
shlq $0x5, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x2811af
movslq 0x10(%rdi,%rdx), %rsi
movq 0x8(%rax), %r8
shlq $0x4, %rsi
fldt (%r8,%rsi)
fmul %st(1), %st
fldt (%rdi,%rdx)
faddp %st, %st(1)
fstpt (%rdi,%rdx)
addq $0x20, %rdx
jmp 0x281189
fstp %st(0)
movq 0x8(%r12), %rdx
movslq %r15d, %rsi
movq %r14, 0x58(%rsp)
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x27edd0
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r15d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x27ee04
movslq 0x20(%rsp), %r8
movl %eax, 0x24(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1dfe40(%rip), %rdx # 0x461045
leaq 0x20(%rsp), %rcx
callq 0xb91c2
movl %r15d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r15d, %eax, %r13d
shlq $0x5, %r13
cmpq %r14, %r13
je 0x281247
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r14), %r8
addq %r14, %rcx
callq 0x126d84
addq $0x20, %r14
jmp 0x281221
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1dfdf9(%rip), %rdx # 0x46105c
leaq 0x24(%rsp), %r8
callq 0xb91c2
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %r8d
fldt 0x90(%rsp)
fldt 0x80(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movl %r15d, %r9d
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x27ee75
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x8, %r14
movq %rcx, %rax
jmp 0x281110
andb $0x1, %al
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d6f08(%rip), %rdi # 0x4581de
leaq 0x1d919d(%rip), %rsi # 0x45a47a
leaq 0x1dfcf1(%rip), %rdx # 0x460fd5
leaq 0x1dfd88(%rip), %rcx # 0x461073
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, 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 objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x1db029(%rip), %rdx # 0x45c33f
fldt 0x110(%rsp)
fstpt 0x64(%rsp)
fldt 0x100(%rsp)
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fstpt 0x90(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
pushq $0x19
popq %rsi
leaq 0x90(%rsp), %rcx
leaq 0x80(%rsp), %r8
leaq 0x70(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x1e23cd(%rip), %rbp # 0x46373e
movq %rax, 0x38(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbx
movq %r13, 0x40(%rsp)
cmpq 0x48(%rsp), %r14
je 0x28152b
movl (%r14), %edx
movl %edx, 0x20(%rsp)
cmpl 0x78(%r12), %edx
jge 0x28153f
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rax, 0x50(%rsp)
callq 0x3de66
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
fldt 0x70(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x27ece4
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0x27ed0a
movl %eax, %r15d
movq 0x58(%r12), %rdi
movq 0x70(%r12), %rax
fldt 0x64(%rsp)
movl %r15d, %ecx
shlq $0x5, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x28141f
movslq 0x10(%rdi,%rdx), %rsi
movq 0x8(%rax), %r8
shlq $0x4, %rsi
fldt (%r8,%rsi)
fmul %st(1), %st
fldt (%rdi,%rdx)
faddp %st, %st(1)
fstpt (%rdi,%rdx)
addq $0x20, %rdx
jmp 0x2813f9
fstp %st(0)
movq 0x8(%r12), %rdx
movslq %r15d, %rsi
movq %r14, 0x58(%rsp)
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x27edd0
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
movl %r15d, %esi
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %ecx
callq 0x27ee04
movslq 0x20(%rsp), %r8
movl %eax, 0x24(%rsp)
movq %r12, %rdi
shlq $0x3, %r8
addq 0x60(%r12), %r8
pushq $0x16
popq %rsi
leaq 0x1dfbd0(%rip), %rdx # 0x461045
leaq 0x20(%rsp), %rcx
callq 0xb91c2
movl %r15d, %eax
sarl $0x1f, %eax
xorl %r14d, %r14d
andnl %r15d, %eax, %r13d
shlq $0x5, %r13
cmpq %r14, %r13
je 0x2814b7
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
leaq 0x10(%rcx,%r14), %r8
addq %r14, %rcx
callq 0x126d84
addq $0x20, %r14
jmp 0x281491
movslq 0x20(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq 0x4(%rcx,%rax,8), %rcx
pushq $0x16
popq %rsi
leaq 0x1dfb89(%rip), %rdx # 0x46105c
leaq 0x24(%rsp), %r8
callq 0xb91c2
movq 0x30(%rsp), %rdx
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %r8d
fldt 0x90(%rsp)
fldt 0x80(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movl %r15d, %r9d
movq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x27ee75
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0x281380
andb $0x1, %al
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d6c98(%rip), %rdi # 0x4581de
leaq 0x1d8f2d(%rip), %rsi # 0x45a47a
leaq 0x1dfa81(%rip), %rdx # 0x460fd5
leaq 0x1dfb18(%rip), %rcx # 0x461073
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double)
|
result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp # imm = 0x428
vmovsd %xmm0, 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 0x2829e8
movq 0x10(%r14), %rdi
leaq 0xb8(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x8d304
fstpt 0x9c(%rsp)
jmp 0x282a01
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 0x27da08
movl 0xcc(%r12), %esi
leaq 0x118(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x98(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x1d0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x282ae3
cmpl $0x1, %eax
je 0x282abd
cmpl $0x2, %eax
jne 0x282af4
movq 0x18(%r14), %rdx
leaq 0x1d0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
jmp 0x282ace
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
vmovsd 0x1d1562(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x8b497
jmp 0x282af4
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 0x282b2d
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x48(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x282b29
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x282b06
leaq 0x1d8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x1c8(%rsp), %ecx
movl 0x1cc(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x48(%rsp)
leaq 0x1d7a12(%rip), %rdx # 0x45a577
leaq 0x1d0(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x42b5a
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x118(%rsp), %rdi
leaq 0x150(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x27dbd0
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 0x282cd6
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 0x27dc12
movq 0x1a0(%rsp), %rdx
movq 0x1b8(%rsp), %rcx
movl %eax, %ebx
leaq 0x1d0(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x95274
testl %ebx, %ebx
je 0x282d8a
cmpl %ebp, %ebx
jge 0x282c4e
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x283eaa
movl %ebx, %ebp
cmpq 0x90(%rsp), %r15
jle 0x282c9f
movl %ebx, 0xb0(%rsp)
fildl 0xb0(%rsp)
movl 0x1c8(%rsp), %eax
movl %eax, 0xb4(%rsp)
fidivl 0xb4(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x282ca3
fldt 0x48(%rsp)
fldt 0xe4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x282cd6
fstp %st(0)
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x283ee2
fldt 0x48(%rsp)
fldt 0x54(%rsp)
testb %al, %al
jne 0x282cd6
incq %r15
jmp 0x282bc7
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 0x282d04
movq 0x60(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x282d35
movq 0x60(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x98(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x1d0(%rsp), %rdi
callq 0x42cbc
leaq 0x118(%rsp), %rdi
callq 0x393ac
leaq 0x150(%rsp), %rdi
callq 0x27e0e6
leaq 0xc0(%rsp), %rdi
callq 0x8affa
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rax
addq $0x428, %rsp # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
leaq 0x70(%rsp), %rbx
movq %rbx, %rsi
callq 0x8b74a
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x283e60
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 0x282ced
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 0x27de42
testl %eax, %eax
jne 0x282e60
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 0x283e60
movq %r14, %rdi
callq 0x283ee2
fldt 0x54(%rsp)
fldt 0x48(%rsp)
testb %al, %al
jne 0x282ced
movl %ebx, 0x90(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x282fa9
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 0x27dc12
testl %eax, %eax
je 0x282f59
vcvtsi2sd %r13d, %xmm1, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x282f27
movl %eax, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x1c8(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x282f2b
fldt 0x48(%rsp)
fldt 0xe4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x282f99
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x283ee2
testb %al, %al
jne 0x282fa1
fldt 0x54(%rsp)
fldt 0x48(%rsp)
incl %ebx
jmp 0x282e84
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 0x283e60
fldt 0x54(%rsp)
fldt 0x48(%rsp)
jmp 0x282fa9
fldt 0x54(%rsp)
fxch %st(1)
jmp 0x282fa9
fldt 0x54(%rsp)
fldt 0x48(%rsp)
movl 0x90(%rsp), %ebx
decl 0x6c(%rsp)
incl %ebx
jmp 0x282dd5
jmp 0x282ff6
jmp 0x282fcf
fstp %st(1)
fstp %st(0)
jmp 0x282ff6
movq %rax, %rbx
jmp 0x283006
movq %rax, %rbx
jmp 0x283013
movq %rax, %rbx
jmp 0x283020
movq %rax, %rbx
jmp 0x28302d
movq %rax, %rbx
jmp 0x283037
jmp 0x282ff6
jmp 0x282ff6
jmp 0x282ff6
leaq 0x1d8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x283006
leaq 0x1d0(%rsp), %rdi
movq %rax, %rbx
callq 0x42cbc
leaq 0x118(%rsp), %rdi
callq 0x393ac
leaq 0x150(%rsp), %rdi
callq 0x27e0e6
leaq 0xc0(%rsp), %rdi
callq 0x8affa
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, 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 $0x428, %rsp # imm = 0x428
vmovsd %xmm0, 0x88(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x60(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x70(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0xb8(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x8d226
fldl 0x20(%r12)
fstpt 0xd8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xe4(%rsp)
fldl 0x30(%r12)
fstpt 0xcc(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x54(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x283130
movq 0x10(%r14), %rdi
leaq 0xb8(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x8d304
fstpt 0x9c(%rsp)
jmp 0x283149
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 0x27da08
movl 0xcc(%r12), %esi
leaq 0x118(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x98(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x1d0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x28322b
cmpl $0x1, %eax
je 0x283205
cmpl $0x2, %eax
jne 0x28323c
movq 0x18(%r14), %rdx
leaq 0x1d0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
jmp 0x283216
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
vmovsd 0x1d0e1a(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x8b497
jmp 0x28323c
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 0x283275
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x48(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x283271
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x28324e
leaq 0x1d8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x1c8(%rsp), %ecx
movl 0x1cc(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x48(%rsp)
leaq 0x1d72ca(%rip), %rdx # 0x45a577
leaq 0x1d0(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x118(%rsp), %rdi
leaq 0x150(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x27dbd0
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 0x28341e
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 0x27dc12
movq 0x1a0(%rsp), %rdx
movq 0x1b8(%rsp), %rcx
movl %eax, %ebx
leaq 0x1d0(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x95692
testl %ebx, %ebx
je 0x2834d2
cmpl %ebp, %ebx
jge 0x283396
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x283f8c
movl %ebx, %ebp
cmpq 0x90(%rsp), %r15
jle 0x2833e7
movl %ebx, 0xb0(%rsp)
fildl 0xb0(%rsp)
movl 0x1c8(%rsp), %eax
movl %eax, 0xb4(%rsp)
fidivl 0xb4(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x2833eb
fldt 0x48(%rsp)
fldt 0xe4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x28341e
fstp %st(0)
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x283fc4
fldt 0x48(%rsp)
fldt 0x54(%rsp)
testb %al, %al
jne 0x28341e
incq %r15
jmp 0x28330f
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 0x28344c
movq 0x60(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x28347d
movq 0x60(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x98(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x1d0(%rsp), %rdi
callq 0x435d0
leaq 0x118(%rsp), %rdi
callq 0x393ac
leaq 0x150(%rsp), %rdi
callq 0x27e0e6
leaq 0xc0(%rsp), %rdi
callq 0x8affa
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rax
addq $0x428, %rsp # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
leaq 0x70(%rsp), %rbx
movq %rbx, %rsi
callq 0x8b74a
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x283f42
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 0x283435
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 0x27de42
testl %eax, %eax
jne 0x2835a8
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 0x283f42
movq %r14, %rdi
callq 0x283fc4
fldt 0x54(%rsp)
fldt 0x48(%rsp)
testb %al, %al
jne 0x283435
movl %ebx, 0x90(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x2836f1
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 0x27dc12
testl %eax, %eax
je 0x2836a1
vcvtsi2sd %r13d, %xmm1, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x28366f
movl %eax, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x1c8(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x283673
fldt 0x48(%rsp)
fldt 0xe4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x2836e1
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x283fc4
testb %al, %al
jne 0x2836e9
fldt 0x54(%rsp)
fldt 0x48(%rsp)
incl %ebx
jmp 0x2835cc
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 0x283f42
fldt 0x54(%rsp)
fldt 0x48(%rsp)
jmp 0x2836f1
fldt 0x54(%rsp)
fxch %st(1)
jmp 0x2836f1
fldt 0x54(%rsp)
fldt 0x48(%rsp)
movl 0x90(%rsp), %ebx
decl 0x6c(%rsp)
incl %ebx
jmp 0x28351d
jmp 0x28373e
jmp 0x283717
fstp %st(1)
fstp %st(0)
jmp 0x28373e
movq %rax, %rbx
jmp 0x28374e
movq %rax, %rbx
jmp 0x28375b
movq %rax, %rbx
jmp 0x283768
movq %rax, %rbx
jmp 0x283775
movq %rax, %rbx
jmp 0x28377f
jmp 0x28373e
jmp 0x28373e
jmp 0x28373e
leaq 0x1d8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x28374e
leaq 0x1d0(%rsp), %rdi
movq %rax, %rbx
callq 0x435d0
leaq 0x118(%rsp), %rdi
callq 0x393ac
leaq 0x150(%rsp), %rdi
callq 0x27e0e6
leaq 0xc0(%rsp), %rdi
callq 0x8affa
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double)
|
result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp # imm = 0x1D8
vmovsd %xmm0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x58(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x68(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0xc0(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x8d226
fldl 0x20(%r12)
fstpt 0xe0(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xec(%rsp)
fldl 0x30(%r12)
fstpt 0xd4(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x4c(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x283878
movq 0x10(%r14), %rdi
leaq 0xc0(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x8d304
fstpt 0x94(%rsp)
jmp 0x283891
fstp %st(0)
vmovsd %xmm0, 0x100(%rsp)
fldl 0x100(%rsp)
fstpt 0x94(%rsp)
fldl 0x38(%r12)
fstpt 0x114(%rsp)
fldl 0x40(%r12)
fstpt 0x108(%rsp)
vcvttsd2si 0xa0(%r12), %rax
movq 0x18(%r14), %rsi
movq %rax, 0x88(%rsp)
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x158(%rsp), %rdi
leaq 0xc0(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x27da08
movl 0xcc(%r12), %esi
leaq 0x120(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x90(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0xb0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x283973
cmpl $0x1, %eax
je 0x28394d
cmpl $0x2, %eax
jne 0x283984
movq 0x18(%r14), %rdx
leaq 0xb0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
jmp 0x28395e
movq 0x18(%r14), %rdx
leaq 0x68(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
vmovsd 0x1d06d2(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x8b497
jmp 0x283984
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x8b41f
leaq 0x68(%rsp), %r15
movq %r13, 0x78(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x2839ba
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x40(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x2839b6
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x283993
leaq 0xb8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x120(%rsp), %rdi
leaq 0x158(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x27dbd0
vmovsd 0x40(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x68(%rsp), %rbx
xorl %r15d, %r15d
vmovsd %xmm0, 0xf8(%rsp)
fldl 0xf8(%rsp)
fldt 0x4c(%rsp)
cmpq 0xb0(%r12), %r15
je 0x283b15
movq 0x18(%r14), %rcx
fstpt 0x20(%rsp)
leaq 0x120(%rsp), %rdi
leaq 0x158(%rsp), %rsi
movq %rbx, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x40(%rsp)
fstpt (%rsp)
callq 0x27dc12
movl %eax, %r13d
testl %eax, %eax
je 0x283bbc
cmpl %ebp, %r13d
jge 0x283a8c
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0x28406e
movl %r13d, %ebp
cmpq 0x88(%rsp), %r15
jle 0x283ade
movl %r13d, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x1d0(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xd4(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xe0(%rsp)
fmulp %st, %st(1)
fldt 0x40(%rsp)
faddp %st, %st(1)
jmp 0x283ae2
fldt 0x40(%rsp)
fldt 0xec(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x283b15
fstp %st(0)
movq %r14, %rdi
fstpt 0x40(%rsp)
callq 0x2840a6
fldt 0x40(%rsp)
fldt 0x4c(%rsp)
testb %al, %al
jne 0x283b15
incq %r15
jmp 0x283a26
fstp %st(0)
fstp %st(0)
movq 0x58(%rsp), %rax
movl $0x5, 0xa0(%rax)
fldz
fldz
fstp %st(1)
fstp %st(0)
cmpl $0x0, 0x50(%r14)
jne 0x283b43
movq 0x58(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x283b74
movq 0x58(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x90(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x120(%rsp), %rdi
callq 0x393ac
leaq 0x158(%rsp), %rdi
callq 0x27e0e6
leaq 0xc8(%rsp), %rdi
callq 0x8affa
leaq 0x70(%rsp), %rdi
callq 0x357fe
movq 0x58(%rsp), %rax
addq $0x1d8, %rsp # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
leaq 0x68(%rsp), %rbx
movq %rbx, %rsi
callq 0x8b74a
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x284024
movl $0x0, 0x64(%rsp)
leaq 0x158(%rsp), %r15
leaq 0x68(%rsp), %rbp
xorl %ebx, %ebx
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x283b2c
movq 0x18(%r14), %rcx
fldt 0x114(%rsp)
fld %st(1)
fstpt 0x40(%rsp)
fmulp %st, %st(1)
fldt 0x108(%rsp)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x120(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x27de42
testl %eax, %eax
jne 0x283c8c
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x8b74a
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x284024
movq %r14, %rdi
callq 0x2840a6
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
testb %al, %al
jne 0x283b2c
movl %ebx, 0x88(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x283dd2
movq 0x18(%r14), %rcx
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x120(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x40(%rsp)
fstpt (%rsp)
callq 0x27dc12
testl %eax, %eax
je 0x283d85
vcvtsi2sd %r13d, %xmm2, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x283d53
movl %eax, 0xa0(%rsp)
fildl 0xa0(%rsp)
movl 0x1d0(%rsp), %eax
movl %eax, 0xa4(%rsp)
fidivl 0xa4(%rsp)
fldt 0xd4(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xe0(%rsp)
fmulp %st, %st(1)
fldt 0x40(%rsp)
faddp %st, %st(1)
jmp 0x283d57
fldt 0x40(%rsp)
fldt 0xec(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x283dc2
movq %r14, %rdi
fstpt 0x40(%rsp)
callq 0x2840a6
testb %al, %al
jne 0x283dca
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
incl %ebx
jmp 0x283cb0
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x8b74a
movl 0xc0(%r12), %eax
imull 0x64(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x284024
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
jmp 0x283dd2
fldt 0x4c(%rsp)
fxch %st(1)
jmp 0x283dd2
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
movl 0x88(%rsp), %ebx
decl 0x64(%rsp)
incl %ebx
jmp 0x283c04
jmp 0x283e1a
jmp 0x283df3
fstp %st(1)
fstp %st(0)
jmp 0x283e1a
movq %rax, %rbx
jmp 0x283e2a
movq %rax, %rbx
jmp 0x283e37
movq %rax, %rbx
jmp 0x283e44
movq %rax, %rbx
jmp 0x283e4e
jmp 0x283e1a
jmp 0x283e1a
jmp 0x283e1a
leaq 0xb8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x283e1d
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x393ac
leaq 0x158(%rsp), %rdi
callq 0x27e0e6
leaq 0xc8(%rsp), %rdi
callq 0x8affa
leaq 0x70(%rsp), %rdi
callq 0x357fe
movq 0x58(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, 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 0x283ea8
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x283f22
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::pnm_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1d5b75(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, 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 0x283f8a
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x284004
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::file_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1d5a93(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, 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 0x28406c
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x2840e6
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1d59b1(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::solver_inequalities_01coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::default_cost_type<long double> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&)
|
solver_inequalities_01coeff(random_engine& rng_,
int m_,
int n_,
const cost_type& c_,
const std::vector<merged_constraint>& csts)
: logger("solver_inequalities_01coeff")
, rng(rng_)
, ap(csts, m_, n_)
, P(std::make_unique<Float[]>(ap.size()))
, R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts)))
, b(std::make_unique<bound_factor[]>(m_))
, pi(std::make_unique<Float[]>(m_))
, c(c_)
, m(m_)
, n(n_)
{
for (int i = 0; i != m; ++i) {
#if !defined(BARYONYX_FULL_OPTIMIZATION)
// mscv 15.9.6 fail to build this line:
// for ([[maybe_unused]] const auto& cst : csts[i].elements)
// bx_ensures(cst.factor == 1);
for (const auto& cst : csts[i].elements)
bx_ensures(cst.factor == 1);
#endif
if (csts[i].min == csts[i].max) {
b[i].min = csts[i].min;
b[i].max = csts[i].max;
} else {
b[i].min = std::max(0, csts[i].min);
b[i].max = std::min(length(csts[i].elements), csts[i].max);
}
bx_ensures(b[i].min <= b[i].max);
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
andq $0x0, (%rdi)
leaq 0x10(%rdi), %rbx
movq %rsi, 0x8(%rdi)
movq %rdi, %r13
movq %r9, %r15
movq %r8, 0x20(%rsp)
movl %ecx, %r12d
movl %edx, %ebp
movq %r9, %rsi
movq %rbx, %rdi
callq 0x3a4ca
movl 0x38(%r13), %esi
leaq 0x50(%r13), %r14
movq %r14, %rdi
movq %rbx, 0x18(%rsp)
callq 0x8afb9
movq %r15, %rdi
movq %r14, 0x10(%rsp)
leaq 0x58(%r13), %rbx
callq 0x3a89d
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2851c1
leaq 0x60(%r13), %rbx
movslq %ebp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x285201
leaq 0x68(%r13), %rdi
movq %r14, %rsi
callq 0x8afb9
movq 0x20(%rsp), %rax
movl %ebp, %edx
xorl %esi, %esi
movq %rax, 0x70(%r13)
movl %ebp, 0x78(%r13)
movl %r12d, 0x7c(%r13)
movq (%r15), %rax
movq 0x60(%r13), %rcx
cmpq %rdx, %rsi
je 0x284c05
imulq $0x28, %rsi, %rdi
movq (%rax,%rdi), %r9
leaq (%rax,%rdi), %r8
movq 0x8(%rax,%rdi), %rdi
movq %r9, %r10
cmpq %rdi, %r10
je 0x284b9f
cmpl $0x1, (%r10)
leaq 0x8(%r10), %r10
je 0x284b8e
jmp 0x284c14
movl 0x18(%r8), %r11d
cmpl 0x1c(%r8), %r11d
jne 0x284bb2
movl %r11d, (%rcx,%rsi,8)
movl %r11d, %r10d
jmp 0x284bd7
movl %r11d, %r10d
sarl $0x1f, %r10d
subq %r9, %rdi
andnl %r11d, %r10d, %r10d
shrq $0x3, %rdi
movl %r10d, (%rcx,%rsi,8)
movl 0x1c(%r8), %r8d
cmpl %edi, %r8d
cmovll %r8d, %edi
movl %edi, %r11d
movl %r11d, 0x4(%rcx,%rsi,8)
incq %rsi
cmpl %r11d, %r10d
jle 0x284b71
leaq 0x1d383f(%rip), %rdi # 0x45842a
leaq 0x1d56b7(%rip), %rsi # 0x45a2a9
leaq 0x1dc3dc(%rip), %rdx # 0x460fd5
leaq 0x1dc441(%rip), %rcx # 0x461041
callq 0x2813f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d380f(%rip), %rdi # 0x45842a
leaq 0x1d7639(%rip), %rsi # 0x45c25b
leaq 0x1dc3ac(%rip), %rdx # 0x460fd5
leaq 0x1d59e8(%rip), %rcx # 0x45a618
callq 0x2813f
movq %rbx, %rdi
movq %rax, %r15
callq 0x285242
jmp 0x284c45
movq %rax, %r15
movq 0x8(%rsp), %rdi
callq 0x28525c
jmp 0x284c54
movq %rax, %r15
movq 0x10(%rsp), %rdi
callq 0x8affa
jmp 0x284c63
movq %rax, %r15
movq 0x18(%rsp), %rdi
callq 0x3a954
movq %r15, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<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 0x284c8c
movq %rax, %rdi
jmp 0x285292
cmpl $0x7, %ecx
jne 0x284ca9
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0x284cb7
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0x284c9a
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0x285377
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array, long double>(baryonyx::itm::solver_inequalities_01coeff<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)
|
int run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta)
{
bool pi_changed = false;
int remaining = 0;
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.compute_update_row(
x, R.crbegin(), R.crend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
fldt 0xb0(%rsp)
fldt 0xa0(%rsp)
fldt 0x90(%rsp)
movl 0x30(%rdi), %eax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decl %eax
cmpl $0x6, %eax
ja 0x284dd9
leaq 0x1dc104(%rip), %rdx # 0x460df8
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x68(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
fxch %st(2)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x285454
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x285377
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %r15, %rdx
fstpt 0x3c(%rsp)
callq 0x286dc9
jmp 0x284e4d
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
fstpt 0x3c(%rsp)
callq 0x2864f3
jmp 0x284d98
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
fstpt 0x3c(%rsp)
callq 0x28695e
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x285682
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x285792
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fxch %st(2)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
jmp 0x284e22
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %rcx, %rdx
fstpt 0x3c(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x285572
jmp 0x284e76
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %r15, %rdx
fstpt 0x3c(%rsp)
callq 0x28731d
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x285878
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x285377
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %rcx, %rdx
fstpt 0x3c(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x285572
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x285988
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array, long double>(baryonyx::itm::solver_inequalities_01coeff<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 0x284f33
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 0x28504a
leaq 0x1dbecf(%rip), %rdx # 0x460e14
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 0x28786e
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x285377
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 0x28876a
jmp 0x2850d7
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x287e94
jmp 0x284ffe
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x2882ff
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 0x287b88
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x285792
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fxch %st(3)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
jmp 0x2850fa
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 0x287a02
jmp 0x285108
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %r15, %rdx
fstpt 0x40(%rsp)
callq 0x288cbe
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 0x287d0e
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x285377
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 0x287a02
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x285988
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false> const, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false> const&, baryonyx::bit_array const&)
|
int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x2852b6
movq %rax, 0x20(%rdi)
movq 0x20(%rsp), %rcx
leaq 0x18(%rdi), %rax
movq %rdi, 0x28(%rsp)
xorl %ebp, %ebp
movq %rax, 0x18(%rsp)
movl 0x78(%rcx), %r12d
leaq 0x10(%rcx), %rax
movq %rax, 0x30(%rsp)
cmpq %r12, %rbp
je 0x285357
movq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x3c868
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r13
xorl %ebx, %ebx
cmpq %r15, %r13
je 0x285313
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0x2852fa
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rcx
movl (%rcx,%rbp,8), %eax
subl %ebx, %eax
jle 0x285331
shlq $0x20, %rax
orq %rbp, %rax
movq %rax, 0x8(%rsp)
jmp 0x285343
subl 0x4(%rcx,%rbp,8), %ebx
jle 0x285352
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0x2852d8
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<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 0x285395
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x78(%r15), %esi
je 0x2853c8
movq %r15, %rdi
movq %r14, %rdx
callq 0x2853df
testb %al, %al
jne 0x2853c0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0x28539c
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false> const&, int, baryonyx::bit_array const&)
|
bool
is_valid_constraint(const Solver& slv, int k, const Xtype& x)
{
typename sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = slv.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += slv.factor(it->value) * x[it->column];
return slv.bound_min(k) <= v && v <= slv.bound_max(k);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
leaq 0x10(%rdi), %rsi
leaq 0x8(%rsp), %r15
movq %rdx, %r14
movq %rdi, %rbx
movl %ebp, %edx
movq %r15, %rdi
callq 0x3c868
movq (%r15), %r12
movq 0x8(%r15), %r13
xorl %r15d, %r15d
cmpq %r12, %r13
je 0x28542c
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %r15d
addq $0x8, %r13
jmp 0x285412
movq 0x60(%rbx), %rcx
movslq %ebp, %rax
cmpl %r15d, (%rcx,%rax,8)
jle 0x28543d
xorl %eax, %eax
jmp 0x285445
cmpl 0x4(%rcx,%rax,8), %r15d
setle %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, long double, long double, long double)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
fldt 0xc0(%rsp)
fstpt 0x5c(%rsp)
fldt 0xb0(%rsp)
fstpt 0x50(%rsp)
fldt 0xa0(%rsp)
fstpt 0x44(%rsp)
movq %rax, 0x30(%rsp)
movq (%rdx), %rax
movq 0x38(%rsp), %rcx
cmpq (%rcx), %rax
je 0x28555c
movslq -0x4(%rax), %rbx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
fldt 0x5c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x2859c8
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2859ee
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x285ab4
movq 0x60(%r12), %rax
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rbx,8), %edx
movl 0x4(%rax,%rbx,8), %ecx
callq 0x285ae8
movq 0x28(%rsp), %rdx
fldt 0x50(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
movl %r13d, %r9d
fldt 0x44(%rsp)
fstpt (%rsp)
callq 0x285b59
orb %al, %bpl
movq (%r14), %rax
addq $-0x4, %rax
movq %rax, (%r14)
jmp 0x28549f
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-01.cpp
|
bool baryonyx::itm::solver_inequalities_01coeff<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*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, long double, long double, long double)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
fldt 0xc0(%rsp)
fstpt 0x5c(%rsp)
fldt 0xb0(%rsp)
fstpt 0x50(%rsp)
fldt 0xa0(%rsp)
fstpt 0x44(%rsp)
movq %rax, 0x30(%rsp)
cmpq 0x38(%rsp), %r14
je 0x28566d
movslq (%r14), %rbx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
fldt 0x5c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x2859c8
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2859ee
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x285ab4
movq 0x60(%r12), %rax
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rbx,8), %edx
movl 0x4(%rax,%rbx,8), %ecx
callq 0x285ae8
movq 0x28(%rsp), %rdx
fldt 0x50(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
movl %r13d, %r9d
fldt 0x44(%rsp)
fstpt (%rsp)
callq 0x285b59
orb %al, %bpl
addq $0x4, %r14
jmp 0x2855ba
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-01.cpp
|
bool baryonyx::itm::solver_inequalities_01coeff<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 r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
fldt 0xc0(%rsp)
fstpt 0x5c(%rsp)
fldt 0xb0(%rsp)
fstpt 0x50(%rsp)
fldt 0xa0(%rsp)
fstpt 0x44(%rsp)
movq %rax, 0x30(%rsp)
cmpq 0x38(%rsp), %r14
je 0x28577d
movslq (%r14), %rbx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
fldt 0x5c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x2859c8
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2859ee
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x285ab4
movq 0x60(%r12), %rax
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rbx,8), %edx
movl 0x4(%rax,%rbx,8), %ecx
callq 0x285ae8
movq 0x28(%rsp), %rdx
fldt 0x50(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
movl %r13d, %r9d
fldt 0x44(%rsp)
fstpt (%rsp)
callq 0x285b59
orb %al, %bpl
addq $0x8, %r14
jmp 0x2856ca
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-01.cpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>&, baryonyx::bit_array const&)
|
int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0x2857b6
movq %rax, 0x20(%rdi)
movq 0x20(%rsp), %rcx
leaq 0x18(%rdi), %rax
movq %rdi, 0x28(%rsp)
xorl %ebp, %ebp
movq %rax, 0x18(%rsp)
movl 0x78(%rcx), %r12d
leaq 0x10(%rcx), %rax
movq %rax, 0x30(%rsp)
cmpq %r12, %rbp
je 0x285857
movq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
movl %ebp, %edx
callq 0x3de66
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r13
xorl %ebx, %ebx
cmpq %r15, %r13
je 0x285813
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0x2857fa
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rcx
movl (%rcx,%rbp,8), %eax
subl %ebx, %eax
jle 0x285831
shlq $0x20, %rax
orq %rbp, %rax
movq %rax, 0x8(%rsp)
jmp 0x285843
subl 0x4(%rcx,%rbp,8), %ebx
jle 0x285852
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0x2857d8
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::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 r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, 0x38(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
fldt 0xc0(%rsp)
fstpt 0x5c(%rsp)
fldt 0xb0(%rsp)
fstpt 0x50(%rsp)
fldt 0xa0(%rsp)
fstpt 0x44(%rsp)
movq %rax, 0x30(%rsp)
cmpq 0x38(%rsp), %r14
je 0x285973
movslq (%r14), %rbx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
fldt 0x5c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x2859c8
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2859ee
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
movq %r13, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x285ab4
movq 0x60(%r12), %rax
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rbx,8), %edx
movl 0x4(%rax,%rbx,8), %ecx
callq 0x285ae8
movq 0x28(%rsp), %rdx
fldt 0x50(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
movl %r13d, %r9d
fldt 0x44(%rsp)
fstpt (%rsp)
callq 0x285b59
orb %al, %bpl
addq $0x4, %r14
jmp 0x2858c0
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-01.cpp
|
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false> const&, baryonyx::bit_array const&)
|
int local_compute_violated_constraints(const Solver& slv, const Xtype& x)
{
int remaining = 0;
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
++remaining;
return remaining;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl 0x78(%r14), %r15d
je 0x2859ba
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x2853df
xorb $0x1, %al
incl %r15d
movzbl %al, %eax
addl %eax, %ebp
jmp 0x28599a
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::decrease_preference(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, long double)
|
void decrease_preference(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
Float theta) noexcept
{
for (; begin != end; ++begin)
P[begin->value] *= theta;
}
|
fldt 0x8(%rsp)
movq 0x50(%rdi), %rax
cmpq %rdx, %rsi
je 0x2859ea
movslq (%rsi), %rcx
addq $0x8, %rsi
shlq $0x4, %rcx
fldt (%rax,%rcx)
fmul %st(1), %st
fstpt (%rax,%rcx)
jmp 0x2859d0
fstp %st(0)
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
int baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::compute_reduced_costs<baryonyx::bit_array>(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, baryonyx::bit_array const&)
|
int compute_reduced_costs(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
const Xtype& x) noexcept
{
int r_size = 0;
for (; begin != end; ++begin) {
Float sum_a_pi = 0;
Float sum_a_p = 0;
auto ht = ap.column(begin->column);
for (; std::get<0>(ht) != std::get<1>(ht); ++std::get<0>(ht)) {
sum_a_pi += pi[std::get<0>(ht)->row];
sum_a_p += P[std::get<0>(ht)->value];
}
R[r_size].id = r_size;
R[r_size].value = c(begin->column, x) - sum_a_pi - sum_a_p;
++r_size;
}
return r_size;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x10(%rdi), %r13
leaq 0x8(%rsp), %rbp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
xorl %r15d, %r15d
cmpq %rbx, %r14
je 0x285aa2
movl 0x4(%r14), %edx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3dede
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movq 0x50(%r12), %rdx
movq 0x68(%r12), %rsi
fldz
fld %st(0)
cmpq %rax, %rcx
je 0x285a6a
movslq 0x4(%rcx), %rdi
shlq $0x4, %rdi
fldt (%rsi,%rdi)
faddp %st, %st(1)
movslq (%rcx), %rdi
addq $0x8, %rcx
shlq $0x4, %rdi
fldt (%rdx,%rdi)
faddp %st, %st(2)
movq %rcx, 0x10(%rsp)
jmp 0x285a41
movq 0x58(%r12), %rax
movq %r15, %rcx
shlq $0x5, %rcx
movl %r15d, 0x10(%rax,%rcx)
incq %r15
movq 0x70(%r12), %rdx
movslq 0x4(%r14), %rsi
addq $0x8, %r14
movq 0x8(%rdx), %rdx
shlq $0x4, %rsi
fldt (%rdx,%rsi)
fsubp %st, %st(1)
fsubp %st, %st(1)
fstpt (%rax,%rcx)
jmp 0x285a11
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::select_variables(int, int, int)
|
int select_variables(const int r_size, int bkmin, int bkmax)
{
if (bkmin == bkmax)
return std::min(bkmin, r_size) - 1;
bkmin = std::min(bkmin, r_size);
bkmax = std::min(bkmax, r_size);
for (int i = bkmin; i <= bkmax; ++i)
if (stop_iterating<Mode>(R[i].value, rng))
return i - 1;
return bkmax - 1;
}
|
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpl %ecx, %edx
jne 0x285b02
cmpl %edx, %esi
cmovll %esi, %edx
movl %edx, %ebx
jmp 0x285b47
cmpl %ecx, %esi
movl %ecx, %ebx
movq %rdi, %r14
cmovll %esi, %ebx
cmpl %esi, %edx
cmovll %edx, %esi
movslq %ebx, %r12
movslq %esi, %r15
movq %r15, %r13
shlq $0x5, %r13
cmpq %r12, %r15
jg 0x285b47
movq 0x8(%r14), %rdi
movq 0x58(%r14), %rax
fldt (%rax,%r13)
fstpt (%rsp)
callq 0x9098a
testb %al, %al
jne 0x285b44
incq %r15
addq $0x20, %r13
jmp 0x285b1e
movl %r15d, %ebx
decl %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
bool baryonyx::itm::affect<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, long double>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, long double, long 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 $0x48, %rsp
fldt 0x90(%rsp)
fldt 0x80(%rsp)
movq 0x68(%rdi), %rax
movq %rdx, %r15
movslq %ecx, %rdx
movl %ecx, 0x1c(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
shlq $0x4, %rdx
fldt (%rax,%rdx)
movq %rdx, 0x28(%rsp)
fld %st(0)
fstpt 0x3c(%rsp)
testl %r8d, %r8d
js 0x285c37
leal 0x1(%r8), %ecx
cmpl %r9d, %ecx
jge 0x285c99
movq 0x58(%rbx), %rsi
addq %rdx, %rax
movl %r8d, %edx
movl %r9d, 0x18(%rsp)
shlq $0x5, %rdx
movl %ecx, %ebp
xorl %r12d, %r12d
fldt (%rsi,%rdx)
movq %rbp, 0x20(%rsp)
shlq $0x5, %rbp
fldt (%rsi,%rbp)
faddp %st, %st(1)
fmuls 0x1d3ef0(%rip) # 0x459ad0
faddp %st, %st(1)
fstpt (%rax)
fld1
fsub %st(1), %st
fdivrp %st, %st(1)
fldt (%rsi,%rbp)
fldt (%rsi,%rdx)
fsubrp %st, %st(1)
fmulp %st, %st(1)
faddp %st, %st(1)
fstpt 0xc(%rsp)
cmpq %r12, %rbp
je 0x285cff
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x10(%rax,%r12), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
addq $0x20, %r12
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0xc(%rsp)
faddp %st, %st(1)
fstpt (%rcx,%rax)
jmp 0x285bfa
fstp %st(0)
fld1
fsub %st(1), %st
fdivrp %st, %st(1)
movq 0x58(%rbx), %rax
movl %r9d, %r12d
shlq $0x5, %r12
xorl %ebp, %ebp
fldt (%rax)
fmuls 0x1d3e7c(%rip) # 0x459ad0
fmulp %st, %st(1)
faddp %st, %st(1)
fstpt 0xc(%rsp)
cmpq %rbp, %r12
je 0x285d46
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x10(%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
addq $0x20, %rbp
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0xc(%rsp)
fsubrp %st, %st(1)
fstpt (%rcx,%rax)
jmp 0x285c5c
fstp %st(0)
fld1
fsub %st(1), %st
fdivrp %st, %st(1)
movq 0x58(%rbx), %rcx
movl %r8d, %eax
shlq $0x5, %rax
movl %r9d, %r12d
shlq $0x5, %r12
xorl %ebp, %ebp
fldt (%rcx,%rax)
fmuls 0x1d600a(%rip) # 0x45bcc8
fmulp %st, %st(1)
faddp %st, %st(1)
fstpt 0xc(%rsp)
cmpq %rbp, %r12
je 0x285d46
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x10(%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
addq $0x20, %rbp
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0xc(%rsp)
faddp %st, %st(1)
fstpt (%rcx,%rax)
jmp 0x285cc6
movl 0x18(%rsp), %r12d
orq $0x10, %rbp
subq 0x20(%rsp), %r12
subq $0x1, %r12
jb 0x285d46
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq (%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
addq $0x20, %rbp
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0xc(%rsp)
fsubrp %st, %st(1)
fstpt (%rcx,%rax)
jmp 0x285d0d
movl 0x1c(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2853df
testb %al, %al
je 0x285d88
movq 0x68(%rbx), %rax
movq 0x28(%rsp), %rcx
movzwl 0x8(%rax,%rcx), %ecx
fldt 0x3c(%rsp)
fstpt 0x30(%rsp)
movzwl 0x38(%rsp), %eax
xorl %ecx, %eax
shrl $0xf, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d244f(%rip), %rdi # 0x4581de
leaq 0x1d6586(%rip), %rsi # 0x45c31c
leaq 0x1d41ef(%rip), %rdx # 0x459f8c
leaq 0x1d6597(%rip), %rcx # 0x45c33b
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::rc_data*>(baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::rc_data*, baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::rc_data*, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&)
|
inline void
random_shuffle_unique(iteratorT begin,
iteratorT end,
random_engine& rng) noexcept
{
auto ret = begin++;
for (; begin != end; ++begin) {
if (ret->value != begin->value) {
std::shuffle(ret, begin, rng);
ret = begin;
}
}
std::shuffle(ret, begin, rng);
}
|
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x20(%rdi), %r15
cmpq %r14, %r15
je 0x285de4
fldt (%rdi)
fldt (%r15)
addq $0x20, %r15
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jne 0x285dd0
jnp 0x285db8
addq $-0x20, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x286365
movq %r15, %rdi
jmp 0x285db4
movq %r15, %rsi
movq %rbx, %rdx
callq 0x286365
popq %rbx
popq %r14
popq %r15
retq
jmp 0x285df7
movq %rax, %rdi
callq 0xeb9f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::push_and_compute_update_row<baryonyx::bit_array, 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, long double)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, 0x48(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x6c(%rsp)
fldt 0xc0(%rsp)
fstpt 0x60(%rsp)
fldt 0xb0(%rsp)
fstpt 0x54(%rsp)
movq %rax, 0x40(%rsp)
movq (%rdx), %rax
fstpt 0x34(%rsp)
movq 0x48(%rsp), %rcx
cmpq (%rcx), %rax
je 0x2879ca
movslq -0x4(%rax), %rbx
cmpl 0x78(%r12), %ebx
jge 0x2879e0
movq 0x40(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
fldt 0x6c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x2859c8
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2859ee
fldt 0x34(%rsp)
movl %eax, %ebp
movq 0x58(%r12), %rdi
movq 0x70(%r12), %rax
movl %ebp, %ecx
shlq $0x5, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x28795f
movslq 0x10(%rdi,%rdx), %rsi
movq 0x8(%rax), %r8
shlq $0x4, %rsi
fldt (%r8,%rsi)
fmul %st(1), %st
fldt (%rdi,%rdx)
faddp %st, %st(1)
fstpt (%rdi,%rdx)
addq $0x20, %rdx
jmp 0x287939
fstp %st(0)
movq 0x8(%r12), %rdx
movslq %ebp, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x285ab4
movq 0x60(%r12), %rax
movq %r12, %rdi
movl %ebp, %esi
movl (%rax,%rbx,8), %edx
movl 0x4(%rax,%rbx,8), %ecx
callq 0x285ae8
movq 0x28(%rsp), %rdx
fldt 0x60(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
movl %ebp, %r9d
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x285b59
fldt 0x34(%rsp)
fstp %st(0)
orb %al, %r13b
movq (%r14), %rax
addq $-0x4, %rax
movq %rax, (%r14)
jmp 0x2878c5
andb $0x1, %r13b
movl %r13d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d07f7(%rip), %rdi # 0x4581de
leaq 0x1d2a8c(%rip), %rsi # 0x45a47a
leaq 0x1d95e0(%rip), %rdx # 0x460fd5
leaq 0x1d9677(%rip), %rcx # 0x461073
callq 0x2813f
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
bool baryonyx::itm::solver_inequalities_01coeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long 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>>>, long double, long double, long double, long double)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
bx_expects(k < m);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k].min, b[k].max);
logger::log("constraints {}: {} <= ", k, b[k].min);
for (int i = 0; i < r_size; ++i)
logger::log("({} {}) ", R[i].value, R[i].id);
logger::log("<= {} => Selected: {}\n", b[k].max, selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, 0x48(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x6c(%rsp)
fldt 0xc0(%rsp)
fstpt 0x60(%rsp)
fldt 0xb0(%rsp)
fstpt 0x54(%rsp)
movq %rax, 0x40(%rsp)
fstpt 0x34(%rsp)
cmpq 0x48(%rsp), %r14
je 0x287b51
movslq (%r14), %rbx
cmpl 0x78(%r12), %ebx
jge 0x287b67
movq 0x40(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
fldt 0x6c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x2859c8
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x2859ee
fldt 0x34(%rsp)
movl %eax, %ebp
movq 0x58(%r12), %rdi
movq 0x70(%r12), %rax
movl %ebp, %ecx
shlq $0x5, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x287aec
movslq 0x10(%rdi,%rdx), %rsi
movq 0x8(%rax), %r8
shlq $0x4, %rsi
fldt (%r8,%rsi)
fmul %st(1), %st
fldt (%rdi,%rdx)
faddp %st, %st(1)
fstpt (%rdi,%rdx)
addq $0x20, %rdx
jmp 0x287ac6
fstp %st(0)
movq 0x8(%r12), %rdx
movslq %ebp, %rsi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x285ab4
movq 0x60(%r12), %rax
movq %r12, %rdi
movl %ebp, %esi
movl (%rax,%rbx,8), %edx
movl 0x4(%rax,%rbx,8), %ecx
callq 0x285ae8
movq 0x28(%rsp), %rdx
fldt 0x60(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %eax, %r8d
movl %ebp, %r9d
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x285b59
fldt 0x34(%rsp)
fstp %st(0)
orb %al, %r13b
addq $0x4, %r14
jmp 0x287a56
andb $0x1, %r13b
movl %r13d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d0670(%rip), %rdi # 0x4581de
leaq 0x1d2905(%rip), %rsi # 0x45a47a
leaq 0x1d9459(%rip), %rdx # 0x460fd5
leaq 0x1d94f0(%rip), %rcx # 0x461073
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-solver-inequalities-01.cpp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.