Skip to content

Commit

Permalink
Add lift to Long Product
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Jun 28, 2019
1 parent 225eb92 commit acc1f19
Showing 1 changed file with 102 additions and 25 deletions.
127 changes: 102 additions & 25 deletions examples/Long_product.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -885,28 +885,9 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.989209 seconds (4.87 M allocations: 584.325 MiB, 10.60% gc time)\n",
" 0.439154 seconds (2.91 M allocations: 537.668 MiB, 18.66% gc time)\n"
]
},
{
"data": {
"text/plain": [
"PSW(1.6839819618874383, [1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1])"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"@time seq = sosbuildsequence(s, 6, niter=410, l=1, p_0=:Primal)\n",
"@time psw = findsmp(seq)"
Expand Down Expand Up @@ -1006,13 +987,109 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"#### Debruijn lift aka $M$-dependent lift"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"function msos(d, m, tol=1e-4)\n",
" s2 = mdependentlift(s, m)\n",
" @time lb, ub = soslyapb(s2, d; factory=interior_point_solver, tol=1e-4, verbose=1)\n",
" ub - smp.growthrate\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msos(1, 2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msos(2, 2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msos(3, 2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msos(4, 2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"s2 = mdependentlift(s, 2)\n",
"@time lb, ub = soslyapb(s2, 6; factory=interior_point_solver, tol=1e-4, verbose=1)\n",
"ub - smp.growthrate"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"msos(3, 3, 1e-6)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msos(4, 3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msos(1, 4)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"msos(2, 4)"
]
}
],
"metadata": {
Expand All @@ -1029,7 +1106,7 @@
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.1.0"
"version": "1.1.1"
}
},
"nbformat": 4,
Expand Down

0 comments on commit acc1f19

Please sign in to comment.