python2 support

This commit is contained in:
urojony 2020-04-10 23:38:12 +02:00
parent aa97bc4418
commit a5854e31d7
3 changed files with 16 additions and 3 deletions

View File

@ -4,7 +4,18 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/grzegorz/shiroindev/shiroindev.py:42: DeprecationWarning: invalid escape sequence \\^\n",
" formula=re.sub('\\^{(.)}',r'^\\1',latex(formula,fold_short_frac=True).replace(' ','').replace('\\\\left(','(').replace('\\\\right)',')'))\n",
"/home/grzegorz/shiroindev/shiroindev.py:43: DeprecationWarning: invalid escape sequence \\{\n",
" return re.sub('\\{(\\(.+?\\))\\}',r'\\1',formula)\n"
]
}
],
"source": [
"from shiroindev import *\n",
"sSeed=1"
@ -758,8 +769,8 @@
"status: 0\n",
"From weighted AM-GM inequality:\n",
"$$2a^2b^2c^3d \\le a^3bc^2d^2+ab^3c^4$$\n",
"$$4a^2bc^3d \\le a^3bc^2d^2+a^3c^2d^2+ab^3c^4+ac^4$$\n",
"$$2a^2c^3d \\le a^3c^2d^2+ac^4$$\n",
"$$4a^2bc^3d \\le a^3bc^2d^2+a^3c^2d^2+ab^3c^4+ac^4$$\n",
"\n",
"$$ 0 \\le \n",
"4a^3bcd^3+2a^3bd^4+2a^3cd^3+2a^2b^2cd^3+4a^2bc^2d^2+12a^2bcd^3+6a^2bd^4+4a^2c^2d^2+6a^2cd^3+4ab^3c^3d+2ab^3c^2d^2+6ab^2c^4+8ab^2c^3d+4ab^2c^2d^2+4ab^2cd^3+6abc^4+4abc^3d+6abc^2d^2+12abcd^3+6abd^4+4ac^2d^2+6acd^3+2b^3c^3d+2b^3c^2d^2+4b^2c^3d+4b^2c^2d^2+2b^2cd^3+2bc^3d+4bc^2d^2+4bcd^3+2bd^4+2c^2d^2+2cd^3 $$\n",

View File

@ -1,4 +1,6 @@
from __future__ import print_function
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import warnings,operator
warnings.filterwarnings("ignore")
#Seed is needed to select the weights in linprog function.