{ "info": { "author": "David Baird", "author_email": "dhbaird@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "Intended Audience :: Financial and Insurance Industry", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "CVExp is short for \"controlled vocabulary expressions.\" CVExp is a\nPython module that allows abstract syntax trees (\"expressions\") to be\nconstructed just as easily as writing normal Python code. The names\nof functions in the abstract syntax trees are based on a controlled\nvocabulary, using URIs as names just like the W3C RDF does.\n\nThe intent of CVExp is that it should make it easier for developers\nto integrate 3rd party libraries into Python without having to specify\nentirely new APIs. Libraries and languages of particular concern are\ncomputer algebra systems, linear programming and optimization (such as\nlp_solve, GLPK, and CVXOPT), and Prolog.\n\nHere is an example usage to solve a mixed-integer linear programming\nproblem using GLPK as the backend. In order for this to work, you\nobviously must install prerequisite Python packages (i.e. python-glpk or\nwhatever) because these are not included with CVExp::\n\n from cvexp.builders import var\n from cvexp.builders import integer\n from cvexp.builders import minimize\n from cvexp.translate_glpk import solve\n\n # You could also use lp_solve by doing this:\n # from cvexp.translate_lpsolve55 import solve\n # ...or you could use CVXOPT like this:\n # from cvexp.translate_cvxopt import solve\n\n X = var('X') # the 'X' name is optional\n Y = var('Y') # ...and so is 'Y'\n\n # Purely linear programming:\n sol = solve((\n Y + 0.1 == X,\n Y >= 9.8 - X,\n minimize(Y),\n ), out_filename='problem.out') # out_filename is optional\n print 'X =', sol[X] # >>> 4.95\n print 'Y =', sol[Y] # >>> 4.85\n\n # Mixed integer-linear programming:\n sol = solve((\n Y + 0.1 == X,\n Y >= 9.8 - X,\n integer(Y),\n minimize(Y),\n ), out_filename='problem.out') # out_filename is optional\n print 'X =', sol[X] # >>> 5.1\n print 'Y =', sol[Y] # >>> 5\n\nIf using CVXOPT, quadratic programming problems can also be solved.\nFor example::\n\n from cvexp.builders import var\n from cvexp.builders import integer\n from cvexp.builders import minimize\n from cvexp.translate_cvxopt import solve\n\n X = var()\n Y = var()\n\n sol = solve((\n minimize((X - 5) ** 2 + (Y - 3) ** 2),\n ))\n print 'X =', sol[X] # >>> 5.0\n print 'Y =', sol[Y] # >>> 3.0", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.aclevername.com/projects/cvexp", "keywords": "controlled vocabulary linear programming optimization", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "cvexp", "package_url": "https://pypi.org/project/cvexp/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cvexp/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.aclevername.com/projects/cvexp" }, "release_url": "https://pypi.org/project/cvexp/0.1/", "requires_dist": null, "requires_python": null, "summary": "Expression Tree Builder and Translator based on a Controlled Vocabulary", "version": "0.1" }, "last_serial": 89925, "releases": { "0.1": [] }, "urls": [] }