name
stringlengths 1
473k
| code
stringlengths 7
647k
| asm
stringlengths 4
3.39M
| file
stringlengths 8
196
|
---|---|---|---|
bool baryonyx::itm::affect<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, float, float)
|
bool
affect(Solver& slv,
Xtype& x,
Iterator it,
int k,
int selected,
int r_size,
const Float kappa,
const Float delta)
{
constexpr Float one{ 1 };
constexpr Float two{ 2 };
constexpr Float middle{ (two + one) / two };
const auto old_pi = slv.pi[k];
auto d = delta;
if (selected < 0) {
// slv.pi[k] += slv.R[0].value / two;
d += (kappa / (one - kappa)) * (slv.R[0].value / two);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
} else if (selected + 1 >= r_size) {
// slv.pi[k] += slv.R[selected].value * middle;
d += (kappa / (one - kappa)) * (slv.R[selected].value * middle);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
} else {
slv.pi[k] +=
((slv.R[selected].value + slv.R[selected + 1].value) / two);
d += (kappa / (one - kappa)) *
(slv.R[selected + 1].value - slv.R[selected].value);
int i = 0;
for (; i <= selected; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
for (; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
}
// TODO job: develops is_valid_constraint for all the solvers
bx_expects(is_valid_constraint(slv, k, x));
return is_signbit_change(old_pi, slv.pi[k]);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x68(%rbx), %rax
movslq %ecx, %rdi
movq %rdx, %r15
movq %rsi, %r14
movl %ecx, 0x14(%rsp)
movq %rdi, 0x18(%rsp)
vmovss (%rax,%rdi,4), %xmm3
vmovaps %xmm3, 0x20(%rsp)
testl %r8d, %r8d
js 0xc6e79
leal 0x1(%r8), %ecx
cmpl %r9d, %ecx
jge 0xc6ee5
movq 0x58(%rbx), %rsi
movl %r8d, %edx
movl %ecx, %ebp
xorl %r13d, %r13d
movl %r9d, 0x10(%rsp)
vmovss (%rsi,%rdx,8), %xmm2
vaddss (%rsi,%rbp,8), %xmm2, %xmm2
vmulss 0x392cc1(%rip), %xmm2, %xmm2 # 0x459ad0
vaddss %xmm2, %xmm3, %xmm2
vmovss %xmm2, (%rax,%rdi,4)
vmovss 0x392ca4(%rip), %xmm2 # 0x459ac4
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rsi,%rbp,8), %xmm2
vsubss (%rsi,%rdx,8), %xmm2, %xmm2
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %r13, %rbp
je 0xc6f51
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%r13,8), %r12
movl 0x4(%r15,%r12,8), %esi
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
vmovss 0xc(%rsp), %xmm0
incq %r13
vaddss (%rcx,%rax,4), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xc6e3d
vmovss 0x392c43(%rip), %xmm2 # 0x459ac4
movq 0x58(%rbx), %rax
movl %r9d, %r12d
xorl %ebp, %ebp
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rax), %xmm2
vmulss 0x392c32(%rip), %xmm2, %xmm2 # 0x459ad0
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %rbp, %r12
je 0xc6f8e
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
incq %rbp
vmovss (%rcx,%rax,4), %xmm0
vsubss 0xc(%rsp), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xc6ea9
vmovss 0x392bd7(%rip), %xmm2 # 0x459ac4
movq 0x58(%rbx), %rcx
movl %r8d, %eax
movl %r9d, %r12d
xorl %ebp, %ebp
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rcx,%rax,8), %xmm2
vmulss 0x394dba(%rip), %xmm2, %xmm2 # 0x45bcc8
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %rbp, %r12
je 0xc6f8e
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovss 0xc(%rsp), %xmm0
incq %rbp
vaddss (%rcx,%rax,4), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xc6f19
movl 0x10(%rsp), %r12d
cmpq %rbp, %r12
je 0xc6f8e
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
incq %rbp
vmovss (%rcx,%rax,4), %xmm0
vsubss 0xc(%rsp), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xc6f56
movl 0x14(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xc6431
testb %al, %al
je 0xc6fcc
vmovaps 0x20(%rsp), %xmm0
movq 0x68(%rbx), %rcx
movq 0x18(%rsp), %rdx
vmovmskps %xmm0, %eax
shll $0x1f, %eax
xorl (%rcx,%rdx,4), %eax
shrl $0x1f, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x39120b(%rip), %rdi # 0x4581de
leaq 0x395342(%rip), %rsi # 0x45c31c
leaq 0x392fab(%rip), %rdx # 0x459f8c
leaq 0x395353(%rip), %rcx # 0x45c33b
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::rc_data*>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::rc_data*, baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::rc_data*, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&)
|
inline void
random_shuffle_unique(iteratorT begin,
iteratorT end,
random_engine& rng) noexcept
{
auto ret = begin++;
for (; begin != end; ++begin) {
if (ret->value != begin->value) {
std::shuffle(ret, begin, rng);
ret = begin;
}
}
std::shuffle(ret, begin, rng);
}
|
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x8(%rdi), %rsi
cmpq %r14, %rsi
je 0xc7028
vmovss (%rdi), %xmm0
leaq 0x8(%rsi), %r15
vucomiss (%rsi), %xmm0
movq %r15, %rsi
jne 0xc7014
jnp 0xc6ffc
addq $-0x8, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0xc748f
movq %r15, %rdi
jmp 0xc6ff8
movq %rbx, %rdx
callq 0xc748f
popq %rbx
popq %r14
popq %r15
retq
jmp 0xc7038
movq %rax, %rdi
callq 0xeb9f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::push_and_compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, float, float, float, float)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, 0x38(%rsp)
movq %rdx, %rbx
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0xc(%rsp), %r9
leaq 0x393a99(%rip), %rdx # 0x45c33f
vmovss %xmm3, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, %r12
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
movq %rbx, 0x30(%rsp)
xorl %edx, %edx
movq %rax, 0x28(%rsp)
movq (%rbx), %rax
pushq $0x8
popq %rbp
movq 0x38(%rsp), %rcx
cmpq (%rcx), %rax
je 0xc8a4b
movq %rdx, 0x40(%rsp)
movl -0x4(%rax), %edx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %edx, (%rsp)
callq 0x3de66
vmovss 0xc(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0xc6c86
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0xc6ca4
movl %eax, %r14d
xorl %r13d, %r13d
cmpq %r13, %r14
je 0xc8972
movq 0x58(%r12), %rax
movq 0x70(%r12), %rdi
movq %r15, %rdx
movl 0x4(%rax,%r13,8), %esi
callq 0x49ffa
movq 0x58(%r12), %rax
vmovss 0x8(%rsp), %xmm1
vfmadd213ss (%rax,%r13,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rax,%r13,8)
incq %r13
jmp 0xc893a
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %r14d, %rbx
leaq (%rdi,%rbx,8), %rsi
callq 0xc6d71
movslq (%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,4), %r8
movl (%r8), %eax
cmpl %eax, %ebx
cmovll %ebx, %eax
decl %eax
movl %eax, 0x4(%rsp)
pushq $0x15
popq %rsi
leaq 0x39394d(%rip), %rdx # 0x45c2fd
movq %rsp, %rcx
callq 0xb91c2
movl %ebx, %eax
sarl $0x1f, %eax
andnl %ebx, %eax, %r13d
xorl %ebx, %ebx
shlq $0x3, %r13
cmpq %rbx, %r13
je 0xc89f2
movq 0x58(%r12), %rcx
leaq 0x39393a(%rip), %rdx # 0x45c313
movq %r12, %rdi
movq %rbp, %rsi
leaq 0x4(%rcx,%rbx), %r8
addq %rbx, %rcx
callq 0xb91f0
addq $0x8, %rbx
jmp 0xc89c8
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x398662(%rip), %rdx # 0x461061
leaq 0x4(%rsp), %rcx
callq 0xb921e
vmovss 0x14(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %r9d
callq 0xc6da4
movq 0x40(%rsp), %rdx
movq 0x30(%rsp), %rcx
orb %al, %dl
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0xc88df
andb $0x1, %dl
movl %edx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, float, float, float, float)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, 0x30(%rsp)
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0xc(%rsp), %r9
movq %rdx, %rbx
vmovss %xmm3, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x3938a7(%rip), %rdx # 0x45c33f
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbp
cmpq 0x30(%rsp), %rbx
je 0xc8c27
movl (%rbx), %edx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movq %rax, 0x38(%rsp)
movl %edx, (%rsp)
callq 0x3de66
vmovss 0xc(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0xc6c86
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0xc6ca4
movl %eax, %r13d
xorl %r14d, %r14d
cmpq %r14, %r13
je 0xc8b4c
movq 0x58(%r12), %rax
movq 0x70(%r12), %rdi
movq %r15, %rdx
movl 0x4(%rax,%r14,8), %esi
callq 0x49ffa
movq 0x58(%r12), %rax
vmovss 0x8(%rsp), %xmm1
vfmadd213ss (%rax,%r14,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rax,%r14,8)
incq %r14
jmp 0xc8b14
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movq %rbx, 0x40(%rsp)
movslq %r13d, %rbx
leaq (%rdi,%rbx,8), %rsi
callq 0xc6d71
movslq (%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,4), %r8
movl (%r8), %eax
cmpl %eax, %ebx
cmovll %ebx, %eax
decl %eax
movl %eax, 0x4(%rsp)
pushq $0x15
popq %rsi
leaq 0x39376e(%rip), %rdx # 0x45c2fd
movq %rsp, %rcx
callq 0xb91c2
movl %ebx, %eax
sarl $0x1f, %eax
andnl %ebx, %eax, %r14d
xorl %ebx, %ebx
shlq $0x3, %r14
cmpq %rbx, %r14
je 0xc8bd1
movq 0x58(%r12), %rcx
leaq 0x39375b(%rip), %rdx # 0x45c313
movq %r12, %rdi
movq %rbp, %rsi
leaq 0x4(%rcx,%rbx), %r8
addq %rbx, %rcx
callq 0xb91f0
addq $0x8, %rbx
jmp 0xc8ba7
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x398483(%rip), %rdx # 0x461061
leaq 0x4(%rsp), %rcx
callq 0xb921e
vmovss 0x14(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %r9d
callq 0xc6da4
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rbx
orb %al, %cl
addq $0x4, %rbx
movq %rcx, %rax
jmp 0xc8abd
andb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, float, float, float, float)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, 0x30(%rsp)
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0xc(%rsp), %r9
movq %rdx, %rbx
vmovss %xmm3, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x3936cf(%rip), %rdx # 0x45c33f
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x19
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbp
cmpq 0x30(%rsp), %rbx
je 0xc8dff
movl (%rbx), %edx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movq %rax, 0x38(%rsp)
movl %edx, (%rsp)
callq 0x3de66
vmovss 0xc(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0xc6c86
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0xc6ca4
movl %eax, %r13d
xorl %r14d, %r14d
cmpq %r14, %r13
je 0xc8d24
movq 0x58(%r12), %rax
movq 0x70(%r12), %rdi
movq %r15, %rdx
movl 0x4(%rax,%r14,8), %esi
callq 0x49ffa
movq 0x58(%r12), %rax
vmovss 0x8(%rsp), %xmm1
vfmadd213ss (%rax,%r14,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rax,%r14,8)
incq %r14
jmp 0xc8cec
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movq %rbx, 0x40(%rsp)
movslq %r13d, %rbx
leaq (%rdi,%rbx,8), %rsi
callq 0xc6d71
movslq (%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,4), %r8
movl (%r8), %eax
cmpl %eax, %ebx
cmovll %ebx, %eax
decl %eax
movl %eax, 0x4(%rsp)
pushq $0x15
popq %rsi
leaq 0x393596(%rip), %rdx # 0x45c2fd
movq %rsp, %rcx
callq 0xb91c2
movl %ebx, %eax
sarl $0x1f, %eax
andnl %ebx, %eax, %r14d
xorl %ebx, %ebx
shlq $0x3, %r14
cmpq %rbx, %r14
je 0xc8da9
movq 0x58(%r12), %rcx
leaq 0x393583(%rip), %rdx # 0x45c313
movq %r12, %rdi
movq %rbp, %rsi
leaq 0x4(%rcx,%rbx), %r8
addq %rbx, %rcx
callq 0xb91f0
addq $0x8, %rbx
jmp 0xc8d7f
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x3982ab(%rip), %rdx # 0x461061
leaq 0x4(%rsp), %rcx
callq 0xb921e
vmovss 0x14(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %r9d
callq 0xc6da4
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rbx
orb %al, %cl
addq $0x8, %rbx
movq %rcx, %rax
jmp 0xc8c95
andb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<float> const&, double)
|
result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3b8, %rsp # imm = 0x3B8
vmovsd %xmm0, 0x60(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x30(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x46c07
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, 0x50(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0xca3b2
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x1c(%rsp)
jmp 0xca3bc
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x1c(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x78(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x70(%rsp)
vmovsd %xmm1, 0x68(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xe0(%rsp), %rdi
leaq 0x88(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0xc5c0e
movl 0xcc(%r12), %esi
leaq 0xa8(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x84(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x10(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x160(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0xca49d
cmpl $0x1, %eax
je 0xca477
cmpl $0x2, %eax
jne 0xca4ae
movq 0x18(%r14), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0xca488
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x160(%rsp), %rsi
vmovsd 0x389ba8(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x44e5a
jmp 0xca4ae
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x44de5
vcvtsd2ss 0x50(%rsp), %xmm3, %xmm0
leaq 0x30(%rsp), %r15
movq %r13, 0x58(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
vmovss %xmm0, 0x2c(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x50(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x70(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x70(%rsp)
vcvtsd2ss 0x68(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
cmpl %ebx, %ebp
je 0xca520
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xca51c
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0xca4f9
leaq 0x168(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x158(%rsp), %ecx
movl 0x15c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x10(%rsp)
leaq 0x39001f(%rip), %rdx # 0x45a577
leaq 0x160(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x42b5a
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0xc5d9e
vcvtsd2ss 0x10(%rsp), %xmm3, %xmm0
vmovss 0xc(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x30(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0xca691
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0xc5de0
movq 0x130(%rsp), %rdx
movq 0x148(%rsp), %rcx
movl %eax, %ebx
leaq 0x160(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x42bbe
testl %ebx, %ebx
je 0xca739
cmpl %ebp, %ebx
jge 0xca627
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0xcb750
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0xca65d
vcvtsi2ss %ebx, %xmm3, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xca663
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0xca691
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0xcb788
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0xca691
incq %r15
jmp 0xca5ac
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0xca6b3
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0xca6e4
movq 0x20(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x84(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x160(%rsp), %rdi
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0xc6240
leaq 0x88(%rsp), %rdi
callq 0x4495c
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rax
addq $0x3b8, %rsp # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x45118
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xcb706
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
leaq 0xe0(%rsp), %r15
leaq 0x30(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0xca6a0
vmovss %xmm0, 0x10(%rsp)
vmulss 0x70(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
vmovss 0x68(%rsp), %xmm3
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0xc5fec
testl %eax, %eax
jne 0xca7f1
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x45118
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xcb706
movq %r14, %rdi
callq 0xcb788
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0xca6a0
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0xca918
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0xc5de0
testl %eax, %eax
je 0xca8ce
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0xca895
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xca8a1
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0xca918
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0xcb788
testb %al, %al
jne 0xca90c
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0xca816
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x45118
movl 0xc0(%r12), %eax
imull 0x40(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xcb706
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0xca918
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0xca782
jmp 0xca95e
jmp 0xca937
jmp 0xca95e
movq %rax, %r14
jmp 0xca96e
movq %rax, %r14
jmp 0xca97b
movq %rax, %r14
jmp 0xca988
movq %rax, %r14
jmp 0xca995
movq %rax, %r14
jmp 0xca99f
jmp 0xca95e
jmp 0xca95e
jmp 0xca95e
leaq 0x168(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0xca96e
leaq 0x160(%rsp), %rdi
movq %rax, %r14
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0xc6240
leaq 0x88(%rsp), %rdi
callq 0x4495c
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::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, 0x60(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x30(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x46c07
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, 0x50(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0xcaa96
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x1c(%rsp)
jmp 0xcaaa0
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x1c(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x78(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x70(%rsp)
vmovsd %xmm1, 0x68(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xe0(%rsp), %rdi
leaq 0x88(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0xc5c0e
movl 0xcc(%r12), %esi
leaq 0xa8(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x84(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x10(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x160(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0xcab81
cmpl $0x1, %eax
je 0xcab5b
cmpl $0x2, %eax
jne 0xcab92
movq 0x18(%r14), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0xcab6c
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x160(%rsp), %rsi
vmovsd 0x3894c4(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x44e5a
jmp 0xcab92
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x44de5
vcvtsd2ss 0x50(%rsp), %xmm3, %xmm0
leaq 0x30(%rsp), %r15
movq %r13, 0x58(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
vmovss %xmm0, 0x2c(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x50(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x70(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x70(%rsp)
vcvtsd2ss 0x68(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
cmpl %ebx, %ebp
je 0xcac04
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xcac00
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0xcabdd
leaq 0x168(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x158(%rsp), %ecx
movl 0x15c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x10(%rsp)
leaq 0x38f93b(%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 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0xc5d9e
vcvtsd2ss 0x10(%rsp), %xmm3, %xmm0
vmovss 0xc(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x30(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0xcad75
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0xc5de0
movq 0x130(%rsp), %rdx
movq 0x148(%rsp), %rcx
movl %eax, %ebx
leaq 0x160(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x434d2
testl %ebx, %ebx
je 0xcae1d
cmpl %ebp, %ebx
jge 0xcad0b
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0xcb832
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0xcad41
vcvtsi2ss %ebx, %xmm3, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xcad47
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0xcad75
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0xcb86a
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0xcad75
incq %r15
jmp 0xcac90
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0xcad97
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0xcadc8
movq 0x20(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x84(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x160(%rsp), %rdi
callq 0x435d0
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0xc6240
leaq 0x88(%rsp), %rdi
callq 0x4495c
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rax
addq $0x3b8, %rsp # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x45118
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xcb7e8
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
leaq 0xe0(%rsp), %r15
leaq 0x30(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0xcad84
vmovss %xmm0, 0x10(%rsp)
vmulss 0x70(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
vmovss 0x68(%rsp), %xmm3
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0xc5fec
testl %eax, %eax
jne 0xcaed5
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x45118
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xcb7e8
movq %r14, %rdi
callq 0xcb86a
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0xcad84
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0xcaffc
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0xc5de0
testl %eax, %eax
je 0xcafb2
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0xcaf79
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xcaf85
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0xcaffc
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0xcb86a
testb %al, %al
jne 0xcaff0
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0xcaefa
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x45118
movl 0xc0(%r12), %eax
imull 0x40(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xcb7e8
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0xcaffc
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0xcae66
jmp 0xcb042
jmp 0xcb01b
jmp 0xcb042
movq %rax, %r14
jmp 0xcb052
movq %rax, %r14
jmp 0xcb05f
movq %rax, %r14
jmp 0xcb06c
movq %rax, %r14
jmp 0xcb079
movq %rax, %r14
jmp 0xcb083
jmp 0xcb042
jmp 0xcb042
jmp 0xcb042
leaq 0x168(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0xcb052
leaq 0x160(%rsp), %rdi
movq %rax, %r14
callq 0x435d0
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0xc6240
leaq 0x88(%rsp), %rdi
callq 0x4495c
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<float> const&, double)
|
result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp # imm = 0x168
vmovsd %xmm0, 0x58(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x18(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x28(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x90(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 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 0xcb17a
movq 0x10(%r14), %rdi
leaq 0x90(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x14(%rsp)
jmp 0xcb184
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x14(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x70(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x68(%rsp)
vmovsd %xmm1, 0x60(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xe8(%rsp), %rdi
leaq 0x90(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0xc5c0e
movl 0xcc(%r12), %esi
leaq 0xb0(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x7c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x80(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0xcb262
cmpl $0x1, %eax
je 0xcb23c
cmpl $0x2, %eax
jne 0xcb273
movq 0x18(%r14), %rdx
leaq 0x80(%rsp), %rdi
leaq 0x28(%rsp), %rsi
jmp 0xcb24d
movq 0x18(%r14), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x80(%rsp), %rsi
vmovsd 0x388de3(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x44e5a
jmp 0xcb273
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 0xcb2e5
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xcb2e1
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0xcb2be
leaq 0x88(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, 0x8(%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0xc5d9e
vcvtsd2ss 0x8(%rsp), %xmm3, %xmm0
vmovss 0x4(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x28(%rsp), %rbx
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0xcb408
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
movq %rbx, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0xc5de0
movl %eax, %r13d
testl %eax, %eax
je 0xcb4a0
cmpl %ebp, %r13d
jge 0xcb39d
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0xcb914
movl %r13d, %ebp
cmpq 0x70(%rsp), %r15
jle 0xcb3d4
vcvtsi2ss %r13d, %xmm3, %xmm0
vcvtsi2ssl 0x160(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss 0x8(%rsp), %xmm1
vfmadd231ss 0x24(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xcb3da
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xcb408
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0xcb94c
vmovss 0x8(%rsp), %xmm0
vmovss 0x4(%rsp), %xmm2
testb %al, %al
jne 0xcb408
incq %r15
jmp 0xcb343
movq 0x18(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0xcb42a
movq 0x18(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0xcb458
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 0xb0(%rsp), %rdi
callq 0x393ac
leaq 0xe8(%rsp), %rdi
callq 0xc6240
leaq 0x90(%rsp), %rdi
callq 0x4495c
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%rsp), %rax
addq $0x168, %rsp # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rbx
movq %rbx, %rsi
callq 0x45118
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xcb8ca
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
leaq 0xe8(%rsp), %r15
leaq 0x28(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x38(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0xcb417
vmovss %xmm0, 0x8(%rsp)
vmulss 0x68(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
vmovss 0x60(%rsp), %xmm3
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0xc5fec
testl %eax, %eax
jne 0xcb558
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 0xcb8ca
movq %r14, %rdi
callq 0xcb94c
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
testb %al, %al
jne 0xcb417
movl %ebx, 0x70(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0xcb67f
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0xc5de0
testl %eax, %eax
je 0xcb635
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0xcb5fc
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x160(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss 0x8(%rsp), %xmm1
vmovss 0x4(%rsp), %xmm2
vfmadd231ss 0x24(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xcb608
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xcb67f
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0xcb94c
testb %al, %al
jne 0xcb673
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
incl %ebx
jmp 0xcb57d
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 0xcb8ca
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
jmp 0xcb67f
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
movl 0x70(%rsp), %ebx
decl 0x38(%rsp)
incl %ebx
jmp 0xcb4e9
jmp 0xcb6c0
jmp 0xcb699
jmp 0xcb6c0
movq %rax, %r14
jmp 0xcb6d0
movq %rax, %r14
jmp 0xcb6dd
movq %rax, %r14
jmp 0xcb6ea
movq %rax, %r14
jmp 0xcb6f4
jmp 0xcb6c0
jmp 0xcb6c0
jmp 0xcb6c0
leaq 0x88(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0xcb6c3
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0x393ac
leaq 0xe8(%rsp), %rdi
callq 0xc6240
leaq 0x90(%rsp), %rdi
callq 0x4495c
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::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 0xcb74e
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0xcb7c8
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::pnm_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x38e2cf(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long)
|
inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
}
|
vucomisd 0x30(%rdi), %xmm0
jbe 0xcb830
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0xcb8aa
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::none_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x38e10b(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::optimize_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::quadratic_cost_type<float>, float, baryonyx::itm::maximize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<float> const&, double)
|
void operator()(const std::atomic_bool& stop_task,
best_solution_recorder<Cost, Float, Mode>& best_recorder,
const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
bit_array x(variables);
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_local_ctx.rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const auto w_limit = static_cast<long int>(p.w);
Solver slv(m_local_ctx.rng,
length(constraints),
variables,
norm_costs,
constraints);
compute_order compute(p.order, variables);
bool is_a_solution = false;
while (!stop_task.load()) {
++m_call_number;
const auto kappa_start = static_cast<Float>(best_recorder.reinit(
m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x));
auto kappa = kappa_start;
compute.init(slv, x);
auto best_remaining = INT_MAX;
is_a_solution = false;
for (long int i = 0; !stop_task.load() && i != p.limit; ++i) {
auto remaining =
compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
i);
best_remaining = 0;
is_a_solution = true;
break;
} else {
best_remaining = std::min(remaining, best_remaining);
}
if (i > w_limit)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
if (best_remaining > 0) {
best_recorder.try_advance(
m_local_ctx, x, best_remaining, p.limit);
continue;
}
for (int push = 0; !stop_task.load() && push < p.pushes_limit;
++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_local_ctx.rng,
pushing_k_factor,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
is_a_solution = true;
}
kappa = kappa_start;
for (int iter = 0;
!stop_task.load() && iter < p.pushing_iteration_limit;
++iter) {
remaining = compute.run(
slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
is_a_solution = true;
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
}
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp # imm = 0x158
movq %rdi, %rbp
leaq 0x18(%rsp), %rdi
movq %rsi, %r15
movl %r8d, %esi
vmovsd %xmm0, 0x58(%rsp)
movq %r9, %r12
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x28(%rsp)
callq 0x368ae
movq (%rbp), %r13
movq %rbp, 0x70(%rsp)
addq $0x8, %rbp
leaq 0x80(%rsp), %rdi
movq %r13, %rsi
movq %r12, 0x50(%rsp)
movq %r12, %rdx
movq %rbp, %rcx
movl %ebx, %r8d
callq 0x46c07
vmovsd 0x20(%r13), %xmm0
vmovsd 0x10(%r13), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, (%rsp)
vmovsd 0x28(%r13), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r13), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r13), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0xcbe81
movq 0x70(%rsp), %rax
movq (%rax), %rdi
leaq 0x80(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x8(%rsp)
jmp 0xcbe8b
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x8(%rsp)
vcvttsd2si 0xa0(%r13), %rax
vmovsd 0x38(%r13), %xmm0
vmovsd 0x40(%r13), %xmm1
movq %rax, 0x78(%rsp)
movq 0x8(%r14), %rax
vmovsd %xmm0, 0x38(%rsp)
vmovsd %xmm1, 0x60(%rsp)
subq (%r14), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd8(%rsp), %rdi
leaq 0x80(%rsp), %r8
movq %rbp, %rsi
movl %eax, %edx
movl %ebx, %ecx
movq %r14, %r9
callq 0xcc2da
movl 0xcc(%r13), %esi
leaq 0xa0(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
vcvtsd2ss (%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x34(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x40(%rsp)
vcvtsd2ss 0x38(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x6c(%rsp)
vcvtsd2ss 0x60(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
movq $0x0, 0x10(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0xcc241
movq 0x70(%rsp), %rax
incq 0xb0(%rax)
vmovsd 0x18(%r13), %xmm0
vmovsd 0x28(%r13), %xmm1
movzbl 0x10(%rsp), %edx
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbp, %rsi
movq %rbx, %rcx
andl $0x1, %edx
callq 0x46f82
vmovsd %xmm0, (%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdx
callq 0xcc44a
vcvtsd2ss (%rsp), %xmm3, %xmm0
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
vmovss %xmm0, 0x60(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0xcc042
cmpq 0xb0(%r13), %r14
je 0xcc042
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbp, %rcx
vmovss %xmm0, (%rsp)
callq 0xcc48c
testl %eax, %eax
je 0xcc05a
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0x78(%rsp), %r14
jle 0xcc02d
vcvtsi2ss %eax, %xmm3, %xmm0
vcvtsi2ssl 0x150(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss (%rsp), %xmm1
vfmadd231ss 0x34(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xcc032
vmovss (%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xcc042
incq %r14
jmp 0xcbfa9
testl %ebx, %ebx
jg 0xcc221
leaq 0x18(%rsp), %rbx
movq $0x0, 0x10(%rsp)
jmp 0xcc08c
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x45118
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x472d0
movb $0x1, %al
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x38(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0xcbf39
cmpl 0xbc(%r13), %r14d
jge 0xcbf39
vmovss 0x6c(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vmovss 0x68(%rsp), %xmm3
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0xcc698
testl %eax, %eax
jne 0xcc120
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x45118
movl 0xc0(%r13), %eax
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
imull %r14d, %eax
notl %eax
movslq %eax, %rcx
callq 0x472d0
movb $0x1, %al
movq %rax, 0x10(%rsp)
pushq $0x1
popq %rax
vmovss 0x60(%rsp), %xmm0
movl %eax, %ebx
movb (%r15), %al
testb $0x1, %al
jne 0xcc1cb
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0xcc1cb
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbp, %rcx
vmovss %xmm0, (%rsp)
callq 0xcc48c
testl %eax, %eax
je 0xcc1d2
vcvtsi2sd %r12d, %xmm4, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0xcc1b7
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x150(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss (%rsp), %xmm1
vfmadd231ss 0x34(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xcc1bc
vmovss (%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xcc1cb
incl %ebx
jmp 0xcc12b
leaq 0x18(%rsp), %rbx
jmp 0xcc215
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %r12
movq %r12, %rsi
callq 0x45118
movl 0xc0(%r13), %eax
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
imull 0x38(%rsp), %eax
subl %ebx, %eax
movq %r12, %rbx
movslq %eax, %rcx
callq 0x472d0
movb $0x1, %al
movq %rax, 0x10(%rsp)
decl 0x38(%rsp)
incl %r14d
jmp 0xcc097
movq 0xb0(%r13), %r8
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0x47358
jmp 0xcbf30
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0xcc8ec
leaq 0x80(%rsp), %rdi
callq 0x4495c
leaq 0x20(%rsp), %rdi
callq 0x357fe
addq $0x158, %rsp # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcc28b
movq %rax, %rbx
jmp 0xcc2ad
movq %rax, %rbx
jmp 0xcc2ba
movq %rax, %rbx
jmp 0xcc2c7
jmp 0xcc29d
jmp 0xcc29d
jmp 0xcc29d
jmp 0xcc29d
leaq 0xa0(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0xcc8ec
leaq 0x80(%rsp), %rdi
callq 0x4495c
leaq 0x20(%rsp), %rdi
callq 0x357fe
movq %rbx, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
|
baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::solver_equalities_01coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::quadratic_cost_type<float> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&)
|
solver_equalities_01coeff(random_engine& rng_,
int m_,
int n_,
const cost_type& c_,
const std::vector<merged_constraint>& csts)
: logger("solver_equalities_01coeff")
, rng(rng_)
, ap(csts, m_, n_)
, P(std::make_unique<Float[]>(ap.size()))
, R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts)))
, b(std::make_unique<bound_factor[]>(m_))
, pi(std::make_unique<Float[]>(m_))
, c(c_)
, m(m_)
, n(n_)
{
for (int i = 0; i != m; ++i) {
#if !defined(BARYONYX_FULL_OPTIMIZATION)
// mscv 15.9.6 fail to build this line:
// for ([[maybe_unused]] const auto& cst : csts[i].elements)
// bx_ensures(cst.factor == 1);
for (const auto& cst : csts[i].elements)
bx_ensures(cst.factor == 1);
#endif
bx_ensures(csts[i].min == csts[i].max);
b[i] = csts[i].min;
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
andq $0x0, (%rdi)
leaq 0x10(%rdi), %r14
movq %rsi, 0x8(%rdi)
movq %rdi, %rbx
movq %r9, %r12
movq %r8, 0x20(%rsp)
movl %ecx, %r13d
movl %edx, %ebp
movq %r9, %rsi
movq %r14, %rdi
callq 0x3a4ca
movl 0x38(%rbx), %esi
leaq 0x50(%rbx), %r15
movq %r15, %rdi
movq %r14, 0x18(%rsp)
callq 0x35bd8
movq %r12, %rdi
movq %r15, 0x10(%rsp)
leaq 0x58(%rbx), %r14
callq 0x3a89d
movq %r14, 0x8(%rsp)
movq %r14, %rdi
movq %rax, %rsi
callq 0xcc921
leaq 0x60(%rbx), %r14
movslq %ebp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x28eb6
leaq 0x68(%rbx), %rdi
movq %r15, %rsi
callq 0x35bd8
movq 0x20(%rsp), %rax
xorl %edx, %edx
movq %rax, 0x70(%rbx)
movl %ebp, 0x78(%rbx)
movl %r13d, 0x7c(%rbx)
movq (%r12), %rax
movq 0x60(%rbx), %rcx
movl %ebp, %esi
cmpq %rsi, %rdx
je 0xcc3b8
imulq $0x28, %rdx, %rdi
leaq (%rax,%rdi), %rsi
movq (%rax,%rdi), %r8
movq 0x8(%rax,%rdi), %rdi
cmpq %rdi, %r8
je 0xcc3a5
cmpl $0x1, (%r8)
leaq 0x8(%r8), %r8
je 0xcc394
jmp 0xcc3c7
movl 0x18(%rsi), %edi
cmpl 0x1c(%rsi), %edi
jne 0xcc3e8
movl %edi, (%rcx,%rdx,4)
incq %rdx
movl 0x78(%rbx), %ebp
jmp 0xcc37c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x38c05c(%rip), %rdi # 0x45842a
leaq 0x38fe86(%rip), %rsi # 0x45c25b
leaq 0x38fe8f(%rip), %rdx # 0x45c26b
leaq 0x38e0c7(%rip), %rcx # 0x45a4aa
callq 0x2813f
leaq 0x38c03b(%rip), %rdi # 0x45842a
leaq 0x38fedf(%rip), %rsi # 0x45c2d5
leaq 0x38fe6e(%rip), %rdx # 0x45c26b
leaq 0x38feec(%rip), %rcx # 0x45c2f0
callq 0x2813f
movq %r14, %rdi
movq %rax, %rbx
callq 0x28fb6
jmp 0xcc419
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0xcc962
jmp 0xcc428
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x35c1a
jmp 0xcc437
movq %rax, %rbx
movq 0x18(%rsp), %rdi
callq 0x3a954
movq %rbx, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float)
|
int run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta)
{
bool pi_changed = false;
int remaining = 0;
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.compute_update_row(
x, R.crbegin(), R.crend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl 0x30(%rdi), %eax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decl %eax
cmpl $0x6, %eax
ja 0xcc5cb
leaq 0x38f8c1(%rip), %rdx # 0x45bd74
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
callq 0xccb42
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xcca6f
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xce241
jmp 0xcc600
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xcd96b
jmp 0xcc55c
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xcddd6
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xccd30
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xcce20
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x3ceed
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xccc40
jmp 0xcc624
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xce733
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xccf06
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xcca6f
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x3ceed
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xccc40
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xccff6
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float, float)
|
int push_and_run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
bool pi_changed = 0;
int remaining = 0;
if (use_cycle)
order = next_state(order);
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.push_and_compute_update_row(x,
R.crbegin(),
R.crend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl 0x30(%rdi), %eax
cmpb $0x1, 0x34(%rdi)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
jne 0xcc6c4
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 0xcc85d
leaq 0x38f6ba(%rip), %rdx # 0x45bd90
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
callq 0xcec2a
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xcca6f
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xcf9e6
jmp 0xcc846
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xcf110
jmp 0xcc78e
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xcf57b
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xceea4
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xcce20
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x3ceed
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xced6e
jmp 0xcc86f
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xcfed8
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xcefda
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xcca6f
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x3ceed
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xced6e
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xccff6
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false> const, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false> const&, baryonyx::bit_array const&)
|
int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0xcc9ae
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 0xcca4f
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 0xcca0b
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0xcc9f2
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rax
movl (%rax,%rbp,4), %eax
movl %eax, %ecx
subl %ebx, %ecx
jle 0xcca2b
shlq $0x20, %rcx
orq %rbp, %rcx
movq %rcx, 0x8(%rsp)
jmp 0xcca3b
jge 0xcca4a
subl %eax, %ebx
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0xcc9d0
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false> const&, baryonyx::bit_array const&, std::vector<int, std::allocator<int>>&)
|
int
compute_violated_constraints(const Solver& slv,
const Xtype& x,
std::vector<int>& out)
{
out.clear();
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
out.emplace_back(k);
return length(out);
}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdx), %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rax, 0x8(%rdx)
je 0xcca8d
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x78(%r15), %esi
je 0xccac0
movq %r15, %rdi
movq %r14, %rdx
callq 0xccad7
testb %al, %al
jne 0xccab8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0xcca94
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false> const&, int, baryonyx::bit_array const&)
|
bool
is_valid_constraint(const Solver& slv, int k, const Xtype& x)
{
typename sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = slv.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += slv.factor(it->value) * x[it->column];
return slv.bound_min(k) <= v && v <= slv.bound_max(k);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
leaq 0x10(%rdi), %rsi
leaq 0x8(%rsp), %r15
movq %rdx, %r14
movq %rdi, %rbx
movl %ebp, %edx
movq %r15, %rdi
callq 0x3c868
movq (%r15), %r12
movq 0x8(%r15), %r13
xorl %r15d, %r15d
cmpq %r12, %r13
je 0xccb24
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %r15d
addq $0x8, %r13
jmp 0xccb0a
movq 0x60(%rbx), %rcx
movslq %ebp, %rax
cmpl (%rcx,%rax,4), %r15d
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::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);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm2, 0x14(%rsp)
vmovss %xmm1, 0x10(%rsp)
vmovss %xmm0, 0xc(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
movq %rax, 0x28(%rsp)
movq (%rdx), %rax
movq 0x30(%rsp), %rcx
cmpq (%rcx), %rax
je 0xccc2a
movslq -0x4(%rax), %rbx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0xcd036
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0xcd054
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
leaq (%rdi,%r13,8), %rsi
callq 0xcd121
movq 0x60(%r12), %rax
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
movl (%rax,%rbx,4), %r8d
cmpl %r8d, %r13d
cmovll %r13d, %r8d
decl %r8d
callq 0xcd154
orb %al, %bpl
movq (%r14), %rax
addq $-0x4, %rax
movq %rax, (%r14)
jmp 0xccb7e
andb $0x1, %bpl
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm2, 0x14(%rsp)
vmovss %xmm1, 0x10(%rsp)
vmovss %xmm0, 0xc(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
movq %rax, 0x28(%rsp)
cmpq 0x30(%rsp), %r14
je 0xccd1b
movslq (%r14), %rbx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0xcd036
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0xcd054
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
leaq (%rdi,%r13,8), %rsi
callq 0xcd121
movq 0x60(%r12), %rax
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
movl (%rax,%rbx,4), %r8d
cmpl %r8d, %r13d
cmovll %r13d, %r8d
decl %r8d
callq 0xcd154
orb %al, %bpl
addq $0x4, %r14
jmp 0xccc79
andb $0x1, %bpl
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm2, 0x14(%rsp)
vmovss %xmm1, 0x10(%rsp)
vmovss %xmm0, 0xc(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
movq %rax, 0x28(%rsp)
cmpq 0x30(%rsp), %r14
je 0xcce0b
movslq (%r14), %rbx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0xcd036
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0xcd054
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
leaq (%rdi,%r13,8), %rsi
callq 0xcd121
movq 0x60(%r12), %rax
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
movl (%rax,%rbx,4), %r8d
cmpl %r8d, %r13d
cmovll %r13d, %r8d
decl %r8d
callq 0xcd154
orb %al, %bpl
addq $0x8, %r14
jmp 0xccd69
andb $0x1, %bpl
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<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, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0xcce44
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 0xccee5
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 0xccea1
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0xcce88
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rax
movl (%rax,%rbp,4), %eax
movl %eax, %ecx
subl %ebx, %ecx
jle 0xccec1
shlq $0x20, %rcx
orq %rbp, %rcx
movq %rcx, 0x8(%rsp)
jmp 0xcced1
jge 0xccee0
subl %eax, %ebx
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0xcce66
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm2, 0x14(%rsp)
vmovss %xmm1, 0x10(%rsp)
vmovss %xmm0, 0xc(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
movq %rax, 0x28(%rsp)
cmpq 0x30(%rsp), %r14
je 0xccfe1
movslq (%r14), %rbx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0xcd036
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0xcd054
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
leaq (%rdi,%r13,8), %rsi
callq 0xcd121
movq 0x60(%r12), %rax
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
movl (%rax,%rbx,4), %r8d
cmpl %r8d, %r13d
cmovll %r13d, %r8d
decl %r8d
callq 0xcd154
orb %al, %bpl
addq $0x4, %r14
jmp 0xccf3f
andb $0x1, %bpl
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false> const&, baryonyx::bit_array const&)
|
int local_compute_violated_constraints(const Solver& slv, const Xtype& x)
{
int remaining = 0;
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
++remaining;
return remaining;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl 0x78(%r14), %r15d
je 0xcd028
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0xccad7
xorb $0x1, %al
incl %r15d
movzbl %al, %eax
addl %eax, %ebp
jmp 0xcd008
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, 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), %rbp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
xorl %r12d, %r12d
cmpq %r14, %r15
je 0xcd10f
movl 0x4(%r15), %edx
leaq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x3dede
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movq 0x50(%r13), %rdx
movq 0x68(%r13), %rsi
vxorps %xmm0, %xmm0, %xmm0
vxorps %xmm1, %xmm1, %xmm1
cmpq %rax, %rcx
je 0xcd0ca
movslq 0x4(%rcx), %rdi
vaddss (%rsi,%rdi,4), %xmm0, %xmm0
movslq (%rcx), %rdi
addq $0x8, %rcx
vaddss (%rdx,%rdi,4), %xmm1, %xmm1
movq %rcx, 0x10(%rsp)
jmp 0xcd0a9
movq 0x58(%r13), %rax
movq %rbx, %rdx
vmovss %xmm0, (%rsp)
vmovss %xmm1, 0x4(%rsp)
movl %r12d, 0x4(%rax,%r12,8)
movq 0x70(%r13), %rdi
movl 0x4(%r15), %esi
callq 0x49ffa
vsubss (%rsp), %xmm0, %xmm0
movq 0x58(%r13), %rax
addq $0x8, %r15
vsubss 0x4(%rsp), %xmm0, %xmm0
vmovss %xmm0, (%rax,%r12,8)
incq %r12
jmp 0xcd075
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::affect<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, float, float)
|
bool
affect(Solver& slv,
Xtype& x,
Iterator it,
int k,
int selected,
int r_size,
const Float kappa,
const Float delta)
{
constexpr Float one{ 1 };
constexpr Float two{ 2 };
constexpr Float middle{ (two + one) / two };
const auto old_pi = slv.pi[k];
auto d = delta;
if (selected < 0) {
// slv.pi[k] += slv.R[0].value / two;
d += (kappa / (one - kappa)) * (slv.R[0].value / two);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
} else if (selected + 1 >= r_size) {
// slv.pi[k] += slv.R[selected].value * middle;
d += (kappa / (one - kappa)) * (slv.R[selected].value * middle);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
} else {
slv.pi[k] +=
((slv.R[selected].value + slv.R[selected + 1].value) / two);
d += (kappa / (one - kappa)) *
(slv.R[selected + 1].value - slv.R[selected].value);
int i = 0;
for (; i <= selected; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
for (; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
}
// TODO job: develops is_valid_constraint for all the solvers
bx_expects(is_valid_constraint(slv, k, x));
return is_signbit_change(old_pi, slv.pi[k]);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x68(%rbx), %rax
movslq %ecx, %rdi
movq %rdx, %r15
movq %rsi, %r14
movl %ecx, 0x14(%rsp)
movq %rdi, 0x18(%rsp)
vmovss (%rax,%rdi,4), %xmm3
vmovaps %xmm3, 0x20(%rsp)
testl %r8d, %r8d
js 0xcd229
leal 0x1(%r8), %ecx
cmpl %r9d, %ecx
jge 0xcd295
movq 0x58(%rbx), %rsi
movl %r8d, %edx
movl %ecx, %ebp
xorl %r13d, %r13d
movl %r9d, 0x10(%rsp)
vmovss (%rsi,%rdx,8), %xmm2
vaddss (%rsi,%rbp,8), %xmm2, %xmm2
vmulss 0x38c911(%rip), %xmm2, %xmm2 # 0x459ad0
vaddss %xmm2, %xmm3, %xmm2
vmovss %xmm2, (%rax,%rdi,4)
vmovss 0x38c8f4(%rip), %xmm2 # 0x459ac4
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rsi,%rbp,8), %xmm2
vsubss (%rsi,%rdx,8), %xmm2, %xmm2
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %r13, %rbp
je 0xcd301
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%r13,8), %r12
movl 0x4(%r15,%r12,8), %esi
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
vmovss 0xc(%rsp), %xmm0
incq %r13
vaddss (%rcx,%rax,4), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xcd1ed
vmovss 0x38c893(%rip), %xmm2 # 0x459ac4
movq 0x58(%rbx), %rax
movl %r9d, %r12d
xorl %ebp, %ebp
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rax), %xmm2
vmulss 0x38c882(%rip), %xmm2, %xmm2 # 0x459ad0
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %rbp, %r12
je 0xcd33e
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
incq %rbp
vmovss (%rcx,%rax,4), %xmm0
vsubss 0xc(%rsp), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xcd259
vmovss 0x38c827(%rip), %xmm2 # 0x459ac4
movq 0x58(%rbx), %rcx
movl %r8d, %eax
movl %r9d, %r12d
xorl %ebp, %ebp
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rcx,%rax,8), %xmm2
vmulss 0x38ea0a(%rip), %xmm2, %xmm2 # 0x45bcc8
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %rbp, %r12
je 0xcd33e
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovss 0xc(%rsp), %xmm0
incq %rbp
vaddss (%rcx,%rax,4), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xcd2c9
movl 0x10(%rsp), %r12d
cmpq %rbp, %r12
je 0xcd33e
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
incq %rbp
vmovss (%rcx,%rax,4), %xmm0
vsubss 0xc(%rsp), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xcd306
movl 0x14(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xccad7
testb %al, %al
je 0xcd37c
vmovaps 0x20(%rsp), %xmm0
movq 0x68(%rbx), %rcx
movq 0x18(%rsp), %rdx
vmovmskps %xmm0, %eax
shll $0x1f, %eax
xorl (%rcx,%rdx,4), %eax
shrl $0x1f, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x38ae5b(%rip), %rdi # 0x4581de
leaq 0x38ef92(%rip), %rsi # 0x45c31c
leaq 0x38cbfb(%rip), %rdx # 0x459f8c
leaq 0x38efa3(%rip), %rcx # 0x45c33b
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::rc_data*>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::rc_data*, baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::rc_data*, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&)
|
inline void
random_shuffle_unique(iteratorT begin,
iteratorT end,
random_engine& rng) noexcept
{
auto ret = begin++;
for (; begin != end; ++begin) {
if (ret->value != begin->value) {
std::shuffle(ret, begin, rng);
ret = begin;
}
}
std::shuffle(ret, begin, rng);
}
|
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x8(%rdi), %rsi
cmpq %r14, %rsi
je 0xcd3d8
vmovss (%rdi), %xmm0
leaq 0x8(%rsi), %r15
vucomiss (%rsi), %xmm0
movq %r15, %rsi
jne 0xcd3c4
jnp 0xcd3ac
addq $-0x8, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0xcd83f
movq %r15, %rdi
jmp 0xcd3a8
movq %rbx, %rdx
callq 0xcd83f
popq %rbx
popq %r14
popq %r15
retq
jmp 0xcd3e8
movq %rax, %rdi
callq 0xeb9f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::push_and_compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, float, float, float, float)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
movq %rcx, 0x30(%rsp)
movq %rsi, %r15
movq %rdi, %r13
movq %rdx, 0x28(%rsp)
xorl %r12d, %r12d
movq %rax, 0x20(%rsp)
movq (%rdx), %rax
movq 0x30(%rsp), %rcx
cmpq (%rcx), %rax
je 0xced57
movl -0x4(%rax), %eax
movq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdi
movslq %eax, %rbp
movl %ebp, %edx
callq 0x3de66
vmovss 0x8(%rsp), %xmm0
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0xcd036
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r13, %rdi
movq %r15, %rcx
callq 0xcd054
movl %eax, %ebx
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0xcecfa
movq 0x58(%r13), %rax
movq 0x70(%r13), %rdi
movq %r15, %rdx
movl 0x4(%rax,%r14,8), %esi
callq 0x49ffa
movq 0x58(%r13), %rax
vmovss 0xc(%rsp), %xmm1
vfmadd213ss (%rax,%r14,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rax,%r14,8)
incq %r14
jmp 0xcecc5
movq 0x58(%r13), %rdi
movq 0x8(%r13), %rdx
movslq %ebx, %rbx
leaq (%rdi,%rbx,8), %rsi
callq 0xcd121
movq 0x60(%r13), %rax
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
movq 0x18(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %ebx, %r9d
movl (%rax,%rbp,4), %r8d
cmpl %r8d, %ebx
cmovll %ebx, %r8d
decl %r8d
callq 0xcd154
movq 0x28(%rsp), %rcx
orb %al, %r12b
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0xcec6e
andb $0x1, %r12b
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<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*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, float, float, float, float)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movq %rax, 0x20(%rsp)
xorl %eax, %eax
cmpq 0x28(%rsp), %r14
je 0xcee93
movl (%r14), %ecx
movq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdi
movq %rax, 0x30(%rsp)
movslq %ecx, %rbp
movl %ebp, %edx
callq 0x3de66
vmovss 0x8(%rsp), %xmm0
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0xcd036
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0xcd054
movl %eax, %ebx
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0xcee3a
movq 0x58(%r13), %rax
movq 0x70(%r13), %rdi
movq %r12, %rdx
movl 0x4(%rax,%r15,8), %esi
callq 0x49ffa
movq 0x58(%r13), %rax
vmovss 0xc(%rsp), %xmm1
vfmadd213ss (%rax,%r15,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rax,%r15,8)
incq %r15
jmp 0xcee05
movq 0x58(%r13), %rdi
movq 0x8(%r13), %rdx
movslq %ebx, %rbx
leaq (%rdi,%rbx,8), %rsi
callq 0xcd121
movq 0x60(%r13), %rax
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
movq 0x18(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %ebx, %r9d
movl (%rax,%rbp,4), %r8d
cmpl %r8d, %ebx
cmovll %ebx, %r8d
decl %r8d
callq 0xcd154
movq 0x30(%rsp), %rcx
addq $0x4, %r14
orb %al, %cl
movq %rcx, %rax
jmp 0xcedac
andb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, float, float, float, float)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movq %rax, 0x20(%rsp)
xorl %eax, %eax
cmpq 0x28(%rsp), %r14
je 0xcefc9
movl (%r14), %ecx
movq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdi
movq %rax, 0x30(%rsp)
movslq %ecx, %rbp
movl %ebp, %edx
callq 0x3de66
vmovss 0x8(%rsp), %xmm0
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0xcd036
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0xcd054
movl %eax, %ebx
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0xcef70
movq 0x58(%r13), %rax
movq 0x70(%r13), %rdi
movq %r12, %rdx
movl 0x4(%rax,%r15,8), %esi
callq 0x49ffa
movq 0x58(%r13), %rax
vmovss 0xc(%rsp), %xmm1
vfmadd213ss (%rax,%r15,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rax,%r15,8)
incq %r15
jmp 0xcef3b
movq 0x58(%r13), %rdi
movq 0x8(%r13), %rdx
movslq %ebx, %rbx
leaq (%rdi,%rbx,8), %rsi
callq 0xcd121
movq 0x60(%r13), %rax
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
movq 0x18(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %ebx, %r9d
movl (%rax,%rbp,4), %r8d
cmpl %r8d, %ebx
cmovll %ebx, %r8d
decl %r8d
callq 0xcd154
movq 0x30(%rsp), %rcx
addq $0x8, %r14
orb %al, %cl
movq %rcx, %rax
jmp 0xceee2
andb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::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 objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movq %rax, 0x20(%rsp)
xorl %eax, %eax
cmpq 0x28(%rsp), %r14
je 0xcf0ff
movl (%r14), %ecx
movq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdi
movq %rax, 0x30(%rsp)
movslq %ecx, %rbp
movl %ebp, %edx
callq 0x3de66
vmovss 0x8(%rsp), %xmm0
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0xcd036
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0xcd054
movl %eax, %ebx
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0xcf0a6
movq 0x58(%r13), %rax
movq 0x70(%r13), %rdi
movq %r12, %rdx
movl 0x4(%rax,%r15,8), %esi
callq 0x49ffa
movq 0x58(%r13), %rax
vmovss 0xc(%rsp), %xmm1
vfmadd213ss (%rax,%r15,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rax,%r15,8)
incq %r15
jmp 0xcf071
movq 0x58(%r13), %rdi
movq 0x8(%r13), %rdx
movslq %ebx, %rbx
leaq (%rdi,%rbx,8), %rsi
callq 0xcd121
movq 0x60(%r13), %rax
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
movq 0x18(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %ebx, %r9d
movl (%rax,%rbp,4), %r8d
cmpl %r8d, %ebx
cmovll %ebx, %r8d
decl %r8d
callq 0xcd154
movq 0x30(%rsp), %rcx
addq $0x4, %r14
orb %al, %cl
movq %rcx, %rax
jmp 0xcf018
andb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<float> const&, double)
|
result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3b8, %rsp # imm = 0x3B8
vmovsd %xmm0, 0x60(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x30(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x46c07
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, 0x50(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0xd04da
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x1c(%rsp)
jmp 0xd04e4
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x1c(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x78(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x70(%rsp)
vmovsd %xmm1, 0x68(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xe0(%rsp), %rdi
leaq 0x88(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0xcc2da
movl 0xcc(%r12), %esi
leaq 0xa8(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x84(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x10(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x160(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0xd05c5
cmpl $0x1, %eax
je 0xd059f
cmpl $0x2, %eax
jne 0xd05d6
movq 0x18(%r14), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0xd05b0
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x160(%rsp), %rsi
vmovsd 0x383a80(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x44e5a
jmp 0xd05d6
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x44de5
vcvtsd2ss 0x50(%rsp), %xmm3, %xmm0
leaq 0x30(%rsp), %r15
movq %r13, 0x58(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
vmovss %xmm0, 0x2c(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x50(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x70(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x70(%rsp)
vcvtsd2ss 0x68(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
cmpl %ebx, %ebp
je 0xd0648
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xd0644
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0xd0621
leaq 0x168(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x158(%rsp), %ecx
movl 0x15c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x10(%rsp)
leaq 0x389ef7(%rip), %rdx # 0x45a577
leaq 0x160(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x42b5a
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0xcc44a
vcvtsd2ss 0x10(%rsp), %xmm3, %xmm0
vmovss 0xc(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x30(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0xd07b9
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0xcc48c
movq 0x130(%rsp), %rdx
movq 0x148(%rsp), %rcx
movl %eax, %ebx
leaq 0x160(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x42bbe
testl %ebx, %ebx
je 0xd0861
cmpl %ebp, %ebx
jge 0xd074f
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0xd1878
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0xd0785
vcvtsi2ss %ebx, %xmm3, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xd078b
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0xd07b9
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0xd18b0
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0xd07b9
incq %r15
jmp 0xd06d4
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0xd07db
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0xd080c
movq 0x20(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x84(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x160(%rsp), %rdi
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0xcc8ec
leaq 0x88(%rsp), %rdi
callq 0x4495c
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rax
addq $0x3b8, %rsp # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x45118
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xd182e
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
leaq 0xe0(%rsp), %r15
leaq 0x30(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0xd07c8
vmovss %xmm0, 0x10(%rsp)
vmulss 0x70(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
vmovss 0x68(%rsp), %xmm3
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0xcc698
testl %eax, %eax
jne 0xd0919
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x45118
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xd182e
movq %r14, %rdi
callq 0xd18b0
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0xd07c8
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0xd0a40
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0xcc48c
testl %eax, %eax
je 0xd09f6
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0xd09bd
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xd09c9
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0xd0a40
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0xd18b0
testb %al, %al
jne 0xd0a34
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0xd093e
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x45118
movl 0xc0(%r12), %eax
imull 0x40(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xd182e
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0xd0a40
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0xd08aa
jmp 0xd0a86
jmp 0xd0a5f
jmp 0xd0a86
movq %rax, %r14
jmp 0xd0a96
movq %rax, %r14
jmp 0xd0aa3
movq %rax, %r14
jmp 0xd0ab0
movq %rax, %r14
jmp 0xd0abd
movq %rax, %r14
jmp 0xd0ac7
jmp 0xd0a86
jmp 0xd0a86
jmp 0xd0a86
leaq 0x168(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0xd0a96
leaq 0x160(%rsp), %rdi
movq %rax, %r14
callq 0x42cbc
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0xcc8ec
leaq 0x88(%rsp), %rdi
callq 0x4495c
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::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, 0x60(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x30(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x46c07
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, 0x50(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0xd0bbe
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x1c(%rsp)
jmp 0xd0bc8
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x1c(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x78(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x70(%rsp)
vmovsd %xmm1, 0x68(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xe0(%rsp), %rdi
leaq 0x88(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0xcc2da
movl 0xcc(%r12), %esi
leaq 0xa8(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x84(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x10(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x160(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0xd0ca9
cmpl $0x1, %eax
je 0xd0c83
cmpl $0x2, %eax
jne 0xd0cba
movq 0x18(%r14), %rdx
leaq 0x160(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0xd0c94
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x160(%rsp), %rsi
vmovsd 0x38339c(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x44e5a
jmp 0xd0cba
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x44de5
vcvtsd2ss 0x50(%rsp), %xmm3, %xmm0
leaq 0x30(%rsp), %r15
movq %r13, 0x58(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
vmovss %xmm0, 0x2c(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x50(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x70(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x70(%rsp)
vcvtsd2ss 0x68(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
cmpl %ebx, %ebp
je 0xd0d2c
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xd0d28
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0xd0d05
leaq 0x168(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x158(%rsp), %ecx
movl 0x15c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x10(%rsp)
leaq 0x389813(%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 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0xcc44a
vcvtsd2ss 0x10(%rsp), %xmm3, %xmm0
vmovss 0xc(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x30(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0xd0e9d
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0xcc48c
movq 0x130(%rsp), %rdx
movq 0x148(%rsp), %rcx
movl %eax, %ebx
leaq 0x160(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x434d2
testl %ebx, %ebx
je 0xd0f45
cmpl %ebp, %ebx
jge 0xd0e33
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0xd195a
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0xd0e69
vcvtsi2ss %ebx, %xmm3, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xd0e6f
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0xd0e9d
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0xd1992
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0xd0e9d
incq %r15
jmp 0xd0db8
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0xd0ebf
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0xd0ef0
movq 0x20(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x84(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x160(%rsp), %rdi
callq 0x435d0
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0xcc8ec
leaq 0x88(%rsp), %rdi
callq 0x4495c
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rax
addq $0x3b8, %rsp # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x45118
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xd1910
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
leaq 0xe0(%rsp), %r15
leaq 0x30(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0xd0eac
vmovss %xmm0, 0x10(%rsp)
vmulss 0x70(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
vmovss 0x68(%rsp), %xmm3
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0xcc698
testl %eax, %eax
jne 0xd0ffd
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x45118
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xd1910
movq %r14, %rdi
callq 0xd1992
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0xd0eac
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0xd1124
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0xcc48c
testl %eax, %eax
je 0xd10da
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0xd10a1
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x158(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xd10ad
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0xd1124
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0xd1992
testb %al, %al
jne 0xd1118
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0xd1022
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x45118
movl 0xc0(%r12), %eax
imull 0x40(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xd1910
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0xd1124
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0xd0f8e
jmp 0xd116a
jmp 0xd1143
jmp 0xd116a
movq %rax, %r14
jmp 0xd117a
movq %rax, %r14
jmp 0xd1187
movq %rax, %r14
jmp 0xd1194
movq %rax, %r14
jmp 0xd11a1
movq %rax, %r14
jmp 0xd11ab
jmp 0xd116a
jmp 0xd116a
jmp 0xd116a
leaq 0x168(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0xd117a
leaq 0x160(%rsp), %rdi
movq %rax, %r14
callq 0x435d0
leaq 0xa8(%rsp), %rdi
callq 0x393ac
leaq 0xe0(%rsp), %rdi
callq 0xcc8ec
leaq 0x88(%rsp), %rdi
callq 0x4495c
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<float> const&, double)
|
result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp # imm = 0x168
vmovsd %xmm0, 0x58(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x18(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x28(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x90(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 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 0xd12a2
movq 0x10(%r14), %rdi
leaq 0x90(%rsp), %rsi
movl %ebx, %edx
callq 0x46ce1
vmovss %xmm0, 0x14(%rsp)
jmp 0xd12ac
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x14(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x70(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x68(%rsp)
vmovsd %xmm1, 0x60(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xe8(%rsp), %rdi
leaq 0x90(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0xcc2da
movl 0xcc(%r12), %esi
leaq 0xb0(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x7c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x80(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0xd138a
cmpl $0x1, %eax
je 0xd1364
cmpl $0x2, %eax
jne 0xd139b
movq 0x18(%r14), %rdx
leaq 0x80(%rsp), %rdi
leaq 0x28(%rsp), %rsi
jmp 0xd1375
movq 0x18(%r14), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x80(%rsp), %rsi
vmovsd 0x382cbb(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x44e5a
jmp 0xd139b
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 0xd140d
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xd1409
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0xd13e6
leaq 0x88(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, 0x8(%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0xcc44a
vcvtsd2ss 0x8(%rsp), %xmm3, %xmm0
vmovss 0x4(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x28(%rsp), %rbx
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0xd1530
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xb0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
movq %rbx, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0xcc48c
movl %eax, %r13d
testl %eax, %eax
je 0xd15c8
cmpl %ebp, %r13d
jge 0xd14c5
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0xd1a3c
movl %r13d, %ebp
cmpq 0x70(%rsp), %r15
jle 0xd14fc
vcvtsi2ss %r13d, %xmm3, %xmm0
vcvtsi2ssl 0x160(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss 0x8(%rsp), %xmm1
vfmadd231ss 0x24(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xd1502
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xd1530
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0xd1a74
vmovss 0x8(%rsp), %xmm0
vmovss 0x4(%rsp), %xmm2
testb %al, %al
jne 0xd1530
incq %r15
jmp 0xd146b
movq 0x18(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0xd1552
movq 0x18(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0xd1580
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 0xb0(%rsp), %rdi
callq 0x393ac
leaq 0xe8(%rsp), %rdi
callq 0xcc8ec
leaq 0x90(%rsp), %rdi
callq 0x4495c
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%rsp), %rax
addq $0x168, %rsp # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rbx
movq %rbx, %rsi
callq 0x45118
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xd19f2
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
leaq 0xe8(%rsp), %r15
leaq 0x28(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x38(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0xd153f
vmovss %xmm0, 0x8(%rsp)
vmulss 0x68(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
vmovss 0x60(%rsp), %xmm3
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0xcc698
testl %eax, %eax
jne 0xd1680
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 0xd19f2
movq %r14, %rdi
callq 0xd1a74
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
testb %al, %al
jne 0xd153f
movl %ebx, 0x70(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0xd17a7
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0xcc48c
testl %eax, %eax
je 0xd175d
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0xd1724
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x160(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss 0x8(%rsp), %xmm1
vmovss 0x4(%rsp), %xmm2
vfmadd231ss 0x24(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xd1730
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xd17a7
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0xd1a74
testb %al, %al
jne 0xd179b
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
incl %ebx
jmp 0xd16a5
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 0xd19f2
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
jmp 0xd17a7
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
movl 0x70(%rsp), %ebx
decl 0x38(%rsp)
incl %ebx
jmp 0xd1611
jmp 0xd17e8
jmp 0xd17c1
jmp 0xd17e8
movq %rax, %r14
jmp 0xd17f8
movq %rax, %r14
jmp 0xd1805
movq %rax, %r14
jmp 0xd1812
movq %rax, %r14
jmp 0xd181c
jmp 0xd17e8
jmp 0xd17e8
jmp 0xd17e8
leaq 0x88(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0xd17eb
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0x393ac
leaq 0xe8(%rsp), %rdi
callq 0xcc8ec
leaq 0x90(%rsp), %rdi
callq 0x4495c
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::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 0xd1876
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0xd18f0
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::pnm_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x3881a7(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long)
|
inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
}
|
vucomisd 0x30(%rdi), %xmm0
jbe 0xd1958
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0xd19d2
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::file_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x3880c5(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::none_observer>::store_if_better(baryonyx::bit_array const&, double, long)
|
inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
}
|
vucomisd 0x30(%rdi), %xmm0
jbe 0xd1a3a
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0xd1ab4
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, false>, float, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<float>, baryonyx::none_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x387fe3(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::result baryonyx::itm::optimize_problem<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>>(baryonyx::context const&, baryonyx::problem const&)
|
inline result
optimize_problem(const context& ctx, const problem& pb)
{
result r;
if (ctx.start)
ctx.start(ctx.parameters);
auto constraints{ make_merged_constraints(ctx, pb) };
if (constraints.empty() || pb.vars.values.empty()) {
r.status = result_status::success;
r.solutions.resize(1);
r.solutions.back().value = pb.objective.value;
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
return r;
}
random_engine rng(init_random_generator_seed(ctx));
auto variables = length(pb.vars.values);
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
const auto thread = get_thread_number(ctx);
std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors;
std::vector<std::thread> pool(thread);
best_solution_recorder<Cost, Float, Mode> best_recorder(
rng,
thread,
cost,
cost_constant,
variables,
constraints,
ctx.parameters.init_population_size);
auto seeds = generate_seed(rng, thread);
std::atomic_bool stop_task;
stop_task.store(false);
for (unsigned i = 0u; i != thread; ++i)
functors.emplace_back(ctx, i, seeds[i]);
for (unsigned i = 0u; i != thread; ++i)
pool[i] = std::thread(std::ref(functors[i]),
std::ref(stop_task),
std::ref(best_recorder),
std::cref(constraints),
variables,
std::cref(cost),
cost_constant);
const auto start = std::chrono::steady_clock::now();
auto end = start;
do {
std::this_thread::sleep_for(std::chrono::seconds{ 1L });
if (ctx.update) {
auto call_number = 0L;
for (auto i = 0u; i != thread; ++i)
call_number += functors[i].m_call_number;
int constraints_remaining;
long int loop;
double value;
double duration;
best_recorder.get_best(
constraints_remaining, value, duration, loop);
ctx.update(
constraints_remaining, value, loop, duration, call_number);
}
end = std::chrono::steady_clock::now();
} while (!is_time_limit(ctx.parameters.time_limit, start, end));
stop_task.store(true);
for (auto& t : pool)
t.join();
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
r.variables = variables;
r.constraints = length(constraints);
const auto& first = best_recorder.get_best(0);
if (!first.is_solution())
r.status = result_status::time_limit_reached;
else
r.status = result_status::success;
r.duration = first.duration;
r.loop = first.loop;
r.remaining_constraints = first.remaining_constraints;
switch (ctx.parameters.storage) {
case solver_parameters::storage_type::one: {
r.solutions.resize(1);
convert(first, r.solutions[0], variables);
} break;
case solver_parameters::storage_type::bound: {
r.solutions.resize(2);
convert(first, r.solutions[0], variables);
convert(best_recorder.get_worst(), r.solutions[1], variables);
} break;
case solver_parameters::storage_type::five: {
r.solutions.resize(5);
for (int i = 0; i != 5; ++i)
convert(best_recorder.get_best(i), r.solutions[i], variables);
} break;
}
best_recorder.show_population(ctx);
if (ctx.finish)
ctx.finish(r);
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp # imm = 0x188
vxorpd %xmm0, %xmm0, %xmm0
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
cmpq $0x0, 0x128(%rsi)
je 0xd1b39
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 0xd1c95
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0xd1c95
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0x60(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x353d2
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x70(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0x4f322
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x70(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x98(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0xd1cf0
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xd2dbe
movl 0x8(%rsp), %eax
incl %eax
jmp 0xd1c6c
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 0xd2085
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 0xd1db1
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 0xd2e0a
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 0xd1d10
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 0xd1e46
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0xd1e07
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0xd1df1
leaq 0xd0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x56bc2
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x20(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movl 0x18(%rsp), %esi
movq %r12, %rdi
movq %r14, %rcx
callq 0x35736
callq 0xb5a0
vmovsd (%r13), %xmm0
subq %rbx, %rax
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm0, %xmm1
vcvtsi2sd %rax, %xmm2, %xmm1
vdivsd 0x387c17(%rip), %xmm1, %xmm1 # 0x459a80
jae 0xd1dcc
vucomisd %xmm0, %xmm1
jbe 0xd1dcc
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0xd1ea7
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0xd1e94
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 0xd2002
cmpl $0x1, %eax
je 0xd1fca
cmpl $0x2, %eax
jne 0xd2021
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0xd2021
movq 0x108(%rsp), %rax
movq (%rbx), %rsi
movl 0x4(%rsp), %edx
movslq (%rax,%r15,4), %rax
addq %r14, %rsi
imulq $0x38, %rax, %rdi
addq 0x120(%rsp), %rdi
callq 0x4f485
incq %r15
addq $0x20, %r14
jmp 0xd1f90
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4f485
leaq 0xd0(%rsp), %rdi
callq 0x56c40
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0xd2015
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x4f485
leaq 0xc8(%rsp), %rdi
movq %r13, %rsi
callq 0x4f4da
cmpq $0x0, 0x168(%r13)
je 0xd204d
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0x4f4ee
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0xd7da0
leaq 0x68(%rsp), %rdi
callq 0x35c1a
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x188, %rsp # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xd20e6
movq %rax, %rbx
jmp 0xd20f3
movq %rax, %rbx
jmp 0xd2100
jmp 0xd20ca
jmp 0xd20bb
jmp 0xd20d9
jmp 0xd20d9
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0xd211e
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0xd2114
jmp 0xd20d9
jmp 0xd20d9
jmp 0xd20d9
jmp 0xd20d9
jmp 0xd20d9
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0x4f4ee
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0xd7da0
leaq 0x68(%rsp), %rdi
callq 0x35c1a
leaq 0x48(%rsp), %rdi
callq 0x35858
movq 0x10(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
|
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
|
baryonyx::result baryonyx::itm::solve_problem<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>>(baryonyx::context const&, baryonyx::problem const&)
|
inline result
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 0xd2162
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 0xd228b
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0xd228b
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 0xd22b2
cmpl $0x2, %eax
jne 0xd2301
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 0xd84ac
jmp 0xd234e
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 0xd237d
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 0xd7dc8
jmp 0xd234e
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 0xd8b90
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 0xd23e9
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 0xd240b
jmp 0xd240b
leaq 0x58(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x28(%rsp), %rdi
callq 0x35c1a
jmp 0xd242e
jmp 0xd242b
movq %rax, %r14
jmp 0xd2438
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x35858
movq %rbx, %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::result baryonyx::itm::optimize_problem<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::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
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 0xd24ae
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 0xd260a
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0xd260a
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0x60(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x353d2
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x70(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0x4f322
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x70(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x98(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0xd2665
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xd94b2
movl 0x8(%rsp), %eax
incl %eax
jmp 0xd25e1
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 0xd29fa
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 0xd2726
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 0xd94fe
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 0xd2685
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 0xd27bb
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0xd277c
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0xd2766
leaq 0xd0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x56bc2
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x20(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movl 0x18(%rsp), %esi
movq %r12, %rdi
movq %r14, %rcx
callq 0x35736
callq 0xb5a0
vmovsd (%r13), %xmm0
subq %rbx, %rax
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm0, %xmm1
vcvtsi2sd %rax, %xmm2, %xmm1
vdivsd 0x3872a2(%rip), %xmm1, %xmm1 # 0x459a80
jae 0xd2741
vucomisd %xmm0, %xmm1
jbe 0xd2741
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0xd281c
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0xd2809
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 0xd2977
cmpl $0x1, %eax
je 0xd293f
cmpl $0x2, %eax
jne 0xd2996
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0xd2996
movq 0x108(%rsp), %rax
movq (%rbx), %rsi
movl 0x4(%rsp), %edx
movslq (%rax,%r15,4), %rax
addq %r14, %rsi
imulq $0x38, %rax, %rdi
addq 0x120(%rsp), %rdi
callq 0x4f485
incq %r15
addq $0x20, %r14
jmp 0xd2905
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4f485
leaq 0xd0(%rsp), %rdi
callq 0x56c40
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0xd298a
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x4f485
leaq 0xc8(%rsp), %rdi
movq %r13, %rsi
callq 0x4f4da
cmpq $0x0, 0x168(%r13)
je 0xd29c2
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0x4f4ee
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0xdde90
leaq 0x68(%rsp), %rdi
callq 0x35c1a
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x188, %rsp # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xd2a5b
movq %rax, %rbx
jmp 0xd2a68
movq %rax, %rbx
jmp 0xd2a75
jmp 0xd2a3f
jmp 0xd2a30
jmp 0xd2a4e
jmp 0xd2a4e
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0xd2a93
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0xd2a89
jmp 0xd2a4e
jmp 0xd2a4e
jmp 0xd2a4e
jmp 0xd2a4e
jmp 0xd2a4e
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0x4f4ee
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0xdde90
leaq 0x68(%rsp), %rdi
callq 0x35c1a
leaq 0x48(%rsp), %rdi
callq 0x35858
movq 0x10(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
|
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
|
baryonyx::result baryonyx::itm::solve_problem<baryonyx::itm::solver_equalities_01coeff<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 0xd2ad7
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 0xd2c00
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0xd2c00
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 0xd2c27
cmpl $0x2, %eax
jne 0xd2c76
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 0xde59c
jmp 0xd2cc3
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 0xd2cf2
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 0xddeb8
jmp 0xd2cc3
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 0xdec80
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 0xd2d5e
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 0xd2d80
jmp 0xd2d80
leaq 0x58(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x28(%rsp), %rdi
callq 0x35c1a
jmp 0xd2da3
jmp 0xd2da0
movq %rax, %r14
jmp 0xd2dad
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x35858
movq %rbx, %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::optimize_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<float>, float, baryonyx::itm::minimize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<float> const&, double)
|
void operator()(const std::atomic_bool& stop_task,
best_solution_recorder<Cost, Float, Mode>& best_recorder,
const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
bit_array x(variables);
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_local_ctx.rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const auto w_limit = static_cast<long int>(p.w);
Solver slv(m_local_ctx.rng,
length(constraints),
variables,
norm_costs,
constraints);
compute_order compute(p.order, variables);
bool is_a_solution = false;
while (!stop_task.load()) {
++m_call_number;
const auto kappa_start = static_cast<Float>(best_recorder.reinit(
m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x));
auto kappa = kappa_start;
compute.init(slv, x);
auto best_remaining = INT_MAX;
is_a_solution = false;
for (long int i = 0; !stop_task.load() && i != p.limit; ++i) {
auto remaining =
compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
i);
best_remaining = 0;
is_a_solution = true;
break;
} else {
best_remaining = std::min(remaining, best_remaining);
}
if (i > w_limit)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
if (best_remaining > 0) {
best_recorder.try_advance(
m_local_ctx, x, best_remaining, p.limit);
continue;
}
for (int push = 0; !stop_task.load() && push < p.pushes_limit;
++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_local_ctx.rng,
pushing_k_factor,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
is_a_solution = true;
}
kappa = kappa_start;
for (int iter = 0;
!stop_task.load() && iter < p.pushing_iteration_limit;
++iter) {
remaining = compute.run(
slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
is_a_solution = true;
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
}
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp # imm = 0x148
movq %rdi, %rbp
leaq 0x18(%rsp), %rdi
movq %rsi, %r15
movl %r8d, %esi
vmovsd %xmm0, 0x58(%rsp)
movq %r9, %r12
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x28(%rsp)
callq 0x368ae
movq (%rbp), %r13
movq %rbp, 0x70(%rsp)
addq $0x8, %rbp
leaq 0x78(%rsp), %rdi
movq %r13, %rsi
movq %r12, 0x50(%rsp)
movq %r12, %rdx
movq %rbp, %rcx
movl %ebx, %r8d
callq 0x38959
vmovsd 0x20(%r13), %xmm0
vmovsd 0x10(%r13), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, (%rsp)
vmovsd 0x28(%r13), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r13), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r13), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0xd328d
movq 0x70(%rsp), %rax
movq (%rax), %rdi
leaq 0x78(%rsp), %rsi
movl %ebx, %edx
callq 0x38a37
vmovss %xmm0, 0x8(%rsp)
jmp 0xd3297
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x8(%rsp)
vcvttsd2si 0xa0(%r13), %rax
vmovsd 0x38(%r13), %xmm0
vmovsd 0x40(%r13), %xmm1
movq %rax, 0x88(%rsp)
movq 0x8(%r14), %rax
vmovsd %xmm0, 0x38(%rsp)
vmovsd %xmm1, 0x60(%rsp)
subq (%r14), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xc8(%rsp), %rdi
leaq 0x78(%rsp), %r8
movq %rbp, %rsi
movl %eax, %edx
movl %ebx, %ecx
movq %r14, %r9
callq 0xd36e8
movl 0xcc(%r13), %esi
leaq 0x90(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
vcvtsd2ss (%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x34(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x40(%rsp)
vcvtsd2ss 0x38(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x6c(%rsp)
vcvtsd2ss 0x60(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
movq $0x0, 0x10(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0xd3650
movq 0x70(%rsp), %rax
incq 0xb0(%rax)
vmovsd 0x18(%r13), %xmm0
vmovsd 0x28(%r13), %xmm1
movzbl 0x10(%rsp), %edx
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbp, %rsi
movq %rbx, %rcx
andl $0x1, %edx
callq 0x51a12
vmovsd %xmm0, (%rsp)
leaq 0x90(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
movq %rbx, %rdx
callq 0xd3878
vcvtsd2ss (%rsp), %xmm3, %xmm0
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
vmovss %xmm0, 0x60(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0xd3451
cmpq 0xb0(%r13), %r14
je 0xd3451
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
leaq 0x90(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbp, %rcx
vmovss %xmm0, (%rsp)
callq 0xd38ba
testl %eax, %eax
je 0xd3469
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0x88(%rsp), %r14
jle 0xd343c
vcvtsi2ss %eax, %xmm3, %xmm0
vcvtsi2ssl 0x140(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss (%rsp), %xmm1
vfmadd231ss 0x34(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xd3441
vmovss (%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xd3451
incq %r14
jmp 0xd33b5
testl %ebx, %ebx
jg 0xd3630
leaq 0x18(%rsp), %rbx
movq $0x0, 0x10(%rsp)
jmp 0xd349b
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x365d4
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x51d60
movb $0x1, %al
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x38(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0xd3345
cmpl 0xbc(%r13), %r14d
jge 0xd3345
vmovss 0x6c(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vmovss 0x68(%rsp), %xmm3
leaq 0x90(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0xd3ac6
testl %eax, %eax
jne 0xd352f
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x365d4
movl 0xc0(%r13), %eax
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
imull %r14d, %eax
notl %eax
movslq %eax, %rcx
callq 0x51d60
movb $0x1, %al
movq %rax, 0x10(%rsp)
pushq $0x1
popq %rax
vmovss 0x60(%rsp), %xmm0
movl %eax, %ebx
movb (%r15), %al
testb $0x1, %al
jne 0xd35da
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0xd35da
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
leaq 0x90(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbp, %rcx
vmovss %xmm0, (%rsp)
callq 0xd38ba
testl %eax, %eax
je 0xd35e1
vcvtsi2sd %r12d, %xmm4, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0xd35c6
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x140(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss (%rsp), %xmm1
vfmadd231ss 0x34(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xd35cb
vmovss (%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xd35da
incl %ebx
jmp 0xd353a
leaq 0x18(%rsp), %rbx
jmp 0xd3624
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %r12
movq %r12, %rsi
callq 0x365d4
movl 0xc0(%r13), %eax
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
imull 0x38(%rsp), %eax
subl %ebx, %eax
movq %r12, %rbx
movslq %eax, %rcx
callq 0x51d60
movb $0x1, %al
movq %rax, 0x10(%rsp)
decl 0x38(%rsp)
incl %r14d
jmp 0xd34a6
movq 0xb0(%r13), %r8
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0x51de8
jmp 0xd333c
leaq 0x90(%rsp), %rdi
callq 0x393ac
leaq 0xc8(%rsp), %rdi
callq 0xd3d1a
leaq 0x80(%rsp), %rdi
callq 0x35c1a
leaq 0x20(%rsp), %rdi
callq 0x357fe
addq $0x148, %rsp # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd369a
movq %rax, %rbx
jmp 0xd36bc
movq %rax, %rbx
jmp 0xd36c9
movq %rax, %rbx
jmp 0xd36d6
jmp 0xd36ac
jmp 0xd36ac
jmp 0xd36ac
jmp 0xd36ac
leaq 0x90(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0xc8(%rsp), %rdi
callq 0xd3d1a
leaq 0x80(%rsp), %rdi
callq 0x35c1a
leaq 0x20(%rsp), %rdi
callq 0x357fe
movq %rbx, %rdi
callq 0xb3d0
|
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
|
baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::solver_equalities_01coeff(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_01coeff(random_engine& rng_,
int m_,
int n_,
const cost_type& c_,
const std::vector<merged_constraint>& csts)
: logger("solver_equalities_01coeff")
, rng(rng_)
, ap(csts, m_, n_)
, P(std::make_unique<Float[]>(ap.size()))
, R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts)))
, b(std::make_unique<bound_factor[]>(m_))
, pi(std::make_unique<Float[]>(m_))
, c(c_)
, m(m_)
, n(n_)
{
for (int i = 0; i != m; ++i) {
#if !defined(BARYONYX_FULL_OPTIMIZATION)
// mscv 15.9.6 fail to build this line:
// for ([[maybe_unused]] const auto& cst : csts[i].elements)
// bx_ensures(cst.factor == 1);
for (const auto& cst : csts[i].elements)
bx_ensures(cst.factor == 1);
#endif
bx_ensures(csts[i].min == csts[i].max);
b[i] = csts[i].min;
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
leaq 0x388b42(%rip), %rdx # 0x45c241
movq %r9, %r12
movq %r8, 0x20(%rsp)
movl %ecx, %r13d
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x19
popq %rsi
callq 0xb8418
movq %r14, 0x8(%rbx)
leaq 0x10(%rbx), %r14
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
movl %r13d, %ecx
callq 0x3a4ca
movl 0x38(%rbx), %esi
leaq 0x50(%rbx), %r15
movq %r15, %rdi
movq %r14, 0x18(%rsp)
callq 0x35bd8
movq %r12, %rdi
movq %r15, 0x10(%rsp)
leaq 0x58(%rbx), %r14
callq 0x3a89d
movq %r14, 0x8(%rsp)
movq %r14, %rdi
movq %rax, %rsi
callq 0xd3d54
leaq 0x60(%rbx), %r14
movslq %ebp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x28eb6
leaq 0x68(%rbx), %rdi
movq %r15, %rsi
callq 0x35bd8
movq 0x20(%rsp), %rax
xorl %edx, %edx
movq %rax, 0x70(%rbx)
movl %ebp, 0x78(%rbx)
movl %r13d, 0x7c(%rbx)
movq (%r12), %rax
movq 0x60(%rbx), %rcx
movl %ebp, %esi
cmpq %rsi, %rdx
je 0xd37d9
imulq $0x28, %rdx, %rdi
leaq (%rax,%rdi), %rsi
movq (%rax,%rdi), %r8
movq 0x8(%rax,%rdi), %rdi
cmpq %rdi, %r8
je 0xd37c6
cmpl $0x1, (%r8)
leaq 0x8(%r8), %r8
je 0xd37b5
jmp 0xd37e8
movl 0x18(%rsi), %edi
cmpl 0x1c(%rsi), %edi
jne 0xd3809
movl %edi, (%rcx,%rdx,4)
incq %rdx
movl 0x78(%rbx), %ebp
jmp 0xd379d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x384c3b(%rip), %rdi # 0x45842a
leaq 0x388a65(%rip), %rsi # 0x45c25b
leaq 0x388a6e(%rip), %rdx # 0x45c26b
leaq 0x386ca6(%rip), %rcx # 0x45a4aa
callq 0x2813f
leaq 0x384c1a(%rip), %rdi # 0x45842a
leaq 0x388abe(%rip), %rsi # 0x45c2d5
leaq 0x388a4d(%rip), %rdx # 0x45c26b
leaq 0x388acb(%rip), %rcx # 0x45c2f0
callq 0x2813f
movq %r14, %rdi
movq %rax, %r12
callq 0x28fb6
jmp 0xd383a
movq %rax, %r12
movq 0x8(%rsp), %rdi
callq 0xd3d96
jmp 0xd3849
movq %rax, %r12
movq 0x10(%rsp), %rdi
callq 0x35c1a
jmp 0xd3858
movq %rax, %r12
movq 0x18(%rsp), %rdi
callq 0x3a954
jmp 0xd3867
movq %rax, %r12
movq %rbx, %rdi
callq 0xb853a
movq %r12, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true> const&, baryonyx::bit_array const&)
|
void init(const Solver& s, const Xtype& x)
{
switch (order) {
case solver_parameters::constraint_order::infeasibility_decr:
case solver_parameters::constraint_order::infeasibility_incr:
infeasibility_local_compute_violated_constraints(s, x);
break;
case solver_parameters::constraint_order::pi_sign_change:
std::iota(R.begin(), R.end(), 0);
break;
case solver_parameters::constraint_order::none:
case solver_parameters::constraint_order::reversing:
case solver_parameters::constraint_order::random_sorting:
case solver_parameters::constraint_order::lagrangian_decr:
case solver_parameters::constraint_order::lagrangian_incr:
default:
compute_violated_constraints(s, x, R);
break;
}
}
|
movl 0x30(%rdi), %ecx
movq %rdi, %rax
leal -0x3(%rcx), %edi
cmpl $0x2, %edi
jae 0xd388e
movq %rax, %rdi
jmp 0xd3dbe
cmpl $0x7, %ecx
jne 0xd38ab
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0xd38b9
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0xd389c
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0xd3ea3
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float)
|
int run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta)
{
bool pi_changed = false;
int remaining = 0;
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.compute_update_row(
x, R.crbegin(), R.crend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl 0x30(%rdi), %eax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decl %eax
cmpl $0x6, %eax
ja 0xd39f9
leaq 0x3884cb(%rip), %rdx # 0x45bdac
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
callq 0xd3f76
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xd3ea3
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xd595e
jmp 0xd3a2e
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xd5088
jmp 0xd398a
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xd54f3
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd42de
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xd448c
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x3ceed
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd4130
jmp 0xd3a52
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xd5e50
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd4572
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xd3ea3
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x3ceed
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd4130
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xd4720
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float, float)
|
int push_and_run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
bool pi_changed = 0;
int remaining = 0;
if (use_cycle)
order = next_state(order);
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.push_and_compute_update_row(x,
R.crbegin(),
R.crend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl 0x30(%rdi), %eax
cmpb $0x1, 0x34(%rdi)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
jne 0xd3af2
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 0xd3c8b
leaq 0x3882c4(%rip), %rdx # 0x45bdc8
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
callq 0xd6346
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xd3ea3
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xd73b8
jmp 0xd3c74
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xd6ae2
jmp 0xd3bbc
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xd6f4d
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd671a
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xd448c
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x3ceed
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd6536
jmp 0xd3c9d
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xd78aa
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd68fe
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xd3ea3
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x3ceed
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd6536
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xd4720
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true> const, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<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, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0xd3de2
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 0xd3e83
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 0xd3e3f
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0xd3e26
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rax
movl (%rax,%rbp,4), %eax
movl %eax, %ecx
subl %ebx, %ecx
jle 0xd3e5f
shlq $0x20, %rcx
orq %rbp, %rcx
movq %rcx, 0x8(%rsp)
jmp 0xd3e6f
jge 0xd3e7e
subl %eax, %ebx
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0xd3e04
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true> const&, baryonyx::bit_array const&, std::vector<int, std::allocator<int>>&)
|
int
compute_violated_constraints(const Solver& slv,
const Xtype& x,
std::vector<int>& out)
{
out.clear();
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
out.emplace_back(k);
return length(out);
}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdx), %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rax, 0x8(%rdx)
je 0xd3ec1
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x78(%r15), %esi
je 0xd3ef4
movq %r15, %rdi
movq %r14, %rdx
callq 0xd3f0b
testb %al, %al
jne 0xd3eec
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0xd3ec8
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true> const&, int, baryonyx::bit_array const&)
|
bool
is_valid_constraint(const Solver& slv, int k, const Xtype& x)
{
typename sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = slv.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += slv.factor(it->value) * x[it->column];
return slv.bound_min(k) <= v && v <= slv.bound_max(k);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
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 0xd3f58
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %r15d
addq $0x8, %r13
jmp 0xd3f3e
movq 0x60(%rbx), %rcx
movslq %ebp, %rax
cmpl (%rcx,%rax,4), %r15d
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::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);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %rbx
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
leaq 0x3883a2(%rip), %rdx # 0x45c344
movq %rsi, %r14
movq %rdi, %r12
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
movq %rbx, 0x40(%rsp)
xorl %edx, %edx
movq %rax, 0x30(%rsp)
movq (%rbx), %rax
leaq 0x38833a(%rip), %rbx # 0x45c313
pushq $0x8
popq %rbp
movq %r14, 0x38(%rsp)
movq 0x48(%rsp), %rcx
cmpq (%rcx), %rax
je 0xd411c
movq %rdx, 0x50(%rsp)
movl -0x4(%rax), %edx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %edx, 0xc(%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0xd4760
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0xd477e
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r14
movl %eax, %r15d
leaq (%rdi,%r14,8), %rsi
callq 0xd483e
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,4), %r8
movl (%r8), %eax
cmpl %eax, %r14d
cmovll %r14d, %eax
decl %eax
movl %eax, 0x10(%rsp)
pushq $0x15
popq %rsi
leaq 0x388282(%rip), %rdx # 0x45c2fd
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
xorl %r13d, %r13d
andnl %r14d, %eax, %r14d
shlq $0x3, %r14
cmpq %r13, %r14
je 0xd40bd
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x4(%rcx,%r13), %r8
addq %r13, %rcx
callq 0xb91f0
addq $0x8, %r13
jmp 0xd4097
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x38cf97(%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 0xd4871
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rcx
orb %al, %dl
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0xd3fe1
andb $0x1, %dl
movl %edx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x40(%rsp)
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x3881e2(%rip), %rdx # 0x45c344
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
leaq 0x38818f(%rip), %rbx # 0x45c313
movq %rax, 0x30(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbp
movq %r13, 0x38(%rsp)
cmpq 0x40(%rsp), %r14
je 0xd42cd
movl (%r14), %edx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movq %rax, 0x48(%rsp)
movq %r14, 0x50(%rsp)
movl %edx, 0xc(%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0xd4760
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0xd477e
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r14
movl %eax, %r15d
leaq (%rdi,%r14,8), %rsi
callq 0xd483e
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,4), %r8
movl (%r8), %eax
cmpl %eax, %r14d
cmovll %r14d, %eax
decl %eax
movl %eax, 0x10(%rsp)
pushq $0x15
popq %rsi
leaq 0x3880ce(%rip), %rdx # 0x45c2fd
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
andnl %r14d, %eax, %r13d
xorl %r14d, %r14d
shlq $0x3, %r13
cmpq %r14, %r13
je 0xd4271
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x4(%rcx,%r14), %r8
addq %r14, %rcx
callq 0xb91f0
addq $0x8, %r14
jmp 0xd424b
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x38cde3(%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 0xd4871
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0xd4193
andb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::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);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x40(%rsp)
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x388034(%rip), %rdx # 0x45c344
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
leaq 0x387fe1(%rip), %rbx # 0x45c313
movq %rax, 0x30(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbp
movq %r13, 0x38(%rsp)
cmpq 0x40(%rsp), %r14
je 0xd447b
movl (%r14), %edx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movq %rax, 0x48(%rsp)
movq %r14, 0x50(%rsp)
movl %edx, 0xc(%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0xd4760
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0xd477e
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r14
movl %eax, %r15d
leaq (%rdi,%r14,8), %rsi
callq 0xd483e
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,4), %r8
movl (%r8), %eax
cmpl %eax, %r14d
cmovll %r14d, %eax
decl %eax
movl %eax, 0x10(%rsp)
pushq $0x15
popq %rsi
leaq 0x387f20(%rip), %rdx # 0x45c2fd
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
andnl %r14d, %eax, %r13d
xorl %r14d, %r14d
shlq $0x3, %r13
cmpq %r14, %r13
je 0xd441f
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x4(%rcx,%r14), %r8
addq %r14, %rcx
callq 0xb91f0
addq $0x8, %r14
jmp 0xd43f9
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x38cc35(%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 0xd4871
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r14
orb %al, %cl
addq $0x8, %r14
movq %rcx, %rax
jmp 0xd4341
andb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<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, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0xd44b0
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 0xd4551
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 0xd450d
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0xd44f4
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rax
movl (%rax,%rbp,4), %eax
movl %eax, %ecx
subl %ebx, %ecx
jle 0xd452d
shlq $0x20, %rcx
orq %rbp, %rcx
movq %rcx, 0x8(%rsp)
jmp 0xd453d
jge 0xd454c
subl %eax, %ebx
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0xd44d2
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x40(%rsp)
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x387da0(%rip), %rdx # 0x45c344
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
leaq 0x387d4d(%rip), %rbx # 0x45c313
movq %rax, 0x30(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbp
movq %r13, 0x38(%rsp)
cmpq 0x40(%rsp), %r14
je 0xd470f
movl (%r14), %edx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movq %rax, 0x48(%rsp)
movq %r14, 0x50(%rsp)
movl %edx, 0xc(%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0xd4760
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0xd477e
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r14
movl %eax, %r15d
leaq (%rdi,%r14,8), %rsi
callq 0xd483e
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,4), %r8
movl (%r8), %eax
cmpl %eax, %r14d
cmovll %r14d, %eax
decl %eax
movl %eax, 0x10(%rsp)
pushq $0x15
popq %rsi
leaq 0x387c8c(%rip), %rdx # 0x45c2fd
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
andnl %r14d, %eax, %r13d
xorl %r14d, %r14d
shlq $0x3, %r13
cmpq %r14, %r13
je 0xd46b3
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x4(%rcx,%r14), %r8
addq %r14, %rcx
callq 0xb91f0
addq $0x8, %r14
jmp 0xd468d
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x38c9a1(%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 0xd4871
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0xd45d5
andb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true> const&, baryonyx::bit_array const&)
|
int local_compute_violated_constraints(const Solver& slv, const Xtype& x)
{
int remaining = 0;
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
++remaining;
return remaining;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl 0x78(%r14), %r15d
je 0xd4752
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0xd3f0b
xorb $0x1, %al
incl %r15d
movzbl %al, %eax
addl %eax, %ebp
jmp 0xd4732
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::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&)
|
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 0xd482c
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
vxorps %xmm0, %xmm0, %xmm0
vxorps %xmm1, %xmm1, %xmm1
cmpq %rax, %rcx
je 0xd47f6
movslq 0x4(%rcx), %rdi
vaddss (%rsi,%rdi,4), %xmm0, %xmm0
movslq (%rcx), %rdi
addq $0x8, %rcx
vaddss (%rdx,%rdi,4), %xmm1, %xmm1
movq %rcx, 0x10(%rsp)
jmp 0xd47d5
movq 0x58(%r12), %rax
movl %r15d, 0x4(%rax,%r15,8)
movq 0x70(%r12), %rcx
movslq 0x4(%r14), %rdx
addq $0x8, %r14
movq 0x8(%rcx), %rcx
vmovss (%rcx,%rdx,4), %xmm2
vsubss %xmm0, %xmm2, %xmm0
vsubss %xmm1, %xmm0, %xmm0
vmovss %xmm0, (%rax,%r15,8)
incq %r15
jmp 0xd47a1
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::affect<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, float, float)
|
bool
affect(Solver& slv,
Xtype& x,
Iterator it,
int k,
int selected,
int r_size,
const Float kappa,
const Float delta)
{
constexpr Float one{ 1 };
constexpr Float two{ 2 };
constexpr Float middle{ (two + one) / two };
const auto old_pi = slv.pi[k];
auto d = delta;
if (selected < 0) {
// slv.pi[k] += slv.R[0].value / two;
d += (kappa / (one - kappa)) * (slv.R[0].value / two);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
} else if (selected + 1 >= r_size) {
// slv.pi[k] += slv.R[selected].value * middle;
d += (kappa / (one - kappa)) * (slv.R[selected].value * middle);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
} else {
slv.pi[k] +=
((slv.R[selected].value + slv.R[selected + 1].value) / two);
d += (kappa / (one - kappa)) *
(slv.R[selected + 1].value - slv.R[selected].value);
int i = 0;
for (; i <= selected; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
for (; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
}
// TODO job: develops is_valid_constraint for all the solvers
bx_expects(is_valid_constraint(slv, k, x));
return is_signbit_change(old_pi, slv.pi[k]);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x68(%rbx), %rax
movslq %ecx, %rdi
movq %rdx, %r15
movq %rsi, %r14
movl %ecx, 0x14(%rsp)
movq %rdi, 0x18(%rsp)
vmovss (%rax,%rdi,4), %xmm3
vmovaps %xmm3, 0x20(%rsp)
testl %r8d, %r8d
js 0xd4946
leal 0x1(%r8), %ecx
cmpl %r9d, %ecx
jge 0xd49b2
movq 0x58(%rbx), %rsi
movl %r8d, %edx
movl %ecx, %ebp
xorl %r13d, %r13d
movl %r9d, 0x10(%rsp)
vmovss (%rsi,%rdx,8), %xmm2
vaddss (%rsi,%rbp,8), %xmm2, %xmm2
vmulss 0x3851f4(%rip), %xmm2, %xmm2 # 0x459ad0
vaddss %xmm2, %xmm3, %xmm2
vmovss %xmm2, (%rax,%rdi,4)
vmovss 0x3851d7(%rip), %xmm2 # 0x459ac4
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rsi,%rbp,8), %xmm2
vsubss (%rsi,%rdx,8), %xmm2, %xmm2
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %r13, %rbp
je 0xd4a1e
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%r13,8), %r12
movl 0x4(%r15,%r12,8), %esi
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
vmovss 0xc(%rsp), %xmm0
incq %r13
vaddss (%rcx,%rax,4), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xd490a
vmovss 0x385176(%rip), %xmm2 # 0x459ac4
movq 0x58(%rbx), %rax
movl %r9d, %r12d
xorl %ebp, %ebp
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rax), %xmm2
vmulss 0x385165(%rip), %xmm2, %xmm2 # 0x459ad0
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %rbp, %r12
je 0xd4a5b
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
incq %rbp
vmovss (%rcx,%rax,4), %xmm0
vsubss 0xc(%rsp), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xd4976
vmovss 0x38510a(%rip), %xmm2 # 0x459ac4
movq 0x58(%rbx), %rcx
movl %r8d, %eax
movl %r9d, %r12d
xorl %ebp, %ebp
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rcx,%rax,8), %xmm2
vmulss 0x3872ed(%rip), %xmm2, %xmm2 # 0x45bcc8
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %rbp, %r12
je 0xd4a5b
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovss 0xc(%rsp), %xmm0
incq %rbp
vaddss (%rcx,%rax,4), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xd49e6
movl 0x10(%rsp), %r12d
cmpq %rbp, %r12
je 0xd4a5b
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
incq %rbp
vmovss (%rcx,%rax,4), %xmm0
vsubss 0xc(%rsp), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xd4a23
movl 0x14(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xd3f0b
testb %al, %al
je 0xd4a99
vmovaps 0x20(%rsp), %xmm0
movq 0x68(%rbx), %rcx
movq 0x18(%rsp), %rdx
vmovmskps %xmm0, %eax
shll $0x1f, %eax
xorl (%rcx,%rdx,4), %eax
shrl $0x1f, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x38373e(%rip), %rdi # 0x4581de
leaq 0x387875(%rip), %rsi # 0x45c31c
leaq 0x3854de(%rip), %rdx # 0x459f8c
leaq 0x387886(%rip), %rcx # 0x45c33b
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::rc_data*>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>::rc_data*, baryonyx::itm::solver_equalities_01coeff<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 0x8(%rdi), %rsi
cmpq %r14, %rsi
je 0xd4af5
vmovss (%rdi), %xmm0
leaq 0x8(%rsi), %r15
vucomiss (%rsi), %xmm0
movq %r15, %rsi
jne 0xd4ae1
jnp 0xd4ac9
addq $-0x8, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0xd4f5c
movq %r15, %rdi
jmp 0xd4ac5
movq %rbx, %rdx
callq 0xd4f5c
popq %rbx
popq %r14
popq %r15
retq
jmp 0xd4b05
movq %rax, %rdi
callq 0xeb9f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long)
|
void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
}
|
vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xd9332
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0xd93ac
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::file_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x3806eb(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::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 0xd9418
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0xd9492
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::none_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x380605(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::optimize_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<float>, float, baryonyx::itm::minimize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<float> const&, double)
|
void operator()(const std::atomic_bool& stop_task,
best_solution_recorder<Cost, Float, Mode>& best_recorder,
const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
bit_array x(variables);
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_local_ctx.rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const auto w_limit = static_cast<long int>(p.w);
Solver slv(m_local_ctx.rng,
length(constraints),
variables,
norm_costs,
constraints);
compute_order compute(p.order, variables);
bool is_a_solution = false;
while (!stop_task.load()) {
++m_call_number;
const auto kappa_start = static_cast<Float>(best_recorder.reinit(
m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x));
auto kappa = kappa_start;
compute.init(slv, x);
auto best_remaining = INT_MAX;
is_a_solution = false;
for (long int i = 0; !stop_task.load() && i != p.limit; ++i) {
auto remaining =
compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
i);
best_remaining = 0;
is_a_solution = true;
break;
} else {
best_remaining = std::min(remaining, best_remaining);
}
if (i > w_limit)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
if (best_remaining > 0) {
best_recorder.try_advance(
m_local_ctx, x, best_remaining, p.limit);
continue;
}
for (int push = 0; !stop_task.load() && push < p.pushes_limit;
++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_local_ctx.rng,
pushing_k_factor,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
is_a_solution = true;
}
kappa = kappa_start;
for (int iter = 0;
!stop_task.load() && iter < p.pushing_iteration_limit;
++iter) {
remaining = compute.run(
slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
is_a_solution = true;
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
}
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp # imm = 0x148
movq %rdi, %rbp
leaq 0x18(%rsp), %rdi
movq %rsi, %r15
movl %r8d, %esi
vmovsd %xmm0, 0x58(%rsp)
movq %r9, %r12
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x28(%rsp)
callq 0x368ae
movq (%rbp), %r13
movq %rbp, 0x70(%rsp)
addq $0x8, %rbp
leaq 0x78(%rsp), %rdi
movq %r13, %rsi
movq %r12, 0x50(%rsp)
movq %r12, %rdx
movq %rbp, %rcx
movl %ebx, %r8d
callq 0x38959
vmovsd 0x20(%r13), %xmm0
vmovsd 0x10(%r13), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, (%rsp)
vmovsd 0x28(%r13), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r13), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r13), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0xd9981
movq 0x70(%rsp), %rax
movq (%rax), %rdi
leaq 0x78(%rsp), %rsi
movl %ebx, %edx
callq 0x38a37
vmovss %xmm0, 0x8(%rsp)
jmp 0xd998b
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x8(%rsp)
vcvttsd2si 0xa0(%r13), %rax
vmovsd 0x38(%r13), %xmm0
vmovsd 0x40(%r13), %xmm1
movq %rax, 0x88(%rsp)
movq 0x8(%r14), %rax
vmovsd %xmm0, 0x38(%rsp)
vmovsd %xmm1, 0x60(%rsp)
subq (%r14), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xc8(%rsp), %rdi
leaq 0x78(%rsp), %r8
movq %rbp, %rsi
movl %eax, %edx
movl %ebx, %ecx
movq %r14, %r9
callq 0xd9ddc
movl 0xcc(%r13), %esi
leaq 0x90(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
vcvtsd2ss (%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x34(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x40(%rsp)
vcvtsd2ss 0x38(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x6c(%rsp)
vcvtsd2ss 0x60(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
movq $0x0, 0x10(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0xd9d44
movq 0x70(%rsp), %rax
incq 0xb0(%rax)
vmovsd 0x18(%r13), %xmm0
vmovsd 0x28(%r13), %xmm1
movzbl 0x10(%rsp), %edx
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbp, %rsi
movq %rbx, %rcx
andl $0x1, %edx
callq 0x51a12
vmovsd %xmm0, (%rsp)
leaq 0x90(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
movq %rbx, %rdx
callq 0xd9f4c
vcvtsd2ss (%rsp), %xmm3, %xmm0
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
vmovss %xmm0, 0x60(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0xd9b45
cmpq 0xb0(%r13), %r14
je 0xd9b45
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
leaq 0x90(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbp, %rcx
vmovss %xmm0, (%rsp)
callq 0xd9f8e
testl %eax, %eax
je 0xd9b5d
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0x88(%rsp), %r14
jle 0xd9b30
vcvtsi2ss %eax, %xmm3, %xmm0
vcvtsi2ssl 0x140(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss (%rsp), %xmm1
vfmadd231ss 0x34(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xd9b35
vmovss (%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xd9b45
incq %r14
jmp 0xd9aa9
testl %ebx, %ebx
jg 0xd9d24
leaq 0x18(%rsp), %rbx
movq $0x0, 0x10(%rsp)
jmp 0xd9b8f
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x365d4
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x51d60
movb $0x1, %al
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x38(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0xd9a39
cmpl 0xbc(%r13), %r14d
jge 0xd9a39
vmovss 0x6c(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vmovss 0x68(%rsp), %xmm3
leaq 0x90(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0xda19a
testl %eax, %eax
jne 0xd9c23
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x365d4
movl 0xc0(%r13), %eax
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
imull %r14d, %eax
notl %eax
movslq %eax, %rcx
callq 0x51d60
movb $0x1, %al
movq %rax, 0x10(%rsp)
pushq $0x1
popq %rax
vmovss 0x60(%rsp), %xmm0
movl %eax, %ebx
movb (%r15), %al
testb $0x1, %al
jne 0xd9cce
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0xd9cce
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
leaq 0x90(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbp, %rcx
vmovss %xmm0, (%rsp)
callq 0xd9f8e
testl %eax, %eax
je 0xd9cd5
vcvtsi2sd %r12d, %xmm4, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0xd9cba
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x140(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss (%rsp), %xmm1
vfmadd231ss 0x34(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xd9cbf
vmovss (%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xd9cce
incl %ebx
jmp 0xd9c2e
leaq 0x18(%rsp), %rbx
jmp 0xd9d18
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %r12
movq %r12, %rsi
callq 0x365d4
movl 0xc0(%r13), %eax
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
imull 0x38(%rsp), %eax
subl %ebx, %eax
movq %r12, %rbx
movslq %eax, %rcx
callq 0x51d60
movb $0x1, %al
movq %rax, 0x10(%rsp)
decl 0x38(%rsp)
incl %r14d
jmp 0xd9b9a
movq 0xb0(%r13), %r8
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0x51de8
jmp 0xd9a30
leaq 0x90(%rsp), %rdi
callq 0x393ac
leaq 0xc8(%rsp), %rdi
callq 0xda3ee
leaq 0x80(%rsp), %rdi
callq 0x35c1a
leaq 0x20(%rsp), %rdi
callq 0x357fe
addq $0x148, %rsp # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd9d8e
movq %rax, %rbx
jmp 0xd9db0
movq %rax, %rbx
jmp 0xd9dbd
movq %rax, %rbx
jmp 0xd9dca
jmp 0xd9da0
jmp 0xd9da0
jmp 0xd9da0
jmp 0xd9da0
leaq 0x90(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0xc8(%rsp), %rdi
callq 0xda3ee
leaq 0x80(%rsp), %rdi
callq 0x35c1a
leaq 0x20(%rsp), %rdi
callq 0x357fe
movq %rbx, %rdi
callq 0xb3d0
|
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
|
baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::solver_equalities_01coeff(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_01coeff(random_engine& rng_,
int m_,
int n_,
const cost_type& c_,
const std::vector<merged_constraint>& csts)
: logger("solver_equalities_01coeff")
, rng(rng_)
, ap(csts, m_, n_)
, P(std::make_unique<Float[]>(ap.size()))
, R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts)))
, b(std::make_unique<bound_factor[]>(m_))
, pi(std::make_unique<Float[]>(m_))
, c(c_)
, m(m_)
, n(n_)
{
for (int i = 0; i != m; ++i) {
#if !defined(BARYONYX_FULL_OPTIMIZATION)
// mscv 15.9.6 fail to build this line:
// for ([[maybe_unused]] const auto& cst : csts[i].elements)
// bx_ensures(cst.factor == 1);
for (const auto& cst : csts[i].elements)
bx_ensures(cst.factor == 1);
#endif
bx_ensures(csts[i].min == csts[i].max);
b[i] = csts[i].min;
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
andq $0x0, (%rdi)
leaq 0x10(%rdi), %r14
movq %rsi, 0x8(%rdi)
movq %rdi, %rbx
movq %r9, %r12
movq %r8, 0x20(%rsp)
movl %ecx, %r13d
movl %edx, %ebp
movq %r9, %rsi
movq %r14, %rdi
callq 0x3a4ca
movl 0x38(%rbx), %esi
leaq 0x50(%rbx), %r15
movq %r15, %rdi
movq %r14, 0x18(%rsp)
callq 0x35bd8
movq %r12, %rdi
movq %r15, 0x10(%rsp)
leaq 0x58(%rbx), %r14
callq 0x3a89d
movq %r14, 0x8(%rsp)
movq %r14, %rdi
movq %rax, %rsi
callq 0xda423
leaq 0x60(%rbx), %r14
movslq %ebp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x28eb6
leaq 0x68(%rbx), %rdi
movq %r15, %rsi
callq 0x35bd8
movq 0x20(%rsp), %rax
xorl %edx, %edx
movq %rax, 0x70(%rbx)
movl %ebp, 0x78(%rbx)
movl %r13d, 0x7c(%rbx)
movq (%r12), %rax
movq 0x60(%rbx), %rcx
movl %ebp, %esi
cmpq %rsi, %rdx
je 0xd9eba
imulq $0x28, %rdx, %rdi
leaq (%rax,%rdi), %rsi
movq (%rax,%rdi), %r8
movq 0x8(%rax,%rdi), %rdi
cmpq %rdi, %r8
je 0xd9ea7
cmpl $0x1, (%r8)
leaq 0x8(%r8), %r8
je 0xd9e96
jmp 0xd9ec9
movl 0x18(%rsi), %edi
cmpl 0x1c(%rsi), %edi
jne 0xd9eea
movl %edi, (%rcx,%rdx,4)
incq %rdx
movl 0x78(%rbx), %ebp
jmp 0xd9e7e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x37e55a(%rip), %rdi # 0x45842a
leaq 0x382384(%rip), %rsi # 0x45c25b
leaq 0x38238d(%rip), %rdx # 0x45c26b
leaq 0x3805c5(%rip), %rcx # 0x45a4aa
callq 0x2813f
leaq 0x37e539(%rip), %rdi # 0x45842a
leaq 0x3823dd(%rip), %rsi # 0x45c2d5
leaq 0x38236c(%rip), %rdx # 0x45c26b
leaq 0x3823ea(%rip), %rcx # 0x45c2f0
callq 0x2813f
movq %r14, %rdi
movq %rax, %rbx
callq 0x28fb6
jmp 0xd9f1b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0xda464
jmp 0xd9f2a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x35c1a
jmp 0xd9f39
movq %rax, %rbx
movq 0x18(%rsp), %rdi
callq 0x3a954
movq %rbx, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false> const&, baryonyx::bit_array const&)
|
void init(const Solver& s, const Xtype& x)
{
switch (order) {
case solver_parameters::constraint_order::infeasibility_decr:
case solver_parameters::constraint_order::infeasibility_incr:
infeasibility_local_compute_violated_constraints(s, x);
break;
case solver_parameters::constraint_order::pi_sign_change:
std::iota(R.begin(), R.end(), 0);
break;
case solver_parameters::constraint_order::none:
case solver_parameters::constraint_order::reversing:
case solver_parameters::constraint_order::random_sorting:
case solver_parameters::constraint_order::lagrangian_decr:
case solver_parameters::constraint_order::lagrangian_incr:
default:
compute_violated_constraints(s, x, R);
break;
}
}
|
movl 0x30(%rdi), %ecx
movq %rdi, %rax
leal -0x3(%rcx), %edi
cmpl $0x2, %edi
jae 0xd9f62
movq %rax, %rdi
jmp 0xda48c
cmpl $0x7, %ecx
jne 0xd9f7f
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0xd9f8d
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0xd9f70
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0xda571
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float)
|
int run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta)
{
bool pi_changed = false;
int remaining = 0;
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.compute_update_row(
x, R.crbegin(), R.crend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl 0x30(%rdi), %eax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decl %eax
cmpl $0x6, %eax
ja 0xda0cd
leaq 0x381e2f(%rip), %rdx # 0x45bde4
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
callq 0xda644
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xda571
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xdbd36
jmp 0xda102
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xdb460
jmp 0xda05e
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xdb8cb
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xda832
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xda922
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x3ceed
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xda742
jmp 0xda126
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xdc228
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xdaa08
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xda571
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x3ceed
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xda742
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xdaaf8
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float, float)
|
int push_and_run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
bool pi_changed = 0;
int remaining = 0;
if (use_cycle)
order = next_state(order);
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.push_and_compute_update_row(x,
R.crbegin(),
R.crend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl 0x30(%rdi), %eax
cmpb $0x1, 0x34(%rdi)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
jne 0xda1c6
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 0xda35f
leaq 0x381c28(%rip), %rdx # 0x45be00
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
callq 0xdc71e
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xda571
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xdd4a8
jmp 0xda348
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xdcbd2
jmp 0xda290
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xdd03d
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xdc97e
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xda922
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x3ceed
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xdc854
jmp 0xda371
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xdd99a
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xdcaa8
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xda571
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x3ceed
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xdc854
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xdaaf8
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false> const, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false> const&, baryonyx::bit_array const&)
|
int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0xda4b0
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 0xda551
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 0xda50d
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0xda4f4
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rax
movl (%rax,%rbp,4), %eax
movl %eax, %ecx
subl %ebx, %ecx
jle 0xda52d
shlq $0x20, %rcx
orq %rbp, %rcx
movq %rcx, 0x8(%rsp)
jmp 0xda53d
jge 0xda54c
subl %eax, %ebx
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0xda4d2
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false> const&, baryonyx::bit_array const&, std::vector<int, std::allocator<int>>&)
|
int
compute_violated_constraints(const Solver& slv,
const Xtype& x,
std::vector<int>& out)
{
out.clear();
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
out.emplace_back(k);
return length(out);
}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdx), %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rax, 0x8(%rdx)
je 0xda58f
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x78(%r15), %esi
je 0xda5c2
movq %r15, %rdi
movq %r14, %rdx
callq 0xda5d9
testb %al, %al
jne 0xda5ba
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0xda596
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false> const&, int, baryonyx::bit_array const&)
|
bool
is_valid_constraint(const Solver& slv, int k, const Xtype& x)
{
typename sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = slv.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += slv.factor(it->value) * x[it->column];
return slv.bound_min(k) <= v && v <= slv.bound_max(k);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $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 0xda626
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %r15d
addq $0x8, %r13
jmp 0xda60c
movq 0x60(%rbx), %rcx
movslq %ebp, %rax
cmpl (%rcx,%rax,4), %r15d
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm2, 0x14(%rsp)
vmovss %xmm1, 0x10(%rsp)
vmovss %xmm0, 0xc(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
movq %rax, 0x28(%rsp)
movq (%rdx), %rax
movq 0x30(%rsp), %rcx
cmpq (%rcx), %rax
je 0xda72c
movslq -0x4(%rax), %rbx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0xdab38
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0xdab56
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
leaq (%rdi,%r13,8), %rsi
callq 0xdac16
movq 0x60(%r12), %rax
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
movl (%rax,%rbx,4), %r8d
cmpl %r8d, %r13d
cmovll %r13d, %r8d
decl %r8d
callq 0xdac49
orb %al, %bpl
movq (%r14), %rax
addq $-0x4, %rax
movq %rax, (%r14)
jmp 0xda680
andb $0x1, %bpl
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm2, 0x14(%rsp)
vmovss %xmm1, 0x10(%rsp)
vmovss %xmm0, 0xc(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
movq %rax, 0x28(%rsp)
cmpq 0x30(%rsp), %r14
je 0xda81d
movslq (%r14), %rbx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0xdab38
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0xdab56
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
leaq (%rdi,%r13,8), %rsi
callq 0xdac16
movq 0x60(%r12), %rax
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
movl (%rax,%rbx,4), %r8d
cmpl %r8d, %r13d
cmovll %r13d, %r8d
decl %r8d
callq 0xdac49
orb %al, %bpl
addq $0x4, %r14
jmp 0xda77b
andb $0x1, %bpl
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm2, 0x14(%rsp)
vmovss %xmm1, 0x10(%rsp)
vmovss %xmm0, 0xc(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
movq %rax, 0x28(%rsp)
cmpq 0x30(%rsp), %r14
je 0xda90d
movslq (%r14), %rbx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0xdab38
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0xdab56
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
leaq (%rdi,%r13,8), %rsi
callq 0xdac16
movq 0x60(%r12), %rax
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
movl (%rax,%rbx,4), %r8d
cmpl %r8d, %r13d
cmovll %r13d, %r8d
decl %r8d
callq 0xdac49
orb %al, %bpl
addq $0x8, %r14
jmp 0xda86b
andb $0x1, %bpl
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>&, baryonyx::bit_array const&)
|
int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
cmpq %rax, 0x20(%rdi)
je 0xda946
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 0xda9e7
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 0xda9a3
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0xda98a
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rax
movl (%rax,%rbp,4), %eax
movl %eax, %ecx
subl %ebx, %ecx
jle 0xda9c3
shlq $0x20, %rcx
orq %rbp, %rcx
movq %rcx, 0x8(%rsp)
jmp 0xda9d3
jge 0xda9e2
subl %eax, %ebx
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0xda968
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm2, 0x14(%rsp)
vmovss %xmm1, 0x10(%rsp)
vmovss %xmm0, 0xc(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
movq %rax, 0x28(%rsp)
cmpq 0x30(%rsp), %r14
je 0xdaae3
movslq (%r14), %rbx
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0xdab38
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0xdab56
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r13
leaq (%rdi,%r13,8), %rsi
callq 0xdac16
movq 0x60(%r12), %rax
vmovss 0xc(%rsp), %xmm0
vmovss 0x10(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
movl (%rax,%rbx,4), %r8d
cmpl %r8d, %r13d
cmovll %r13d, %r8d
decl %r8d
callq 0xdac49
orb %al, %bpl
addq $0x4, %r14
jmp 0xdaa41
andb $0x1, %bpl
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
int baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, 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 0xdac04
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
vxorps %xmm0, %xmm0, %xmm0
vxorps %xmm1, %xmm1, %xmm1
cmpq %rax, %rcx
je 0xdabce
movslq 0x4(%rcx), %rdi
vaddss (%rsi,%rdi,4), %xmm0, %xmm0
movslq (%rcx), %rdi
addq $0x8, %rcx
vaddss (%rdx,%rdi,4), %xmm1, %xmm1
movq %rcx, 0x10(%rsp)
jmp 0xdabad
movq 0x58(%r12), %rax
movl %r15d, 0x4(%rax,%r15,8)
movq 0x70(%r12), %rcx
movslq 0x4(%r14), %rdx
addq $0x8, %r14
movq 0x8(%rcx), %rcx
vmovss (%rcx,%rdx,4), %xmm2
vsubss %xmm0, %xmm2, %xmm0
vsubss %xmm1, %xmm0, %xmm0
vmovss %xmm0, (%rax,%r15,8)
incq %r15
jmp 0xdab79
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::affect<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>&, baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, float, float)
|
bool
affect(Solver& slv,
Xtype& x,
Iterator it,
int k,
int selected,
int r_size,
const Float kappa,
const Float delta)
{
constexpr Float one{ 1 };
constexpr Float two{ 2 };
constexpr Float middle{ (two + one) / two };
const auto old_pi = slv.pi[k];
auto d = delta;
if (selected < 0) {
// slv.pi[k] += slv.R[0].value / two;
d += (kappa / (one - kappa)) * (slv.R[0].value / two);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
} else if (selected + 1 >= r_size) {
// slv.pi[k] += slv.R[selected].value * middle;
d += (kappa / (one - kappa)) * (slv.R[selected].value * middle);
for (int i = 0; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
} else {
slv.pi[k] +=
((slv.R[selected].value + slv.R[selected + 1].value) / two);
d += (kappa / (one - kappa)) *
(slv.R[selected + 1].value - slv.R[selected].value);
int i = 0;
for (; i <= selected; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.unset(var->column);
slv.P[var->value] -= d;
} else {
x.set(var->column);
slv.P[var->value] += d;
}
}
for (; i != r_size; ++i) {
auto var = it + slv.R[i].id;
if (slv.R[i].is_negative_factor()) {
x.set(var->column);
slv.P[var->value] += d;
} else {
x.unset(var->column);
slv.P[var->value] -= d;
}
}
}
// TODO job: develops is_valid_constraint for all the solvers
bx_expects(is_valid_constraint(slv, k, x));
return is_signbit_change(old_pi, slv.pi[k]);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x68(%rbx), %rax
movslq %ecx, %rdi
movq %rdx, %r15
movq %rsi, %r14
movl %ecx, 0x14(%rsp)
movq %rdi, 0x18(%rsp)
vmovss (%rax,%rdi,4), %xmm3
vmovaps %xmm3, 0x20(%rsp)
testl %r8d, %r8d
js 0xdad1e
leal 0x1(%r8), %ecx
cmpl %r9d, %ecx
jge 0xdad8a
movq 0x58(%rbx), %rsi
movl %r8d, %edx
movl %ecx, %ebp
xorl %r13d, %r13d
movl %r9d, 0x10(%rsp)
vmovss (%rsi,%rdx,8), %xmm2
vaddss (%rsi,%rbp,8), %xmm2, %xmm2
vmulss 0x37ee1c(%rip), %xmm2, %xmm2 # 0x459ad0
vaddss %xmm2, %xmm3, %xmm2
vmovss %xmm2, (%rax,%rdi,4)
vmovss 0x37edff(%rip), %xmm2 # 0x459ac4
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rsi,%rbp,8), %xmm2
vsubss (%rsi,%rdx,8), %xmm2, %xmm2
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %r13, %rbp
je 0xdadf6
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%r13,8), %r12
movl 0x4(%r15,%r12,8), %esi
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
vmovss 0xc(%rsp), %xmm0
incq %r13
vaddss (%rcx,%rax,4), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xdace2
vmovss 0x37ed9e(%rip), %xmm2 # 0x459ac4
movq 0x58(%rbx), %rax
movl %r9d, %r12d
xorl %ebp, %ebp
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rax), %xmm2
vmulss 0x37ed8d(%rip), %xmm2, %xmm2 # 0x459ad0
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %rbp, %r12
je 0xdae33
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
incq %rbp
vmovss (%rcx,%rax,4), %xmm0
vsubss 0xc(%rsp), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xdad4e
vmovss 0x37ed32(%rip), %xmm2 # 0x459ac4
movq 0x58(%rbx), %rcx
movl %r8d, %eax
movl %r9d, %r12d
xorl %ebp, %ebp
vsubss %xmm0, %xmm2, %xmm2
vdivss %xmm2, %xmm0, %xmm0
vmovss (%rcx,%rax,8), %xmm2
vmulss 0x380f15(%rip), %xmm2, %xmm2 # 0x45bcc8
vfmadd213ss %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm2) + xmm1
vmovss %xmm2, 0xc(%rsp)
cmpq %rbp, %r12
je 0xdae33
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
vmovss 0xc(%rsp), %xmm0
incq %rbp
vaddss (%rcx,%rax,4), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xdadbe
movl 0x10(%rsp), %r12d
cmpq %rbp, %r12
je 0xdae33
movq 0x58(%rbx), %rax
movq %r14, %rdi
movslq 0x4(%rax,%rbp,8), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
incq %rbp
vmovss (%rcx,%rax,4), %xmm0
vsubss 0xc(%rsp), %xmm0, %xmm0
vmovss %xmm0, (%rcx,%rax,4)
jmp 0xdadfb
movl 0x14(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xda5d9
testb %al, %al
je 0xdae71
vmovaps 0x20(%rsp), %xmm0
movq 0x68(%rbx), %rcx
movq 0x18(%rsp), %rdx
vmovmskps %xmm0, %eax
shll $0x1f, %eax
xorl (%rcx,%rdx,4), %eax
shrl $0x1f, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x37d366(%rip), %rdi # 0x4581de
leaq 0x38149d(%rip), %rsi # 0x45c31c
leaq 0x37f106(%rip), %rdx # 0x459f8c
leaq 0x3814ae(%rip), %rcx # 0x45c33b
callq 0x2813f
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::push_and_compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, float, float, float, float)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm3, 0x14(%rsp)
vmovss %xmm2, 0x10(%rsp)
vmovss %xmm1, 0xc(%rsp)
vmovss %xmm0, 0x8(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
xorl %r12d, %r12d
movq %rax, 0x28(%rsp)
movq (%rdx), %rax
movq 0x30(%rsp), %rcx
cmpq (%rcx), %rax
je 0xdc83e
movl -0x4(%rax), %eax
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movslq %eax, %rbp
movl %ebp, %edx
callq 0x3de66
vmovss 0x10(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0xdab38
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
movq %r15, %rcx
callq 0xdab56
vmovss 0x14(%rsp), %xmm1
movq 0x58(%r13), %rdi
movq 0x70(%r13), %rcx
movl %eax, %eax
xorl %edx, %edx
cmpq %rdx, %rax
je 0xdc7e9
movslq 0x4(%rdi,%rdx,8), %rsi
movq 0x8(%rcx), %r8
vmovss (%r8,%rsi,4), %xmm0
vfmadd213ss (%rdi,%rdx,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rdi,%rdx,8)
incq %rdx
jmp 0xdc7c5
movq 0x8(%r13), %rdx
movslq %eax, %rbx
leaq (%rdi,%rbx,8), %rsi
callq 0xdac16
movq 0x60(%r13), %rax
vmovss 0x8(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %ebx, %r9d
movl (%rax,%rbp,4), %r8d
cmpl %r8d, %ebx
cmovll %ebx, %r8d
decl %r8d
callq 0xdac49
orb %al, %r12b
movq (%r14), %rax
addq $-0x4, %rax
movq %rax, (%r14)
jmp 0xdc761
andb $0x1, %r12b
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, float, float, float, float)
|
bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value += objective_amplifier * c(R[i].id, x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
vmovss %xmm3, 0x14(%rsp)
vmovss %xmm2, 0x10(%rsp)
vmovss %xmm1, 0xc(%rsp)
vmovss %xmm0, 0x8(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
xorl %r15d, %r15d
movq %rax, 0x28(%rsp)
cmpq 0x30(%rsp), %r14
je 0xdca92
movl (%r14), %eax
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
movslq %eax, %rbp
movl %ebp, %edx
callq 0x3de66
vmovss 0x10(%rsp), %xmm0
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0xdab38
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0xdab56
vmovss 0x14(%rsp), %xmm1
movq 0x58(%r13), %rdi
movq 0x70(%r13), %rcx
movl %eax, %eax
xorl %edx, %edx
cmpq %rdx, %rax
je 0xdca43
movslq 0x4(%rdi,%rdx,8), %rsi
movq 0x8(%rcx), %r8
vmovss (%r8,%rsi,4), %xmm0
vfmadd213ss (%rdi,%rdx,8), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovss %xmm0, (%rdi,%rdx,8)
incq %rdx
jmp 0xdca1f
movq 0x8(%r13), %rdx
movslq %eax, %rbx
leaq (%rdi,%rbx,8), %rsi
callq 0xdac16
movq 0x60(%r13), %rax
vmovss 0x8(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm1
movq 0x20(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl %ebx, %r9d
movl (%rax,%rbp,4), %r8d
cmpl %r8d, %ebx
cmovll %ebx, %r8d
decl %r8d
callq 0xdac49
orb %al, %r15b
addq $0x8, %r14
jmp 0xdc9be
andb $0x1, %r15b
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<float> const&, double)
|
result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3a8, %rsp # imm = 0x3A8
vmovsd %xmm0, 0x60(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x30(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x38959
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, 0x50(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0xc(%rsp)
jbe 0xde680
movq 0x10(%r14), %rdi
leaq 0x88(%rsp), %rsi
movl %ebx, %edx
callq 0x38a37
vmovss %xmm0, 0x1c(%rsp)
jmp 0xde68a
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x1c(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x78(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x70(%rsp)
vmovsd %xmm1, 0x68(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd0(%rsp), %rdi
leaq 0x88(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0xd9ddc
movl 0xcc(%r12), %esi
leaq 0x98(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x84(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x10(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x150(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0xde76b
cmpl $0x1, %eax
je 0xde745
cmpl $0x2, %eax
jne 0xde77c
movq 0x18(%r14), %rdx
leaq 0x150(%rsp), %rdi
leaq 0x30(%rsp), %rsi
jmp 0xde756
movq 0x18(%r14), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x150(%rsp), %rsi
vmovsd 0x3758da(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x4f9c9
jmp 0xde77c
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x4f95d
vcvtsd2ss 0x50(%rsp), %xmm3, %xmm0
leaq 0x30(%rsp), %r15
movq %r13, 0x58(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
vmovss %xmm0, 0x2c(%rsp)
vcvtsd2ss 0x48(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x50(%rsp)
vcvtsd2ss 0x40(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x48(%rsp)
vcvtsd2ss 0x70(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x70(%rsp)
vcvtsd2ss 0x68(%rsp), %xmm3, %xmm0
vmovss %xmm0, 0x68(%rsp)
cmpl %ebx, %ebp
je 0xde7ee
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x10(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xde7ea
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0xde7c7
leaq 0x158(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x148(%rsp), %ecx
movl 0x14c(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x10(%rsp)
leaq 0x37bd51(%rip), %rdx # 0x45a577
leaq 0x150(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0xd9f4c
vcvtsd2ss 0x10(%rsp), %xmm3, %xmm0
vmovss 0xc(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x30(%rsp), %r13
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0xde95f
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0x98(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq %r13, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0xd9f8e
movq 0x120(%rsp), %rdx
movq 0x138(%rsp), %rcx
movl %eax, %ebx
leaq 0x150(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x434d2
testl %ebx, %ebx
je 0xdea07
cmpl %ebp, %ebx
jge 0xde8f5
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0xdf424
movl %ebx, %ebp
cmpq 0x78(%rsp), %r15
jle 0xde92b
vcvtsi2ss %ebx, %xmm3, %xmm0
vcvtsi2ssl 0x148(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xde931
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0xde95f
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0xdf45c
vmovss 0x10(%rsp), %xmm0
vmovss 0xc(%rsp), %xmm2
testb %al, %al
jne 0xde95f
incq %r15
jmp 0xde87a
movq 0x20(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0xde981
movq 0x20(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0xde9b2
movq 0x20(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x84(%rsp), %edx
movq %r14, %rdi
callq 0x4f485
leaq 0x150(%rsp), %rdi
callq 0x435d0
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0xda3ee
leaq 0x90(%rsp), %rdi
callq 0x35c1a
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rax
addq $0x3a8, %rsp # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x365d4
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xdf3d6
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
leaq 0xd0(%rsp), %r15
leaq 0x30(%rsp), %rbp
xorl %ebx, %ebx
movl $0x0, 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0xde96e
vmovss %xmm0, 0x10(%rsp)
vmulss 0x70(%rsp), %xmm0, %xmm0
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
vmovss 0x68(%rsp), %xmm3
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0xda19a
testl %eax, %eax
jne 0xdeabf
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x365d4
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xdf3d6
movq %r14, %rdi
callq 0xdf45c
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
testb %al, %al
jne 0xde96e
movl %ebx, 0x78(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0xdebe6
movq 0x18(%r14), %rcx
vmovss 0x1c(%rsp), %xmm1
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x10(%rsp)
callq 0xd9f8e
testl %eax, %eax
je 0xdeb9c
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0xdeb63
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x148(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x48(%rsp), %xmm1
callq 0xb530
vmovss 0x10(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
vfmadd231ss 0x2c(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xdeb6f
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
vucomiss 0x50(%rsp), %xmm0
ja 0xdebe6
movq %r14, %rdi
vmovss %xmm0, 0x10(%rsp)
callq 0xdf45c
testb %al, %al
jne 0xdebda
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
incl %ebx
jmp 0xdeae4
vmovsd 0x60(%rsp), %xmm0
movq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x365d4
movl 0xc0(%r12), %eax
imull 0x40(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xdf3d6
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
jmp 0xdebe6
vmovss 0xc(%rsp), %xmm2
vmovss 0x10(%rsp), %xmm0
movl 0x78(%rsp), %ebx
decl 0x40(%rsp)
incl %ebx
jmp 0xdea50
jmp 0xdec2c
jmp 0xdec05
jmp 0xdec2c
movq %rax, %r14
jmp 0xdec3c
movq %rax, %r14
jmp 0xdec49
movq %rax, %r14
jmp 0xdec56
movq %rax, %r14
jmp 0xdec63
movq %rax, %r14
jmp 0xdec6d
jmp 0xdec2c
jmp 0xdec2c
jmp 0xdec2c
leaq 0x158(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0xdec3c
leaq 0x150(%rsp), %rdi
movq %rax, %r14
callq 0x435d0
leaq 0x98(%rsp), %rdi
callq 0x393ac
leaq 0xd0(%rsp), %rdi
callq 0xda3ee
leaq 0x90(%rsp), %rdi
callq 0x35c1a
leaq 0x38(%rsp), %rdi
callq 0x357fe
movq 0x20(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<float> const&, double)
|
result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp # imm = 0x158
vmovsd %xmm0, 0x58(%rsp)
vxorps %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x18(%rsp)
vmovups %zmm0, 0x58(%rdi)
vmovups %zmm0, 0x40(%rdi)
vmovups %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x28(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x90(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x38959
vmovsd 0x20(%r12), %xmm0
vmovsd 0x10(%r12), %xmm2
vxorpd %xmm1, %xmm1, %xmm1
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x28(%r12), %xmm0
vucomisd %xmm2, %xmm1
vmovsd %xmm0, 0x40(%rsp)
vmovsd 0x30(%r12), %xmm0
vmovsd %xmm0, 0x38(%rsp)
vcvtsd2ss 0x8(%r12), %xmm3, %xmm0
vmovss %xmm0, 0x4(%rsp)
jbe 0xded64
movq 0x10(%r14), %rdi
leaq 0x90(%rsp), %rsi
movl %ebx, %edx
callq 0x38a37
vmovss %xmm0, 0x14(%rsp)
jmp 0xded6e
vcvtsd2ss %xmm2, %xmm2, %xmm0
vmovss %xmm0, 0x14(%rsp)
vcvttsd2si 0xa0(%r12), %rax
vmovsd 0x38(%r12), %xmm0
vmovsd 0x40(%r12), %xmm1
movq 0x18(%r14), %rsi
movq %rax, 0x70(%rsp)
movq 0x8(%r15), %rax
vmovsd %xmm0, 0x68(%rsp)
vmovsd %xmm1, 0x60(%rsp)
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0xd8(%rsp), %rdi
leaq 0x90(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0xd9ddc
movl 0xcc(%r12), %esi
leaq 0xa0(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x7c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x80(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0xdee4c
cmpl $0x1, %eax
je 0xdee26
cmpl $0x2, %eax
jne 0xdee5d
movq 0x18(%r14), %rdx
leaq 0x80(%rsp), %rdi
leaq 0x28(%rsp), %rsi
jmp 0xdee37
movq 0x18(%r14), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x80(%rsp), %rsi
vmovsd 0x3751f9(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x4f9c9
jmp 0xdee5d
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 0xdeecf
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x8(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xdeecb
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0xdeea8
leaq 0x88(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, 0x8(%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0xd9f4c
vcvtsd2ss 0x8(%rsp), %xmm3, %xmm0
vmovss 0x4(%rsp), %xmm2
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x28(%rsp), %rbx
xorl %r15d, %r15d
cmpq 0xb0(%r12), %r15
je 0xdeff2
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movq %rbx, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0xd9f8e
movl %eax, %r13d
testl %eax, %eax
je 0xdf08a
cmpl %ebp, %r13d
jge 0xdef87
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0xdf50a
movl %r13d, %ebp
cmpq 0x70(%rsp), %r15
jle 0xdefbe
vcvtsi2ss %r13d, %xmm3, %xmm0
vcvtsi2ssl 0x150(%rsp), %xmm3, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss 0x8(%rsp), %xmm1
vfmadd231ss 0x24(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xdefc4
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xdeff2
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0xdf542
vmovss 0x8(%rsp), %xmm0
vmovss 0x4(%rsp), %xmm2
testb %al, %al
jne 0xdeff2
incq %r15
jmp 0xdef2d
movq 0x18(%rsp), %rax
movl $0x5, 0xa0(%rax)
cmpl $0x0, 0x50(%r14)
jne 0xdf014
movq 0x18(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0xdf042
movq 0x18(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x7c(%rsp), %edx
movq %r14, %rdi
callq 0x4f485
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0xda3ee
leaq 0x98(%rsp), %rdi
callq 0x35c1a
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%rsp), %rax
addq $0x158, %rsp # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x58(%rsp), %xmm0
movq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rbx
movq %rbx, %rsi
callq 0x365d4
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xdf4bc
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 0xdf001
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 0xda19a
testl %eax, %eax
jne 0xdf142
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 0xdf4bc
movq %r14, %rdi
callq 0xdf542
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
testb %al, %al
jne 0xdf001
movl %ebx, 0x70(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0xdf269
movq 0x18(%r14), %rcx
vmovss 0x14(%rsp), %xmm1
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovss %xmm0, 0x8(%rsp)
callq 0xd9f8e
testl %eax, %eax
je 0xdf21f
vcvtsi2sd %r13d, %xmm4, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0xdf1e6
vcvtsi2ss %eax, %xmm4, %xmm0
vcvtsi2ssl 0x150(%rsp), %xmm4, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss 0x40(%rsp), %xmm1
callq 0xb530
vmovss 0x8(%rsp), %xmm1
vmovss 0x4(%rsp), %xmm2
vfmadd231ss 0x24(%rsp), %xmm0, %xmm1 # xmm1 = (xmm0 * mem) + xmm1
vmovaps %xmm1, %xmm0
jmp 0xdf1f2
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
vucomiss 0x48(%rsp), %xmm0
ja 0xdf269
movq %r14, %rdi
vmovss %xmm0, 0x8(%rsp)
callq 0xdf542
testb %al, %al
jne 0xdf25d
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
incl %ebx
jmp 0xdf167
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 0xdf4bc
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
jmp 0xdf269
vmovss 0x4(%rsp), %xmm2
vmovss 0x8(%rsp), %xmm0
movl 0x70(%rsp), %ebx
decl 0x38(%rsp)
incl %ebx
jmp 0xdf0d3
jmp 0xdf2aa
jmp 0xdf283
jmp 0xdf2aa
movq %rax, %r14
jmp 0xdf2ba
movq %rax, %r14
jmp 0xdf2c7
movq %rax, %r14
jmp 0xdf2d4
movq %rax, %r14
jmp 0xdf2de
jmp 0xdf2aa
jmp 0xdf2aa
jmp 0xdf2aa
leaq 0x88(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
jmp 0xdf2ad
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0x393ac
leaq 0xd8(%rsp), %rdi
callq 0xda3ee
leaq 0x98(%rsp), %rdi
callq 0x35c1a
leaq 0x30(%rsp), %rdi
callq 0x357fe
movq 0x18(%rsp), %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long)
|
void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
}
|
vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xdf33c
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0xdf3b6
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::pnm_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x37a6e1(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long)
|
void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
}
|
vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xdf422
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0xdf49c
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::file_observer>::is_timelimit_reached()
|
bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x37a5fb(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-common.hpp
|
baryonyx::itm::solver_functor<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, false>, float, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<float>, baryonyx::none_observer>::store_if_better(baryonyx::bit_array const&, double, long)
|
void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
}
|
vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0xdf508
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0xdf582
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::result baryonyx::itm::optimize_problem<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>>(baryonyx::context const&, baryonyx::problem const&)
|
inline result
optimize_problem(const context& ctx, const problem& pb)
{
result r;
if (ctx.start)
ctx.start(ctx.parameters);
auto constraints{ make_merged_constraints(ctx, pb) };
if (constraints.empty() || pb.vars.values.empty()) {
r.status = result_status::success;
r.solutions.resize(1);
r.solutions.back().value = pb.objective.value;
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
return r;
}
random_engine rng(init_random_generator_seed(ctx));
auto variables = length(pb.vars.values);
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
const auto thread = get_thread_number(ctx);
std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors;
std::vector<std::thread> pool(thread);
best_solution_recorder<Cost, Float, Mode> best_recorder(
rng,
thread,
cost,
cost_constant,
variables,
constraints,
ctx.parameters.init_population_size);
auto seeds = generate_seed(rng, thread);
std::atomic_bool stop_task;
stop_task.store(false);
for (unsigned i = 0u; i != thread; ++i)
functors.emplace_back(ctx, i, seeds[i]);
for (unsigned i = 0u; i != thread; ++i)
pool[i] = std::thread(std::ref(functors[i]),
std::ref(stop_task),
std::ref(best_recorder),
std::cref(constraints),
variables,
std::cref(cost),
cost_constant);
const auto start = std::chrono::steady_clock::now();
auto end = start;
do {
std::this_thread::sleep_for(std::chrono::seconds{ 1L });
if (ctx.update) {
auto call_number = 0L;
for (auto i = 0u; i != thread; ++i)
call_number += functors[i].m_call_number;
int constraints_remaining;
long int loop;
double value;
double duration;
best_recorder.get_best(
constraints_remaining, value, duration, loop);
ctx.update(
constraints_remaining, value, loop, duration, call_number);
}
end = std::chrono::steady_clock::now();
} while (!is_time_limit(ctx.parameters.time_limit, start, end));
stop_task.store(true);
for (auto& t : pool)
t.join();
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
r.variables = variables;
r.constraints = length(constraints);
const auto& first = best_recorder.get_best(0);
if (!first.is_solution())
r.status = result_status::time_limit_reached;
else
r.status = result_status::success;
r.duration = first.duration;
r.loop = first.loop;
r.remaining_constraints = first.remaining_constraints;
switch (ctx.parameters.storage) {
case solver_parameters::storage_type::one: {
r.solutions.resize(1);
convert(first, r.solutions[0], variables);
} break;
case solver_parameters::storage_type::bound: {
r.solutions.resize(2);
convert(first, r.solutions[0], variables);
convert(best_recorder.get_worst(), r.solutions[1], variables);
} break;
case solver_parameters::storage_type::five: {
r.solutions.resize(5);
for (int i = 0; i != 5; ++i)
convert(best_recorder.get_best(i), r.solutions[i], variables);
} break;
}
best_recorder.show_population(ctx);
if (ctx.finish)
ctx.finish(r);
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp # imm = 0x198
vxorpd %xmm0, %xmm0, %xmm0
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
cmpq $0x0, 0x128(%rsi)
je 0xdf607
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 0xdf766
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0xdf766
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0xb8(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x445b4
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x70(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x60(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xe0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0xc0(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0x58da6
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x60(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x88(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0xdf7c1
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xe08a4
movl 0x8(%rsp), %eax
incl %eax
jmp 0xdf73d
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 0xdfb5c
movq %r13, 0x80(%rsp)
movq %r15, %r13
leaq 0x8(%rsp), %r15
leaq 0x98(%rsp), %r14
leaq 0x4(%rsp), %rbx
xorl %r12d, %r12d
cmpq %rbp, %r12
je 0xdf885
imulq $0xc0, %r12, %rax
addq 0x60(%rsp), %rax
leaq 0x3(%rsp), %r10
leaq 0xd8(%rsp), %r11
movq %r10, 0x20(%rsp)
leaq 0x48(%rsp), %r10
movq %r11, 0x18(%rsp)
movq %r10, 0x98(%rsp)
movq %rax, 0x28(%rsp)
leaq 0xb8(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x20(%rsp), %rdx
leaq 0x38(%rsp), %rax
movq %r15, %rdi
leaq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rcx
movq %r14, %r8
movq %rbx, %r9
pushq %rax
leaq 0x98(%rsp), %rax
pushq %rax
callq 0xe08f0
popq %rax
popq %rcx
leaq (,%r12,8), %rdi
addq 0xa0(%rsp), %rdi
movq %r15, %rsi
callq 0x356d6
movq %r15, %rdi
callq 0x356f0
incq %r12
jmp 0xdf7e1
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 0xdf91a
movq 0x60(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0xdf8db
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0xdf8c5
leaq 0xe0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0x60418
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x20(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movl 0x18(%rsp), %esi
movq %r12, %rdi
movq %r14, %rcx
callq 0x35736
callq 0xb5a0
vmovsd (%r13), %xmm0
subq %rbx, %rax
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm0, %xmm1
vcvtsi2sd %rax, %xmm2, %xmm1
vdivsd 0x37a143(%rip), %xmm1, %xmm1 # 0x459a80
jae 0xdf8a0
vucomisd %xmm0, %xmm1
jbe 0xdf8a0
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xa0(%rsp), %rbx
movq 0xa8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0xdf97b
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0xdf968
movq 0x80(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x31d28
addq $0xc0, %rbx
leaq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x352c2
leaq 0x50(%r12), %rdi
movq 0x88(%rsp), %rsi
callq 0x352ec
movl 0x4(%rsp), %eax
movl %eax, 0x90(%r12)
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
pushq $0x28
popq %rcx
cqto
xorl %esi, %esi
idivq %rcx
movq 0x118(%rsp), %rdi
movq 0x130(%rsp), %rcx
movl %eax, 0x94(%r12)
movslq (%rdi), %rax
imulq $0x38, %rax, %rax
movl 0x30(%rcx,%rax), %edx
leaq (%rcx,%rax), %rbx
testl %edx, %edx
setne %sil
leal (%rsi,%rsi,2), %esi
movl %esi, 0xa0(%r12)
vmovsd 0x18(%rcx,%rax), %xmm0
vmovsd %xmm0, 0x80(%r12)
movq 0x28(%rcx,%rax), %rax
movq %rax, 0x88(%r12)
movl %edx, 0x98(%r12)
movl 0xe8(%r13), %eax
testl %eax, %eax
je 0xdfad6
cmpl $0x1, %eax
je 0xdfa9e
cmpl $0x2, %eax
jne 0xdfaf5
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0xdfaf5
movq 0x118(%rsp), %rax
movq (%rbx), %rsi
movl 0x4(%rsp), %edx
movslq (%rax,%r15,4), %rax
addq %r14, %rsi
imulq $0x38, %rax, %rdi
addq 0x130(%rsp), %rdi
callq 0x4f485
incq %r15
addq $0x20, %r14
jmp 0xdfa64
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4f485
leaq 0xe0(%rsp), %rdi
callq 0x60496
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0xdfae9
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x4f485
leaq 0xd8(%rsp), %rdi
movq %r13, %rsi
callq 0x58f0a
cmpq $0x0, 0x168(%r13)
je 0xdfb21
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x58f1e
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0xe586a
leaq 0xb8(%rsp), %rdi
callq 0x4495c
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x198, %rsp # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xdfbbd
movq %rax, %rbx
jmp 0xdfbca
movq %rax, %rbx
jmp 0xdfbd7
jmp 0xdfba1
jmp 0xdfb92
jmp 0xdfbb0
jmp 0xdfbb0
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0xdfbf8
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0xdfbee
jmp 0xdfbb0
jmp 0xdfbb0
jmp 0xdfbb0
jmp 0xdfbb0
jmp 0xdfbb0
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xd8(%rsp), %rdi
callq 0x58f1e
leaq 0xa0(%rsp), %rdi
callq 0x35836
leaq 0x60(%rsp), %rdi
callq 0xe586a
leaq 0xb8(%rsp), %rdi
callq 0x4495c
leaq 0x48(%rsp), %rdi
callq 0x35858
movq 0x10(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
|
/quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp
|
baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::solver_equalities_01coeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::quadratic_cost_type<float> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&)
|
solver_equalities_01coeff(random_engine& rng_,
int m_,
int n_,
const cost_type& c_,
const std::vector<merged_constraint>& csts)
: logger("solver_equalities_01coeff")
, rng(rng_)
, ap(csts, m_, n_)
, P(std::make_unique<Float[]>(ap.size()))
, R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts)))
, b(std::make_unique<bound_factor[]>(m_))
, pi(std::make_unique<Float[]>(m_))
, c(c_)
, m(m_)
, n(n_)
{
for (int i = 0; i != m; ++i) {
#if !defined(BARYONYX_FULL_OPTIMIZATION)
// mscv 15.9.6 fail to build this line:
// for ([[maybe_unused]] const auto& cst : csts[i].elements)
// bx_ensures(cst.factor == 1);
for (const auto& cst : csts[i].elements)
bx_ensures(cst.factor == 1);
#endif
bx_ensures(csts[i].min == csts[i].max);
b[i] = csts[i].min;
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
leaq 0x37b058(%rip), %rdx # 0x45c241
movq %r9, %r12
movq %r8, 0x20(%rsp)
movl %ecx, %r13d
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x19
popq %rsi
callq 0xb8418
movq %r14, 0x8(%rbx)
leaq 0x10(%rbx), %r14
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
movl %r13d, %ecx
callq 0x3a4ca
movl 0x38(%rbx), %esi
leaq 0x50(%rbx), %r15
movq %r15, %rdi
movq %r14, 0x18(%rsp)
callq 0x35bd8
movq %r12, %rdi
movq %r15, 0x10(%rsp)
leaq 0x58(%rbx), %r14
callq 0x3a89d
movq %r14, 0x8(%rsp)
movq %r14, %rdi
movq %rax, %rsi
callq 0xe183e
leaq 0x60(%rbx), %r14
movslq %ebp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x28eb6
leaq 0x68(%rbx), %rdi
movq %r15, %rsi
callq 0x35bd8
movq 0x20(%rsp), %rax
xorl %edx, %edx
movq %rax, 0x70(%rbx)
movl %ebp, 0x78(%rbx)
movl %r13d, 0x7c(%rbx)
movq (%r12), %rax
movq 0x60(%rbx), %rcx
movl %ebp, %esi
cmpq %rsi, %rdx
je 0xe12c3
imulq $0x28, %rdx, %rdi
leaq (%rax,%rdi), %rsi
movq (%rax,%rdi), %r8
movq 0x8(%rax,%rdi), %rdi
cmpq %rdi, %r8
je 0xe12b0
cmpl $0x1, (%r8)
leaq 0x8(%r8), %r8
je 0xe129f
jmp 0xe12d2
movl 0x18(%rsi), %edi
cmpl 0x1c(%rsi), %edi
jne 0xe12f3
movl %edi, (%rcx,%rdx,4)
incq %rdx
movl 0x78(%rbx), %ebp
jmp 0xe1287
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x377151(%rip), %rdi # 0x45842a
leaq 0x37af7b(%rip), %rsi # 0x45c25b
leaq 0x37af84(%rip), %rdx # 0x45c26b
leaq 0x3791bc(%rip), %rcx # 0x45a4aa
callq 0x2813f
leaq 0x377130(%rip), %rdi # 0x45842a
leaq 0x37afd4(%rip), %rsi # 0x45c2d5
leaq 0x37af63(%rip), %rdx # 0x45c26b
leaq 0x37afe1(%rip), %rcx # 0x45c2f0
callq 0x2813f
movq %r14, %rdi
movq %rax, %r12
callq 0x28fb6
jmp 0xe1324
movq %rax, %r12
movq 0x8(%rsp), %rdi
callq 0xe1880
jmp 0xe1333
movq %rax, %r12
movq 0x10(%rsp), %rdi
callq 0x35c1a
jmp 0xe1342
movq %rax, %r12
movq 0x18(%rsp), %rdi
callq 0x3a954
jmp 0xe1351
movq %rax, %r12
movq %rbx, %rdi
callq 0xb853a
movq %r12, %rdi
callq 0xb3d0
nop
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true> const&, baryonyx::bit_array const&)
|
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 0xe1378
movq %rax, %rdi
jmp 0xe18a8
cmpl $0x7, %ecx
jne 0xe1395
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0xe13a3
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0xe1386
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0xe198d
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float)
|
int run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta)
{
bool pi_changed = false;
int remaining = 0;
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.compute_update_row(
x, R.crbegin(), R.crend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl 0x30(%rdi), %eax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decl %eax
cmpl $0x6, %eax
ja 0xe14e3
leaq 0x37aa51(%rip), %rdx # 0x45be1c
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
callq 0xe1a60
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xe198d
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xe3455
jmp 0xe1518
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xe2b7f
jmp 0xe1474
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xe2fea
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe1dc8
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xe1f76
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x3ceed
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe1c1a
jmp 0xe153c
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0xe3947
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe205c
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xe198d
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm2, 0xc(%rsp)
vmovss %xmm1, 0x8(%rsp)
vmovss %xmm0, 0x4(%rsp)
callq 0x3ceed
vmovss 0x4(%rsp), %xmm0
vmovss 0x8(%rsp), %xmm1
vmovss 0xc(%rsp), %xmm2
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe1c1a
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xe220a
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array, float>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, float, float, float, float)
|
int push_and_run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
bool pi_changed = 0;
int remaining = 0;
if (use_cycle)
order = next_state(order);
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.push_and_compute_update_row(x,
R.crbegin(),
R.crend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl 0x30(%rdi), %eax
cmpb $0x1, 0x34(%rdi)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
jne 0xe15dc
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 0xe1775
leaq 0x37a84a(%rip), %rdx # 0x45be38
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
callq 0xe3e3e
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xe198d
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xe4e82
jmp 0xe175e
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xe45ac
jmp 0xe16a6
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xe4a17
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe41fc
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xe1f76
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x3ceed
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe4024
jmp 0xe1787
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %r15, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0xe5374
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe43d4
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xe198d
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rcx, %rdx
vmovss %xmm3, 0xc(%rsp)
vmovss %xmm2, 0x8(%rsp)
vmovss %xmm1, 0x4(%rsp)
vmovss %xmm0, (%rsp)
callq 0x3ceed
vmovss (%rsp), %xmm0
vmovss 0x4(%rsp), %xmm1
vmovss 0x8(%rsp), %xmm2
vmovss 0xc(%rsp), %xmm3
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe4024
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xe220a
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true> const, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true> const&, baryonyx::bit_array const&)
|
int 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 0xe18cc
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 0xe196d
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 0xe1929
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %ebx
addq $0x8, %r13
jmp 0xe1910
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rax
movl (%rax,%rbp,4), %eax
movl %eax, %ecx
subl %ebx, %ecx
jle 0xe1949
shlq $0x20, %rcx
orq %rbp, %rcx
movq %rcx, 0x8(%rsp)
jmp 0xe1959
jge 0xe1968
subl %eax, %ebx
shlq $0x20, %rbx
orq %rbp, %rbx
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c8c2
incq %rbp
jmp 0xe18ee
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
subq 0x18(%rcx), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true> const&, baryonyx::bit_array const&, 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 0xe19ab
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x78(%r15), %esi
je 0xe19de
movq %r15, %rdi
movq %r14, %rdx
callq 0xe19f5
testb %al, %al
jne 0xe19d6
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0xe19b2
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>, baryonyx::bit_array>(baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true> const&, 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 0xe1a42
movl 0x4(%r13), %esi
movq %r14, %rdi
callq 0x3664a
addl %eax, %r15d
addq $0x8, %r13
jmp 0xe1a28
movq 0x60(%rbx), %rcx
movslq %ebp, %rax
cmpl (%rcx,%rax,4), %r15d
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/quesnel[P]baryonyx/lib/src/itm-common.hpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %rbx
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
leaq 0x37a8b8(%rip), %rdx # 0x45c344
movq %rsi, %r14
movq %rdi, %r12
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
movq %rbx, 0x40(%rsp)
xorl %edx, %edx
movq %rax, 0x30(%rsp)
movq (%rbx), %rax
leaq 0x37a850(%rip), %rbx # 0x45c313
pushq $0x8
popq %rbp
movq %r14, 0x38(%rsp)
movq 0x48(%rsp), %rcx
cmpq (%rcx), %rax
je 0xe1c06
movq %rdx, 0x50(%rsp)
movl -0x4(%rax), %edx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %edx, 0xc(%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0xe224a
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rcx
callq 0xe2268
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r14
movl %eax, %r15d
leaq (%rdi,%r14,8), %rsi
callq 0xe2335
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,4), %r8
movl (%r8), %eax
cmpl %eax, %r14d
cmovll %r14d, %eax
decl %eax
movl %eax, 0x10(%rsp)
pushq $0x15
popq %rsi
leaq 0x37a798(%rip), %rdx # 0x45c2fd
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
xorl %r13d, %r13d
andnl %r14d, %eax, %r14d
shlq $0x3, %r14
cmpq %r13, %r14
je 0xe1ba7
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x4(%rcx,%r13), %r8
addq %r13, %rcx
callq 0xb91f0
addq $0x8, %r13
jmp 0xe1b81
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x37f4ad(%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 0xe2368
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rcx
orb %al, %dl
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0xe1acb
andb $0x1, %dl
movl %edx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
bool baryonyx::itm::solver_equalities_01coeff<float, baryonyx::itm::minimize_tag, baryonyx::itm::quadratic_cost_type<float>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, float, float, float)
|
bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
int selected = select_variables(r_size, b[k]);
logger::log("constraints {}: {} = ", k, b[k]);
for (int i = 0; i < r_size; ++i)
logger::log("{} ({}) ", R[i].value, R[i].id);
logger::log(" => Selected: {}\n", selected);
auto pi_change = affect(
*this, x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x40(%rsp)
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq 0x37a6f8(%rip), %rdx # 0x45c344
vmovss %xmm0, (%rcx)
vmovss %xmm1, (%r8)
vmovss %xmm2, (%r9)
pushq $0x14
popq %rsi
callq 0xb907e
leaq 0x10(%r12), %rax
leaq 0x37a6a5(%rip), %rbx # 0x45c313
movq %rax, 0x30(%rsp)
xorl %eax, %eax
pushq $0x8
popq %rbp
movq %r13, 0x38(%rsp)
cmpq 0x40(%rsp), %r14
je 0xe1db7
movl (%r14), %edx
movq 0x30(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movq %rax, 0x48(%rsp)
movq %r14, 0x50(%rsp)
movl %edx, 0xc(%rsp)
callq 0x3de66
vmovss 0x14(%rsp), %xmm0
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0xe224a
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rcx
callq 0xe2268
movq 0x58(%r12), %rdi
movq 0x8(%r12), %rdx
movslq %eax, %r14
movl %eax, %r15d
leaq (%rdi,%r14,8), %rsi
callq 0xe2335
movslq 0xc(%rsp), %rax
movq 0x60(%r12), %rcx
movq %r12, %rdi
leaq (%rcx,%rax,4), %r8
movl (%r8), %eax
cmpl %eax, %r14d
cmovll %r14d, %eax
decl %eax
movl %eax, 0x10(%rsp)
pushq $0x15
popq %rsi
leaq 0x37a5e4(%rip), %rdx # 0x45c2fd
leaq 0xc(%rsp), %rcx
callq 0xb91c2
movl %r14d, %eax
sarl $0x1f, %eax
andnl %r14d, %eax, %r13d
xorl %r14d, %r14d
shlq $0x3, %r13
cmpq %r14, %r13
je 0xe1d5b
movq 0x58(%r12), %rcx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x4(%rcx,%r14), %r8
addq %r14, %rcx
callq 0xb91f0
addq $0x8, %r14
jmp 0xe1d35
movq %r12, %rdi
pushq $0x11
popq %rsi
leaq 0x37f2f9(%rip), %rdx # 0x461061
leaq 0x10(%rsp), %rcx
callq 0xb921e
vmovss 0x1c(%rsp), %xmm0
vmovss 0x18(%rsp), %xmm1
movq 0x38(%rsp), %r13
movq 0x28(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
movq %r12, %rdi
movl %r15d, %r9d
movq %r13, %rsi
callq 0xe2368
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r14
orb %al, %cl
addq $0x4, %r14
movq %rcx, %rax
jmp 0xe1c7d
andb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/quesnel[P]baryonyx/lib/src/itm-solver-equalities-01.cpp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.