Changeset 257


Ignore:
Timestamp:
Apr 26, 2017 2:43:41 AM (2 years ago)
Author:
ferreau
Message:

fixing issue in Python interface, exceptionally also fast-forward to point release 3.2.1

Files:
18 edited

Legend:

Unmodified
Added
Removed
  • releases/3.2.1/VERSIONS

    r245 r257  
    2727
    2828
    29 3.2 (released on 1st September 2015, last updated on 3rd April 2017):
    30 ---------------------------------------------------------------------
     293.2 (released on 1st September 2015, last updated on 26th April 2017):
     30----------------------------------------------------------------------
    3131
    3232+ Addition of SQProblemSchur class implementing Schur complement approach
  • releases/3.2.1/VERSIONS.txt

    r245 r257  
    2727
    2828
    29 3.2 (released on 1st September 2015, last updated on 3rd April 2017):
    30 ---------------------------------------------------------------------
     293.2 (released on 1st September 2015, last updated on 26th April 2017):
     30----------------------------------------------------------------------
    3131
    3232+ Addition of SQProblemSchur class implementing Schur complement approach
  • releases/3.2.1/doc/mainpage.dox

    r245 r257  
    117117 *      <li>Reference to the <b>webpage</b>:
    118118 *      \code
    119  *       @MISC{qpOASES2014,
     119 *       @MISC{qpOASES2017,
    120120 *        author = {H.J. Ferreau and A. Potschka and C. Kirches},
    121121 *        title = {{qpOASES} webpage},
  • releases/3.2.1/interfaces/python/qpoases.pxd

    r245 r257  
    2323##
    2424##    Filename:  qpoases.pxd
    25 ##    Author:    Sebastian F. Walter, Manuel Kudruss
     25##    Author:    Sebastian F. Walter, Manuel Kudruss (thanks to Felix Lenders)
    2626##    Version:   3.2
    2727##    Date:      2013-2017
     
    3131
    3232    ctypedef double real_t
    33     ctypedef int int_t
     33    ctypedef long int_t
    3434
    3535    cdef enum BooleanType:
     
    301301    cdef cppclass QProblemB:
    302302        QProblemB()
    303         QProblemB(int_t, HessianType)
     303        QProblemB(int_t, HessianType, BooleanType)
    304304
    305305        QProblemB(const QProblemB&)
     
    340340    cdef cppclass QProblem:
    341341        QProblem()
    342         QProblem(int_t, int_t, HessianType)
     342        QProblem(int_t, int_t, HessianType, BooleanType)
    343343
    344344        QProblem(const QProblem&)
     
    389389    cdef cppclass SQProblem:
    390390        SQProblem()
    391         SQProblem(int_t, int_t, HessianType)
     391        SQProblem(int_t, int_t, HessianType, BooleanType)
    392392
    393393        SQProblem(const QProblem&)
     
    477477                                BooleanType useHotstarts,   # Shall QP solution be hotstarted?
    478478                                const Options& options,     # QP solver options to be used while solving benchmark problems.
    479                                 int maxAllowedNWSR,         # Maximum number of working set recalculations to be performed.
     479                                int_t maxAllowedNWSR,       # Maximum number of working set recalculations to be performed.
    480480                                real_t& maxNWSR,            # Output: Maximum number of performed working set recalculations.
    481481                                real_t& avgNWSR,            # Output: Average number of performed working set recalculations.
  • releases/3.2.1/interfaces/python/qpoases.pyx

    r245 r257  
    2121##
    2222
    23 ## author of this file: Sebastian F. Walter
     23## authors of this file: Sebastian F. Walter (thanks to Felix Lenders)
    2424
    2525"""
    2626Python interface to qpOASES
    2727using Cython
    28 :author: Sebastian F. Walter, Manuel Kudruss
     28:author: Sebastian F. Walter, Manuel Kudruss (thanks to Felix Lenders)
    2929"""
    3030
     
    386386cdef class PyQProblemB:
    387387    cdef QProblemB *thisptr      # hold a C++ instance which we're wrapping
    388     def __cinit__(self, int nV):
     388    def __cinit__(self, long nV):
    389389        # FIXME: allow other HessianTypes!
    390         self.thisptr = new QProblemB(nV, HST_UNKNOWN)
     390        self.thisptr = new QProblemB(nV, HST_UNKNOWN, BT_TRUE)
    391391    def __dealloc__(self):
    392392        del self.thisptr
     
    405405
    406406        # enable nWSR as return value in argument list
    407         if isinstance(nWSR, int):
     407        if isinstance(nWSR, long) or isinstance(nWSR, int):
    408408            deprecation_warning_nWSR()
    409             nWSR_tmp = np.array([nWSR], dtype=int)
     409            nWSR_tmp = np.array([nWSR], dtype=long)
    410410        else:
    411411            nWSR_tmp = nWSR
     
    424424                    <double*> lb.data,
    425425                    <double*> ub.data,
    426                     <int&>    nWSR_tmp.data[0],
     426                    <int_t&>  nWSR_tmp.data[0],
    427427                    <double*> &cput_tmp.data[0]
    428428                    )
     
    433433                    <double*> lb.data,
    434434                    <double*> ub.data,
    435                     <int&> nWSR_tmp.data[0]
     435                    <int_t&> nWSR_tmp.data[0]
    436436                    )
    437437
     
    448448
    449449        # enable nWSR as return value in argument list
    450         if isinstance(nWSR, int):
     450        if isinstance(nWSR, long) or isinstance(nWSR, int):
    451451            deprecation_warning_nWSR()
    452             nWSR_tmp = np.array([nWSR], dtype=int)
     452            nWSR_tmp = np.array([nWSR], dtype=long)
    453453        else:
    454454            nWSR_tmp = nWSR#np.asarray(nWSR, dtype=int)
     
    466466                    <double*> lb.data,
    467467                    <double*> ub.data,
    468                     <int&>    nWSR_tmp.data[0],
     468                    <int_t&>  nWSR_tmp.data[0],
    469469                    <double*> &cput_tmp.data[0]
    470470                )
     
    474474                    <double*> lb.data,
    475475                    <double*> ub.data,
    476                     <int&>    nWSR_tmp.data[0]
     476                    <int_t&>  nWSR_tmp.data[0]
    477477            )
    478478
     
    502502cdef class PyQProblem:
    503503    cdef QProblem *thisptr      # hold a C++ instance which we're wrapping
    504     def __cinit__(self, int nV, int nC):
    505         self.thisptr = new QProblem(nV, nC, HST_UNKNOWN)
     504    def __cinit__(self, long nV, long nC):
     505        self.thisptr = new QProblem(nV, nC, HST_UNKNOWN, BT_TRUE)
    506506    def __dealloc__(self):
    507507        del self.thisptr
     
    523523
    524524        # enable nWSR as return value in argument list
    525         if isinstance(nWSR, int):
     525        if isinstance(nWSR, long) or isinstance(nWSR, int):
    526526            deprecation_warning_nWSR()
    527             nWSR_tmp = np.array([nWSR], dtype=int)
     527            nWSR_tmp = np.array([nWSR], dtype=long)
    528528        else:
    529529            nWSR_tmp = nWSR
     
    545545                    <double*> lbA.data,
    546546                    <double*> ubA.data,
    547                     <int&>    nWSR_tmp.data[0],
     547                    <int_t&>  nWSR_tmp.data[0],
    548548                    <double*> &cput_tmp.data[0]
    549549                )
     
    557557                    <double*> lbA.data,
    558558                    <double*> ubA.data,
    559                     <int&>    nWSR_tmp.data[0]
     559                    <int_t&>  nWSR_tmp.data[0]
    560560                )
    561561
     
    575575
    576576        # enable nWSR as return value in argument list
    577         if isinstance(nWSR, int):
     577        if isinstance(nWSR, long) or isinstance(nWSR, int):
    578578            deprecation_warning_nWSR()
    579             nWSR_tmp = np.array([nWSR], dtype=int)
     579            nWSR_tmp = np.array([nWSR], dtype=long)
    580580        else:
    581581            nWSR_tmp = nWSR
     
    595595                    <double*> lbA.data,
    596596                    <double*> ubA.data,
    597                     <int&>    nWSR_tmp.data[0],
     597                    <int_t&>  nWSR_tmp.data[0],
    598598                    <double*> &cput_tmp.data[0]
    599599                )
     
    605605                    <double*> lbA.data,
    606606                    <double*> ubA.data,
    607                     <int&>    nWSR_tmp.data[0]
     607                    <int_t&>  nWSR_tmp.data[0]
    608608                )
    609609
     
    625625cdef class PySQProblem:
    626626    cdef SQProblem *thisptr      # hold a C++ instance which we're wrapping
    627     def __cinit__(self, int nV, int nC):
    628         self.thisptr = new SQProblem(nV, nC, HST_UNKNOWN)
     627    def __cinit__(self, long nV, long nC):
     628        self.thisptr = new SQProblem(nV, nC, HST_UNKNOWN, BT_TRUE)
    629629    def __dealloc__(self):
    630630        del self.thisptr
     
    646646
    647647        # enable nWSR as return value in argument list
    648         if isinstance(nWSR, int):
     648        if isinstance(nWSR, long) or isinstance(nWSR, int):
    649649            deprecation_warning_nWSR()
    650             nWSR_tmp = np.array([nWSR], dtype=int)
     650            nWSR_tmp = np.array([nWSR], dtype=long)
    651651        else:
    652             nWSR_tmp = np.asarray(nWSR, dtype=int)
     652            nWSR_tmp = np.asarray(nWSR, dtype=long)
    653653
    654654        if cputime > 1.e-16:
     
    668668                        <double*> lbA.data,
    669669                        <double*> ubA.data,
    670                         <int&>    nWSR_tmp.data[0],
     670                        <int_t&>  nWSR_tmp.data[0],
    671671                        <double*> &cput_tmp.data[0]
    672672                )
     
    680680                    <double*> lbA.data,
    681681                    <double*> ubA.data,
    682                     <int&>    nWSR_tmp.data[0],
     682                    <int_t&>  nWSR_tmp.data[0],
    683683        )
    684684
     
    699699
    700700        # enable nWSR as return value in argument list
    701         if isinstance(nWSR, int):
     701        if isinstance(nWSR, long) or isinstance(nWSR, int):
    702702            deprecation_warning_nWSR()
    703             nWSR_tmp = np.array([nWSR], dtype=int)
     703            nWSR_tmp = np.array([nWSR], dtype=long)
    704704        else:
    705705            nWSR_tmp = nWSR
     
    721721                    <double*> lbA.data,
    722722                    <double*> ubA.data,
    723                     <int&>    nWSR_tmp.data[0],
     723                    <int_t&>  nWSR_tmp.data[0],
    724724                    <double*> &cput_tmp.data[0]
    725725            )
     
    733733                    <double*> lbA.data,
    734734                    <double*> ubA.data,
    735                     <int&>    nWSR_tmp.data[0],
     735                    <int_t&>  nWSR_tmp.data[0],
    736736        )
    737737
     
    863863                         useHotstarts,       # Shall QP solution be hotstarted?
    864864                         PyOptions options,  # QP solver options to be used while solving benchmark problems.
    865                          int maxAllowedNWSR, # Maximum number of working set recalculations to be performed.
     865                         long maxAllowedNWSR, # Maximum number of working set recalculations to be performed.
    866866                         double maxCPUTime,  # Maximum allowed CPU time for qp solving.
    867867                         ):
     
    895895
    896896"""
    897 def py_getKktViolation(int nV,                              # Number of variables.
    898                        int nC,                              # Number of constraints.
     897def py_getKktViolation(long nV,                             # Number of variables.
     898                       long nC,                             # Number of constraints.
    899899                       np.ndarray[np.double_t, ndim=2] H,   # Hessian matrix.
    900900                       np.ndarray[np.double_t, ndim=1] g,   # Sequence of gradient vectors.
  • releases/3.2.1/interfaces/python/setup.py

    r245 r257  
    2626#
    2727#   Filename:  setup.py
    28 #   Author:    Sebastian F. Walter, Manuel Kudruss
     28#   Author:    Sebastian F. Walter, Manuel Kudruss (thanks to Felix Lenders)
    2929#   Version:   3.2
    3030#   Date:      2013-2017
     
    3333import os
    3434import numpy as np
     35import platform
    3536
    36 from distutils.core import setup
     37from=20distutils.core import setup
    3738from distutils.extension import Extension
    3839from Cython.Distutils import build_ext
     
    5859extra_params['language'] = 'c++'
    5960
     61if platform.system() in ['Linux', 'Darwin']:
     62    extra_params['extra_compile_args'] = ['-D__USE_LONG_INTEGERS__', '-D__USE_LONG_INTS__']
     63
    6064if os.name == 'posix':
    6165    extra_params['runtime_library_dirs'] = extra_params['library_dirs']
  • stable/3.2/VERSIONS

    r245 r257  
    2727
    2828
    29 3.2 (released on 1st September 2015, last updated on 3rd April 2017):
    30 ---------------------------------------------------------------------
     293.2 (released on 1st September 2015, last updated on 26th April 2017):
     30----------------------------------------------------------------------
    3131
    3232+ Addition of SQProblemSchur class implementing Schur complement approach
  • stable/3.2/VERSIONS.txt

    r245 r257  
    2727
    2828
    29 3.2 (released on 1st September 2015, last updated on 3rd April 2017):
    30 ---------------------------------------------------------------------
     293.2 (released on 1st September 2015, last updated on 26th April 2017):
     30----------------------------------------------------------------------
    3131
    3232+ Addition of SQProblemSchur class implementing Schur complement approach
  • stable/3.2/doc/mainpage.dox

    r245 r257  
    117117 *      <li>Reference to the <b>webpage</b>:
    118118 *      \code
    119  *       @MISC{qpOASES2014,
     119 *       @MISC{qpOASES2017,
    120120 *        author = {H.J. Ferreau and A. Potschka and C. Kirches},
    121121 *        title = {{qpOASES} webpage},
  • stable/3.2/interfaces/python/qpoases.pxd

    r245 r257  
    2323##
    2424##    Filename:  qpoases.pxd
    25 ##    Author:    Sebastian F. Walter, Manuel Kudruss
     25##    Author:    Sebastian F. Walter, Manuel Kudruss (thanks to Felix Lenders)
    2626##    Version:   3.2
    2727##    Date:      2013-2017
     
    3131
    3232    ctypedef double real_t
    33     ctypedef int int_t
     33    ctypedef long int_t
    3434
    3535    cdef enum BooleanType:
     
    301301    cdef cppclass QProblemB:
    302302        QProblemB()
    303         QProblemB(int_t, HessianType)
     303        QProblemB(int_t, HessianType, BooleanType)
    304304
    305305        QProblemB(const QProblemB&)
     
    340340    cdef cppclass QProblem:
    341341        QProblem()
    342         QProblem(int_t, int_t, HessianType)
     342        QProblem(int_t, int_t, HessianType, BooleanType)
    343343
    344344        QProblem(const QProblem&)
     
    389389    cdef cppclass SQProblem:
    390390        SQProblem()
    391         SQProblem(int_t, int_t, HessianType)
     391        SQProblem(int_t, int_t, HessianType, BooleanType)
    392392
    393393        SQProblem(const QProblem&)
     
    477477                                BooleanType useHotstarts,   # Shall QP solution be hotstarted?
    478478                                const Options& options,     # QP solver options to be used while solving benchmark problems.
    479                                 int maxAllowedNWSR,         # Maximum number of working set recalculations to be performed.
     479                                int_t maxAllowedNWSR,       # Maximum number of working set recalculations to be performed.
    480480                                real_t& maxNWSR,            # Output: Maximum number of performed working set recalculations.
    481481                                real_t& avgNWSR,            # Output: Average number of performed working set recalculations.
  • stable/3.2/interfaces/python/qpoases.pyx

    r245 r257  
    2121##
    2222
    23 ## author of this file: Sebastian F. Walter
     23## authors of this file: Sebastian F. Walter (thanks to Felix Lenders)
    2424
    2525"""
    2626Python interface to qpOASES
    2727using Cython
    28 :author: Sebastian F. Walter, Manuel Kudruss
     28:author: Sebastian F. Walter, Manuel Kudruss (thanks to Felix Lenders)
    2929"""
    3030
     
    386386cdef class PyQProblemB:
    387387    cdef QProblemB *thisptr      # hold a C++ instance which we're wrapping
    388     def __cinit__(self, int nV):
     388    def __cinit__(self, long nV):
    389389        # FIXME: allow other HessianTypes!
    390         self.thisptr = new QProblemB(nV, HST_UNKNOWN)
     390        self.thisptr = new QProblemB(nV, HST_UNKNOWN, BT_TRUE)
    391391    def __dealloc__(self):
    392392        del self.thisptr
     
    405405
    406406        # enable nWSR as return value in argument list
    407         if isinstance(nWSR, int):
     407        if isinstance(nWSR, long) or isinstance(nWSR, int):
    408408            deprecation_warning_nWSR()
    409             nWSR_tmp = np.array([nWSR], dtype=int)
     409            nWSR_tmp = np.array([nWSR], dtype=long)
    410410        else:
    411411            nWSR_tmp = nWSR
     
    424424                    <double*> lb.data,
    425425                    <double*> ub.data,
    426                     <int&>    nWSR_tmp.data[0],
     426                    <int_t&>  nWSR_tmp.data[0],
    427427                    <double*> &cput_tmp.data[0]
    428428                    )
     
    433433                    <double*> lb.data,
    434434                    <double*> ub.data,
    435                     <int&> nWSR_tmp.data[0]
     435                    <int_t&> nWSR_tmp.data[0]
    436436                    )
    437437
     
    448448
    449449        # enable nWSR as return value in argument list
    450         if isinstance(nWSR, int):
     450        if isinstance(nWSR, long) or isinstance(nWSR, int):
    451451            deprecation_warning_nWSR()
    452             nWSR_tmp = np.array([nWSR], dtype=int)
     452            nWSR_tmp = np.array([nWSR], dtype=long)
    453453        else:
    454454            nWSR_tmp = nWSR#np.asarray(nWSR, dtype=int)
     
    466466                    <double*> lb.data,
    467467                    <double*> ub.data,
    468                     <int&>    nWSR_tmp.data[0],
     468                    <int_t&>  nWSR_tmp.data[0],
    469469                    <double*> &cput_tmp.data[0]
    470470                )
     
    474474                    <double*> lb.data,
    475475                    <double*> ub.data,
    476                     <int&>    nWSR_tmp.data[0]
     476                    <int_t&>  nWSR_tmp.data[0]
    477477            )
    478478
     
    502502cdef class PyQProblem:
    503503    cdef QProblem *thisptr      # hold a C++ instance which we're wrapping
    504     def __cinit__(self, int nV, int nC):
    505         self.thisptr = new QProblem(nV, nC, HST_UNKNOWN)
     504    def __cinit__(self, long nV, long nC):
     505        self.thisptr = new QProblem(nV, nC, HST_UNKNOWN, BT_TRUE)
    506506    def __dealloc__(self):
    507507        del self.thisptr
     
    523523
    524524        # enable nWSR as return value in argument list
    525         if isinstance(nWSR, int):
     525        if isinstance(nWSR, long) or isinstance(nWSR, int):
    526526            deprecation_warning_nWSR()
    527             nWSR_tmp = np.array([nWSR], dtype=int)
     527            nWSR_tmp = np.array([nWSR], dtype=long)
    528528        else:
    529529            nWSR_tmp = nWSR
     
    545545                    <double*> lbA.data,
    546546                    <double*> ubA.data,
    547                     <int&>    nWSR_tmp.data[0],
     547                    <int_t&>  nWSR_tmp.data[0],
    548548                    <double*> &cput_tmp.data[0]
    549549                )
     
    557557                    <double*> lbA.data,
    558558                    <double*> ubA.data,
    559                     <int&>    nWSR_tmp.data[0]
     559                    <int_t&>  nWSR_tmp.data[0]
    560560                )
    561561
     
    575575
    576576        # enable nWSR as return value in argument list
    577         if isinstance(nWSR, int):
     577        if isinstance(nWSR, long) or isinstance(nWSR, int):
    578578            deprecation_warning_nWSR()
    579             nWSR_tmp = np.array([nWSR], dtype=int)
     579            nWSR_tmp = np.array([nWSR], dtype=long)
    580580        else:
    581581            nWSR_tmp = nWSR
     
    595595                    <double*> lbA.data,
    596596                    <double*> ubA.data,
    597                     <int&>    nWSR_tmp.data[0],
     597                    <int_t&>  nWSR_tmp.data[0],
    598598                    <double*> &cput_tmp.data[0]
    599599                )
     
    605605                    <double*> lbA.data,
    606606                    <double*> ubA.data,
    607                     <int&>    nWSR_tmp.data[0]
     607                    <int_t&>  nWSR_tmp.data[0]
    608608                )
    609609
     
    625625cdef class PySQProblem:
    626626    cdef SQProblem *thisptr      # hold a C++ instance which we're wrapping
    627     def __cinit__(self, int nV, int nC):
    628         self.thisptr = new SQProblem(nV, nC, HST_UNKNOWN)
     627    def __cinit__(self, long nV, long nC):
     628        self.thisptr = new SQProblem(nV, nC, HST_UNKNOWN, BT_TRUE)
    629629    def __dealloc__(self):
    630630        del self.thisptr
     
    646646
    647647        # enable nWSR as return value in argument list
    648         if isinstance(nWSR, int):
     648        if isinstance(nWSR, long) or isinstance(nWSR, int):
    649649            deprecation_warning_nWSR()
    650             nWSR_tmp = np.array([nWSR], dtype=int)
     650            nWSR_tmp = np.array([nWSR], dtype=long)
    651651        else:
    652             nWSR_tmp = np.asarray(nWSR, dtype=int)
     652            nWSR_tmp = np.asarray(nWSR, dtype=long)
    653653
    654654        if cputime > 1.e-16:
     
    668668                        <double*> lbA.data,
    669669                        <double*> ubA.data,
    670                         <int&>    nWSR_tmp.data[0],
     670                        <int_t&>  nWSR_tmp.data[0],
    671671                        <double*> &cput_tmp.data[0]
    672672                )
     
    680680                    <double*> lbA.data,
    681681                    <double*> ubA.data,
    682                     <int&>    nWSR_tmp.data[0],
     682                    <int_t&>  nWSR_tmp.data[0],
    683683        )
    684684
     
    699699
    700700        # enable nWSR as return value in argument list
    701         if isinstance(nWSR, int):
     701        if isinstance(nWSR, long) or isinstance(nWSR, int):
    702702            deprecation_warning_nWSR()
    703             nWSR_tmp = np.array([nWSR], dtype=int)
     703            nWSR_tmp = np.array([nWSR], dtype=long)
    704704        else:
    705705            nWSR_tmp = nWSR
     
    721721                    <double*> lbA.data,
    722722                    <double*> ubA.data,
    723                     <int&>    nWSR_tmp.data[0],
     723                    <int_t&>  nWSR_tmp.data[0],
    724724                    <double*> &cput_tmp.data[0]
    725725            )
     
    733733                    <double*> lbA.data,
    734734                    <double*> ubA.data,
    735                     <int&>    nWSR_tmp.data[0],
     735                    <int_t&>  nWSR_tmp.data[0],
    736736        )
    737737
     
    863863                         useHotstarts,       # Shall QP solution be hotstarted?
    864864                         PyOptions options,  # QP solver options to be used while solving benchmark problems.
    865                          int maxAllowedNWSR, # Maximum number of working set recalculations to be performed.
     865                         long maxAllowedNWSR, # Maximum number of working set recalculations to be performed.
    866866                         double maxCPUTime,  # Maximum allowed CPU time for qp solving.
    867867                         ):
     
    895895
    896896"""
    897 def py_getKktViolation(int nV,                              # Number of variables.
    898                        int nC,                              # Number of constraints.
     897def py_getKktViolation(long nV,                             # Number of variables.
     898                       long nC,                             # Number of constraints.
    899899                       np.ndarray[np.double_t, ndim=2] H,   # Hessian matrix.
    900900                       np.ndarray[np.double_t, ndim=1] g,   # Sequence of gradient vectors.
  • stable/3.2/interfaces/python/setup.py

    r245 r257  
    2626#
    2727#   Filename:  setup.py
    28 #   Author:    Sebastian F. Walter, Manuel Kudruss
     28#   Author:    Sebastian F. Walter, Manuel Kudruss (thanks to Felix Lenders)
    2929#   Version:   3.2
    3030#   Date:      2013-2017
     
    3333import os
    3434import numpy as np
     35import platform
    3536
    36 from distutils.core import setup
     37from=20distutils.core import setup
    3738from distutils.extension import Extension
    3839from Cython.Distutils import build_ext
     
    5859extra_params['language'] = 'c++'
    5960
     61if platform.system() in ['Linux', 'Darwin']:
     62    extra_params['extra_compile_args'] = ['-D__USE_LONG_INTEGERS__', '-D__USE_LONG_INTS__']
     63
    6064if os.name == 'posix':
    6165    extra_params['runtime_library_dirs'] = extra_params['library_dirs']
  • trunk/VERSIONS

    r241 r257  
    2727
    2828
    29 3.2 (released on 1st September 2015, last updated on 3rd April 2017):
    30 ---------------------------------------------------------------------
     293.2 (released on 1st September 2015, last updated on 26th April 2017):
     30----------------------------------------------------------------------
    3131
    3232+ Addition of SQProblemSchur class implementing Schur complement approach
  • trunk/VERSIONS.txt

    r241 r257  
    2727
    2828
    29 3.2 (released on 1st September 2015, last updated on 3rd April 2017):
    30 ---------------------------------------------------------------------
     293.2 (released on 1st September 2015, last updated on 26th April 2017):
     30----------------------------------------------------------------------
    3131
    3232+ Addition of SQProblemSchur class implementing Schur complement approach
  • trunk/doc/mainpage.dox

    r243 r257  
    117117 *      <li>Reference to the <b>webpage</b>:
    118118 *      \code
    119  *       @MISC{qpOASES2014,
     119 *       @MISC{qpOASES2017,
    120120 *        author = {H.J. Ferreau and A. Potschka and C. Kirches},
    121121 *        title = {{qpOASES} webpage},
  • trunk/interfaces/python/qpoases.pxd

    r239 r257  
    2323##
    2424##    Filename:  qpoases.pxd
    25 ##    Author:    Sebastian F. Walter, Manuel Kudruss
     25##    Author:    Sebastian F. Walter, Manuel Kudruss (thanks to Felix Lenders)
    2626##    Version:   3.2
    2727##    Date:      2013-2017
     
    3131
    3232    ctypedef double real_t
    33     ctypedef int int_t
     33    ctypedef long int_t
    3434
    3535    cdef enum BooleanType:
     
    301301    cdef cppclass QProblemB:
    302302        QProblemB()
    303         QProblemB(int_t, HessianType)
     303        QProblemB(int_t, HessianType, BooleanType)
    304304
    305305        QProblemB(const QProblemB&)
     
    340340    cdef cppclass QProblem:
    341341        QProblem()
    342         QProblem(int_t, int_t, HessianType)
     342        QProblem(int_t, int_t, HessianType, BooleanType)
    343343
    344344        QProblem(const QProblem&)
     
    389389    cdef cppclass SQProblem:
    390390        SQProblem()
    391         SQProblem(int_t, int_t, HessianType)
     391        SQProblem(int_t, int_t, HessianType, BooleanType)
    392392
    393393        SQProblem(const QProblem&)
     
    477477                                BooleanType useHotstarts,   # Shall QP solution be hotstarted?
    478478                                const Options& options,     # QP solver options to be used while solving benchmark problems.
    479                                 int maxAllowedNWSR,         # Maximum number of working set recalculations to be performed.
     479                                int_t maxAllowedNWSR,       # Maximum number of working set recalculations to be performed.
    480480                                real_t& maxNWSR,            # Output: Maximum number of performed working set recalculations.
    481481                                real_t& avgNWSR,            # Output: Average number of performed working set recalculations.
  • trunk/interfaces/python/qpoases.pyx

    r239 r257  
    2121##
    2222
    23 ## author of this file: Sebastian F. Walter
     23## authors of this file: Sebastian F. Walter (thanks to Felix Lenders)
    2424
    2525"""
    2626Python interface to qpOASES
    2727using Cython
    28 :author: Sebastian F. Walter, Manuel Kudruss
     28:author: Sebastian F. Walter, Manuel Kudruss (thanks to Felix Lenders)
    2929"""
    3030
     
    386386cdef class PyQProblemB:
    387387    cdef QProblemB *thisptr      # hold a C++ instance which we're wrapping
    388     def __cinit__(self, int nV):
     388    def __cinit__(self, long nV):
    389389        # FIXME: allow other HessianTypes!
    390         self.thisptr = new QProblemB(nV, HST_UNKNOWN)
     390        self.thisptr = new QProblemB(nV, HST_UNKNOWN, BT_TRUE)
    391391    def __dealloc__(self):
    392392        del self.thisptr
     
    405405
    406406        # enable nWSR as return value in argument list
    407         if isinstance(nWSR, int):
     407        if isinstance(nWSR, long) or isinstance(nWSR, int):
    408408            deprecation_warning_nWSR()
    409             nWSR_tmp = np.array([nWSR], dtype=int)
     409            nWSR_tmp = np.array([nWSR], dtype=long)
    410410        else:
    411411            nWSR_tmp = nWSR
     
    424424                    <double*> lb.data,
    425425                    <double*> ub.data,
    426                     <int&>    nWSR_tmp.data[0],
     426                    <int_t&>  nWSR_tmp.data[0],
    427427                    <double*> &cput_tmp.data[0]
    428428                    )
     
    433433                    <double*> lb.data,
    434434                    <double*> ub.data,
    435                     <int&> nWSR_tmp.data[0]
     435                    <int_t&> nWSR_tmp.data[0]
    436436                    )
    437437
     
    448448
    449449        # enable nWSR as return value in argument list
    450         if isinstance(nWSR, int):
     450        if isinstance(nWSR, long) or isinstance(nWSR, int):
    451451            deprecation_warning_nWSR()
    452             nWSR_tmp = np.array([nWSR], dtype=int)
     452            nWSR_tmp = np.array([nWSR], dtype=long)
    453453        else:
    454454            nWSR_tmp = nWSR#np.asarray(nWSR, dtype=int)
     
    466466                    <double*> lb.data,
    467467                    <double*> ub.data,
    468                     <int&>    nWSR_tmp.data[0],
     468                    <int_t&>  nWSR_tmp.data[0],
    469469                    <double*> &cput_tmp.data[0]
    470470                )
     
    474474                    <double*> lb.data,
    475475                    <double*> ub.data,
    476                     <int&>    nWSR_tmp.data[0]
     476                    <int_t&>  nWSR_tmp.data[0]
    477477            )
    478478
     
    502502cdef class PyQProblem:
    503503    cdef QProblem *thisptr      # hold a C++ instance which we're wrapping
    504     def __cinit__(self, int nV, int nC):
    505         self.thisptr = new QProblem(nV, nC, HST_UNKNOWN)
     504    def __cinit__(self, long nV, long nC):
     505        self.thisptr = new QProblem(nV, nC, HST_UNKNOWN, BT_TRUE)
    506506    def __dealloc__(self):
    507507        del self.thisptr
     
    523523
    524524        # enable nWSR as return value in argument list
    525         if isinstance(nWSR, int):
     525        if isinstance(nWSR, long) or isinstance(nWSR, int):
    526526            deprecation_warning_nWSR()
    527             nWSR_tmp = np.array([nWSR], dtype=int)
     527            nWSR_tmp = np.array([nWSR], dtype=long)
    528528        else:
    529529            nWSR_tmp = nWSR
     
    545545                    <double*> lbA.data,
    546546                    <double*> ubA.data,
    547                     <int&>    nWSR_tmp.data[0],
     547                    <int_t&>  nWSR_tmp.data[0],
    548548                    <double*> &cput_tmp.data[0]
    549549                )
     
    557557                    <double*> lbA.data,
    558558                    <double*> ubA.data,
    559                     <int&>    nWSR_tmp.data[0]
     559                    <int_t&>  nWSR_tmp.data[0]
    560560                )
    561561
     
    575575
    576576        # enable nWSR as return value in argument list
    577         if isinstance(nWSR, int):
     577        if isinstance(nWSR, long) or isinstance(nWSR, int):
    578578            deprecation_warning_nWSR()
    579             nWSR_tmp = np.array([nWSR], dtype=int)
     579            nWSR_tmp = np.array([nWSR], dtype=long)
    580580        else:
    581581            nWSR_tmp = nWSR
     
    595595                    <double*> lbA.data,
    596596                    <double*> ubA.data,
    597                     <int&>    nWSR_tmp.data[0],
     597                    <int_t&>  nWSR_tmp.data[0],
    598598                    <double*> &cput_tmp.data[0]
    599599                )
     
    605605                    <double*> lbA.data,
    606606                    <double*> ubA.data,
    607                     <int&>    nWSR_tmp.data[0]
     607                    <int_t&>  nWSR_tmp.data[0]
    608608                )
    609609
     
    625625cdef class PySQProblem:
    626626    cdef SQProblem *thisptr      # hold a C++ instance which we're wrapping
    627     def __cinit__(self, int nV, int nC):
    628         self.thisptr = new SQProblem(nV, nC, HST_UNKNOWN)
     627    def __cinit__(self, long nV, long nC):
     628        self.thisptr = new SQProblem(nV, nC, HST_UNKNOWN, BT_TRUE)
    629629    def __dealloc__(self):
    630630        del self.thisptr
     
    646646
    647647        # enable nWSR as return value in argument list
    648         if isinstance(nWSR, int):
     648        if isinstance(nWSR, long) or isinstance(nWSR, int):
    649649            deprecation_warning_nWSR()
    650             nWSR_tmp = np.array([nWSR], dtype=int)
     650            nWSR_tmp = np.array([nWSR], dtype=long)
    651651        else:
    652             nWSR_tmp = np.asarray(nWSR, dtype=int)
     652            nWSR_tmp = np.asarray(nWSR, dtype=long)
    653653
    654654        if cputime > 1.e-16:
     
    668668                        <double*> lbA.data,
    669669                        <double*> ubA.data,
    670                         <int&>    nWSR_tmp.data[0],
     670                        <int_t&>  nWSR_tmp.data[0],
    671671                        <double*> &cput_tmp.data[0]
    672672                )
     
    680680                    <double*> lbA.data,
    681681                    <double*> ubA.data,
    682                     <int&>    nWSR_tmp.data[0],
     682                    <int_t&>  nWSR_tmp.data[0],
    683683        )
    684684
     
    699699
    700700        # enable nWSR as return value in argument list
    701         if isinstance(nWSR, int):
     701        if isinstance(nWSR, long) or isinstance(nWSR, int):
    702702            deprecation_warning_nWSR()
    703             nWSR_tmp = np.array([nWSR], dtype=int)
     703            nWSR_tmp = np.array([nWSR], dtype=long)
    704704        else:
    705705            nWSR_tmp = nWSR
     
    721721                    <double*> lbA.data,
    722722                    <double*> ubA.data,
    723                     <int&>    nWSR_tmp.data[0],
     723                    <int_t&>  nWSR_tmp.data[0],
    724724                    <double*> &cput_tmp.data[0]
    725725            )
     
    733733                    <double*> lbA.data,
    734734                    <double*> ubA.data,
    735                     <int&>    nWSR_tmp.data[0],
     735                    <int_t&>  nWSR_tmp.data[0],
    736736        )
    737737
     
    863863                         useHotstarts,       # Shall QP solution be hotstarted?
    864864                         PyOptions options,  # QP solver options to be used while solving benchmark problems.
    865                          int maxAllowedNWSR, # Maximum number of working set recalculations to be performed.
     865                         long maxAllowedNWSR, # Maximum number of working set recalculations to be performed.
    866866                         double maxCPUTime,  # Maximum allowed CPU time for qp solving.
    867867                         ):
     
    895895
    896896"""
    897 def py_getKktViolation(int nV,                              # Number of variables.
    898                        int nC,                              # Number of constraints.
     897def py_getKktViolation(long nV,                             # Number of variables.
     898                       long nC,                             # Number of constraints.
    899899                       np.ndarray[np.double_t, ndim=2] H,   # Hessian matrix.
    900900                       np.ndarray[np.double_t, ndim=1] g,   # Sequence of gradient vectors.
  • trunk/interfaces/python/setup.py

    r239 r257  
    2626#
    2727#   Filename:  setup.py
    28 #   Author:    Sebastian F. Walter, Manuel Kudruss
     28#   Author:    Sebastian F. Walter, Manuel Kudruss (thanks to Felix Lenders)
    2929#   Version:   3.2
    3030#   Date:      2013-2017
     
    3333import os
    3434import numpy as np
     35import platform
    3536
    36 from distutils.core import setup
     37from=20distutils.core import setup
    3738from distutils.extension import Extension
    3839from Cython.Distutils import build_ext
     
    5859extra_params['language'] = 'c++'
    5960
     61if platform.system() in ['Linux', 'Darwin']:
     62    extra_params['extra_compile_args'] = ['-D__USE_LONG_INTEGERS__', '-D__USE_LONG_INTS__']
     63
    6064if os.name == 'posix':
    6165    extra_params['runtime_library_dirs'] = extra_params['library_dirs']
Note: See TracChangeset for help on using the changeset viewer.