{ "info": { "author": "Tsimpitas Dimitris", "author_email": "dimitristsimpitas@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# ![Aplos](https://i.imgur.com/2LhCOIn.png) \n[![Build Status](https://travis-ci.org/TsimpDim/Aplos.svg?branch=master)](https://travis-ci.org/TsimpDim/Aplos) [![Coverage Status](https://coveralls.io/repos/github/TsimpDim/Aplos/badge.svg?branch=master)](https://coveralls.io/github/TsimpDim/Aplos?branch=master)\n\nAplos is a simple and elegant linear problem(LP) parser. It allows one to get all the information they need about any linear problem given with the correct syntax. You can read more about Linear Programming [here.](https://en.wikipedia.org/wiki/Linear_programming)\n\n#### Expected LP format\n\n>min/max cTx \n>\n>s.t /st /s.t. /subject to Ax \u2297 b \n>\n>End\n\nWhere \u2297 can be any of the following =, <=, >=\n\nVariable(x) constraints/domains are not taken into consideration *(not yet)*.\n\n---\nExamples:\n\n1. Max 3x1 +2x2\n\n s.t. x1+2x2<=9\n\n\t2x1+5x2<=4\n\n\tEnd\n\n 2. min 3x1 - 5x2 + x4 \n \tst x2 + x3 = 2 \n 2x1 + 3x2 + 5x4 >= 5 \n x1 - 5x2 + 2x3 - 4x4 <= 10 \n END\n\n## Usage\n``` python\nimport Aplos\n\n# Initialization\n# From a file\nparser = Aplos.AplosParser(filename='lp.txt')\n\n# From a string\ntext_lp = '''Max 3x1 +2x2\n\ns.t. x1+2x2<=9\n\n2x1+5x2<=4\n\nEnd'''\n\nparser = Aplos.AplosParser(text=text_lp)\n\n# From a string with a custom delimeter\ntext = \"Max 3x1 +2x3 + x5,s.t. x1+2x2<=9,2x1+5x2<=4,End\"\n\nparser = Aplos.AplosParser(text=text, delimeter=',')\n\n\n# Getting the variables\nvariables_of_line = parser.get_vars(line_idx=0)\n# variables_of_line = {\"existing\":['x1','x3'], \"extended\":['x1','x2','x3','x4','x5']}\nvariables_all = parser.get_vars()\n# variables_all = ['x1','x2','x3','x4','x5']\n\n# Detect errors\nerrors = parser.detect_errors() # set print_msg=True to print the full list of errors\n\nif not errors:\n # Get dimensions\n dimensions = parser.get_dimensions()\n m = dimensions['m']\n n = dimensions['n']\n\n # Get any matrix (A,b,c,Eqin or MinMax)\n # Eqin and MinMax have values corresponding to symbols\n # Eqin -- '<=': -1 | '>=' : 1 | '=' : 0\n # MinMax -- 'max':1 | 'min':-1\n matrix_A = parser.get_matrix('a')\n matrix_b = parser.get_matrix('B')\n # And so on\n\n # Otherwise, get all matrices at once.\n # Keys are : A,b,c,Eqin & MinMax\n matrices = parser.get_matrices()\n matrix_A = matrices['A']\n # And so on\n\n # Save matrices to file\n parser.write_matrices_to_file('output.txt')\n\n # Get dual matrices\n # Variable constraints -- 'free' : 0 | '>= 0' : 1 | '<= 0' : -1}\n dual_A = parser.get_dual_matrix('a')\n\n # Variable constraints are calculated assuming that x(i) >= 0\n # for every i. This is subject to change.\n dual_var_constr = parser.get_dual_matrix('var_constr')\n # And so on\n\n # You can also get all the dual matrices together\n # Similarly keys are : A,b,c,Eqin,MinMax & VarConstr\n dual_matrices = parser.get_dual_matrices()\n dual_A = dual_matrices['A']\n # And so on\n\n # Save dual matrices to file\n parser.write_matrices_to_file('output_dual.txt', dual=True)\n\n\n # After saving matrices (non-dual), you can also read them back\n saved_matrices = parser.read_matrices_from_file('output.txt')\n\n # If dual\n saved_d_matrices = parser.read_matrices_from_file('output_dual.txt')\n\n```\n\n\n*As the project continues, the 'usage' section will get updated and eventually (hopefully) be moved in a documentation file/page altogether.*\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/TsimpDim/Aplos", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "Aplos", "package_url": "https://pypi.org/project/Aplos/", "platform": "", "project_url": "https://pypi.org/project/Aplos/", "project_urls": { "Homepage": "https://github.com/TsimpDim/Aplos" }, "release_url": "https://pypi.org/project/Aplos/1.1/", "requires_dist": null, "requires_python": "", "summary": "A Linear Problem parser", "version": "1.1" }, "last_serial": 4159335, "releases": { "1.1": [ { "comment_text": "", "digests": { "md5": "a19489de13e21c2c254c8f99ec4b853a", "sha256": "4c299690442172b23f5a9b61f89650fd30d2b1fbdcb5626ee6934e0164fb9fd0" }, "downloads": -1, "filename": "Aplos-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a19489de13e21c2c254c8f99ec4b853a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14665, "upload_time": "2018-08-11T09:38:45", "url": "https://files.pythonhosted.org/packages/7d/9b/5adf637319f0ede086b6781fcacc73e01d321b3ddfaa33b759109df97e3e/Aplos-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "176bea0da11b9a8e03cc77349b5c09dd", "sha256": "ee8d4175a9a1ca87e56118d3370f5f44ea10fce79c21274d38b1b369a7bd1bb5" }, "downloads": -1, "filename": "Aplos-1.1.tar.gz", "has_sig": false, "md5_digest": "176bea0da11b9a8e03cc77349b5c09dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11910, "upload_time": "2018-08-11T09:38:47", "url": "https://files.pythonhosted.org/packages/b1/46/94b3f4f437a2c6067fc72de8fc241fc372707bdd197174bca542d0325a58/Aplos-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a19489de13e21c2c254c8f99ec4b853a", "sha256": "4c299690442172b23f5a9b61f89650fd30d2b1fbdcb5626ee6934e0164fb9fd0" }, "downloads": -1, "filename": "Aplos-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a19489de13e21c2c254c8f99ec4b853a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14665, "upload_time": "2018-08-11T09:38:45", "url": "https://files.pythonhosted.org/packages/7d/9b/5adf637319f0ede086b6781fcacc73e01d321b3ddfaa33b759109df97e3e/Aplos-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "176bea0da11b9a8e03cc77349b5c09dd", "sha256": "ee8d4175a9a1ca87e56118d3370f5f44ea10fce79c21274d38b1b369a7bd1bb5" }, "downloads": -1, "filename": "Aplos-1.1.tar.gz", "has_sig": false, "md5_digest": "176bea0da11b9a8e03cc77349b5c09dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11910, "upload_time": "2018-08-11T09:38:47", "url": "https://files.pythonhosted.org/packages/b1/46/94b3f4f437a2c6067fc72de8fc241fc372707bdd197174bca542d0325a58/Aplos-1.1.tar.gz" } ] }