Commit 046dc357 authored by Guillaume Sagnol's avatar Guillaume Sagnol

version 1.1.2. released, 1.1.3.dev ready

parent 299d9c89
......@@ -101,4 +101,16 @@ v 1.1.1, 29.08.15:
* Partial trace of an Affine Expression, cf. :func:`partial_trace() <picos.tools.partial_trace>`
* Bugfix for compatibility with python3 (thanks to `Sergio Callegari <http://www.unibo.it/faculty/sergio.callegari>`_)
* Initial support for the SDPA solver (with the option ``solver='sdpa'``, picos works as a wrapper around the SDPA executable based on the :func:`write_to_file() <picos.Problem.write_to_file()>` function; thanks to `Petter Wittek <http://peterwittek.com/>`_ )
* Better PEP8-compliance
\ No newline at end of file
* Better PEP8-compliance
v 1.1.2, 04.07.16:
Major release with following changes:
* Improved efficiency for the processing of large expressions.
* It is now possible to dynamically add and remove constraints, e.g. for column generation approaches, cf. :ref:`this paragraph <delcons>` for an example.
For an easier use, the function :func:`add_constraint() <picos.Problem.add_constraint()>` now returns a handle to the constraint when the option :func:`return_constraints=True <picos.Problem.set_all_options_to_default()>`
has been passed to the problem. Then, constraints can be deleted by using :func:`constraint.delete() <picos.Constraint.delete()>`.
* In previous versions, PICOS detected constraints that could be interpreted as a bound on a variable. This was creating a mess to delete constraints,
so the default behaviour is now to pass all constraints as such. To stick to the old behaviour, use the option :func:`pass_simple_cons_as_bound=True <picos.Problem.set_all_options_to_default()>`.
* New signature for the function :func:`partial_transpose() <picos.tools.partial_transpose()>`, which can now transpose arbitrary subsystems from a kronecker product.
* Corrections of minor bugs with complex expressions.
* Better support for the SDPA solver.
\ No newline at end of file
......@@ -8,6 +8,18 @@
Change History
==============
* 4 Jul. 16: **Picos** :ref:`1.1.2 <download>` **Released**
Major release with following changes:
* Improved efficiency for the processing of large expressions.
* It is now possible to dynamically add and remove constraints, e.g. for column generation approaches, cf. :ref:`this paragraph <delcons>` for an example.
For an easier use, the function :func:`add_constraint() <picos.Problem.add_constraint()>` now returns a handle to the constraint when the option :func:`return_constraints=True <picos.Problem.set_all_options_to_default()>`
has been passed to the problem. Then, constraints can be deleted by using :func:`constraint.delete() <picos.Constraint.delete()>`.
* In previous versions, PICOS detected constraints that could be interpreted as a bound on a variable. This was creating a mess to delete constraints,
so the default behaviour is now to pass all constraints as such. To stick to the old behaviour, use the option :func:`pass_simple_cons_as_bound=True <picos.Problem.set_all_options_to_default()>`.
* New signature for the function :func:`partial_transpose() <picos.tools.partial_transpose()>`, which can now transpose arbitrary subsystems from a kronecker product.
* Corrections of minor bugs with complex expressions.
* Better support for the SDPA solver.
* 29 Aug. 15: **Picos** :ref:`1.1.1 <download>` **Released**
Minor release with following changes:
* Partial trace of an Affine Expression, cf. :func:`partial_trace() <picos.tools.partial_trace>`
......
......@@ -72,7 +72,7 @@ copyright = u'2012, Guillaume Sagnol'
# The short X.Y version.
version = '1.1'
# The full version, including alpha/beta/rc tags.
release = '1.1.2.dev'
release = '1.1.3.dev'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -6,7 +6,7 @@ Download
The latest version of PICOS can be downloaded here:
`picos-1.1.1 <dist/PICOS-1.1.1.tar.gz>`_
`picos-1.1.2 <dist/PICOS-1.1.2.tar.gz>`_
Installation instructions are explained
:ref:`here <requirements>`.
......@@ -15,6 +15,8 @@ Installation instructions are explained
**Older versions**
`picos-1.1.1 <dist/PICOS-1.1.1.tar.gz>`_
`picos-1.1.0 <dist/PICOS-1.1.0.tar.gz>`_
`picos-1.0.2 <dist/PICOS-1.0.2.tar.gz>`_
......
......@@ -32,6 +32,18 @@ on every function of PICOS.
**News**
* 4 Jul. 16: **Picos** :ref:`1.1.2 <download>` **Released**
Major release with following changes:
* Improved efficiency for the processing of large expressions.
* It is now possible to dynamically add and remove constraints, e.g. for column generation approaches, cf. :ref:`this paragraph <delcons>` for an example.
For an easier use, the function :func:`add_constraint() <picos.Problem.add_constraint()>` now returns a handle to the constraint when the option :func:`return_constraints=True <picos.Problem.set_all_options_to_default()>`
has been passed to the problem. Then, constraints can be deleted by using :func:`constraint.delete() <picos.Constraint.delete()>`.
* In previous versions, PICOS detected constraints that could be interpreted as a bound on a variable. This was creating a mess to delete constraints,
so the default behaviour is now to pass all constraints as such. To stick to the old behaviour, use the option :func:`pass_simple_cons_as_bound=True <picos.Problem.set_all_options_to_default()>`.
* New signature for the function :func:`partial_transpose() <picos.tools.partial_transpose()>`, which can now transpose arbitrary subsystems from a kronecker product.
* Corrections of minor bugs with complex expressions.
* Better support for the SDPA solver.
* 29 Aug. 15: **Picos** :ref:`1.1.1 <download>` **Released**
Minor release with following changes:
* Partial trace of an Affine Expression, cf. :func:`partial_trace() <picos.tools.partial_trace>`
......@@ -44,22 +56,6 @@ on every function of PICOS.
* PICOS is now available on `github <http://github.com/gsagnol/picos>`_.
* 30 Jan. 15: **Picos** :ref:`1.0.2 <download>` **Released**
Major release with following new functionalities:
* Support (read and write) for ``.cbf`` problem files (`conic benchmark format <http://cblib.zib.de/>`_ ), which should be the standard for (mixed integer) conic optimization problems, cf. :func:`write_to_file <picos.Problem.write_to_file>` and :func:`import_cbf <picos.tools.import_cbf>` .
* Improved support for complex SDP (more efficient implementation of :func:`to_real() <picos.Problem.to_real>` , corrected bug in the implementation of the scalar product for Hermitian matrices and the conjugate of a complex expression, support for equality constraints involving complex coefficients)
* Support for inequalities involving the sum of k largest elements of an affine expression, or the k largest eigenvalues of a symmetric matrix expression, cf. the functions :func:`sum_k_largest() <picos.tools.sum_k_largest>` , :func:`sum_k_smallest() <picos.tools.sum_k_smallest>` , :func:`sum_k_largest_lambda() <picos.tools.sum_k_largest_lambda>`, :func:`sum_k_smallest_lambda() <picos.tools.sum_k_smallest_lambda>`, :func:`lambda_max() <picos.tools.lambda_max>` and :func:`lambda_min() <picos.tools.lambda_min>` .
* Support for inequalities involving the :math:`L_{p,q}-` norm of an affine expresison, cf. :func:`norm() <picos.tools.norm>` .
* New ``vtype`` for antisymmetric matrix variables ( :attr:`vtype <picos.Variable.vtype>` ``= antisym``).
* Constraints can be specified as membership in a :class:`Set <picos.Set>` . Sets can be created by the functions :func:`ball() <picos.tools.ball>` , :func:`simplex() <picos.tools.simplex>`, and :func:`truncated_simplex() <picos.tools.truncated_simplex>` .
* New functions :func:`maximize <picos.Problem.maximize>` and :func:`maximize <picos.Problem.minimize>` to specify the objective function of a problem and solve it.
And many thanks to `Petter Wittek <http://peterwittek.com/>`_ for the following improvements, who were motivated by the use of PICOS in the package `ncpol2sdpa <http://peterwittek.github.io/ncpol2sdpa/>`_ for optimization over noncommutative polynomials:
* More efficient implementation of the writer to the sparse - SDPA file format (:func:`write_to_file <picos.Problem.write_to_file>`)
* Hadamard (elementwise) product of affine expression is implemented, as an overload of the ``^`` operator, cf. an example :ref:`here <overloads>` .
* Partial transposition of an Affine Expression, cf. :func:`partial_transpose() <picos.tools.partial_transpose>` or the :attr:`Tx <picos.AffinExp.Tx>` attribute.
* Former changes are listed :ref:`here <changes>`.
.. _contents:
......
......@@ -136,9 +136,9 @@
|:func:`simplex(a) <picos.tools.simplex>` | a standard simplex |
| | :math:`\{x\geq 0: \Vert x \Vert_1 \leq a \}` |
+-------------------------------------------------------------+------------------------------------------------------------------+
|:func:`truncated_simplex(a) <picos.tools.truncated_simplex>` | a set of the form |
| |:math:`\{ 0\leq x\leq 1: \Vert x \Vert_1 \leq a\}` or |
| |:math:`\{x: \Vert x \Vert_\infty \leq 1 \Vert x \Vert_1 \leq a\}` |
|:func:`truncated_simplex(a) <picos.tools.truncated_simplex>` | a set of the form |
| |:math:`\{ 0\leq x\leq 1: \Vert x \Vert_1 \leq a\}`, or |
| |:math:`\{x: \Vert x \Vert_\infty \leq 1; \Vert x \Vert_1 \leq a\}`|
+-------------------------------------------------------------+------------------------------------------------------------------+
......@@ -149,16 +149,16 @@
To transform a problem
----------------------
+-----------------------------------------------------------------+-------------------------------------------+
| **function** | **short doc** |
+=================================================================+===========================================+
|:func:`convert_quad_to_socp() <picos.tools.convert_quad_to_socp>`| replaces quadratic constraints by |
| | equivalent second order cone constraints |
+-----------------------------------------------------------------+-------------------------------------------+
|:func:`to_real() <picos.tools.to_real>` | transform complex SDP to real SDP |
+-----------------------------------------------------------------+-------------------------------------------+
|:func:`dualize() <picos.tools.dualize>` | returns Lagrangian dual of a problem |
+-----------------------------------------------------------------+-------------------------------------------+
+-----------------------------------------------------------------+------------------------------------------------------+
| **function** | **short doc** |
+=================================================================+======================================================+
|:func:`convert_quad_to_socp() <picos.tools.convert_quad_to_socp>`| replaces quadratic constraints by |
| | equivalent second order cone constraints |
+-----------------------------------------------------------------+------------------------------------------------------+
|:func:`to_real() <picos.tools.to_real>` | transform complex SDP to equivalent real-valued SDP |
+-----------------------------------------------------------------+------------------------------------------------------+
|:func:`dualize() <picos.tools.dualize>` | returns Lagrangian dual of a problem |
+-----------------------------------------------------------------+------------------------------------------------------+
Get information on a problem
----------------------------
......@@ -170,7 +170,7 @@ Get information on a problem
+-----------------------------------------------------------------------------------------+-------------------------------------------+
|:func:`get_valued_variable(name) <picos.Problem.get_valued_variable>` | gets the value of the variable ``name`` |
+-----------------------------------------------------------------------------------------+-------------------------------------------+
|:func:`check_current_value_feasibility() <picos.Problem.check_current_value_feasibility>`| are the current variable value feasible? |
|:func:`check_current_value_feasibility() <picos.Problem.check_current_value_feasibility>`| are the current variable value feasible? |
+-----------------------------------------------------------------------------------------+-------------------------------------------+
|:func:`obj_value() <picos.Problem.obj_value>` | objective for the current variable values |
+-----------------------------------------------------------------------------------------+-------------------------------------------+
......
......@@ -492,31 +492,37 @@ then re-add the modified constraint.
To delete a constraint, you must have a handle to this constraint. To this end,
you can pass the option ``return constraints`` when you create the instance of the problem.
The next example shows an example in which the constraint ``2*x1<=1`` is replaced by ``2*x1+x2 <= 1``
The next code shows an example in which a variable ``x2`` is added to the model,
which appears as ``+3*x2`` in the objective function and as ``+x2`` in the LHS of a constraint.
>>> prb = pic.Problem(return_constraints=True)
>>> x1 = prb.add_variable('x1',1)
>>> lhs = 2*x1
>>> obj = 5*x1
>>> cons = prb.add_constraint(lhs <= 1)
>>> # now we add the variable y, and add it to the lhs of the constraint
>>> sol = prb.maximize(obj,verbose=0)
>>> #--------------------------------------
>>> #at this place, the user can use his favorite method to solve the 'pricing problem'.
>>> #Let us assume that this phase suggests to add a new variable 'x2' in the model,
>>> #which appears as `+3*x2` in the objective function, and as `+x2` in the LHS of the constraint.
>>> x2 = prb.add_variable('x2',1)
>>> lhs += x2
>>> obj += 3*x2
>>> cons.delete()
>>> newcons = prb.add_constraint(lhs <= 1)
>>> print prb #doctest: +NORMALIZE_WHITESPACE Todo here and explain better cutting plane
---------------------
optimization problem (LP):
2 variables, 1 affine constraints
<BLANKLINE>
x2 : (1, 1), continuous
x1 : (1, 1), continuous
<BLANKLINE>
find vars
such that
2.0*x1 + x2 < 1.0
---------------------
>>> print prb #doctest: +NORMALIZE_WHITESPACE
---------------------
optimization problem (LP):
2 variables, 1 affine constraints
<BLANKLINE>
x2 : (1, 1), continuous
x1 : (1, 1), continuous
<BLANKLINE>
maximize 5.0*x1 + 3.0*x2
such that
2.0*x1 + x2 < 1.0
---------------------
.. _flowcons:
Flow constraints in Graphs
......
# coding: utf-8
#-------------------------------------------------------------------
#Picos 1.1.2.dev : A pyton Interface To Conic Optimization Solvers
#Picos 1.1.3.dev : A pyton Interface To Conic Optimization Solvers
#Copyright (C) 2012 Guillaume Sagnol
#
#This program is free software: you can redistribute it and/or modify
......@@ -32,5 +32,5 @@ from .tools import sum,lse,new_param,diag,diag_vect,geomean,norm,tracepow,trace,
__all__=['tools','constraint','expression','problem']
__version_info__ = ('1', '1', '2','dev')
__version_info__ = ('1', '1', '3','dev')
__version__ = '.'.join(__version_info__)
# coding: utf-8
#-------------------------------------------------------------------
# Picos 1.1.2.dev : A pyton Interface To Conic Optimization Solvers
# Picos 1.1.3.dev : A pyton Interface To Conic Optimization Solvers
# Copyright (C) 2012 Guillaume Sagnol
#
# This program is free software: you can redistribute it and/or modify
......
# coding: utf-8
#-------------------------------------------------------------------
# Picos 1.1.2.dev : A pyton Interface To Conic Optimization Solvers
# Picos 1.1.3.dev : A pyton Interface To Conic Optimization Solvers
# Copyright (C) 2012 Guillaume Sagnol
#
# This program is free software: you can redistribute it and/or modify
......
# coding: utf-8
#-------------------------------------------------------------------
# Picos 1.1.2.dev : A pyton Interface To Conic Optimization Solvers
# Picos 1.1.3.dev : A pyton Interface To Conic Optimization Solvers
# Copyright (C) 2012 Guillaume Sagnol
#
# This program is free software: you can redistribute it and/or modify
......@@ -541,7 +541,8 @@ class Problem(object):
def set_all_options_to_default(self):
"""set all the options to their default.
The following options are available, and can be passed
as pairs of the form ``key=value`` to :func:`solve() <picos.Problem.solve>` :
as pairs of the form ``key=value`` when the :class:`Problem <picos.Problem>` object is created,
or to the function :func:`solve() <picos.Problem.solve>` :
* General options common to all solvers:
......@@ -3817,8 +3818,10 @@ class Problem(object):
if not active_cons:
active_cons = []
iaff = 0
idx_aff = 0
else:
iaff = active_cons[-1] + 1
iaff = len(active_cons)
idx_aff = active_cons[-1] + 1
tridex = {}
......@@ -3953,7 +3956,10 @@ class Problem(object):
else:
b = rhstmp[i]
if version7:
task.putarow(iaff, J, V)
try:
task.putarow(iaff, J, V)
except:
import pdb;pdb.set_trace()
else:
task.putaijlist([iaff] * len(J), J, V)
if self.options['handleBarVars']:
......@@ -3978,10 +3984,11 @@ class Problem(object):
if cons.Id is None:
cons.Id = {}
cons.Id.setdefault('mosek',[])
cons.Id['mosek'].append(iaff)
active_cons.append(iaff)
cons.Id['mosek'].append(idx_aff)
active_cons.append(idx_aff)
iaff += 1
idx_aff += 1
# conic constraints:
elif cons.typeOfConstraint.endswith('cone'):
......@@ -4073,10 +4080,11 @@ class Problem(object):
if cons.Id is None:
cons.Id = {}
cons.Id.setdefault('mosek',[])
cons.Id['mosek'].append(iaff)
active_cons.append(iaff)
cons.Id['mosek'].append(idx_aff)
active_cons.append(idx_aff)
iaff += 1
idx_aff += 1
icone += 1
iend = icone
# sk in quadratic cone
......@@ -4193,10 +4201,11 @@ class Problem(object):
if cons.Id is None:
cons.Id = {}
cons.Id.setdefault('mosek',[])
cons.Id['mosek'].append(iaff)
active_cons.append(iaff)
cons.Id['mosek'].append(idx_aff)
active_cons.append(idx_aff)
iaff += 1
idx_aff += 1
isdp += 1
# quadratic constraints:
elif cons.typeOfConstraint == 'quad':
......@@ -4273,10 +4282,11 @@ class Problem(object):
if cons.Id is None:
cons.Id = {}
cons.Id.setdefault('mosek',[])
cons.Id['mosek'].append(iaff)
active_cons.append(iaff)
cons.Id['mosek'].append(idx_aff)
active_cons.append(idx_aff)
iaff += 1
idx_aff += 1
else:
raise Exception(
......
......@@ -1089,7 +1089,7 @@ conic_classes = ['LP1','LP2','SOCP1','SOCP2','SOCP3','SOCP4','SDP','coneP']
results={}
for solver in avs:
if solver == 'smcp':continue#TODO TMP
#if solver == 'smcp':continue#TODO TMP
results[solver]={}
for pclas in prob_classes:
results[solver][pclas]=eval(pclas.upper()+'Test')(solver)
......
# coding: utf-8
#-------------------------------------------------------------------
# Picos 1.1.2.dev : A pyton Interface To Conic Optimization Solvers
# Picos 1.1.3.dev : A pyton Interface To Conic Optimization Solvers
# Copyright (C) 2012 Guillaume Sagnol
#
# This program is free software: you can redistribute it and/or modify
......@@ -533,11 +533,11 @@ def partial_transpose(exp, dims_1=None, subsystems = None, dims_2=None):
for some matrices :math:`A_0,\ldots,A_{n-1}`
of respective sizes ``dims_1[0] x dims_2[0]``, ... , ``dims_1[n-1] x dims_2[n-1]``,
this function returns the matrix
:math:`Y = B_0 \otimes B_{n-1}`,
:math:`Y = B_0 \otimes \cdots \otimes B_{n-1}`,
where :math:`B_i=A_i^T` if ``i in subsystems``, and :math:`B_i=A_i` otherwise.
The optional parameters ``dims_1`` and ``dims_2`` are tuples specifying the dimension
of each subsystem :math:`A_i`. Subsystems must be a ``tuple`` (or an ``int``) with the
of each subsystem :math:`A_i`. The argument ``subsystems`` must be a ``tuple`` (or an ``int``) with the
index of all subsystems to be transposed.
The default value ``dims_1=None`` automatically computes the size of the subblocks,
......
......@@ -2,7 +2,7 @@ from distutils.core import setup
setup(
name='PICOS',
version='1.1.2.dev',
version='1.1.3.dev',
author='G. Sagnol',
author_email='sagnol@zib.de',
packages=['picos'],
......@@ -27,5 +27,5 @@ setup(
'Programming Language :: Python'
],
url='http://picos.zib.de',
download_url='http://picos.zib.de/dist/PICOS-1.1.1dev.tar.gz'
download_url='http://picos.zib.de/dist/PICOS-1.1.3.dev.tar.gz'
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment