Source code for siconos.numerics

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

"""
A collection of low-level algorithms for solving basic algebra and optimization problem arising in the simulation of nonsmooth dynamical systems.

Example of usage:

>>> import siconos.numerics as sn
>>> help(sn.LCP)

"""

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _sicpynumerics
else:
    import _sicpynumerics

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


class SwigPyIterator(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _sicpynumerics.delete_SwigPyIterator

    def value(self) -> "PyObject *":
        return _sicpynumerics.SwigPyIterator_value(self)

    def incr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
        return _sicpynumerics.SwigPyIterator_incr(self, n)

    def decr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
        return _sicpynumerics.SwigPyIterator_decr(self, n)

    def distance(self, x: "SwigPyIterator") -> "ptrdiff_t":
        return _sicpynumerics.SwigPyIterator_distance(self, x)

    def equal(self, x: "SwigPyIterator") -> "bool":
        return _sicpynumerics.SwigPyIterator_equal(self, x)

    def copy(self) -> "swig::SwigPyIterator *":
        return _sicpynumerics.SwigPyIterator_copy(self)

    def next(self) -> "PyObject *":
        return _sicpynumerics.SwigPyIterator_next(self)

    def __next__(self) -> "PyObject *":
        return _sicpynumerics.SwigPyIterator___next__(self)

    def previous(self) -> "PyObject *":
        return _sicpynumerics.SwigPyIterator_previous(self)

    def advance(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
        return _sicpynumerics.SwigPyIterator_advance(self, n)

    def __eq__(self, x: "SwigPyIterator") -> "bool":
        return _sicpynumerics.SwigPyIterator___eq__(self, x)

    def __ne__(self, x: "SwigPyIterator") -> "bool":
        return _sicpynumerics.SwigPyIterator___ne__(self, x)

    def __iadd__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
        return _sicpynumerics.SwigPyIterator___iadd__(self, n)

    def __isub__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
        return _sicpynumerics.SwigPyIterator___isub__(self, n)

    def __add__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
        return _sicpynumerics.SwigPyIterator___add__(self, n)

    def __sub__(self, *args) -> "ptrdiff_t":
        return _sicpynumerics.SwigPyIterator___sub__(self, *args)
    def __iter__(self):
        return self

# Register SwigPyIterator in _sicpynumerics:
_sicpynumerics.SwigPyIterator_swigregister(SwigPyIterator)

SHARED_PTR_DISOWN = _sicpynumerics.SHARED_PTR_DISOWN
ALLOC_CTRL_I = _sicpynumerics.ALLOC_CTRL_I
ALLOC_CTRL_P = _sicpynumerics.ALLOC_CTRL_P

def NM_clean_cs(m: "CSparseMatrix *", alloc_ctrl: "int") -> "void":
    return _sicpynumerics.NM_clean_cs(m, alloc_ctrl)

def NM_clean(M: "NumericsMatrix", alloc_ctrl: "int") -> "int":
    return _sicpynumerics.NM_clean(M, alloc_ctrl)

def sane_pyseq_check(o: "PyObject *") -> "bool":
    return _sicpynumerics.sane_pyseq_check(o)

def _sn_check_nnz(mat: "PyObject **", M: "CSparseMatrix *") -> "void":
    return _sicpynumerics._sn_check_nnz(mat, M)

def _sn_check_shape(mat: "PyObject **", M: "CSparseMatrix *") -> "void":
    return _sicpynumerics._sn_check_shape(mat, M)

def is_Pyobject_scipy_sparse_matrix(o: "PyObject *", scipy_mod: "PyObject *") -> "bool":
    return _sicpynumerics.is_Pyobject_scipy_sparse_matrix(o, scipy_mod)

[docs] def linearComplementarity_driver(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int": r""" General interface to solvers for Linear Complementarity Problems :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: the LinearComplementarityProblem structure which handles the problem (M,q) :type z: float, in/out :param z: a n-vector of doubles which contains the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which contains the solution of the problem. :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: info termination value - 0 : successful - >0 : otherwise see each solver for more information about the log info """ return _sicpynumerics.linearComplementarity_driver(problem, z, w, options)
[docs] def mlcp_driver(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int": r""" General interface to solver for MLCP problems :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: the MixedLinearComplementarityProblem structure which handles the problem (M,q) :type z: float, in/out :param z: a m+n-vector of doubles which contains the solution of the problem. :type w: float, in/out :param w: a m+n-vector of doubles which contains the solution of the problem. :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: info termination value, - 0 : successful - >0 : otherwise see each solver for more information about the log info TODO: Sizing the regularization parameter and apply it only on null diagnal term """ return _sicpynumerics.mlcp_driver(problem, z, w, options)
[docs] def fc2d_driver(problem: "FrictionContactProblem", reaction: "double *", velocity: "double *", options: "SolverOptions") -> "int": r""" General interface to solvers for friction-contact 2D problem :type problem: :py:class:`FrictionContactProblem`, in :param problem: the structure which handles the Friction-Contact problem :type reaction: float, in/out :param reaction: global vector (n) :type velocity: float, in/out :param velocity: global vector (n) :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: result (0 if successful otherwise 1). """ return _sicpynumerics.fc2d_driver(problem, reaction, velocity, options)
[docs] def fc3d_driver(problem: "FrictionContactProblem", reaction: "double *", velocity: "double *", options: "SolverOptions") -> "int": r""" General interface to solvers for friction-contact 3D problem :type problem: :py:class:`FrictionContactProblem`, in :param problem: the structure which handles the Friction-Contact problem :type reaction: float, in/out :param reaction: global vector (n) :type velocity: float, in/out :param velocity: global vector (n) :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: result (0 if successful otherwise 1). """ return _sicpynumerics.fc3d_driver(problem, reaction, velocity, options)
[docs] def rolling_fc3d_driver(problem: "RollingFrictionContactProblem", reaction: "double *", velocity: "double *", options: "SolverOptions") -> "int": r""" General interface to solvers for rolling friction-contact 3D problem :type problem: :py:class:`RollingFrictionContactProblem`, in :param problem: the structure which handles the Friction-Contact problem :type reaction: float, in/out :param reaction: global vector (n) :type velocity: float, in/out :param velocity: global vector (n) :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: result (0 if successful otherwise 1). """ return _sicpynumerics.rolling_fc3d_driver(problem, reaction, velocity, options)
[docs] def rolling_fc2d_driver(problem: "RollingFrictionContactProblem", reaction: "double *", velocity: "double *", options: "SolverOptions") -> "int": r""" General interface to solvers for rolling friction-contact 2D problem :type problem: :py:class:`RollingFrictionContactProblem`, in :param problem: the structure which handles the Friction-Contact problem :type reaction: float, in/out :param reaction: global vector (n) :type velocity: float, in/out :param velocity: global vector (n) :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: result (0 if successful otherwise 1). """ return _sicpynumerics.rolling_fc2d_driver(problem, reaction, velocity, options)
[docs] def gfc2d_driver(problem: "GlobalFrictionContactProblem", reaction: "double *", velocity: "double *", globalVelocity: "double *", options: "SolverOptions") -> "int": r""" General interface to solvers for global friction-contact 2D problem :type problem: :py:class:`GlobalFrictionContactProblem`, in :param problem: the structure which handles the Friction-Contact problem :type reaction: float, in/out :param reaction: global vector (n) :type velocity: float, in/out :param velocity: global vector (n) :type globalVelocity: float, in/out :param globalVelocity: global vector :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: result (0 if successful otherwise 1). """ return _sicpynumerics.gfc2d_driver(problem, reaction, velocity, globalVelocity, options)
[docs] def gfc3d_driver(problem: "GlobalFrictionContactProblem", reaction: "double *", velocity: "double *", globalVelocity: "double *", options: "SolverOptions") -> "int": r""" General interface to solvers for global friction-contact 3D problem :type problem: :py:class:`GlobalFrictionContactProblem`, in :param problem: the structure which handles the Friction-Contact problem :type reaction: float, in/out :param reaction: global vector (n) :type velocity: float, in/out :param velocity: global vector (n) :type globalVelocity: float, in/out :param globalVelocity: global vector :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: result (0 if successful otherwise 1). """ return _sicpynumerics.gfc3d_driver(problem, reaction, velocity, globalVelocity, options)
[docs] def g_rolling_fc3d_driver(problem: "GlobalRollingFrictionContactProblem", reaction: "double *", velocity: "double *", globalVelocity: "double *", options: "SolverOptions") -> "int": r""" General interface to solvers for global rolling friction-contact 3D problem :type problem: :py:class:`GlobalRollingFrictionContactProblem`, in :param problem: the structure which handles the Friction-Contact problem :type reaction: float, in/out :param reaction: global vector (n) :type velocity: float, in/out :param velocity: global vector (n) :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: result (0 if successful otherwise 1). """ return _sicpynumerics.g_rolling_fc3d_driver(problem, reaction, velocity, globalVelocity, options)
[docs] def variationalInequality_driver(problem: "VI", x: "double *", w: "double *", options: "SolverOptions") -> "int": r""" General interface to solvers for friction-contact 3D problem :type problem: :py:class:`VariationalInequality`, in :param problem: the structure which handles the Friction-Contact problem :type x: float, in/out :param x: global vector (n) :type w: float, in/out :param w: global vector (n) :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: result (0 if successful otherwise 1). """ return _sicpynumerics.variationalInequality_driver(problem, x, w, options)
[docs] def avi_driver(problem: "AVI", z: "double *", w: "double *", options: "SolverOptions") -> "int": r""" General interface to solvers for Affine Variational Inequalities (AVI) :type problem: :py:class:`AffineVariationalInequalities`, in :param problem: the AffineVariationalInequalities structure which handles the problem (M,q) :type z: float, in/out :param z: a n-vector of doubles which contains the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which contains the solution of the problem. :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: info termination value - 0 : successful - >0 : otherwise see each solver for more information about the log info """ return _sicpynumerics.avi_driver(problem, z, w, options)
[docs] def mcp_old_driver(problem: "MCP_old", z: "double *", w: "double *", options: "SolverOptions") -> "int": r""" General interface to solver for MCP problems :type problem: :py:class:`MixedComplementarityProblem_old`, in :param problem: the MixedComplementarityProblem_old structure which handles the problem :type z: float, in/out :param z: a m+n-vector of doubles which contains the solution of the problem. :type w: float, in/out :param w: a m+n-vector of doubles which contains the solution of the problem. :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and its(their) parameters :rtype: int :return: info termination value 0 : successful, else error. """ return _sicpynumerics.mcp_old_driver(problem, z, w, options)
[docs] def mcp_driver(problem: "MCP", z: "double *", w: "double *", options: "SolverOptions") -> "int": r""" General interface to solver for MCP problems -- new version :type problem: :py:class:`MixedComplementarityProblem`, in :param problem: the MixedComplementarityProblem structure which handles the problem :type z: float, in/out :param z: a m+n-vector of doubles which contains the solution of the problem. :type w: float, in/out :param w: a m+n-vector of doubles which contains the solution of the problem. :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and its(their) parameters :rtype: int :return: info termination value 0 : successful, else error. """ return _sicpynumerics.mcp_driver(problem, z, w, options)
[docs] def ncp_driver(problem: "NCP", z: "double *", F: "double *", options: "SolverOptions") -> "int": r""" General interface to solver for NCP problems :type problem: :py:class:`NonlinearComplementarityProblem`, in :param problem: the NonlinearComplementarityProblem structure which handles the problem :type z: float, in/out :param z: a n-vector of doubles which contains the solution of the problem. :type F: float, in/out :param F: a n-vector of doubles which contains value of the function evaluated at the solution of the problem. :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and its(their) parameters :rtype: int :return: info termination value 0 : successful, else error """ return _sicpynumerics.ncp_driver(problem, z, F, options)
[docs] def soclcp_driver(problem: "SecondOrderConeLinearComplementarityProblem", r: "double *", v: "double *", options: "SolverOptions") -> "int": r""" General interface to solvers for SOCLCP problem :type problem: :py:class:`SecondOrderConeLinearComplementarityProblem`, in :param problem: the structure which handles the Friction-Contact problem :type r: float, in/out :param r: global vector (n) :type v: float, in/out :param v: global vector (n) :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: result (0 if successful otherwise 1). """ return _sicpynumerics.soclcp_driver(problem, r, v, options)
[docs] def fc3d_LmgcDriver(reaction: "double *", velocity: "double *", q: "double *", mu: "double *", W: "double *", row: "unsigned int *", column: "unsigned int *", nc: "unsigned int", nb: "unsigned int", solver_id: "int", tolerance: "double", itermax: "int", verbose: "int", outputFile: "int", freq_output: "int", ndof: "int") -> "int": r""" LMGC interface to solvers for friction-contact 3D problem :type reaction: float, in/out :param reaction: global vector (nc*3) :type velocity: float, in/out :param velocity: global vector (nc*3) :type q: float, in :param q: global vector (nc*3) :type mu: float, in :param mu: global vector (nc) :type W: float, in :param W: the block matrix in coordinate format :type row: int, in :param row: block row indices :type column: int, in :param column: block column indices :type nc: int, in :param nc: number of contacts :type nb: int, in :param nb: number of blocks :type solver_id: int, in :param solver_id: id an int to be mapped to actual solver in Numerics :type tolerance: float, in :param tolerance: threshold used to validate the solution: if the error is less than this value, the solution is accepted :type itermax: int, in :param itermax: the maximum number of iteration :type verbose: int, in :param verbose: level 0 : nothing, 1: mid level 2: high level :type outputFile: int, in :param outputFile: outputFile option 0 : nothing 1 : dat file 2: FCLIB HDF5 file if FCLIB is found :type freq_output: int, in :param freq_output: :type ndof: int, in :param ndof: the numbe of dof in the dynamical systems involved in contact (for output in file.) :rtype: int :return: result (0 if successful otherwise 1). """ return _sicpynumerics.fc3d_LmgcDriver(reaction, velocity, q, mu, W, row, column, nc, nb, solver_id, tolerance, itermax, verbose, outputFile, freq_output, ndof)
[docs] def gfc3d_LmgcDriver(reaction: "double *", velocity: "double *", globalVelocity: "double *", q: "double *", b: "double *", mu: "double *", Mdata: "double *", nzM: "unsigned int", rowM: "unsigned int *", colM: "unsigned int *", Hdata: "double *", nzH: "unsigned int", rowH: "unsigned int *", colH: "unsigned int *", n: "unsigned int", nc: "unsigned int", solver_id: "int", isize: "int", iparam: "int *", dsize: "int", dparam: "double *", verbose: "int", outputFile: "int", freq_output: "int") -> "int": r""" LMGC interface to solvers for global friction-contact 3D problem :type reaction: float, in/out :param reaction: global vector (nc*3) :type velocity: float, in/out :param velocity: global vector (nc*3) :type globalVelocity: float, in/out :param globalVelocity: global velocity vector (n) :type q: float, in :param q: global vector (n) :type b: float, in :param b: global vector (nc*3) :type mu: float, in :param mu: global vector (nc) :type Mdata: float, in :param Mdata: the sparse matrix in coordinate format :type nzM: int, in :param nzM: number of non zeros in Mdata :type rowM: int, in :param rowM: row indices of M :type colM: int, in :param colM: column indices of M :type Hdata: float, in :param Hdata: the sparse matrix in coordinate format :type nzH: int, in :param nzH: number of non zeros in Hdata :type rowH: int, in :param rowH: row indices of H :type colH: int, in :param colH: column indices of H :type n: int, in :param n: size of global velocity :type nc: int, in :param nc: number of contacts :type solver_id: int, in :param solver_id: id an int to be mapped to actual solver in Numerics :type isize: int, in :param isize: sive of integer parameters array :type iparam: int, in :param iparam: integer parameters array :type dsize: int, in :param dsize: sive of double parameters array :type dparam: float, in :param dparam: double parameters array :type verbose: int, in :param verbose: level 0 : nothing, 1: mid level 2: high level :type outputFile: int, in :param outputFile: outputFile option 0 : nothing 1 : C file , 1 : dat file 3: FCLIB HDF5 file if FCLIB is found :type freq_output: int, in :param freq_output: :rtype: int :return: result (0 if successful otherwise 1). """ return _sicpynumerics.gfc3d_LmgcDriver(reaction, velocity, globalVelocity, q, b, mu, Mdata, nzM, rowM, colM, Hdata, nzH, rowH, colH, n, nc, solver_id, isize, iparam, dsize, dparam, verbose, outputFile, freq_output)
[docs] def relay_driver(problem: "RelayProblem *", z: "double *", w: "double *", options: "SolverOptions") -> "int": r""" General interface to solver for relay problems :type problem: RelayProblem, in :param problem: the RelayProblem structure which handles the problem (M,q) :type z: float, in/out :param z: a n-vector of doubles which contains the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which contains the solution of the problem. :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and its (their) parameters :rtype: int :return: info termination value - 0 : successful - >0 : otherwise see each solver for more information about the log info """ return _sicpynumerics.relay_driver(problem, z, w, options)
[docs] class Callback(object): r""" Structure used to store user callbacks inside solvers""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr env = property(_sicpynumerics.Callback_env_get, _sicpynumerics.Callback_env_set, doc=r""" general user environment""") collectStatsIteration = property(_sicpynumerics.Callback_collectStatsIteration_get, _sicpynumerics.Callback_collectStatsIteration_set, doc=r""" pointer on a function Its signature is: user env, problem size, reaction, velocity, error at end of solver iteration (when this makes sense) and an extra data structure """) def __init__(self): _sicpynumerics.Callback_swiginit(self, _sicpynumerics.new_Callback()) __swig_destroy__ = _sicpynumerics.delete_Callback
# Register Callback in _sicpynumerics: _sicpynumerics.Callback_swigregister(Callback) OPTIONS_PARAM_SIZE = _sicpynumerics.OPTIONS_PARAM_SIZE
[docs] class SolverOptions(object): r""" Structure used to send options (name, parameters and so on) to a specific solver (mainly from Kernel to Numerics). Creation, update and destruction: - solver_options_create() - solver_options_update_internal() - solver_options_delete() Details in users'guide. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr solverId = property(_sicpynumerics.SolverOptions_solverId_get, _sicpynumerics.SolverOptions_solverId_set, doc=r""" id number of the solver.""") isSet = property(_sicpynumerics.SolverOptions_isSet_get, _sicpynumerics.SolverOptions_isSet_set, doc=r""" true(1) if the structure is ready to be used by a numerics driver. """) iSize = property(_sicpynumerics.SolverOptions_iSize_get, _sicpynumerics.SolverOptions_iSize_set, doc=r""" iSize size of vector iparam""") iparam = property(_sicpynumerics.SolverOptions_iparam_get, _sicpynumerics.SolverOptions_iparam_set, doc=r""" list of solver parameters (integer type); Check solvers doc for details. """) dSize = property(_sicpynumerics.SolverOptions_dSize_get, _sicpynumerics.SolverOptions_dSize_set, doc=r""" size of vector dparam""") dparam = property(_sicpynumerics.SolverOptions_dparam_get, _sicpynumerics.SolverOptions_dparam_set, doc=r""" list of solver parameters (double type); Check solvers doc for details. """) filterOn = property(_sicpynumerics.SolverOptions_filterOn_get, _sicpynumerics.SolverOptions_filterOn_set, doc=r""" if true (1), check solution validity after the driver call. Default = 1. For example if filterOn = 1 for a LCP, lcp_compute_error() will be called at the end of the process). """) dWorkSize = property(_sicpynumerics.SolverOptions_dWorkSize_get, _sicpynumerics.SolverOptions_dWorkSize_set, doc=r""" size of double type internal work array.""") dWork = property(_sicpynumerics.SolverOptions_dWork_get, _sicpynumerics.SolverOptions_dWork_set, doc=r""" internal (double type) work array.""") iWorkSize = property(_sicpynumerics.SolverOptions_iWorkSize_get, _sicpynumerics.SolverOptions_iWorkSize_set, doc=r""" size of integer type internal work array.""") iWork = property(_sicpynumerics.SolverOptions_iWork_get, _sicpynumerics.SolverOptions_iWork_set, doc=r""" internal (integer type) work array.""") numberOfInternalSolvers = property(_sicpynumerics.SolverOptions_numberOfInternalSolvers_get, _sicpynumerics.SolverOptions_numberOfInternalSolvers_set, doc=r""" the number of internal or local 'sub-solvers' used by the solver (size of internalSolvers) . """) internalSolvers = property(_sicpynumerics.SolverOptions_internalSolvers_get, _sicpynumerics.SolverOptions_internalSolvers_set, doc=r""" list of internal solver options""") callback = property(_sicpynumerics.SolverOptions_callback_get, _sicpynumerics.SolverOptions_callback_set, doc=r""" pointer to user-defined callback""") solverParameters = property(_sicpynumerics.SolverOptions_solverParameters_get, _sicpynumerics.SolverOptions_solverParameters_set, doc=r""" additional parameters specific to the solver (GAMS and NewtonMethod only) """) solverData = property(_sicpynumerics.SolverOptions_solverData_get, _sicpynumerics.SolverOptions_solverData_set, doc=r""" additional data specific to the solver""") def __init__(self, *args): _sicpynumerics.SolverOptions_swiginit(self, _sicpynumerics.new_SolverOptions(*args)) __swig_destroy__ = _sicpynumerics.delete_SolverOptions
# Register SolverOptions in _sicpynumerics: _sicpynumerics.SolverOptions_swigregister(SolverOptions) SICONOS_IPARAM_MAX_ITER = _sicpynumerics.SICONOS_IPARAM_MAX_ITER SICONOS_IPARAM_ITER_DONE = _sicpynumerics.SICONOS_IPARAM_ITER_DONE SICONOS_IPARAM_PREALLOC = _sicpynumerics.SICONOS_IPARAM_PREALLOC SICONOS_IPARAM_NSGS_SHUFFLE = _sicpynumerics.SICONOS_IPARAM_NSGS_SHUFFLE SICONOS_IPARAM_ERROR_EVALUATION = _sicpynumerics.SICONOS_IPARAM_ERROR_EVALUATION SICONOS_IPARAM_PATHSEARCH_STACKSIZE = _sicpynumerics.SICONOS_IPARAM_PATHSEARCH_STACKSIZE SICONOS_ERROR_FULL_EVALUATION = _sicpynumerics.SICONOS_ERROR_FULL_EVALUATION r""" Complete error computation, including v computation""" SICONOS_ERROR_LIGHT_EVALUATION = _sicpynumerics.SICONOS_ERROR_LIGHT_EVALUATION r""" Light error computation with incremental values on r verification of absolute error at the end """ SICONOS_ERROR_LIGHT_EVALUATION_NO_UPDATE = _sicpynumerics.SICONOS_ERROR_LIGHT_EVALUATION_NO_UPDATE r""" only light error computation, do not update v unknown)""" SICONOS_DPARAM_TOL = _sicpynumerics.SICONOS_DPARAM_TOL SICONOS_DPARAM_RESIDU = _sicpynumerics.SICONOS_DPARAM_RESIDU
[docs] def solver_options_print(options: "SolverOptions") -> "void": r""" screen display of solver parameters :type options: :py:class:`SolverOptions` :param options: the structure to be displayed """ return _sicpynumerics.solver_options_print(options)
[docs] def solver_options_delete(options: "SolverOptions") -> "void": r""" Clear and free all pointer members of the structure, then release memory :type options: :py:class:`SolverOptions` :param options: the structure to be cleared. """ return _sicpynumerics.solver_options_delete(options)
[docs] def solver_options_create(solverId: "int") -> "SolverOptions *": r""" Create and initialize a SolverOptions struct: allocate internal memories, set default values depending on the id. :param id: solver id number It must belong to one of the available ids defined for each formulation, see users'guide for details :rtype: :py:class:`SolverOptions` :return: a pointer to options set, ready to use by a driver. """ return _sicpynumerics.solver_options_create(solverId)
[docs] def solver_options_copy(source: "SolverOptions") -> "SolverOptions *": r""" Copy an existing set of options, to create a new one. Warning : callback, solverData and solverParameters of the new structure are pointer links to those of the original one! :type source: :py:class:`SolverOptions` :param source: an existing solver options structure :rtype: :py:class:`SolverOptions` :return: a pointer to options set, ready to use by a driver. """ return _sicpynumerics.solver_options_copy(source)
[docs] def solver_options_update_internal(parent: "SolverOptions", internal_solver_number: "size_t", solver_id: "int") -> "void": r""" Change one of the internal solver of a previously defined SolverOptions set. Allocate internal memories and set default values for the internal solver. Warning : the actual internal solver in position internal_solver_number and all its content will be destroyed and replaced by a new one. :type parent: :py:class:`SolverOptions` :param parent: the top-level SolverOptions which contains the internal solver to be updated :type internal_solver_number: int :param internal_solver_number: number of the internal solver to be update (warning : this is the position in the list of internal solvers, not the id!) :type solver_id: int :param solver_id: id number of the new internal solver to be created/updated """ return _sicpynumerics.solver_options_update_internal(parent, internal_solver_number, solver_id)
[docs] def solver_options_name_to_id(pName: "char const *") -> "int": r""" return the id of a solver based on its name :type pName: string :param pName: the name of the solver :rtype: int :return: the id of the solver or 0 if it failed """ return _sicpynumerics.solver_options_name_to_id(pName)
[docs] def solver_options_id_to_name(Id: "int") -> "char const *": r""" return the name of a solver given its id :type Id: int :param Id: the id of the solver :rtype: string :return: the name of the solver """ return _sicpynumerics.solver_options_id_to_name(Id)
[docs] def solver_options_get_internal_solver(options: "SolverOptions", n: "size_t") -> "SolverOptions *": r""" return the internal solver options set :type options: :py:class:`SolverOptions` :param options: parent options :param number: of the targeted solver :rtype: :py:class:`SolverOptions` :return: a pointer to the internal solver options set """ return _sicpynumerics.solver_options_get_internal_solver(options, n)
[docs] def solver_options_set_internal_solver(options: "SolverOptions", n: "size_t", NSO: "SolverOptions") -> "void": r""" set internal solver :type options: :py:class:`SolverOptions` :param options: parent options :param number: of the targeted solver :param the: solver options to be used as internal solver number n """ return _sicpynumerics.solver_options_set_internal_solver(options, n, NSO)
NUMERICS_LOG_TO_SCREEN = _sicpynumerics.NUMERICS_LOG_TO_SCREEN NUMERICS_LOG_TO_FILE = _sicpynumerics.NUMERICS_LOG_TO_FILE NUMERICS_EXTERNAL_LOGGER = _sicpynumerics.NUMERICS_EXTERNAL_LOGGER def numerics_set_verbose(newVerboseMode: "int") -> "void": return _sicpynumerics.numerics_set_verbose(newVerboseMode)
[docs] def numerics_error(*args) -> "void": r""" check IO msg output and exit with error :type fn_name: string :param fn_name: name of the function where error occurs :type msg: string :param msg: formatted output msg """ return _sicpynumerics.numerics_error(*args)
[docs] def numerics_error_nonfatal(*args) -> "void": r""" log error message without exit :type fn_name: string :param fn_name: name of the function where the error occurs :type msg: string :param msg: formatted output message """ return _sicpynumerics.numerics_error_nonfatal(*args)
[docs] def numerics_warning(*args) -> "void": r""" log warning :type fn_name: string :param fn_name: name of the function where warning occurs :type msg: string :param msg: formatted output message """ return _sicpynumerics.numerics_warning(*args)
[docs] def numerics_printf(*args) -> "void": r""" log message (if verbosity is on) :type fmt: string :param fmt: formatted output message """ return _sicpynumerics.numerics_printf(*args)
[docs] def numerics_printf_verbose(*args) -> "void": r""" log message if verbose is non null :type verbose: int :param verbose: log message is non null :type fmt: string :param fmt: formatted output message """ return _sicpynumerics.numerics_printf_verbose(*args)
def isqrt(n: "unsigned int") -> "unsigned int": return _sicpynumerics.isqrt(n) def compiled_in_debug_mode() -> "int": return _sicpynumerics.compiled_in_debug_mode() def set_cstruct(p_env: "uintptr_t", p_struct: "void *") -> "void": return _sicpynumerics.set_cstruct(p_env, p_struct)
[docs] class CSparseMatrix_factors(object): r""" Information used and produced by CSparse for an LU factorization""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr n = property(_sicpynumerics.CSparseMatrix_factors_n_get, _sicpynumerics.CSparseMatrix_factors_n_set, doc=r""" size of linear system""") S = property(_sicpynumerics.CSparseMatrix_factors_S_get, _sicpynumerics.CSparseMatrix_factors_S_set, doc=r""" symbolic analysis""") N = property(_sicpynumerics.CSparseMatrix_factors_N_get, _sicpynumerics.CSparseMatrix_factors_N_set, doc=r""" numerics factorization""") def __init__(self): _sicpynumerics.CSparseMatrix_factors_swiginit(self, _sicpynumerics.new_CSparseMatrix_factors()) __swig_destroy__ = _sicpynumerics.delete_CSparseMatrix_factors
# Register CSparseMatrix_factors in _sicpynumerics: _sicpynumerics.CSparseMatrix_factors_swigregister(CSparseMatrix_factors) cvar = _sicpynumerics.cvar
[docs] def CSparseMatrix_lu_factorization(order: "long", A: "CSparseMatrix const *", tol: "double", cs_lu_A: "CSparseMatrix_factors") -> "int": r""" compute a LU factorization of A and store it in a workspace :type order: int :param order: control if ordering is used :type A: CSparseMatrix :param A: the sparse matrix :type tol: float :param tol: the tolerance :type cs_lu_A: :py:class:`CSparseMatrix_factors` :param cs_lu_A: the parameter structure that eventually holds the factors :rtype: int :return: 1 if the factorization was successful, 1 otherwise """ return _sicpynumerics.CSparseMatrix_lu_factorization(order, A, tol, cs_lu_A)
[docs] def CSparseMatrix_chol_factorization(order: "long", A: "CSparseMatrix const *", cs_chol_A: "CSparseMatrix_factors") -> "int": r""" compute a Cholesky factorization of A and store it in a workspace :type order: int :param order: control if ordering is used :type A: CSparseMatrix :param A: the sparse matrix :type cs_chol_A: :py:class:`CSparseMatrix_factors` :param cs_chol_A: the parameter structure that eventually holds the factors :rtype: int :return: 1 if the factorization was successful, 1 otherwise """ return _sicpynumerics.CSparseMatrix_chol_factorization(order, A, cs_chol_A)
[docs] def CSparseMatrix_ldlt_factorization(order: "long", A: "CSparseMatrix const *", cs_ldlt_A: "CSparseMatrix_factors") -> "int": r""" compute a LDLT factorization of A and store it in a workspace :type order: int :param order: control if ordering is used :type A: CSparseMatrix :param A: the sparse matrix :type cs_ldlt_A: :py:class:`CSparseMatrix_factors` :param cs_ldlt_A: the parameter structure that eventually holds the factors :rtype: int :return: 1 if the factorization was successful, 1 otherwise """ return _sicpynumerics.CSparseMatrix_ldlt_factorization(order, A, cs_ldlt_A)
[docs] def CSparseMatrix_solve(cs_lu_A: "CSparseMatrix_factors", x: "double *", b: "double *") -> "long": r""" reuse a LU factorization (stored in the cs_lu_A) to solve a linear system Ax = b :type cs_lu_A: :py:class:`CSparseMatrix_factors` :param cs_lu_A: contains the LU factors of A, permutation information :type x: float :param x: workspace :type b: float, in/out :param b: on input RHS of the linear system; on output the solution :rtype: int :return: 0 if failed, 1 otherwise """ return _sicpynumerics.CSparseMatrix_solve(cs_lu_A, x, b)
[docs] def CSparseMatrix_spsolve(cs_lu_A: "CSparseMatrix_factors", X: "CSparseMatrix *", B: "CSparseMatrix *") -> "long": r""" reuse a LU factorization (stored in the cs_lu_A) to solve a linear system Ax = B with a sparse r.h.s :type cs_lu_A: :py:class:`CSparseMatrix_factors` :param cs_lu_A: contains the LU factors of A, permutation information :type X: CSparseMatrix :param X: a csc sparse matrix workspace :type B: CSparseMatrix, in/out :param B: on input sparse RHS of the linear system; on output the solution :rtype: int :return: 0 if failed, 1 otherwise """ return _sicpynumerics.CSparseMatrix_spsolve(cs_lu_A, X, B)
[docs] def CSparseMatrix_chol_solve(cs_chol_A: "CSparseMatrix_factors", x: "double *", b: "double *") -> "long": r""" reuse a Cholesky factorization (stored in the cs_chol_A) to solve a linear system Ax = b :type cs_chol_A: :py:class:`CSparseMatrix_factors` :param cs_chol_A: contains the Cholesky factors of A, permutation information :type x: float :param x: workspace :type b: float, in/out :param b: on input RHS of the linear system; on output the solution :rtype: int :return: 0 if failed, 1 otherwise """ return _sicpynumerics.CSparseMatrix_chol_solve(cs_chol_A, x, b)
[docs] def CSparseMatrix_chol_spsolve(cs_chol_A: "CSparseMatrix_factors", X: "CSparseMatrix *", B: "CSparseMatrix *") -> "long": r""" reuse a Cholesky factorization (stored in the cs_chol_A) to solve a linear system Ax = B with a sparse r.h.s :type cs_chol_A: :py:class:`CSparseMatrix_factors` :param cs_chol_A: contains the Cholesky factors of A, permutation information :type X: CSparseMatrix :param X: a csc sparse matrix workspace :param b: on input sparse RHS of the linear system; on output the solution :rtype: int :return: 0 if failed, 1 otherwise """ return _sicpynumerics.CSparseMatrix_chol_spsolve(cs_chol_A, X, B)
[docs] def CSparseMatrix_ldlt_solve(cs_ldlt_A: "CSparseMatrix_factors", x: "double *", b: "double *") -> "long": r""" reuse a LDLT factorization (stored in the cs_ldlt_A) to solve a linear system Ax = b :type cs_ldlt_A: :py:class:`CSparseMatrix_factors` :param cs_ldlt_A: contains the LDLT factors of A, permutation information :type x: float :param x: workspace :type b: float, in/out :param b: on input RHS of the linear system; on output the solution :rtype: int :return: 0 if failed, 1 otherwise """ return _sicpynumerics.CSparseMatrix_ldlt_solve(cs_ldlt_A, x, b)
[docs] def CSparseMatrix_free_lu_factors(cs_lu_A: "CSparseMatrix_factors") -> "void": r""" Free a workspace related to a LU factorization :type cs_lu_A: :py:class:`CSparseMatrix_factors` :param cs_lu_A: the structure to free """ return _sicpynumerics.CSparseMatrix_free_lu_factors(cs_lu_A)
[docs] def CSparseMatrix_aaxpby(alpha: "double const", A: "CSparseMatrix const *", x: "double const *", beta: "double const", y: "double *") -> "int": r""" Matrix vector multiplication : y = alpha*A*x+beta*y :type alpha: float, in :param alpha: matrix coefficient :type A: CSparseMatrix, in :param A: the sparse matrix :type x: float, in :param x: pointer on a dense vector of size A->n :type beta: float, in :param beta: vector coefficient :param out]: y pointer on a dense vector of size A->n :rtype: int :return: 0 if A x or y is NULL else 1 """ return _sicpynumerics.CSparseMatrix_aaxpby(alpha, A, x, beta, y)
[docs] def CSparseMatrix_alloc_for_copy(m: "CSparseMatrix const *const") -> "CSparseMatrix *": r""" Allocate a CSparse matrix for future copy (as in NSM_copy) :type m: CSparseMatrix :param m: the matrix used as model :rtype: CSparseMatrix :return: an newly allocated matrix """ return _sicpynumerics.CSparseMatrix_alloc_for_copy(m)
def CSparseMatrix_to_dense(A: "CSparseMatrix const *const", B: "double *") -> "long": return _sicpynumerics.CSparseMatrix_to_dense(A, B)
[docs] def CSparseMatrix_print(A: "CSparseMatrix const *", brief: "int") -> "int": r""" print a matrix to std output :type A: CSparseMatrix :param A: matrix to print :type brief: int :param brief: if positive, print only a portion of the matrix """ return _sicpynumerics.CSparseMatrix_print(A, brief)
[docs] def CSparseMatrix_print_in_file(A: "CSparseMatrix const *", brief: "int", file: "FILE *") -> "int": r""" print a matrix to a text file :type A: CSparseMatrix :param A: matrix to print :type brief: int :param brief: if positive, print only a portion of the matrix :type file: FILE :param file: file descriptor """ return _sicpynumerics.CSparseMatrix_print_in_file(A, brief, file)
def CSparseMatrix_print_in_Matlab_file(A: "CSparseMatrix const *", brief: "int", file: "FILE *") -> "int": return _sicpynumerics.CSparseMatrix_print_in_Matlab_file(A, brief, file) def CSparseMatrix_new_from_file(file: "FILE *") -> "CSparseMatrix *": return _sicpynumerics.CSparseMatrix_new_from_file(file)
[docs] def CSparseMatrix_zentry(T: "CSparseMatrix *", i: "long", j: "long", x: "double", threshold: "double") -> "long": r""" Add an entry to a triplet matrix only if the absolute value is greater than threshold :type T: CSparseMatrix :param T: the sparse matrix :type i: int :param i: row index :type j: int :param j: column index :type x: float :param x: the value :rtype: int :return: integer value : 1 if the absolute value is less than DBL_EPSILON, otherwise the return value of cs_entry. """ return _sicpynumerics.CSparseMatrix_zentry(T, i, j, x, threshold)
def CSparseMatrix_block_dense_zentry(T: "CSparseMatrix *", row_off: "long", col_off: "long", x: "double *", row_size: "long", col_size: "long", threshold: "double") -> "long": return _sicpynumerics.CSparseMatrix_block_dense_zentry(T, row_off, col_off, x, row_size, col_size, threshold)
[docs] def CSparseMatrix_symmetric_zentry(T: "CSparseMatrix *", i: "long", j: "long", x: "double", threshold: "double") -> "long": r""" Add an entry to a symmetric triplet matrix only if the absolute value is greater than threshold :type T: CSparseMatrix :param T: the sparse matrix :type i: int :param i: row index :type j: int :param j: column index :type x: float :param x: the value :rtype: int :return: integer value : 1 if the absolute value is less than DBL_EPSILON, otherwise the return value of cs_entry. """ return _sicpynumerics.CSparseMatrix_symmetric_zentry(T, i, j, x, threshold)
[docs] def CSparseMatrix_entry(T: "CSparseMatrix *", i: "long", j: "long", x: "double") -> "long": r""" Add an entry to a triplet matrix :type T: CSparseMatrix :param T: the sparse matrix :type i: int :param i: row index :type j: int :param j: column index :type x: float :param x: the value """ return _sicpynumerics.CSparseMatrix_entry(T, i, j, x)
[docs] def CSparseMatrix_symmetric_entry(T: "CSparseMatrix *", i: "long", j: "long", x: "double") -> "long": r""" Add an entry to a symmetric triplet matrix :type T: CSparseMatrix :param T: the sparse matrix :type i: int :param i: row index :type j: int :param j: column index :type x: float :param x: the value """ return _sicpynumerics.CSparseMatrix_symmetric_entry(T, i, j, x)
[docs] def CSparseMatrix_check_triplet(T: "CSparseMatrix *") -> "int": r""" Check if the given triplet matrix is properly constructed (col and row indices are correct) :type T: CSparseMatrix :param T: the sparse matrix to check :rtype: int :return: 0 if the matrix is fine, 1 otherwise """ return _sicpynumerics.CSparseMatrix_check_triplet(T)
[docs] def CSparseMatrix_check_csc(T: "CSparseMatrix *") -> "int": r""" Check if the given triplet matrix is properly constructed (col and row indices are correct) :type T: CSparseMatrix :param T: the sparse matrix to check :rtype: int :return: 0 if the matrix is fine, 1 otherwise """ return _sicpynumerics.CSparseMatrix_check_csc(T)
[docs] def CSparseMatrix_spfree_on_stack(A: "CSparseMatrix *") -> "CSparseMatrix *": r""" Free space allocated for a SparseMatrix. note : cs_spfree also free the cs_struct this fails when the struct is allocated on the stack. :type A: CSparseMatrix :param A: the sparse matrix :rtype: CSparseMatrix :return: NULL on success """ return _sicpynumerics.CSparseMatrix_spfree_on_stack(A)
[docs] def CSparseMatrix_copy(A: "CSparseMatrix const *const", B: "CSparseMatrix *") -> "void": r""" Copy a CSparseMatrix inside another CSparseMatrix. Reallocations are performed if B cannot hold a copy of A :type A: CSparseMatrix, in :param A: a CSparseMatrix :type B: CSparseMatrix, in/out :param B: a CSparseMatrix """ return _sicpynumerics.CSparseMatrix_copy(A, B)
[docs] def CSparseMatrix_scal(alpha: "double const", A: "CSparseMatrix const *") -> "int": r""" Multiply a matrix with a double alpha*A --> A :type alpha: float :param alpha: the coefficient :type A: CSparseMatrix :param A: the matrix """ return _sicpynumerics.CSparseMatrix_scal(alpha, A)
[docs] def CSparseMatrix_get_value(A: "CSparseMatrix const *", i: "long", j: "long") -> "double": r""" Return the element A(i,j) :type A: CSparseMatrix :param A: the sparse matrix :type i: int :param i: the row index :type j: int :param j: the column index """ return _sicpynumerics.CSparseMatrix_get_value(A, i, j)
[docs] def CSparseMatrix_write_in_file_python(m: "CSparseMatrix const *const", file: "FILE *") -> "void": r""" print a matrix to a text file in pyhton format :type m: CSparseMatrix :param m: matrix to print :type file: FILE :param file: file descriptor """ return _sicpynumerics.CSparseMatrix_write_in_file_python(m, file)
[docs] def CSparseMatrix_max_by_columns(A: "CSparseMatrix const *", max: "double *") -> "int": r""" Compute the max by columns of a sparse matrix :type A: CSparseMatrix :param A: the sparse matrix :type max: float :param max: the vector of maximum by columns :param j: the column index """ return _sicpynumerics.CSparseMatrix_max_by_columns(A, max)
[docs] def CSparseMatrix_max_abs_by_columns(A: "CSparseMatrix const *", max: "double *") -> "int": r""" Compute the max in absolute value by columns of a sparse matrix :type A: CSparseMatrix :param A: the sparse matrix :type max: float :param max: the vector of maximum by columns :param j: the column index """ return _sicpynumerics.CSparseMatrix_max_abs_by_columns(A, max)
[docs] class SparseBlockStructuredMatrix(object): r""" Structure to store sparse block matrices with square diagonal blocks. :param nbblocks: the total number of non null blocks :param **block: : *block contains the double values of one block in Fortran storage (column by column) **block is the list of non null blocks :param blocknumber0: the first dimension of the block matrix (number of block rows) :param blocknumber1: the second dimension of the block matrix (number of block columns) :param *blocksize0: the list of sums of the number of rows of the first column of blocks of M: blocksize0[i] = blocksize0[i-1] + ni, ni being the number of rows of the block at row i :param *blocksize1: the list of sums of the number of columns of the first row of blocks of M: blocksize1[i] = blocksize1[i-1] + ni, ni being the number of columns of the block at column i :param filled1: index of the last non empty line + 1 :param filled2: number of non null blocks :param index1_data: index1_data is of size equal to number of non empty lines + 1. A block with number blockNumber inside a row numbered rowNumber verify index1_data[rowNumber]<= blockNumber <index1_data[rowNumber+1]` :param index2_data: index2_data is of size filled2 index2_data[blockNumber] -> columnNumber. Related functions: SBM_gemv(), SBM_row_prod(), SBM_clear(), SBM_print, SBM_diagonal_block_index() Note: the sparse format is the same as the one used by Boost C++ library to store compressed sparse row matrices. The same member names have been adopted in order to simplify usage from Siconos Kernel : filled1, filled2, index1_data, index2_data. Reference : http://ublas.sourceforge.net/refdoc/classboost_1_1numeric_1_1ublas_1_1compressed__matrix.html If we consider the matrix M and the right-hand-side q defined as .. math:: M=\left[\begin{array}{cccc|cc|cc} 1 & 2 & 0 & 4 & 3 &-1 & 0 & 0 \\ 2 & 1 & 0 & 0 & 4 & 1 & 0 & 0 \\ 0 & 0 & 1 &-1 & 0 & 0 & 0 & 0 \\ 5 & 0 &-1 & 6 & 0 & 6 & 0 & 0 \\ \hline 0 & 0 & 0 & 0 & 1 & 0 & 0 & 5 \\ 0 & 0 & 0 & 0 & 0 & 2 & 0 & 2 \\ \hline 0 & 0 & 2 & 1 & 0 & 0 & 2 & 2 \\ 0 & 0 & 2 & 2 & 0 & 0 & -1 & 2 \\ \end{array}\right] \quad, q=\left[\begin{array}{c}-1 \\ -1 \\ 0 \\ -1 \\ \hline 1 \\ 0 \\ \hline -1 \\ 2 \end{array}\right]. then - the number of non null blocks is 6 (nbblocks=6) - the number of rows of blocks is 3 (blocknumber0 =3) and the number of columns of blocks is 3 (blocknumber1 =3) - the vector blocksize0 is equal to {4,6,8} and the vector blocksize1 is equal to {4,6,8} - the integer filled1 is equal to 4 - the integer filled2 is equal to 6 - the vector index1_data is equal to {0,2,4,6} - the vector index2_data is equal to {0,1,1,2,0,2} - the block contains all non null block matrices stored in Fortran order (column by column) as block[0] = {1,2,0,5,2,1,0,0,0,0,1,-1,4,0,-1,6} block[1] = {3,4,0,0,-1,1,0,6} ... block[5] = {2,-1,2,2} """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr nbblocks = property(_sicpynumerics.SparseBlockStructuredMatrix_nbblocks_get, _sicpynumerics.SparseBlockStructuredMatrix_nbblocks_set) block = property(_sicpynumerics.SparseBlockStructuredMatrix_block_get, _sicpynumerics.SparseBlockStructuredMatrix_block_set) blocknumber0 = property(_sicpynumerics.SparseBlockStructuredMatrix_blocknumber0_get, _sicpynumerics.SparseBlockStructuredMatrix_blocknumber0_set) blocknumber1 = property(_sicpynumerics.SparseBlockStructuredMatrix_blocknumber1_get, _sicpynumerics.SparseBlockStructuredMatrix_blocknumber1_set) blocksize0 = property(_sicpynumerics.SparseBlockStructuredMatrix_blocksize0_get, _sicpynumerics.SparseBlockStructuredMatrix_blocksize0_set) blocksize1 = property(_sicpynumerics.SparseBlockStructuredMatrix_blocksize1_get, _sicpynumerics.SparseBlockStructuredMatrix_blocksize1_set) filled1 = property(_sicpynumerics.SparseBlockStructuredMatrix_filled1_get, _sicpynumerics.SparseBlockStructuredMatrix_filled1_set) filled2 = property(_sicpynumerics.SparseBlockStructuredMatrix_filled2_get, _sicpynumerics.SparseBlockStructuredMatrix_filled2_set) index1_data = property(_sicpynumerics.SparseBlockStructuredMatrix_index1_data_get, _sicpynumerics.SparseBlockStructuredMatrix_index1_data_set) index2_data = property(_sicpynumerics.SparseBlockStructuredMatrix_index2_data_get, _sicpynumerics.SparseBlockStructuredMatrix_index2_data_set) diagonal_blocks = property(_sicpynumerics.SparseBlockStructuredMatrix_diagonal_blocks_get, _sicpynumerics.SparseBlockStructuredMatrix_diagonal_blocks_set) version = property(_sicpynumerics.SparseBlockStructuredMatrix_version_get, _sicpynumerics.SparseBlockStructuredMatrix_version_set, doc=r""" version of storage""") __swig_destroy__ = _sicpynumerics.delete_SparseBlockStructuredMatrix def __init__(self): _sicpynumerics.SparseBlockStructuredMatrix_swiginit(self, _sicpynumerics.new_SparseBlockStructuredMatrix())
# Register SparseBlockStructuredMatrix in _sicpynumerics: _sicpynumerics.SparseBlockStructuredMatrix_swigregister(SparseBlockStructuredMatrix) class SparseBlockCoordinateMatrix(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr nbblocks = property(_sicpynumerics.SparseBlockCoordinateMatrix_nbblocks_get, _sicpynumerics.SparseBlockCoordinateMatrix_nbblocks_set, doc=r""" number of blocks""") blocknumber0 = property(_sicpynumerics.SparseBlockCoordinateMatrix_blocknumber0_get, _sicpynumerics.SparseBlockCoordinateMatrix_blocknumber0_set, doc=r""" number of rows""") blocknumber1 = property(_sicpynumerics.SparseBlockCoordinateMatrix_blocknumber1_get, _sicpynumerics.SparseBlockCoordinateMatrix_blocknumber1_set, doc=r""" number of columns""") block = property(_sicpynumerics.SparseBlockCoordinateMatrix_block_get, _sicpynumerics.SparseBlockCoordinateMatrix_block_set, doc=r""" block pointers""") blocksize0 = property(_sicpynumerics.SparseBlockCoordinateMatrix_blocksize0_get, _sicpynumerics.SparseBlockCoordinateMatrix_blocksize0_set, doc=r""" cumulative number of rows in blocks""") blocksize1 = property(_sicpynumerics.SparseBlockCoordinateMatrix_blocksize1_get, _sicpynumerics.SparseBlockCoordinateMatrix_blocksize1_set, doc=r""" cumulative number of columns in blocks""") row = property(_sicpynumerics.SparseBlockCoordinateMatrix_row_get, _sicpynumerics.SparseBlockCoordinateMatrix_row_set, doc=r""" row indices""") column = property(_sicpynumerics.SparseBlockCoordinateMatrix_column_get, _sicpynumerics.SparseBlockCoordinateMatrix_column_set, doc=r""" column indices""") def __init__(self): _sicpynumerics.SparseBlockCoordinateMatrix_swiginit(self, _sicpynumerics.new_SparseBlockCoordinateMatrix()) __swig_destroy__ = _sicpynumerics.delete_SparseBlockCoordinateMatrix # Register SparseBlockCoordinateMatrix in _sicpynumerics: _sicpynumerics.SparseBlockCoordinateMatrix_swigregister(SparseBlockCoordinateMatrix) class SparseBlockStructuredMatrixPred(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr nbbldiag = property(_sicpynumerics.SparseBlockStructuredMatrixPred_nbbldiag_get, _sicpynumerics.SparseBlockStructuredMatrixPred_nbbldiag_set) indic = property(_sicpynumerics.SparseBlockStructuredMatrixPred_indic_get, _sicpynumerics.SparseBlockStructuredMatrixPred_indic_set) indicop = property(_sicpynumerics.SparseBlockStructuredMatrixPred_indicop_get, _sicpynumerics.SparseBlockStructuredMatrixPred_indicop_set) submatlcp = property(_sicpynumerics.SparseBlockStructuredMatrixPred_submatlcp_get, _sicpynumerics.SparseBlockStructuredMatrixPred_submatlcp_set) submatlcpop = property(_sicpynumerics.SparseBlockStructuredMatrixPred_submatlcpop_get, _sicpynumerics.SparseBlockStructuredMatrixPred_submatlcpop_set) ipiv = property(_sicpynumerics.SparseBlockStructuredMatrixPred_ipiv_get, _sicpynumerics.SparseBlockStructuredMatrixPred_ipiv_set) sizesublcp = property(_sicpynumerics.SparseBlockStructuredMatrixPred_sizesublcp_get, _sicpynumerics.SparseBlockStructuredMatrixPred_sizesublcp_set) sizesublcpop = property(_sicpynumerics.SparseBlockStructuredMatrixPred_sizesublcpop_get, _sicpynumerics.SparseBlockStructuredMatrixPred_sizesublcpop_set) subq = property(_sicpynumerics.SparseBlockStructuredMatrixPred_subq_get, _sicpynumerics.SparseBlockStructuredMatrixPred_subq_set) bufz = property(_sicpynumerics.SparseBlockStructuredMatrixPred_bufz_get, _sicpynumerics.SparseBlockStructuredMatrixPred_bufz_set) newz = property(_sicpynumerics.SparseBlockStructuredMatrixPred_newz_get, _sicpynumerics.SparseBlockStructuredMatrixPred_newz_set) workspace = property(_sicpynumerics.SparseBlockStructuredMatrixPred_workspace_get, _sicpynumerics.SparseBlockStructuredMatrixPred_workspace_set) def __init__(self): _sicpynumerics.SparseBlockStructuredMatrixPred_swiginit(self, _sicpynumerics.new_SparseBlockStructuredMatrixPred()) __swig_destroy__ = _sicpynumerics.delete_SparseBlockStructuredMatrixPred # Register SparseBlockStructuredMatrixPred in _sicpynumerics: _sicpynumerics.SparseBlockStructuredMatrixPred_swigregister(SparseBlockStructuredMatrixPred) class SBM_index_by_column(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr filled3 = property(_sicpynumerics.SBM_index_by_column_filled3_get, _sicpynumerics.SBM_index_by_column_filled3_set) filled4 = property(_sicpynumerics.SBM_index_by_column_filled4_get, _sicpynumerics.SBM_index_by_column_filled4_set) index3_data = property(_sicpynumerics.SBM_index_by_column_index3_data_get, _sicpynumerics.SBM_index_by_column_index3_data_set) index4_data = property(_sicpynumerics.SBM_index_by_column_index4_data_get, _sicpynumerics.SBM_index_by_column_index4_data_set) blockMap = property(_sicpynumerics.SBM_index_by_column_blockMap_get, _sicpynumerics.SBM_index_by_column_blockMap_set) def __init__(self): _sicpynumerics.SBM_index_by_column_swiginit(self, _sicpynumerics.new_SBM_index_by_column()) __swig_destroy__ = _sicpynumerics.delete_SBM_index_by_column # Register SBM_index_by_column in _sicpynumerics: _sicpynumerics.SBM_index_by_column_swigregister(SBM_index_by_column) NUMERICS_SBM_FREE_BLOCK = _sicpynumerics.NUMERICS_SBM_FREE_BLOCK NUMERICS_SBM_FREE_SBM = _sicpynumerics.NUMERICS_SBM_FREE_SBM
[docs] def SBM_new() -> "SparseBlockStructuredMatrix *": r""" Creation of an empty Sparse Block Matrix. :rtype: :py:class:`SparseBlockStructuredMatrix` :return: a pointer on allocated and initialized space """ return _sicpynumerics.SBM_new()
[docs] def SBM_null(sbm: "SparseBlockStructuredMatrix") -> "void": r""" set Sparse Block Matrix. fields to NULL :type sbm: :py:class:`SparseBlockStructuredMatrix` :param sbm: a matrix """ return _sicpynumerics.SBM_null(sbm)
[docs] def SBM_gemv(sizeX: "unsigned int", sizeY: "unsigned int", alpha: "double", A: "SparseBlockStructuredMatrix", x: "double const *", beta: "double", y: "double *") -> "void": r""" SparseMatrix - vector product y = alpha*A*x + beta*y :type sizeX: int, in :param sizeX: dim of the vectors x :type sizeY: int, in :param sizeY: dim of the vectors y :type alpha: float, in :param alpha: coefficient :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the matrix to be multiplied :type x: float, in :param x: the vector to be multiplied :type beta: float, in :param beta: coefficient :type y: float, in/out :param y: the resulting vector """ return _sicpynumerics.SBM_gemv(sizeX, sizeY, alpha, A, x, beta, y)
[docs] def SBM_gemv_3x3(sizeX: "unsigned int", sizeY: "unsigned int", A: "SparseBlockStructuredMatrix", x: "double *const", y: "double *") -> "void": r""" SparseMatrix - vector product y = A*x + y for block of size 3x3 :type sizeX: int, in :param sizeX: dim of the vectors x :type sizeY: int, in :param sizeY: dim of the vectors y :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the matrix to be multiplied :type x: double, in :param x: the vector to be multiplied :type y: float, in/out :param y: the resulting vector """ return _sicpynumerics.SBM_gemv_3x3(sizeX, sizeY, A, x, y)
[docs] def SBM_gemm_without_allocation(alpha: "double", A: "SparseBlockStructuredMatrix", B: "SparseBlockStructuredMatrix", beta: "double", C: "SparseBlockStructuredMatrix") -> "void": r""" SparseBlockStructuredMatrix - SparseBlockStructuredMatrix product C = alpha*A*B + beta*C The routine has to be used with precaution. The allocation of C is not done since we want to add beta*C. We assume that the structure and the allocation of the matrix C are right. Especially: - the blocks C(i,j) must exists - the sizes of blocks must be consistent - no extra block must be present in C :type alpha: float, in :param alpha: coefficient :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the matrix to be multiplied :type B: :py:class:`SparseBlockStructuredMatrix`, in :param B: the matrix to be multiplied :type beta: float, in :param beta: coefficient :type C: :py:class:`SparseBlockStructuredMatrix`, in/out :param C: the resulting matrix """ return _sicpynumerics.SBM_gemm_without_allocation(alpha, A, B, beta, C)
[docs] def SBM_multiply(A: "SparseBlockStructuredMatrix", B: "SparseBlockStructuredMatrix") -> "SparseBlockStructuredMatrix *": r""" SparseBlockStructuredMatrix - SparseBlockStructuredMatrix multiplication C = A *B Correct allocation is performed :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the matrix to be multiplied :type B: :py:class:`SparseBlockStructuredMatrix`, in :param B: the matrix to be multiplied :rtype: :py:class:`SparseBlockStructuredMatrix` :return: C the resulting matrix """ return _sicpynumerics.SBM_multiply(A, B)
[docs] def SBM_zero_matrix_for_multiply(A: "SparseBlockStructuredMatrix", B: "SparseBlockStructuredMatrix") -> "SparseBlockStructuredMatrix *": r""" Perform the allocation of a zero matrix that is compatible qith multiplication""" return _sicpynumerics.SBM_zero_matrix_for_multiply(A, B)
[docs] def SBM_add(A: "SparseBlockStructuredMatrix", B: "SparseBlockStructuredMatrix", alpha: "double", beta: "double") -> "SparseBlockStructuredMatrix *": r""" SparseBlockStructuredMatrix - SparseBlockStructuredMatrix addition C = alpha*A + beta*B :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the matrix to be added :type B: :py:class:`SparseBlockStructuredMatrix`, in :param B: the matrix to be added :type alpha: float, in :param alpha: coefficient :type beta: float, in :param beta: coefficient :rtype: :py:class:`SparseBlockStructuredMatrix` :return: C the resulting matrix """ return _sicpynumerics.SBM_add(A, B, alpha, beta)
[docs] def SBM_add_without_allocation(A: "SparseBlockStructuredMatrix", B: "SparseBlockStructuredMatrix", alpha: "double", beta: "double", C: "SparseBlockStructuredMatrix", gamma: "double") -> "void": r""" SparseBlockStructuredMatrix - SparseBlockStructuredMatrix addition C = alpha*A + beta*B + gamma*C without allocation. We assume that C has the correct structure :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the matrix to be added :type B: :py:class:`SparseBlockStructuredMatrix`, in :param B: the matrix to be added :type alpha: float, in :param alpha: coefficient :type beta: float, in :param beta: coefficient :type gamma: float, in :param gamma: coefficient :type C: :py:class:`SparseBlockStructuredMatrix`, in/out :param C: the resulting matrix """ return _sicpynumerics.SBM_add_without_allocation(A, B, alpha, beta, C, gamma)
[docs] def SBM_scal(alpha: "double", A: "SparseBlockStructuredMatrix") -> "void": r""" Multiply a matrix with a double alpha*A --> A :type alpha: float :param alpha: the coefficient :type A: :py:class:`SparseBlockStructuredMatrix` :param A: the matrix """ return _sicpynumerics.SBM_scal(alpha, A)
[docs] def SBM_row_prod(sizeX: "unsigned int", sizeY: "unsigned int", currentRowNumber: "unsigned int", A: "SparseBlockStructuredMatrix", x: "double const *const", y: "double *", init: "int") -> "void": r""" Row of a SparseMatrix - vector product y = rowA*x or y += rowA*x, rowA being a row of blocks of A :type sizeX: int, in :param sizeX: dim of the vector x :type sizeY: int, in :param sizeY: dim of the vector y :type currentRowNumber: int, in :param currentRowNumber: number of the required row of blocks :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the matrix to be multiplied :type x: double, in :param x: the vector to be multiplied :type y: float, in/out :param y: the resulting vector :type init: int, in :param init: = 0 for y += Ax, =1 for y = Ax """ return _sicpynumerics.SBM_row_prod(sizeX, sizeY, currentRowNumber, A, x, y, init)
[docs] def SBM_row_prod_no_diag(sizeX: "unsigned int", sizeY: "unsigned int", currentRowNumber: "unsigned int", A: "SparseBlockStructuredMatrix", x: "double const *const", y: "double *", init: "int") -> "void": r""" Row of a SparseMatrix - vector product y = rowA*x or y += rowA*x, rowA being a row of blocks of A :type sizeX: int, in :param sizeX: dim of the vector x :type sizeY: int, in :param sizeY: dim of the vector y :type currentRowNumber: int, in :param currentRowNumber: number of the required row of blocks :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the matrix to be multiplied :type x: double, in :param x: the vector to be multiplied :type y: float, in/out :param y: the resulting vector :type init: int, in :param init: = 0 for y += Ax, =1 for y = Ax """ return _sicpynumerics.SBM_row_prod_no_diag(sizeX, sizeY, currentRowNumber, A, x, y, init)
[docs] def SBM_row_prod_no_diag_3x3(sizeX: "unsigned int", sizeY: "unsigned int", currentRowNumber: "unsigned int", A: "SparseBlockStructuredMatrix", x: "double *const", y: "double *") -> "void": r""" Row of a SparseMatrix - vector product y = rowA*x or y += rowA*x, rowA being a row of blocks of A of size 3x3 :type sizeX: int, in :param sizeX: dim of the vector x :type sizeY: int, in :param sizeY: dim of the vector y :type currentRowNumber: int, in :param currentRowNumber: number of the required row of blocks :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the matrix to be multiplied :type x: double, in :param x: the vector to be multiplied :type y: float, in/out :param y: the resulting vector """ return _sicpynumerics.SBM_row_prod_no_diag_3x3(sizeX, sizeY, currentRowNumber, A, x, y)
def SBM_row_prod_no_diag_2x2(sizeX: "unsigned int", sizeY: "unsigned int", currentRowNumber: "unsigned int", A: "SparseBlockStructuredMatrix", x: "double *const", y: "double *") -> "void": return _sicpynumerics.SBM_row_prod_no_diag_2x2(sizeX, sizeY, currentRowNumber, A, x, y) def SBM_row_prod_no_diag_1x1(sizeX: "unsigned int", sizeY: "unsigned int", currentRowNumber: "unsigned int", A: "SparseBlockStructuredMatrix", x: "double *const", y: "double *") -> "void": return _sicpynumerics.SBM_row_prod_no_diag_1x1(sizeX, sizeY, currentRowNumber, A, x, y) def SBM_extract_component_3x3(A: "SparseBlockStructuredMatrix", B: "SparseBlockStructuredMatrix", row_components: "unsigned int *", row_components_size: "unsigned int", col_components: "unsigned int *", col_components_size: "unsigned int") -> "void": return _sicpynumerics.SBM_extract_component_3x3(A, B, row_components, row_components_size, col_components, col_components_size)
[docs] def SBM_clear(blmat: "SparseBlockStructuredMatrix") -> "void": r""" Destructor for SparseBlockStructuredMatrix objects :type blmat: :py:class:`SparseBlockStructuredMatrix` :param blmat: SparseBlockStructuredMatrix the matrix to be destroyed. """ return _sicpynumerics.SBM_clear(blmat)
[docs] def SBMfree(A: "SparseBlockStructuredMatrix", level: "unsigned int") -> "void": r""" To free a SBM matrix (for example allocated by NM_new_from_file). :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the SparseBlockStructuredMatrix that mus be de-allocated. :type level: int, in :param level: use NUMERICS_SBM_FREE_BLOCK | NUMERICS_SBM_FREE_SBM """ return _sicpynumerics.SBMfree(A, level)
[docs] def SBM_print(m: "SparseBlockStructuredMatrix") -> "void": r""" Screen display of the matrix content :type m: :py:class:`SparseBlockStructuredMatrix` :param m: the matrix to be displayed """ return _sicpynumerics.SBM_print(m)
[docs] def SBM_write_in_file(m: "SparseBlockStructuredMatrix", file: "FILE *") -> "void": r""" print in file of the matrix content :type m: :py:class:`SparseBlockStructuredMatrix` :param m: the matrix to be displayed :type file: FILE :param file: the corresponding file """ return _sicpynumerics.SBM_write_in_file(m, file)
[docs] def SBM_read_in_file(M: "SparseBlockStructuredMatrix", file: "FILE *") -> "void": r""" read in file of the matrix content without performing memory allocation :type M: :py:class:`SparseBlockStructuredMatrix` :param M: the matrix to be displayed :type file: FILE :param file: the corresponding name of the file """ return _sicpynumerics.SBM_read_in_file(M, file)
[docs] def SBM_new_from_file(file: "FILE *") -> "SparseBlockStructuredMatrix *": r""" Create from file a SparseBlockStructuredMatrix with memory allocation :type file: FILE :param file: the corresponding name of the file :rtype: :py:class:`SparseBlockStructuredMatrix` :return: the matrix to be displayed """ return _sicpynumerics.SBM_new_from_file(file)
[docs] def SBM_write_in_fileForScilab(M: "SparseBlockStructuredMatrix", file: "FILE *") -> "void": r""" print in file of the matrix content in Scilab format for each block :type M: :py:class:`SparseBlockStructuredMatrix` :param M: the matrix to be displayed :type file: FILE :param file: the corresponding file """ return _sicpynumerics.SBM_write_in_fileForScilab(M, file)
[docs] def SBM_write_in_filename(M: "SparseBlockStructuredMatrix", filename: "char const *") -> "void": r""" print in file of the matrix content :type M: :py:class:`SparseBlockStructuredMatrix` :param M: the matrix to be displayed :type filename: string :param filename: the corresponding file """ return _sicpynumerics.SBM_write_in_filename(M, filename)
[docs] def SBM_read_in_filename(M: "SparseBlockStructuredMatrix", filename: "char const *") -> "void": r""" read in file of the matrix content :type M: :py:class:`SparseBlockStructuredMatrix` :param M: the matrix to be displayed :type filename: string :param filename: the corresponding name of the file """ return _sicpynumerics.SBM_read_in_filename(M, filename)
[docs] def SBM_clear_pred(blmatpred: "SparseBlockStructuredMatrixPred") -> "void": r""" Destructor for SparseBlockStructuredMatrixPred objects :type blmatpred: :py:class:`SparseBlockStructuredMatrixPred` :param blmatpred: SparseBlockStructuredMatrix, the matrix to be destroyed. """ return _sicpynumerics.SBM_clear_pred(blmatpred)
[docs] def SBM_diagonal_block_indices(M: "SparseBlockStructuredMatrix") -> "unsigned int *": r""" Compute the indices of blocks of the diagonal block :type M: :py:class:`SparseBlockStructuredMatrix` :param M: the SparseBlockStructuredMatrix matrix :rtype: int :return: the indices for all the rows """ return _sicpynumerics.SBM_diagonal_block_indices(M)
[docs] def SBM_diagonal_block_index(M: "SparseBlockStructuredMatrix", row: "unsigned int") -> "unsigned int": r""" Find index of the diagonal block in a row :type M: :py:class:`SparseBlockStructuredMatrix` :param M: the SparseBlockStructuredMatrix matrix :type row: int :param row: the row of the required block :rtype: int :return: pos the position of the block """ return _sicpynumerics.SBM_diagonal_block_index(M, row)
[docs] def SBM_entry(M: "SparseBlockStructuredMatrix", row: "unsigned int", col: "unsigned int", val: "double") -> "int": r""" insert an entry into a SparseBlockStructuredMatrix. This method is expensive in terms of memory management. For a lot of entries, use an alternative :type M: :py:class:`SparseBlockStructuredMatrix` :param M: the SparseBlockStructuredMatrix :param i: row index :param j: column index :type val: float :param val: the value to be inserted. """ return _sicpynumerics.SBM_entry(M, row, col, val)
[docs] def SBM_get_value(M: "SparseBlockStructuredMatrix", row: "unsigned int", col: "unsigned int") -> "double": r""" get the element of row i and column j of the matrix M :type M: :py:class:`SparseBlockStructuredMatrix` :param M: the SparseBlockStructuredMatrix matrix :type row: int :param row: the row index :type col: int :param col: the column index :rtype: float :return: the value """ return _sicpynumerics.SBM_get_value(M, row, col)
[docs] def SBM_copy(A: "SparseBlockStructuredMatrix", B: "SparseBlockStructuredMatrix", copyBlock: "unsigned int") -> "int": r""" Copy of a SBM A into B :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the SparseBlockStructuredMatrix matrix to be copied :type B: :py:class:`SparseBlockStructuredMatrix`, out :param B: the SparseBlockStructuredMatrix matrix copy of A :type copyBlock: int, in :param copyBlock: if copyBlock then the content of block are copied, else only the pointers are copied. :rtype: int :return: 0 if ok """ return _sicpynumerics.SBM_copy(A, B, copyBlock)
[docs] def SBM_transpose(A: "SparseBlockStructuredMatrix", B: "SparseBlockStructuredMatrix") -> "int": r""" Transpose by copy of a SBM A into B :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the SparseBlockStructuredMatrix matrix to be copied :type B: :py:class:`SparseBlockStructuredMatrix`, out :param B: the SparseBlockStructuredMatrix matrix copy of transpose A :rtype: int :return: 0 if ok """ return _sicpynumerics.SBM_transpose(A, B)
[docs] def SBM_inverse_diagonal_block_matrix_in_place(M: "SparseBlockStructuredMatrix", ipiv: "int *") -> "int": r""" Inverse (in place) a square diagonal block matrix :type M: :py:class:`SparseBlockStructuredMatrix`, in/out :param M: the SparseBlockStructuredMatrix matrix to be inversed :type ipiv: int :param ipiv: worksapce for storign ipiv :rtype: int :return: 0 ik ok """ return _sicpynumerics.SBM_inverse_diagonal_block_matrix_in_place(M, ipiv)
[docs] def SBM_to_dense(A: "SparseBlockStructuredMatrix") -> "double *": r""" Copy a SBM into a Dense Matrix :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the SparseBlockStructuredMatrix matrix :type denseMat: float, in :param denseMat: pointer on the filled dense Matrix """ return _sicpynumerics.SBM_to_dense(A)
[docs] def SBM_to_sparse(A: "SparseBlockStructuredMatrix") -> "cs_dl_sparse *": r""" Copy a SBM into a Sparse (CSR) Matrix :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the SparseBlockStructuredMatrix matrix :type outSparseMat: CSparseMatrix, in :param outSparseMat: pointer on the filled sparse Matrix :rtype: int :return: 0 if ok """ return _sicpynumerics.SBM_to_sparse(A)
[docs] def SBM_to_sparse_init_memory(A: "SparseBlockStructuredMatrix", sparseMat: "CSparseMatrix *") -> "int": r""" initMemory of a Sparse (CSR) Matrix form a SBM matrix :type A: :py:class:`SparseBlockStructuredMatrix`, in :param A: the SparseBlockStructuredMatrix matrix :type sparseMat: CSparseMatrix, in :param sparseMat: pointer on the initialized sparse Matrix :rtype: int :return: 0 if ok """ return _sicpynumerics.SBM_to_sparse_init_memory(A, sparseMat)
[docs] def SBM_row_permutation(rowIndex: "unsigned int *", A: "SparseBlockStructuredMatrix", C: "SparseBlockStructuredMatrix") -> "void": r""" :param [in]: rowIndex: permutation: the row numC of C is the row rowIndex[numC] of A. :param [in]: A The source SBM. :param [out]: C The target SBM. It assumes the structure SBM has been allocated. The memory allocation for its menber is done inside. NB : The blocks are not copied. """ return _sicpynumerics.SBM_row_permutation(rowIndex, A, C)
[docs] def SBM_column_permutation(colIndex: "unsigned int *", A: "SparseBlockStructuredMatrix", C: "SparseBlockStructuredMatrix") -> "void": r""" :param [in]: colIndex: permutation: the col numC of C is the col colIndex[numC] of A. :param [in]: A The source SBM. :param [out]: C The target SBM. It assumes the structure SBM has been allocated. The memory allocation for its menber is done inside. NB : The blocks are not copied. """ return _sicpynumerics.SBM_column_permutation(colIndex, A, C)
def SBCM_null(MC: "SparseBlockCoordinateMatrix") -> "void": return _sicpynumerics.SBCM_null(MC) def SBCM_new() -> "SparseBlockCoordinateMatrix *": return _sicpynumerics.SBCM_new()
[docs] def SBCM_new_3x3(m: "unsigned int", n: "unsigned int", nbblocks: "unsigned int", row: "unsigned int *", column: "unsigned int *", block: "double *") -> "SparseBlockCoordinateMatrix *": r""" allocate a SparseBlockCoordinateMatrix from a list of 3x3 blocks :type m: int, in :param m: the number of rows :type n: int, in :param n: the number of colums :type nbblocks: int, in :param nbblocks: the number of blocks :type row: int, in :param row: a pointer to row of each block :type column: int, in :param column: a pointer to column of each block :type block: float, in :param block: a pointer to each block :rtype: :py:class:`SparseBlockCoordinateMatrix` :return: a pointer to a SparseBlockCoordinateMatrix structure """ return _sicpynumerics.SBCM_new_3x3(m, n, nbblocks, row, column, block)
[docs] def SBCM_free_3x3(MC: "SparseBlockCoordinateMatrix") -> "void": r""" free allocated memory in newSparseBlockCoordinateMatrix functions :type MC: :py:class:`SparseBlockCoordinateMatrix`, in :param MC: matrix pointer """ return _sicpynumerics.SBCM_free_3x3(MC)
[docs] def SBCM_to_SBM(MC: "SparseBlockCoordinateMatrix") -> "SparseBlockStructuredMatrix *": r""" copy a SparseBlockCoordinateMatrix to a SparseBlockStructuredMatrix :type MC: :py:class:`SparseBlockCoordinateMatrix`, in :param MC: the SparseBlockCoordinateMatrix matrix :rtype: :py:class:`SparseBlockStructuredMatrix` :return: a pointer to a SparseBlockCoordinateMatrix structure """ return _sicpynumerics.SBCM_to_SBM(MC)
[docs] def SBM_free_from_SBCM(M: "SparseBlockStructuredMatrix") -> "void": r""" free a SparseBlockStructuredMatrix created with SBCM_to_SBM :type M: :py:class:`SparseBlockStructuredMatrix`, in/out :param M: a SparseBlockStructuredMatrix to free """ return _sicpynumerics.SBM_free_from_SBCM(M)
[docs] def SBM_from_csparse(blocksize: "int", sparseMat: "CSparseMatrix const *const") -> "SparseBlockStructuredMatrix *": r""" Copy a Sparse Matrix into a SBM, with fixed blocksize :type blocksize: int, in :param blocksize: the blocksize :type sparseMat: CSparseMatrix, in :param sparseMat: pointer on the Sparse Matrix :type outSBM: :py:class:`SparseBlockStructuredMatrix`, in/out :param outSBM: pointer on an empty SparseBlockStructuredMatrix :rtype: int :return: 0 in ok """ return _sicpynumerics.SBM_from_csparse(blocksize, sparseMat)
[docs] class NumericsMatrixInternalData(object): r"""Structure for simple workspaces""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr iWorkSize = property(_sicpynumerics.NumericsMatrixInternalData_iWorkSize_get, _sicpynumerics.NumericsMatrixInternalData_iWorkSize_set, doc=r""" size of iWork""") iWork = property(_sicpynumerics.NumericsMatrixInternalData_iWork_get, _sicpynumerics.NumericsMatrixInternalData_iWork_set, doc=r""" integer workspace""") sizeof_elt = property(_sicpynumerics.NumericsMatrixInternalData_sizeof_elt_get, _sicpynumerics.NumericsMatrixInternalData_sizeof_elt_set, doc=r""" sizeof_elt of an element in bytes (result of sizeof for instance)""") dWorkSize = property(_sicpynumerics.NumericsMatrixInternalData_dWorkSize_get, _sicpynumerics.NumericsMatrixInternalData_dWorkSize_set, doc=r""" size of dWork""") dWork = property(_sicpynumerics.NumericsMatrixInternalData_dWork_get, _sicpynumerics.NumericsMatrixInternalData_dWork_set, doc=r""" double workspace""") isLUfactorized = property(_sicpynumerics.NumericsMatrixInternalData_isLUfactorized_get, _sicpynumerics.NumericsMatrixInternalData_isLUfactorized_set, doc=r""" true if the matrix has already been LU-factorized""") isCholeskyfactorized = property(_sicpynumerics.NumericsMatrixInternalData_isCholeskyfactorized_get, _sicpynumerics.NumericsMatrixInternalData_isCholeskyfactorized_set, doc=r""" true if the matrix has already been Cholesky factorized""") isLDLTfactorized = property(_sicpynumerics.NumericsMatrixInternalData_isLDLTfactorized_get, _sicpynumerics.NumericsMatrixInternalData_isLDLTfactorized_set, doc=r""" true if the matrix has already been LDLT factorized""") isInversed = property(_sicpynumerics.NumericsMatrixInternalData_isInversed_get, _sicpynumerics.NumericsMatrixInternalData_isInversed_set, doc=r""" true if the matrix contains its inverse (in place inversion)""") def __init__(self): _sicpynumerics.NumericsMatrixInternalData_swiginit(self, _sicpynumerics.new_NumericsMatrixInternalData()) __swig_destroy__ = _sicpynumerics.delete_NumericsMatrixInternalData
# Register NumericsMatrixInternalData in _sicpynumerics: _sicpynumerics.NumericsMatrixInternalData_swigregister(NumericsMatrixInternalData) NM_DENSE = _sicpynumerics.NM_DENSE r""" dense format""" NM_SPARSE_BLOCK = _sicpynumerics.NM_SPARSE_BLOCK r""" sparse block format""" NM_SPARSE = _sicpynumerics.NM_SPARSE r""" compressed column format""" NM_UNKNOWN = _sicpynumerics.NM_UNKNOWN r""" unset. Used in NM_null"""
[docs] class NumericsMatrix(object): r""" Interface to different type of matrices in numerics component. See NM_* functions for linear algebra operations on dense, sparse block and sparse storage. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr storageType = property(_sicpynumerics.NumericsMatrix_storageType_get, _sicpynumerics.NumericsMatrix_storageType_set, doc=r""" the type of storage: 0: dense (double*), 1: SparseBlockStructuredMatrix, 2: classical sparse (csc, csr or triplet) via CSparse (from T. Davis) """) size0 = property(_sicpynumerics.NumericsMatrix_size0_get, _sicpynumerics.NumericsMatrix_size0_set, doc=r""" number of rows""") size1 = property(_sicpynumerics.NumericsMatrix_size1_get, _sicpynumerics.NumericsMatrix_size1_set, doc=r""" number of columns""") matrix0 = property(_sicpynumerics.NumericsMatrix_matrix0_get, _sicpynumerics.NumericsMatrix_matrix0_set, doc=r""" dense storage""") matrix1 = property(_sicpynumerics.NumericsMatrix_matrix1_get, _sicpynumerics.NumericsMatrix_matrix1_set, doc=r""" sparse block storage""") matrix2 = property(_sicpynumerics.NumericsMatrix_matrix2_get, _sicpynumerics.NumericsMatrix_matrix2_set, doc=r""" csc, csr or triplet storage""") internalData = property(_sicpynumerics.NumericsMatrix_internalData_get, _sicpynumerics.NumericsMatrix_internalData_set, doc=r""" internal storage, used for workspace among other things""") version = property(_sicpynumerics.NumericsMatrix_version_get, _sicpynumerics.NumericsMatrix_version_set) destructible = property(_sicpynumerics.NumericsMatrix_destructible_get, _sicpynumerics.NumericsMatrix_destructible_set, doc=r""" pointer on the destructible matrix, by default points toward the matrix itself """) def __init__(self, o: "PyObject *"): _sicpynumerics.NumericsMatrix_swiginit(self, _sicpynumerics.new_NumericsMatrix(o)) def set_matrix0(self, i: "int", j: "int", v: "double") -> "void": return _sicpynumerics.NumericsMatrix_set_matrix0(self, i, j, v) def get_matrix0(self, i: "int", j: "int") -> "double": return _sicpynumerics.NumericsMatrix_get_matrix0(self, i, j) def __setitem__(self, index: "PyObject *", v: "double") -> "PyObject *": return _sicpynumerics.NumericsMatrix___setitem__(self, index, v) def __getitem__(self, index: "PyObject *") -> "PyObject *": return _sicpynumerics.NumericsMatrix___getitem__(self, index) def __len__(self) -> "int": return _sicpynumerics.NumericsMatrix___len__(self) __swig_destroy__ = _sicpynumerics.delete_NumericsMatrix
# Register NumericsMatrix in _sicpynumerics: _sicpynumerics.NumericsMatrix_swigregister(NumericsMatrix) class BalancingMatrices(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr size0 = property(_sicpynumerics.BalancingMatrices_size0_get, _sicpynumerics.BalancingMatrices_size0_set) size1 = property(_sicpynumerics.BalancingMatrices_size1_get, _sicpynumerics.BalancingMatrices_size1_set) D1 = property(_sicpynumerics.BalancingMatrices_D1_get, _sicpynumerics.BalancingMatrices_D1_set) D2 = property(_sicpynumerics.BalancingMatrices_D2_get, _sicpynumerics.BalancingMatrices_D2_set) A = property(_sicpynumerics.BalancingMatrices_A_get, _sicpynumerics.BalancingMatrices_A_set) def __init__(self): _sicpynumerics.BalancingMatrices_swiginit(self, _sicpynumerics.new_BalancingMatrices()) __swig_destroy__ = _sicpynumerics.delete_BalancingMatrices # Register BalancingMatrices in _sicpynumerics: _sicpynumerics.BalancingMatrices_swigregister(BalancingMatrices) NM_NONE = _sicpynumerics.NM_NONE r""" keep nothing""" NM_KEEP_FACTORS = _sicpynumerics.NM_KEEP_FACTORS r""" keep all the factorization data (useful to reuse the factorization)""" NM_PRESERVE = _sicpynumerics.NM_PRESERVE r""" keep the matrix as-is (useful for the dense case)"""
[docs] def NM_new() -> "RawNumericsMatrix *": r""" Constructors and destructors *************** Creation of an empty NumericsMatrix. :rtype: :py:class:`RawNumericsMatrix` :return: a pointer to allocated space """ return _sicpynumerics.NM_new()
def NM_eye(size: "int") -> "RawNumericsMatrix *": return _sicpynumerics.NM_eye(size) def NM_scalar(size: "int", s: "double") -> "RawNumericsMatrix *": return _sicpynumerics.NM_scalar(size, s)
[docs] def NM_create(storageType: "NM_types", size0: "int", size1: "int") -> "RawNumericsMatrix *": r""" create a NumericsMatrix and allocate the memory according to the matrix type :type storageType: int :param storageType: the type of storage :type size0: int :param size0: number of rows :type size1: int :param size1: number of columns :rtype: :py:class:`RawNumericsMatrix` :return: a pointer to a NumericsMatrix """ return _sicpynumerics.NM_create(storageType, size0, size1)
[docs] def NM_create_from_data(storageType: "int", size0: "int", size1: "int", data: "void *") -> "RawNumericsMatrix *": r""" create a NumericsMatrix and possibly set the data :type storageType: int :param storageType: the type of storage :type size0: int :param size0: number of rows :type size1: int :param size1: number of columns :type data: void :param data: pointer to the matrix data. If NULL, all matrixX fields are set to NULL :rtype: :py:class:`RawNumericsMatrix` :return: a pointer to a NumericsMatrix """ return _sicpynumerics.NM_create_from_data(storageType, size0, size1, data)
def NM_create_from_filename(filename: "char const *") -> "RawNumericsMatrix *": return _sicpynumerics.NM_create_from_filename(filename) def NM_create_from_file(file: "FILE *") -> "RawNumericsMatrix *": return _sicpynumerics.NM_create_from_file(file)
[docs] def NM_version_copy(A: "NumericsMatrix", B: "NumericsMatrix") -> "void": r""" Copy NumericsMatrix version. :type A: :py:class:`NumericsMatrix`, in :param A: a NumericsMatrix :type B: :py:class:`NumericsMatrix`, in/out :param B: a NumericsMatrix """ return _sicpynumerics.NM_version_copy(A, B)
[docs] def NM_copy(A: "NumericsMatrix", B: "NumericsMatrix") -> "void": r""" Copy a NumericsMatrix inside another NumericsMatrix (deep). Reallocations are performed if B cannot hold a copy of A :type A: :py:class:`NumericsMatrix`, in :param A: a NumericsMatrix :type B: :py:class:`NumericsMatrix`, in/out :param B: a NumericsMatrix """ return _sicpynumerics.NM_copy(A, B)
[docs] def NM_copy_to_sparse(A: "NumericsMatrix", B: "NumericsMatrix", threshold: "double") -> "void": r""" Copy a NumericsMatrix to s sparse one. Allocation or reallocation are performed on B Warning: It is assumed that B has been properly initialized: its storageType must be set to NM_SPARSE. :type A: :py:class:`NumericsMatrix`, in :param A: a NumericsMatrix :type B: :py:class:`NumericsMatrix`, in/out :param B: a NumericsMatrix :type threshold: float :param threshold: if the original matrix is dense, a threshold can be applied on the absolute value of the entries """ return _sicpynumerics.NM_copy_to_sparse(A, B, threshold)
[docs] def NM_duplicate(mat: "NumericsMatrix") -> "RawNumericsMatrix *": r""" create a NumericsMatrix similar to the another one. The structure is the same :type mat: :py:class:`NumericsMatrix` :param mat: the model matrix :rtype: :py:class:`RawNumericsMatrix` :return: a pointer to a NumericsMatrix """ return _sicpynumerics.NM_duplicate(mat)
[docs] def numericsSparseMatrix(A: "NumericsMatrix") -> "NumericsSparseMatrix *": r""" Creation, if needed, of sparse matrix storage. :type A: :py:class:`NumericsMatrix`, in/out :param A: a NumericsMatrix :rtype: :py:class:`NumericsSparseMatrix` :return: a pointer on the sparse matrix storage """ return _sicpynumerics.numericsSparseMatrix(A)
[docs] def NM_triplet(A: "NumericsMatrix") -> "CSparseMatrix *": r""" Creation, if needed, of triplet storage from sparse block storage. :type A: :py:class:`NumericsMatrix`, in/out :param A: a NumericsMatrix initialized with sparsed block storage. :rtype: CSparseMatrix :return: the triplet sparse Matrix created in A. """ return _sicpynumerics.NM_triplet(A)
[docs] def NM_half_triplet(A: "NumericsMatrix") -> "CSparseMatrix *": r""" Creation, if needed, of half triplet storage from sparse block storage. :type A: :py:class:`NumericsMatrix`, in/out :param A: a NumericsMatrix initialized with sparsed block storage. :rtype: CSparseMatrix :return: the triplet sparse Matrix created in A. """ return _sicpynumerics.NM_half_triplet(A)
[docs] def NM_csc(A: "NumericsMatrix") -> "CSparseMatrix *": r""" Creation, if needed, of compress column storage of a NumericsMatrix. :type A: :py:class:`NumericsMatrix`, in/out :param A: a NumericsMatrix with sparse block storage initialized :rtype: CSparseMatrix :return: the compressed column CSparseMatrix created in A. """ return _sicpynumerics.NM_csc(A)
[docs] def NM_csc_trans(A: "NumericsMatrix") -> "CSparseMatrix *": r""" Creation, if needed, of the transposed compress column storage from compress column storage. :type A: :py:class:`NumericsMatrix`, in/out :param A: a NumericsMatrix with sparse block storage. :rtype: CSparseMatrix :return: the transposed compressed column matrix created in A. """ return _sicpynumerics.NM_csc_trans(A)
[docs] def NM_csr(A: "NumericsMatrix") -> "CSparseMatrix *": r""" Creation, if needed, of compress row storage of a NumericsMatrix Warning: This rely on the MKL :type A: :py:class:`NumericsMatrix`, in/out :param A: a NumericsMatrix with sparse block storage initialized :rtype: CSparseMatrix :return: the compressed row CSparseMatrix created in A. """ return _sicpynumerics.NM_csr(A)
[docs] def NM_fill(M: "NumericsMatrix", storageType: "NM_types", size0: "int", size1: "int", data: "void *") -> "void": r""" fill an existing NumericsMatrix struct :type M: :py:class:`NumericsMatrix`, in/out :param M: the struct to fill :type storageType: int :param storageType: the type of storage :type size0: int :param size0: number of rows :type size1: int :param size1: number of columns :type data: void :param data: pointer to the matrix data. If NULL, all matrixX fields are set to NULL """ return _sicpynumerics.NM_fill(M, storageType, size0, size1, data)
[docs] def NM_new_SBM(size0: "int", size1: "int", m1: "SparseBlockStructuredMatrix") -> "RawNumericsMatrix *": r""" new NumericsMatrix with sparse storage from minimal set of data :type size0: int, in :param size0: number of rows :type size1: int, in :param size1: number of columns :type m1: :py:class:`SparseBlockStructuredMatrix`, in :param m1: the SparseBlockStructuredMatrix :rtype: :py:class:`RawNumericsMatrix` :return: a pointer to a NumericsMatrix """ return _sicpynumerics.NM_new_SBM(size0, size1, m1)
[docs] def NM_transpose(A: "NumericsMatrix") -> "RawNumericsMatrix *": r""" new NumericsMatrix equal to the transpose of a given matrix :type A: :py:class:`NumericsMatrix`, in :param A: :rtype: :py:class:`RawNumericsMatrix` :return: a pointer to a NumericsMatrix """ return _sicpynumerics.NM_transpose(A)
[docs] def NM_null(A: "NumericsMatrix") -> "void": r""" set NumericsMatrix fields to NULL :type A: :py:class:`NumericsMatrix` :param A: a matrix """ return _sicpynumerics.NM_null(A)
[docs] def NM_destructible(A: "NumericsMatrix") -> "bool": r""" Check if a matrix is destructible. :type A: :py:class:`NumericsMatrix`, in :param A: the NumericsMatrix :rtype: boolean :return: true if the matrix is destructible """ return _sicpynumerics.NM_destructible(A)
[docs] def NM_preserve(A: "NumericsMatrix") -> "RawNumericsMatrix *": r""" Preservation of a matrix before in-place transformations such as factorizations. :type A: :py:class:`NumericsMatrix`, in :param A: the NumericsMatrix :rtype: :py:class:`RawNumericsMatrix` :return: a pointer on the preserved Matrix; """ return _sicpynumerics.NM_preserve(A)
[docs] def NM_unpreserve(A: "NumericsMatrix") -> "RawNumericsMatrix *": r""" Set the matrix as destructible, clear the preserved data. :type A: :py:class:`NumericsMatrix`, in :param A: the NumericsMatrix :rtype: :py:class:`RawNumericsMatrix` :return: a pointer on the Matrix; """ return _sicpynumerics.NM_unpreserve(A)
[docs] def NM_LU_factorized(A: "NumericsMatrix") -> "bool": r""" Check for a previous LU factorization. :type A: :py:class:`NumericsMatrix`, in :param A: the NumericsMatrix :rtype: boolean :return: true if the matrix has been LU factorized. """ return _sicpynumerics.NM_LU_factorized(A)
[docs] def NM_Cholesky_factorized(A: "NumericsMatrix") -> "bool": r""" Check for a previous Cholesky factorization. :type A: :py:class:`NumericsMatrix`, in :param A: the NumericsMatrix :rtype: boolean :return: true if the matrix has been Cholesky factorized. """ return _sicpynumerics.NM_Cholesky_factorized(A)
[docs] def NM_LDLT_factorized(A: "NumericsMatrix") -> "bool": r""" Check for a previous LDLT factorization. :type A: :py:class:`NumericsMatrix`, in :param A: the NumericsMatrix :rtype: boolean :return: true if the matrix has been Cholesky factorized. """ return _sicpynumerics.NM_LDLT_factorized(A)
[docs] def NM_set_LU_factorized(A: "NumericsMatrix", flag: "bool") -> "void": r""" Set the factorization flag. :type A: :py:class:`NumericsMatrix`, in :param A: the NumericsMatrix, :type flag: boolean, in :param flag: a boolean. """ return _sicpynumerics.NM_set_LU_factorized(A, flag)
def NM_set_Cholesky_factorized(A: "NumericsMatrix", flag: "bool") -> "void": return _sicpynumerics.NM_set_Cholesky_factorized(A, flag) def NM_set_LDLT_factorized(A: "NumericsMatrix", flag: "bool") -> "void": return _sicpynumerics.NM_set_LDLT_factorized(A, flag)
[docs] def NM_update_size(A: "NumericsMatrix") -> "void": r""" update the size of the matrix based on the matrix data :type A: :py:class:`NumericsMatrix`, in/out :param A: the matrix which size is updated """ return _sicpynumerics.NM_update_size(A)
[docs] def NM_csc_alloc(A: "NumericsMatrix", nzmax: "long") -> "void": r""" Allocate a csc matrix in A :type A: :py:class:`NumericsMatrix` :param A: the matrix :type nzmax: int :param nzmax: number of non-zero elements """ return _sicpynumerics.NM_csc_alloc(A, nzmax)
[docs] def NM_csc_empty_alloc(A: "NumericsMatrix", nzmax: "long") -> "void": r""" Allocate a csc matrix in A and set the vector of column pointers to 0 such that the matrix is empty. :type A: :py:class:`NumericsMatrix` :param A: the matrix :type nzmax: int :param nzmax: number of non-zero elements """ return _sicpynumerics.NM_csc_empty_alloc(A, nzmax)
[docs] def NM_triplet_alloc(A: "NumericsMatrix", nzmax: "long") -> "void": r""" Allocate a triplet matrix in A :type A: :py:class:`NumericsMatrix` :param A: the matrix :type nzmax: int :param nzmax: maximum number of non-zero elements """ return _sicpynumerics.NM_triplet_alloc(A, nzmax)
[docs] def NM_clear(m: "NumericsMatrix") -> "void": r""" Free memory for a NumericsMatrix. Warning: call this function only if you are sure that memory has been allocated for the structure in Numerics. This function is assumed that the memory is "owned" by this structure. Note that this function does not free m. :type m: :py:class:`NumericsMatrix` :param m: the matrix to be deleted. """ return _sicpynumerics.NM_clear(m)
def NM_free(m: "NumericsMatrix") -> "NumericsMatrix *": return _sicpynumerics.NM_free(m)
[docs] def NM_clear_not_dense(m: "NumericsMatrix") -> "void": r""" Free memory for a NumericsMatrix except the dense matrix that is assumed not to be owned. :type m: :py:class:`NumericsMatrix` :param m: the matrix to be cleared. """ return _sicpynumerics.NM_clear_not_dense(m)
def NM_free_not_dense(m: "NumericsMatrix") -> "NumericsMatrix *": return _sicpynumerics.NM_free_not_dense(m)
[docs] def NM_clear_not_SBM(m: "NumericsMatrix") -> "void": r""" Free memory for a NumericsMatrix except the SBM matrix that is assumed not to be owned. Note that this function does not free m. :type m: :py:class:`NumericsMatrix` :param m: the matrix to be cleared. """ return _sicpynumerics.NM_clear_not_SBM(m)
def NM_free_not_SBM(m: "NumericsMatrix") -> "NumericsMatrix *": return _sicpynumerics.NM_free_not_SBM(m)
[docs] def NM_clear_other_storages(M: "NumericsMatrix", storageType: "NM_types") -> "void": r""" Free memory for a NumericsMatrix except for a given storage. Warning: call this function only if you are sure that memory has been allocated for the structure in Numerics. This function is assumed that the memory is "owned" by this structure. Note that this function does not free m. :param m: the matrix to be deleted. :type storageType: int :param storageType: to be kept. """ return _sicpynumerics.NM_clear_other_storages(M, storageType)
[docs] def NM_zentry(M: "NumericsMatrix", i: "int", j: "int", val: "double", threshold: "double") -> "void": r""" insert an non zero entry into a NumericsMatrix. for storageType = NM_SPARSE, a conversion to triplet is done for performing the entry in the matrix. This method is expensive in terms of memory management. For a lot of entries, use preferably a triplet matrix. :type M: :py:class:`NumericsMatrix` :param M: the NumericsMatrix :type i: int :param i: row index :type j: int :param j: column index :type val: float :param val: the value to be inserted. :type threshold: float :param threshold: a threshold to filter the small value in magnitude (useful for dense to sparse conversion) """ return _sicpynumerics.NM_zentry(M, i, j, val, threshold)
[docs] def NM_entry(M: "NumericsMatrix", i: "int", j: "int", val: "double") -> "void": r""" insert an entry into a NumericsMatrix. for storageType = NM_SPARSE, a conversion to triplet is done for performing the entry in the matrix. This method is expensive in terms of memory management. For a lot of entries, use preferably a triplet matrix. :type M: :py:class:`NumericsMatrix` :param M: the NumericsMatrix :type i: int :param i: row index :type j: int :param j: column index :type val: float :param val: the value to be inserted. """ return _sicpynumerics.NM_entry(M, i, j, val)
[docs] def NM_get_value(M: "NumericsMatrix", i: "int", j: "int") -> "double": r""" get the value of a NumericsMatrix. :type M: :py:class:`NumericsMatrix` :param M: the NumericsMatrix :type i: int :param i: row index :type j: int :param j: column index :rtype: float :return: the value to be inserted. """ return _sicpynumerics.NM_get_value(M, i, j)
[docs] def NM_equal(A: "NumericsMatrix", B: "NumericsMatrix") -> "bool": r""" compare to NumericsMatrix up to machine accuracy (DBL_EPSILON) :type A: :py:class:`NumericsMatrix` :param A: the NumericsMatrix :type B: :py:class:`NumericsMatrix` :param B: the NumericsMatrix """ return _sicpynumerics.NM_equal(A, B)
[docs] def NM_compare(A: "NumericsMatrix", B: "NumericsMatrix", tol: "double") -> "bool": r""" compare to NumericsMatrix up to a given tolerance :type A: :py:class:`NumericsMatrix` :param A: the NumericsMatrix :type B: :py:class:`NumericsMatrix` :param B: the NumericsMatrix :type tol: float :param tol: the tolerance """ return _sicpynumerics.NM_compare(A, B, tol)
[docs] def NM_nnz(M: "NumericsMatrix") -> "size_t": r""" return the number of non-zero element. For a dense matrix, it is the product of the dimensions (e.g. an upper bound). For a sparse matrix, it is the true number :type M: :py:class:`NumericsMatrix` :param M: the matrix :rtype: int :return: the number (or an upper bound) of non-zero elements in the matrix """ return _sicpynumerics.NM_nnz(M)
[docs] def NM_extract_diag_block(M: "NumericsMatrix", block_row_nb: "int", start_row: "size_t", size: "int", Block: "double **") -> "void": r""" get the (square) diagonal block of a NumericsMatrix. No allocation is done. :type M: :py:class:`NumericsMatrix`, in :param M: a NumericsMatrix :type block_row_nb: int, in :param block_row_nb: the number of the block Row. Useful only in sparse case :type start_row: int, in :param start_row: the starting row. Useful only in dense case. :type size: int, in :param size: of the diag block. Only useful in dense case. :type Block: float, out :param Block: the target. In the dense and sparse case (*Block) must be allocated by caller. In case of SBM case **Bout contains the resulting block (from the SBM). """ return _sicpynumerics.NM_extract_diag_block(M, block_row_nb, start_row, size, Block)
[docs] def NM_extract_diag_block3(M: "NumericsMatrix", block_row_nb: "int", Block: "double **") -> "void": r""" get a 3x3 diagonal block of a NumericsMatrix. No allocation is done. :type M: :py:class:`NumericsMatrix`, in :param M: a NumericsMatrix :type block_row_nb: int, in :param block_row_nb: the number of the block row :type Block: float, out :param Block: the target. In the dense and sparse case (*Block) must be allocated by caller. In case of SBM case **Bout contains the resulting block (from the SBM). """ return _sicpynumerics.NM_extract_diag_block3(M, block_row_nb, Block)
[docs] def NM_extract_diag_block2(M: "NumericsMatrix", block_row_nb: "int", Block: "double **") -> "void": r""" get a 2x2 diagonal block of a NumericsMatrix. No allocation is done. :type M: :py:class:`NumericsMatrix`, in :param M: a NumericsMatrix :type block_row_nb: int, in :param block_row_nb: the number of the block row :type Block: float, out :param Block: the target. In the dense and sparse case (*Block) must be allocated by caller. In case of SBM case **Bout contains the resulting block (from the SBM). """ return _sicpynumerics.NM_extract_diag_block2(M, block_row_nb, Block)
[docs] def NM_extract_diag_block5(M: "NumericsMatrix", block_row_nb: "int", Block: "double **") -> "void": r""" get a 5x5 diagonal block of a NumericsMatrix. No allocation is done. :type M: :py:class:`NumericsMatrix`, in :param M: a NumericsMatrix :type block_row_nb: int, in :param block_row_nb: the number of the block row :type Block: float, out :param Block: the target. In the dense and sparse case (*Block) must be allocated by caller. In case of SBM case **Bout contains the resulting block (from the SBM). """ return _sicpynumerics.NM_extract_diag_block5(M, block_row_nb, Block)
[docs] def NM_copy_diag_block3(M: "NumericsMatrix", block_row_nb: "int", Block: "double **") -> "void": r""" get a 3x3 diagonal block of a NumericsMatrix. No allocation is done. :type M: :py:class:`NumericsMatrix`, in :param M: a NumericsMatrix :type block_row_nb: int, in :param block_row_nb: the number of the block row :type Block: float, out :param Block: the target. In all cases (dense, sbm, and sparse) (*Block) must be allocated by caller. A copy is always performed """ return _sicpynumerics.NM_copy_diag_block3(M, block_row_nb, Block)
[docs] def NM_insert(A: "NumericsMatrix", B: "NumericsMatrix", start_i: "unsigned int const", start_j: "unsigned int const") -> "void": r""" Set the submatrix B into the matrix A on the position defined in (start_i, start_j) position. :type A: :py:class:`NumericsMatrix`, in :param A: a pointer to NumerixMatrix :type B: :py:class:`NumericsMatrix`, in :param B: a pointer toNumericsMatrix :type start_i: int, in :param start_i: a start row index :type start_j: int, in :param start_j: a start column index """ return _sicpynumerics.NM_insert(A, B, start_i, start_j)
[docs] def NM_prod_mv_3x3(sizeX: "int", sizeY: "int", A: "NumericsMatrix", x: "double *const", y: "double *") -> "void": r""" Matrix - vector product y = A*x + y :type sizeX: int, in :param sizeX: dim of the vector x :type sizeY: int, in :param sizeY: dim of the vector y :type A: :py:class:`NumericsMatrix`, in :param A: the matrix to be multiplied :type x: double, in :param x: the vector to be multiplied :type y: float, in/out :param y: the resulting vector """ return _sicpynumerics.NM_prod_mv_3x3(sizeX, sizeY, A, x, y)
[docs] def NM_row_prod(sizeX: "int", sizeY: "int", currentRowNumber: "int", A: "NumericsMatrix", x: "double const *const", y: "double *", init: "int") -> "void": r""" Row of a Matrix - vector product y = rowA*x or y += rowA*x, rowA being a submatrix of A (sizeY rows and sizeX columns) :type sizeX: int, in :param sizeX: dim of the vector x :type sizeY: int, in :param sizeY: dim of the vector y :type currentRowNumber: int, in :param currentRowNumber: position of the first row of rowA in A (warning: real row if A is a double*, block-row if A is a SparseBlockStructuredMatrix) :type A: :py:class:`NumericsMatrix`, in :param A: the matrix to be multiplied :type x: double, in :param x: the vector to be multiplied :type y: float, in/out :param y: the resulting vector :type init: int, in :param init: = 0 for y += Ax, =1 for y = Ax """ return _sicpynumerics.NM_row_prod(sizeX, sizeY, currentRowNumber, A, x, y, init)
[docs] def NM_row_prod_no_diag(sizeX: "size_t", sizeY: "size_t", block_start: "int", row_start: "size_t", A: "NumericsMatrix", x: "double *", y: "double *", xsave: "double *", init: "bool") -> "void": r""" Row of a Matrix - vector product y = rowA*x or y += rowA*x, rowA being a submatrix of A (sizeY rows and sizeX columns) :type sizeX: int, in :param sizeX: dim of the vector x :type sizeY: int, in :param sizeY: dim of the vector y :type block_start: int, in :param block_start: block number (only used for SBM) :type row_start: int, in :param row_start: position of the first row of A (unused if A is SBM) :type A: :py:class:`NumericsMatrix`, in :param A: the matrix to be multiplied :type x: float, in :param x: the vector to be multiplied :type y: float, in/out :param y: the resulting vector :type xsave: float, in :param xsave: storage for saving the part of x set to 0 :type init: boolean, in :param init: if True y = Ax, else y += Ax """ return _sicpynumerics.NM_row_prod_no_diag(sizeX, sizeY, block_start, row_start, A, x, y, xsave, init)
[docs] def NM_row_prod_no_diag3(sizeX: "size_t", block_start: "int", row_start: "size_t", A: "NumericsMatrix", x: "double *", y: "double *", init: "bool") -> "void": r""" Row of a Matrix - vector product y = rowA*x or y += rowA*x, rowA being a submatrix of A (3 rows and sizeX columns) :type sizeX: int, in :param sizeX: dim of the vector x :type block_start: int, in :param block_start: block number (only used for SBM) :type row_start: int, in :param row_start: position of the first row of A (unused if A is SBM) :type A: :py:class:`NumericsMatrix`, in :param A: the matrix to be multiplied :type x: float, in :param x: the vector to be multiplied :type y: float, in/out :param y: the resulting vector :type init: boolean, in :param init: if True y = Ax, else y += Ax """ return _sicpynumerics.NM_row_prod_no_diag3(sizeX, block_start, row_start, A, x, y, init)
[docs] def NM_row_prod_no_diag2(sizeX: "size_t", block_start: "int", row_start: "size_t", A: "NumericsMatrix", x: "double *", y: "double *", init: "bool") -> "void": r""" Row of a Matrix - vector product y = rowA*x or y += rowA*x, rowA being a submatrix of A (2 rows and sizeX columns) :type sizeX: int, in :param sizeX: dim of the vector x :type block_start: int, in :param block_start: block number (only used for SBM) :type row_start: int, in :param row_start: position of the first row of A (unused if A is SBM) :type A: :py:class:`NumericsMatrix`, in :param A: the matrix to be multiplied :type x: float, in :param x: the vector to be multiplied :type y: float, in/out :param y: the resulting vector :type init: boolean, in :param init: if True y = Ax, else y += Ax """ return _sicpynumerics.NM_row_prod_no_diag2(sizeX, block_start, row_start, A, x, y, init)
def NM_row_prod_no_diag1x1(sizeX: "size_t", block_start: "int", row_start: "size_t", A: "NumericsMatrix", x: "double *", y: "double *", init: "bool") -> "void": return _sicpynumerics.NM_row_prod_no_diag1x1(sizeX, block_start, row_start, A, x, y, init)
[docs] def NM_gemv(alpha: "double const", A: "NumericsMatrix", x: "double const *", beta: "double const", y: "double *") -> "void": r""" Matrix vector multiplication : y = alpha A x + beta y :type alpha: float, in :param alpha: scalar :type A: :py:class:`NumericsMatrix`, in :param A: a NumericsMatrix :type x: float, in :param x: pointer on a dense vector of size A->size1 :type beta: float, in :param beta: scalar :type y: float, in/out :param y: pointer on a dense vector of size A->size1 """ return _sicpynumerics.NM_gemv(alpha, A, x, beta, y)
[docs] def NM_gemm(alpha: "double const", A: "NumericsMatrix", B: "NumericsMatrix", beta: "double const", C: "NumericsMatrix") -> "void": r""" Matrix matrix multiplication : C = alpha A B + beta C :type alpha: float, in :param alpha: scalar :type A: :py:class:`NumericsMatrix`, in :param A: a NumericsMatrix :type B: :py:class:`NumericsMatrix`, in :param B: a NumericsMatrix :type beta: float, in :param beta: scalar :type C: :py:class:`NumericsMatrix`, in/out :param C: a NumericsMatrix """ return _sicpynumerics.NM_gemm(alpha, A, B, beta, C)
[docs] def NM_multiply(A: "NumericsMatrix", B: "NumericsMatrix") -> "RawNumericsMatrix *": r""" Matrix matrix multiplication : C = A B :type A: :py:class:`NumericsMatrix`, in :param A: a NumericsMatrix :type B: :py:class:`NumericsMatrix`, in :param B: a NumericsMatrix :param C: a NumericsMatrix """ return _sicpynumerics.NM_multiply(A, B)
[docs] def NM_tgemv(alpha: "double const", A: "NumericsMatrix", x: "double const *", beta: "double const", y: "double *") -> "void": r""" Transposed matrix multiplication : y += alpha transpose(A) x + y :type alpha: float, in :param alpha: scalar :type A: :py:class:`NumericsMatrix`, in :param A: a NumericsMatrix :type x: float, in :param x: pointer on a dense vector of size A->size1 :type beta: float, in :param beta: scalar :type y: float, in/out :param y: pointer on a dense vector of size A->size1 """ return _sicpynumerics.NM_tgemv(alpha, A, x, beta, y)
def NM_dense_to_sparse(A: "NumericsMatrix", B: "NumericsMatrix", threshold: "double") -> "void": return _sicpynumerics.NM_dense_to_sparse(A, B, threshold)
[docs] def NM_to_dense(A: "NumericsMatrix", B: "NumericsMatrix") -> "int": r""" Copy a NumericsMatrix into another with dense storage. :type A: :py:class:`NumericsMatrix` :param A: source matrix (any kind of storage) :type B: :py:class:`NumericsMatrix` :param B: targeted matrix, must be dense with the same dimension as A """ return _sicpynumerics.NM_to_dense(A, B)
[docs] def NM_dense_display_matlab(m: "double *", nRow: "int", nCol: "int", lDim: "int") -> "void": r""" Screen display of the matrix content stored as a double * array in Fortran style :type m: float :param m: the matrix to be displayed :type nRow: int :param nRow: the number of rows :type nCol: int :param nCol: the number of columns :type lDim: int :param lDim: the leading dimension of M """ return _sicpynumerics.NM_dense_display_matlab(m, nRow, nCol, lDim)
[docs] def NM_dense_display(m: "double *", nRow: "int", nCol: "int", lDim: "int") -> "void": r""" Screen display of the matrix content stored as a double * array in Fortran style :type m: float :param m: the matrix to be displayed :type nRow: int :param nRow: the number of rows :type nCol: int :param nCol: the number of columns :type lDim: int :param lDim: the leading dimension of M """ return _sicpynumerics.NM_dense_display(m, nRow, nCol, lDim)
[docs] def NM_vector_display(m: "double *", nRow: "int") -> "void": r""" Screen display of the vector content stored as a double * array :type m: float :param m: the vector to be displayed :type nRow: int :param nRow: the number of rows """ return _sicpynumerics.NM_vector_display(m, nRow)
[docs] def NM_display(M: "NumericsMatrix") -> "void": r""" Screen display of the matrix content :type M: :py:class:`NumericsMatrix` :param M: the matrix to be displayed """ return _sicpynumerics.NM_display(M)
[docs] def NM_display_storageType(M: "NumericsMatrix") -> "void": r""" Screen display of the matrix storage :type M: :py:class:`NumericsMatrix` :param M: the matrix to be displayed """ return _sicpynumerics.NM_display_storageType(M)
[docs] def NM_display_row_by_row(m: "NumericsMatrix") -> "void": r""" Screen display raw by raw of the matrix content :type m: :py:class:`NumericsMatrix` :param m: the matrix to be displayed """ return _sicpynumerics.NM_display_row_by_row(m)
[docs] def NM_write_in_filename(M: "NumericsMatrix", filename: "char const *") -> "void": r""" matrix I/O ******************** PrintInFile of the matrix content :type M: :py:class:`NumericsMatrix` :param M: the matrix to be printed :type filename: string :param filename: the corresponding name of the file """ return _sicpynumerics.NM_write_in_filename(M, filename)
[docs] def NM_read_in_filename(M: "NumericsMatrix", filename: "char const *") -> "void": r""" Read in file of the matrix content :type M: :py:class:`NumericsMatrix` :param M: the matrix to be read :type filename: string :param filename: the corresponding name of the file """ return _sicpynumerics.NM_read_in_filename(M, filename)
[docs] def NM_write_in_file(M: "NumericsMatrix", file: "FILE *") -> "void": r""" PrintInFile of the matrix content :type M: :py:class:`NumericsMatrix` :param M: the matrix to be printed :type file: FILE :param file: filename the corresponding file """ return _sicpynumerics.NM_write_in_file(M, file)
[docs] def NM_read_in_file(M: "NumericsMatrix", file: "FILE *") -> "void": r""" Read in file of the matrix content without performing memory allocation :type M: :py:class:`NumericsMatrix` :param M: the matrix to be read :type file: FILE :param file: the corresponding file """ return _sicpynumerics.NM_read_in_file(M, file)
[docs] def NM_new_from_file(file: "FILE *") -> "RawNumericsMatrix *": r""" Create from file a NumericsMatrix with memory allocation :type file: FILE :param file: the corresponding file :rtype: :py:class:`RawNumericsMatrix` :return: 0 if the matrix """ return _sicpynumerics.NM_new_from_file(file)
def NM_new_from_filename(filename: "char const *") -> "RawNumericsMatrix *": return _sicpynumerics.NM_new_from_filename(filename)
[docs] def NM_write_in_file_scilab(M: "NumericsMatrix", file: "FILE *") -> "void": r""" NM_write_in_file_scilab of the matrix content :type M: :py:class:`NumericsMatrix` :param M: the matrix to be printed :type file: FILE :param file: the corresponding file """ return _sicpynumerics.NM_write_in_file_scilab(M, file)
[docs] def NM_write_in_file_python(M: "NumericsMatrix", file: "FILE *") -> "void": r""" NM_write_in_file_python of the matrix content :type M: :py:class:`NumericsMatrix` :param M: the matrix to be printed :type file: FILE :param file: the corresponding file """ return _sicpynumerics.NM_write_in_file_python(M, file)
[docs] def NM_read_in_file_scilab(M: "NumericsMatrix", file: "FILE *") -> "void": r""" Read in file for scilab of the matrix content :type M: :py:class:`NumericsMatrix` :param M: the matrix to be read :type file: FILE :param file: the corresponding file """ return _sicpynumerics.NM_read_in_file_scilab(M, file)
[docs] def NM_clearDense(A: "NumericsMatrix") -> "void": r""" Clear dense storage, if it is existent. :type A: :py:class:`NumericsMatrix`, in/out :param A: a Numericsmatrix """ return _sicpynumerics.NM_clearDense(A)
[docs] def NM_clearSparseBlock(A: "NumericsMatrix") -> "void": r""" Clear sparse block storage, if it is existent. :type A: :py:class:`NumericsMatrix`, in/out :param A: a Numericsmatrix """ return _sicpynumerics.NM_clearSparseBlock(A)
[docs] def NM_clearSparse(A: "NumericsMatrix") -> "void": r""" Clear sparse data, if it is existent. The linear solver parameters are also cleared. :type A: :py:class:`NumericsMatrix`, in/out :param A: a Numericsmatrix """ return _sicpynumerics.NM_clearSparse(A)
[docs] def NM_clearTriplet(A: "NumericsMatrix") -> "void": r""" Clear triplet storage, if it is existent. :type A: :py:class:`NumericsMatrix`, in/out :param A: a Numericsmatrix """ return _sicpynumerics.NM_clearTriplet(A)
[docs] def NM_clearHalfTriplet(A: "NumericsMatrix") -> "void": r""" Clear half triplet storage, if it is existent. :type A: :py:class:`NumericsMatrix`, in/out :param A: a Numericsmatrix """ return _sicpynumerics.NM_clearHalfTriplet(A)
[docs] def NM_clearCSC(A: "NumericsMatrix") -> "void": r""" Clear compressed column storage, if it is existent. :type A: :py:class:`NumericsMatrix`, in/out :param A: a Numericsmatrix """ return _sicpynumerics.NM_clearCSC(A)
[docs] def NM_clearCSCTranspose(A: "NumericsMatrix") -> "void": r""" Clear transposed compressed column storage, if it is existent. :type A: :py:class:`NumericsMatrix`, in/out :param A: a Numericsmatrix """ return _sicpynumerics.NM_clearCSCTranspose(A)
[docs] def NM_clearCSR(A: "NumericsMatrix") -> "void": r""" Clear compressed row storage, if it is existent. :type A: :py:class:`NumericsMatrix`, in/out :param A: a Numericsmatrix """ return _sicpynumerics.NM_clearCSR(A)
[docs] def NM_clearSparseStorage(A: "NumericsMatrix") -> "void": r""" Clear triplet, csc, csc transposed storage, if they are existent. Linear solver parameters are preserved. :type A: :py:class:`NumericsMatrix`, in/out :param A: a Numericsmatrix """ return _sicpynumerics.NM_clearSparseStorage(A)
[docs] def NM_LU_factorize(A: "NumericsMatrix") -> "int": r""" LU factorization of the matrix. If the matrix has already been factorized (i.e if NM_LU_factorized(A) return true), nothing is done. To force a new factorization one has to set factorization flag to false : NM_set_LU_factorized(A, false) before the call to NM_LU_factorize. If the matrix is preserved, that means that a call to NM_preserve(A) has been done before the call to NM_LU_factorize, it is not destroyed, but the factorized part remains accessible for subsequent calls to NM_LU_solve. If the matrix is not preserved, then it is replaced by the factorized part. :type A: :py:class:`NumericsMatrix`, in :param A: the NumericsMatrix :rtype: int :return: an int, 0 means the matrix has been factorized. """ return _sicpynumerics.NM_LU_factorize(A)
def NM_Cholesky_factorize(A: "NumericsMatrix") -> "int": return _sicpynumerics.NM_Cholesky_factorize(A) def NM_LDLT_factorize(A: "NumericsMatrix") -> "int": return _sicpynumerics.NM_LDLT_factorize(A)
[docs] def NM_LU_solve(A: "NumericsMatrix", b: "double *", nrhs: "unsigned int") -> "int": r""" Solve linear system with multiple right hand size. A call to NM_LU_factorize is done at the beginning. :type A: :py:class:`NumericsMatrix`, in :param A: the NumericsMatrix. A is not destroyed if it has been preserved by a call to NM_preserve(A). :type b: float, in/out :param b: the right hand size which is a pointer on a matrix of double. It is replaced by the solutions :type nrhs: int, in :param nrhs: the number of right hand side. :rtype: int :return: 0 if the solve succeeded. """ return _sicpynumerics.NM_LU_solve(A, b, nrhs)
def NM_LU_solve_matrix_rhs(Ao: "NumericsMatrix", B: "NumericsMatrix") -> "int": return _sicpynumerics.NM_LU_solve_matrix_rhs(Ao, B) def NM_LU_refine(A: "NumericsMatrix", x: "double *", tol: "double", max_iter: "int", residu: "double *") -> "int": return _sicpynumerics.NM_LU_refine(A, x, tol, max_iter, residu) def NM_Cholesky_solve(A: "NumericsMatrix", b: "double *", nrhs: "unsigned int") -> "int": return _sicpynumerics.NM_Cholesky_solve(A, b, nrhs) def NM_Cholesky_solve_matrix_rhs(Ao: "NumericsMatrix", B: "NumericsMatrix") -> "int": return _sicpynumerics.NM_Cholesky_solve_matrix_rhs(Ao, B) def NM_LDLT_solve(A: "NumericsMatrix", b: "double *", nrhs: "unsigned int") -> "int": return _sicpynumerics.NM_LDLT_solve(A, b, nrhs) def NM_LDLT_refine(Ao: "NumericsMatrix", x: "double *", b: "double *", nrhs: "unsigned int", tol: "double", maxitref: "int", job: "int") -> "int": return _sicpynumerics.NM_LDLT_refine(Ao, x, b, nrhs, tol, maxitref, job) def NM_gesv_expert(A: "NumericsMatrix", b: "double *", keep: "unsigned int") -> "int": return _sicpynumerics.NM_gesv_expert(A, b, keep) def NM_posv_expert(A: "NumericsMatrix", b: "double *", keep: "unsigned int") -> "int": return _sicpynumerics.NM_posv_expert(A, b, keep) def NM_gesv_expert_multiple_rhs(A: "NumericsMatrix", b: "double *", n_rhs: "unsigned int", keep: "unsigned int") -> "int": return _sicpynumerics.NM_gesv_expert_multiple_rhs(A, b, n_rhs, keep) def NM_Linear_solver_finalize(Ao: "NumericsMatrix") -> "int": return _sicpynumerics.NM_Linear_solver_finalize(Ao)
[docs] def NM_LU_inv(A: "NumericsMatrix") -> "NumericsMatrix *": r""" Computation of the inverse of a NumericsMatrix A usinf NM_gesv_expert :type A: :py:class:`NumericsMatrix`, in/out :param A: a NumericsMatrix. :rtype: :py:class:`NumericsMatrix` :return: the matrix inverse. """ return _sicpynumerics.NM_LU_inv(A)
def NM_inverse_diagonal_block_matrix_in_place(A: "NumericsMatrix") -> "int": return _sicpynumerics.NM_inverse_diagonal_block_matrix_in_place(A)
[docs] def NM_inverse_diagonal_block_matrix(A: "NumericsMatrix", block_number: "unsigned int", blocksizes: "unsigned int *") -> "NumericsMatrix *": r""" Computation of the inverse of a NumericsMatrix A composed of diagonal blocks for each block a dense inverse is performed and then inserted into the global inverse :type A: :py:class:`NumericsMatrix`, in :param A: a NumericsMatrix. :type block_number: int, in :param block_number: the number of blocks :param blocksize: the sizes of diagonal blocks :rtype: :py:class:`NumericsMatrix` :return: the matrix inverse. """ return _sicpynumerics.NM_inverse_diagonal_block_matrix(A, block_number, blocksizes)
[docs] def NM_gesv(A: "NumericsMatrix", b: "double *", preserve: "bool") -> "int": r""" Direct computation of the solution of a real system of linear equations: A x = b. :type A: :py:class:`NumericsMatrix`, in/out :param A: a NumericsMatrix. On a dense factorisation A.iWork is initialized. :type b: float, in/out :param b: pointer on a dense vector of size A->size1 :type preserve: boolean :param preserve: preserve the original matrix data. Only useful in the dense case, where the LU factorization is done in-place. :rtype: int :return: 0 if successful, else the error is specific to the backend solver used """ return _sicpynumerics.NM_gesv(A, b, preserve)
[docs] def NM_gesv_inv(A: "NumericsMatrix") -> "NumericsMatrix *": r""" Computation of the inverse of a NumericsMatrix A usinf NM_gesv_expert :type A: :py:class:`NumericsMatrix`, in/out :param A: a NumericsMatrix. :rtype: :py:class:`NumericsMatrix` :return: the matrix inverse. """ return _sicpynumerics.NM_gesv_inv(A)
[docs] def NM_setSparseSolver(A: "NumericsMatrix", solver_id: "NSM_linear_solver") -> "void": r""" Set the linear solver :type A: :py:class:`NumericsMatrix` :param A: the matrix :type solver_id: int :param solver_id: id of the solver """ return _sicpynumerics.NM_setSparseSolver(A, solver_id)
[docs] def NM_internalData(A: "NumericsMatrix") -> "NumericsMatrixInternalData *": r""" Get Matrix internal data with initialization if needed. :type A: :py:class:`NumericsMatrix`, in/out :param A: a NumericsMatrix. :rtype: :py:class:`NumericsMatrixInternalData` :return: a pointer on internal data. """ return _sicpynumerics.NM_internalData(A)
[docs] def NM_internalData_new(M: "NumericsMatrix") -> "void": r""" Allocate the internalData structure (but not its content!) :type M: :py:class:`NumericsMatrix` :param M: the matrix to modify """ return _sicpynumerics.NM_internalData_new(M)
[docs] def NM_internalData_copy(A: "NumericsMatrix", B: "NumericsMatrix") -> "void": r""" Copy the internalData structure :param M: the matrix to modify """ return _sicpynumerics.NM_internalData_copy(A, B)
[docs] def NM_iWork(A: "NumericsMatrix", size: "size_t", sizeof_elt: "size_t") -> "void *": r""" Integer work vector initialization, if needed. :type A: :py:class:`NumericsMatrix`, in/out :param A: pointer on a NumericsMatrix. :type size: int, in :param size: number of element to allocate :type sizeof_elt: int, in :param sizeof_elt: of an element in bytes (result of sizeof for instance) :rtype: void :return: pointer on A->iWork allocated space of with the right size """ return _sicpynumerics.NM_iWork(A, size, sizeof_elt)
[docs] def NM_dWork(A: "NumericsMatrix", size: "int") -> "double *": r""" Double workspace initialization, if needed. :type A: :py:class:`NumericsMatrix`, in/out :param A: pointer on a NumericsMatrix. :type size: int, in :param size: the size of needed space. :rtype: float :return: pointer on A->dWork allocated space of with the right size """ return _sicpynumerics.NM_dWork(A, size)
[docs] def NM_add_to_diag3(M: "NumericsMatrix", alpha: "double") -> "void": r""" Add a constant term to the diagonal elements, when the block of the SBM are 3x3 :type M: :py:class:`NumericsMatrix` :param M: the matrix :type alpha: float :param alpha: the term to add """ return _sicpynumerics.NM_add_to_diag3(M, alpha)
[docs] def NM_add_to_diag5(M: "NumericsMatrix", alpha: "double") -> "void": r""" Add a constant term to the diagonal elements, when the block of the SBM are 5x5 :type M: :py:class:`NumericsMatrix` :param M: the matrix :type alpha: float :param alpha: the term to add """ return _sicpynumerics.NM_add_to_diag5(M, alpha)
[docs] def NM_add(alpha: "double", A: "NumericsMatrix", beta: "double", B: "NumericsMatrix") -> "RawNumericsMatrix *": r""" Add two matrices with coefficients C = alpha*A + beta*B :type alpha: float :param alpha: the first coefficient :type A: :py:class:`NumericsMatrix` :param A: the first matrix :type beta: float :param beta: the second coefficient :type B: :py:class:`NumericsMatrix` :param B: the second matrix :rtype: :py:class:`RawNumericsMatrix` :return: C a new NumericsMatrix """ return _sicpynumerics.NM_add(alpha, A, beta, B)
[docs] def NM_scal(alpha: "double", A: "NumericsMatrix") -> "void": r""" Multiply a matrix with a double alpha*A --> A :type alpha: float :param alpha: the coefficient :type A: :py:class:`NumericsMatrix` :param A: the matrix """ return _sicpynumerics.NM_scal(alpha, A)
[docs] def NM_assert(type: "NM_types", M: "NumericsMatrix") -> "void": r""" assert that a NumericsMatrix has the right structure given its type :type type: int :param type: expected type :type M: :py:class:`NumericsMatrix` :param M: the matrix to check """ return _sicpynumerics.NM_assert(type, M)
[docs] def NM_check(A: "NumericsMatrix") -> "int": r""" Check the matrix (the sparse format for now) :type A: :py:class:`NumericsMatrix` :param A: the matrix to check :rtype: int :return: 0 if the matrix storage is fine, 1 if not """ return _sicpynumerics.NM_check(A)
[docs] def NM_norm_1(A: "NumericsMatrix") -> "double": r""" Compute the 1-norm of a sparse matrix = max (sum (abs (A))), largest column sum of a matrix (the sparse format for now) :type A: :py:class:`NumericsMatrix` :param A: the matrix :rtype: float :return: the norm """ return _sicpynumerics.NM_norm_1(A)
[docs] def NM_norm_inf(A: "NumericsMatrix") -> "double": r""" Compute the inf-norm of a sparse matrix = max (sum (abs (A^T))), largest row sum of a matrix (the sparse format for now) :type A: :py:class:`NumericsMatrix` :param A: the matrix :rtype: float :return: the norm """ return _sicpynumerics.NM_norm_inf(A)
def NM_is_symmetric(A: "NumericsMatrix") -> "int": return _sicpynumerics.NM_is_symmetric(A) def NM_symmetry_discrepancy(A: "NumericsMatrix") -> "double": return _sicpynumerics.NM_symmetry_discrepancy(A)
[docs] def NM_convert(A: "NumericsMatrix") -> "NumericsMatrix *": r""" Pass a NumericsMatrix through swig typemaps. This is only useful in python. :type A: :py:class:`NumericsMatrix` :param A: the matrix :rtype: :py:class:`NumericsMatrix` :return: a NumericsMatrix """ return _sicpynumerics.NM_convert(A)
[docs] def NM_iterated_power_method(A: "NumericsMatrix", tol: "double", itermax: "int") -> "double": r""" Compute the maximum eigenvalue with the iterated power method :type A: :py:class:`NumericsMatrix` :param A: the matrix :rtype: float :return: the maximum eigenvalue """ return _sicpynumerics.NM_iterated_power_method(A, tol, itermax)
[docs] def NM_max_by_columns(A: "NumericsMatrix", max: "double *") -> "int": r""" Compute the maximum values by columns :type A: :py:class:`NumericsMatrix` :param A: the matrix :type max: float :param max: the vector of max that must be preallocated :rtype: int :return: info """ return _sicpynumerics.NM_max_by_columns(A, max)
[docs] def NM_max_by_rows(A: "NumericsMatrix", max: "double *") -> "int": r""" Compute the maximum values by rows :type A: :py:class:`NumericsMatrix` :param A: the matrix :type max: float :param max: the vector of max that must be preallocated :rtype: int :return: info """ return _sicpynumerics.NM_max_by_rows(A, max)
[docs] def NM_max_abs_by_columns(A: "NumericsMatrix", max: "double *") -> "int": r""" Compute the maximum absolute values by columns :type A: :py:class:`NumericsMatrix` :param A: the matrix :type max: float :param max: the vector of max that must be preallocated :rtype: int :return: info """ return _sicpynumerics.NM_max_abs_by_columns(A, max)
[docs] def NM_max_abs_by_rows(A: "NumericsMatrix", max: "double *") -> "int": r""" Compute the maximum absolute values by rows :type A: :py:class:`NumericsMatrix` :param A: the matrix :type max: float :param max: the vector of max that must be preallocated :rtype: int :return: info """ return _sicpynumerics.NM_max_abs_by_rows(A, max)
[docs] def NM_compute_balancing_matrices(A: "NumericsMatrix", tol: "double", itermax: "int", B: "BalancingMatrices") -> "int": r""" Compute the balancing matrices for a given matrix by iteration :type A: :py:class:`NumericsMatrix` :param A: the matrix :type tol: float :param tol: tolerance on the balanced matrix :type itermax: int :param itermax: max number of iterations :param alloated: structure for the balancing matrices and the balanced matrix :rtype: int :return: 0 if succeed. """ return _sicpynumerics.NM_compute_balancing_matrices(A, tol, itermax, B)
[docs] def NM_BalancingMatrices_new(A: "NumericsMatrix") -> "BalancingMatrices *": r""" Create a Balancing Matrices structure :type A: :py:class:`NumericsMatrix` :param A: the matrix to be balanced """ return _sicpynumerics.NM_BalancingMatrices_new(A)
[docs] def NM_BalancingMatrices_free(A: "BalancingMatrices") -> "BalancingMatrices *": r""" free a Balancing Matrices structure""" return _sicpynumerics.NM_BalancingMatrices_free(A)
[docs] def NM_reset_version(M: "NumericsMatrix", id: "NM_types") -> "void": r""" Reset the version of a NM_types storage. :type M: :py:class:`NumericsMatrix` :param M: the NumericsMatrix, :type id: int :param id: the NM_types storage """ return _sicpynumerics.NM_reset_version(M, id)
[docs] def NM_reset_versions(M: "NumericsMatrix") -> "void": r""" Reset versions of all storages. :type M: :py:class:`NumericsMatrix` :param M: the NumericsMatrix """ return _sicpynumerics.NM_reset_versions(M)
def NM_version_sync(M: "NumericsMatrix") -> "void": return _sicpynumerics.NM_version_sync(M) def NM_isnan(M: "NumericsMatrix") -> "int": return _sicpynumerics.NM_isnan(M)
[docs] class linalg_data_t(object): r"""generic data struct for linear algebra operations""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr id = property(_sicpynumerics.linalg_data_t_id_get, _sicpynumerics.linalg_data_t_id_set) free_fn = property(_sicpynumerics.linalg_data_t_free_fn_get, _sicpynumerics.linalg_data_t_free_fn_set) def __init__(self): _sicpynumerics.linalg_data_t_swiginit(self, _sicpynumerics.new_linalg_data_t()) __swig_destroy__ = _sicpynumerics.delete_linalg_data_t
# Register linalg_data_t in _sicpynumerics: _sicpynumerics.linalg_data_t_swigregister(linalg_data_t) SN_LINALG_UNKNOWN = _sicpynumerics.SN_LINALG_UNKNOWN SN_LINALG_MKL = _sicpynumerics.SN_LINALG_MKL NSM_CSPARSE = _sicpynumerics.NSM_CSPARSE NSM_MUMPS = _sicpynumerics.NSM_MUMPS NSM_UMFPACK = _sicpynumerics.NSM_UMFPACK NSM_MKL_PARDISO = _sicpynumerics.NSM_MKL_PARDISO NSM_SUPERLU = _sicpynumerics.NSM_SUPERLU NSM_SUPERLU_MT = _sicpynumerics.NSM_SUPERLU_MT NSM_HSL = _sicpynumerics.NSM_HSL NSM_CS_CSC = _sicpynumerics.NSM_CS_CSC NSM_CS_CSR = _sicpynumerics.NSM_CS_CSR
[docs] class NSM_linear_solver_params(object): r"""solver-specific parameters""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr parent_matrix = property(_sicpynumerics.NSM_linear_solver_params_parent_matrix_get, _sicpynumerics.NSM_linear_solver_params_parent_matrix_set) solver = property(_sicpynumerics.NSM_linear_solver_params_solver_get, _sicpynumerics.NSM_linear_solver_params_solver_set) LDLT_solver = property(_sicpynumerics.NSM_linear_solver_params_LDLT_solver_get, _sicpynumerics.NSM_linear_solver_params_LDLT_solver_set) linear_solver_data = property(_sicpynumerics.NSM_linear_solver_params_linear_solver_data_get, _sicpynumerics.NSM_linear_solver_params_linear_solver_data_set, doc=r""" solver-specific data (or workspace)""") solver_free_hook = property(_sicpynumerics.NSM_linear_solver_params_solver_free_hook_get, _sicpynumerics.NSM_linear_solver_params_solver_free_hook_set, doc=r""" solver-specific hook to free linear_solver_data""") iWork = property(_sicpynumerics.NSM_linear_solver_params_iWork_get, _sicpynumerics.NSM_linear_solver_params_iWork_set, doc=r""" integer work vector array (internal)""") iWorkSize = property(_sicpynumerics.NSM_linear_solver_params_iWorkSize_get, _sicpynumerics.NSM_linear_solver_params_iWorkSize_set, doc=r""" size of integer work vector array""") dWork = property(_sicpynumerics.NSM_linear_solver_params_dWork_get, _sicpynumerics.NSM_linear_solver_params_dWork_set) dWorkSize = property(_sicpynumerics.NSM_linear_solver_params_dWorkSize_get, _sicpynumerics.NSM_linear_solver_params_dWorkSize_set) linalg_data = property(_sicpynumerics.NSM_linear_solver_params_linalg_data_get, _sicpynumerics.NSM_linear_solver_params_linalg_data_set, doc=r""" data for the linear algebra""") def __init__(self): _sicpynumerics.NSM_linear_solver_params_swiginit(self, _sicpynumerics.new_NSM_linear_solver_params()) __swig_destroy__ = _sicpynumerics.delete_NSM_linear_solver_params
# Register NSM_linear_solver_params in _sicpynumerics: _sicpynumerics.NSM_linear_solver_params_swigregister(NSM_linear_solver_params) NSM_UNKNOWN = _sicpynumerics.NSM_UNKNOWN NSM_TRIPLET = _sicpynumerics.NSM_TRIPLET NSM_CSC = _sicpynumerics.NSM_CSC NSM_CSR = _sicpynumerics.NSM_CSR NSM_HALF_TRIPLET = _sicpynumerics.NSM_HALF_TRIPLET
[docs] class NumericsSparseMatrix(object): r""" Sparse matrix representation in Numerics. The supported format are: triplet (aka coordinate, COO), CSC (via CSparse) and CSR if MKL is used """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr triplet = property(_sicpynumerics.NumericsSparseMatrix_triplet_get, _sicpynumerics.NumericsSparseMatrix_triplet_set, doc=r""" triplet format, aka coordinate""") half_triplet = property(_sicpynumerics.NumericsSparseMatrix_half_triplet_get, _sicpynumerics.NumericsSparseMatrix_half_triplet_set, doc=r""" half triplet format for symmetric matrices""") csc = property(_sicpynumerics.NumericsSparseMatrix_csc_get, _sicpynumerics.NumericsSparseMatrix_csc_set, doc=r""" csc matrix""") trans_csc = property(_sicpynumerics.NumericsSparseMatrix_trans_csc_get, _sicpynumerics.NumericsSparseMatrix_trans_csc_set, doc=r""" transpose of a csc matrix (used by CSparse)""") csr = property(_sicpynumerics.NumericsSparseMatrix_csr_get, _sicpynumerics.NumericsSparseMatrix_csr_set, doc=r""" csr matrix, only supported with mkl""") diag_indx = property(_sicpynumerics.NumericsSparseMatrix_diag_indx_get, _sicpynumerics.NumericsSparseMatrix_diag_indx_set, doc=r""" indices for the diagonal terms. Very useful for the proximal perturbation """) origin = property(_sicpynumerics.NumericsSparseMatrix_origin_get, _sicpynumerics.NumericsSparseMatrix_origin_set, doc=r""" original format of the matrix""") linearSolverParams = property(_sicpynumerics.NumericsSparseMatrix_linearSolverParams_get, _sicpynumerics.NumericsSparseMatrix_linearSolverParams_set, doc=r""" solver-specific parameters""") versions = property(_sicpynumerics.NumericsSparseMatrix_versions_get, _sicpynumerics.NumericsSparseMatrix_versions_set) def __init__(self): _sicpynumerics.NumericsSparseMatrix_swiginit(self, _sicpynumerics.new_NumericsSparseMatrix()) __swig_destroy__ = _sicpynumerics.delete_NumericsSparseMatrix
# Register NumericsSparseMatrix in _sicpynumerics: _sicpynumerics.NumericsSparseMatrix_swigregister(NumericsSparseMatrix)
[docs] def NSM_null(A: "NumericsSparseMatrix") -> "void": r""" Initialize the fields of a NumericsSparseMatrix :type A: :py:class:`NumericsSparseMatrix` :param A: the sparse matrix """ return _sicpynumerics.NSM_null(A)
[docs] def NSM_new() -> "NumericsSparseMatrix *": r""" New and empty NumericsSparseMatrix with correctly initialized fields. :rtype: :py:class:`NumericsSparseMatrix` :return: a pointer on the allocated space. """ return _sicpynumerics.NSM_new()
def NSM_triplet_eye(size: "unsigned int") -> "NumericsSparseMatrix *": return _sicpynumerics.NSM_triplet_eye(size) def NSM_triplet_scalar(size: "unsigned int", s: "double") -> "NumericsSparseMatrix *": return _sicpynumerics.NSM_triplet_scalar(size, s)
[docs] def NSM_clear(A: "NumericsSparseMatrix") -> "NumericsSparseMatrix *": r""" Free allocated space for a NumericsSparseMatrix. :type A: :py:class:`NumericsSparseMatrix` :param A: a NumericsSparseMatrix :rtype: :py:class:`NumericsSparseMatrix` :return: NULL on success """ return _sicpynumerics.NSM_clear(A)
[docs] def NSM_version_copy(A: "NumericsSparseMatrix", B: "NumericsSparseMatrix") -> "void": r""" Copy NumericsSparseMatrix version. :type A: :py:class:`NumericsSparseMatrix` :param A: a NumericsSparseMatrix :type B: :py:class:`NumericsSparseMatrix` :param B: a NumericsSparseMatrix """ return _sicpynumerics.NSM_version_copy(A, B)
[docs] def NSM_copy(A: "NumericsSparseMatrix", B: "NumericsSparseMatrix") -> "void": r""" Copy a NumericsSparseMatrix. :type A: :py:class:`NumericsSparseMatrix` :param A: a NumericsSparseMatrix :type B: :py:class:`NumericsSparseMatrix` :param B: a NumericsSparseMatrix """ return _sicpynumerics.NSM_copy(A, B)
[docs] def NSM_clear_p(p: "void *") -> "void": r""" Free a workspace related to a LU factorization :type p: void :param p: the structure to free """ return _sicpynumerics.NSM_clear_p(p)
[docs] def NSM_data(A: "NumericsSparseMatrix") -> "double *": r""" Get the data part of sparse matrix :type A: :py:class:`NumericsSparseMatrix` :param A: the sparse matrix :rtype: float :return: a pointer to the data array """ return _sicpynumerics.NSM_data(A)
[docs] def NSM_linear_solver_data(p: "NSM_linear_solver_params") -> "void *": r""" Get the LU factors for cs_lusol :type p: :py:class:`NSM_linear_solver_params` :param p: the structure holding the data for the solver """ return _sicpynumerics.NSM_linear_solver_data(p)
[docs] def NSM_workspace(p: "NSM_linear_solver_params") -> "double *": r""" Get the workspace for the sparse solver :type p: :py:class:`NSM_linear_solver_params` :param p: the structure holding the data for the solver :rtype: float :return: the (double) workspace """ return _sicpynumerics.NSM_workspace(p)
[docs] def NSM_nnz(A: "CSparseMatrix const *const") -> "size_t": r""" get the number of non-zero (nnz) in a sparse matrix :type A: CSparseMatrix :param A: the matrix :rtype: int :return: the number of non-zero elements in the matrix """ return _sicpynumerics.NSM_nnz(A)
[docs] def NSM_diag_indices(M: "NumericsMatrix") -> "long *": r""" return the set of indices corresponding to the diagonal elements of the matrix Warning: should be better tested :type M: :py:class:`NumericsMatrix` :param M: the matrix :rtype: int :return: the list of indices for the diagonal elements """ return _sicpynumerics.NSM_diag_indices(M)
[docs] def NSM_extract_block(M: "NumericsMatrix", blockM: "double *", pos_row: "size_t", pos_col: "size_t", block_row_size: "size_t", block_col_size: "size_t") -> "void": r""" Extract a block from a sparse matrix :type M: :py:class:`NumericsMatrix` :param M: matrix :type blockM: float :param blockM: dense storage for the block :type pos_row: int :param pos_row: starting row for the block :type pos_col: int :param pos_col: starting column for the block :type block_row_size: int :param block_row_size: block width :type block_col_size: int :param block_col_size: block height """ return _sicpynumerics.NSM_extract_block(M, blockM, pos_row, pos_col, block_row_size, block_col_size)
[docs] def NSM_linearSolverParams_free(p: "NSM_linear_solver_params") -> "NSM_linear_solver_params *": r""" Free allocated space for NSM_linear_solver_params. :type p: :py:class:`NSM_linear_solver_params` :param p: a NSM_linear_solver_params :rtype: :py:class:`NSM_linear_solver_params` :return: NULL on success """ return _sicpynumerics.NSM_linearSolverParams_free(p)
[docs] def NSM_linearSolverParams_new() -> "NSM_linear_solver_params *": r""" New and empty NSM_linear_solver_params. :rtype: :py:class:`NSM_linear_solver_params` :return: a pointer on the allocated space. """ return _sicpynumerics.NSM_linearSolverParams_new()
[docs] def NSM_linearSolverParams(A: "NumericsMatrix") -> "NSM_linear_solver_params *": r""" Get linear solver parameters with initialization if needed. :type A: :py:class:`NumericsMatrix`, in/out :param A: a NumericsMatrix. :rtype: :py:class:`NSM_linear_solver_params` :return: a pointer on parameters. """ return _sicpynumerics.NSM_linearSolverParams(A)
[docs] def NSM_fix_csc(A: "CSparseMatrix *") -> "void": r""" Check and fix a matrix, if needed :type A: CSparseMatrix :param A: the matrix to check, modified if necessary to have ordered indices """ return _sicpynumerics.NSM_fix_csc(A)
def NSM_sort_csc(A: "CSparseMatrix *") -> "void": return _sicpynumerics.NSM_sort_csc(A)
[docs] def NSM_origin(M: "NumericsSparseMatrix") -> "unsigned int": r""" return the origin of a sparse part of a matrix :type M: :py:class:`NumericsSparseMatrix` :param M: the matrix :rtype: int :return: -1 if the matrix has no sparse representation, the origin otherwise """ return _sicpynumerics.NSM_origin(M)
[docs] def NSM_get_origin(M: "NumericsSparseMatrix") -> "CSparseMatrix *": r""" return the sparse matrix that has the original label :type M: :py:class:`NumericsSparseMatrix` :param M: the matrix :rtype: CSparseMatrix :return: the sparse matrix that is at the origin, or NULL if an error occur """ return _sicpynumerics.NSM_get_origin(M)
def NSM_write_in_file(m: "NumericsSparseMatrix", file: "FILE *") -> "void": return _sicpynumerics.NSM_write_in_file(m, file)
[docs] def NSM_new_from_file(file: "FILE *") -> "NumericsSparseMatrix *": r""" New and empty NumericsSparseMatrix with correctly initialized fields. :rtype: :py:class:`NumericsSparseMatrix` :return: a pointer on the allocated space. """ return _sicpynumerics.NSM_new_from_file(file)
def NSM_to_dense(A: "NumericsSparseMatrix", B: "double *") -> "int": return _sicpynumerics.NSM_to_dense(A, B)
[docs] def NSM_version(M: "NumericsSparseMatrix", type: "NSM_t") -> "version_t": r""" Get current version of a type of csparse matrix. :type M: :py:class:`NumericsSparseMatrix` :param M: the NumericsSparseMatrix, :type type: int :param type: the type of sparse storage from NumericsSparseOrigin :rtype: version_t :return: a comparable version. """ return _sicpynumerics.NSM_version(M, type)
[docs] def NSM_max_version(M: "NumericsSparseMatrix") -> "version_t": r""" Get the maximum of versions of csparse matrices. :type M: :py:class:`NumericsSparseMatrix` :param M: the NumericsSparseMatrix, :rtype: version_t :return: a comparable version. """ return _sicpynumerics.NSM_max_version(M)
[docs] def NSM_set_version(M: "NumericsSparseMatrix", type: "NSM_t", value: "version_t") -> "void": r""" Set the version of a NumericsSparseMatrix. :type M: :py:class:`NumericsSparseMatrix` :param M: the NumericsSparseMatrix, :type type: int :param type: the NumericsSparseOrigin of storage, :type value: version_t :param value: the new version. """ return _sicpynumerics.NSM_set_version(M, type, value)
[docs] def NSM_reset_versions(M: "NumericsSparseMatrix") -> "void": r""" Reset all versions of a NumericsSparseMatrix. :type M: :py:class:`NumericsSparseMatrix` :param M: the NumericsSparseMatrix. """ return _sicpynumerics.NSM_reset_versions(M)
[docs] def NSM_reset_version(M: "NumericsSparseMatrix", type: "NSM_t") -> "void": r""" Reset version of a sparse storage. :type M: :py:class:`NumericsSparseMatrix` :param M: the NumericsSparseMatrix, :type type: int :param type: the NumericsSparseOrigin of storage. """ return _sicpynumerics.NSM_reset_version(M, type)
[docs] def NSM_inc_version(M: "NumericsSparseMatrix", type: "NSM_t") -> "void": r""" Increment the version of a NumericsSparseMatrix. :type M: :py:class:`NumericsSparseMatrix` :param M: the NumericsSparseMatrix, :type type: int :param type: the NumericsSparseOrigin of storage """ return _sicpynumerics.NSM_inc_version(M, type)
[docs] def NSM_latest_id(M: "NumericsSparseMatrix") -> "NSM_t": r""" Get the NumericsSparseOrigin with the latest version. :type M: :py:class:`NumericsSparseMatrix` :param M: the NumericsSparseMatrix :rtype: int :return: the NumericsSparseOrigin. """ return _sicpynumerics.NSM_latest_id(M)
[docs] def NSM_latest(M: "NumericsSparseMatrix") -> "CSparseMatrix *": r""" Get most recent CSparseMatrix. :type M: :py:class:`NumericsSparseMatrix` :param M: the NumericsSparseMatrix :rtype: CSparseMatrix :return: a pointer on a CSparseMatrix. """ return _sicpynumerics.NSM_latest(M)
[docs] def NSM_version_sync(M: "NumericsSparseMatrix") -> "void": r""" Sync matrix origin and version :type M: :py:class:`NumericsSparseMatrix` :param M: the NumericsSparseMatrix """ return _sicpynumerics.NSM_version_sync(M)
def NM_MPI_rank(A: "NumericsMatrix") -> "int": return _sicpynumerics.NM_MPI_rank(A) def NM_MPI_copy(A: "NumericsMatrix", B: "NumericsMatrix") -> "void": return _sicpynumerics.NM_MPI_copy(A, B)
[docs] def NM_MUMPS_copy(A: "NumericsMatrix", B: "NumericsMatrix") -> "void": r""" copy MUMPS id if compiled WITH_MUMPS, otherwise do nothing. :type A: :py:class:`NumericsMatrix` :param A: the source NumericsMatrix :type B: :py:class:`NumericsMatrix` :param B: the destination NumericsMatrix """ return _sicpynumerics.NM_MUMPS_copy(A, B)
SICONOS_MLCP_PGS = _sicpynumerics.SICONOS_MLCP_PGS SICONOS_MLCP_RPGS = _sicpynumerics.SICONOS_MLCP_RPGS SICONOS_MLCP_PSOR = _sicpynumerics.SICONOS_MLCP_PSOR SICONOS_MLCP_RPSOR = _sicpynumerics.SICONOS_MLCP_RPSOR SICONOS_MLCP_PATH = _sicpynumerics.SICONOS_MLCP_PATH SICONOS_MLCP_ENUM = _sicpynumerics.SICONOS_MLCP_ENUM SICONOS_MLCP_SIMPLEX = _sicpynumerics.SICONOS_MLCP_SIMPLEX SICONOS_MLCP_DIRECT_ENUM = _sicpynumerics.SICONOS_MLCP_DIRECT_ENUM SICONOS_MLCP_PATH_ENUM = _sicpynumerics.SICONOS_MLCP_PATH_ENUM SICONOS_MLCP_DIRECT_SIMPLEX = _sicpynumerics.SICONOS_MLCP_DIRECT_SIMPLEX SICONOS_MLCP_DIRECT_PATH = _sicpynumerics.SICONOS_MLCP_DIRECT_PATH SICONOS_MLCP_DIRECT_PATH_ENUM = _sicpynumerics.SICONOS_MLCP_DIRECT_PATH_ENUM SICONOS_MLCP_FB = _sicpynumerics.SICONOS_MLCP_FB SICONOS_MLCP_DIRECT_FB = _sicpynumerics.SICONOS_MLCP_DIRECT_FB SICONOS_MLCP_PGS_SBM = _sicpynumerics.SICONOS_MLCP_PGS_SBM SICONOS_MLCP_LCP_LEMKE = _sicpynumerics.SICONOS_MLCP_LCP_LEMKE SICONOS_IPARAM_MLCP_PGS_EXPLICIT = _sicpynumerics.SICONOS_IPARAM_MLCP_PGS_EXPLICIT SICONOS_IPARAM_MLCP_PGS_SUM_ITER = _sicpynumerics.SICONOS_IPARAM_MLCP_PGS_SUM_ITER SICONOS_IPARAM_MLCP_ENUM_USE_DGELS = _sicpynumerics.SICONOS_IPARAM_MLCP_ENUM_USE_DGELS SICONOS_IPARAM_MLCP_NUMBER_OF_CONFIGURATIONS = _sicpynumerics.SICONOS_IPARAM_MLCP_NUMBER_OF_CONFIGURATIONS SICONOS_IPARAM_MLCP_UPDATE_REQUIRED = _sicpynumerics.SICONOS_IPARAM_MLCP_UPDATE_REQUIRED SICONOS_DPARAM_MLCP_PGS_SUM_ERRORS = _sicpynumerics.SICONOS_DPARAM_MLCP_PGS_SUM_ERRORS SICONOS_DPARAM_MLCP_RHO = _sicpynumerics.SICONOS_DPARAM_MLCP_RHO SICONOS_DPARAM_MLCP_OMEGA = _sicpynumerics.SICONOS_DPARAM_MLCP_OMEGA SICONOS_DPARAM_MLCP_SIGN_TOL_NEG = _sicpynumerics.SICONOS_DPARAM_MLCP_SIGN_TOL_NEG SICONOS_DPARAM_MLCP_SIGN_TOL_POS = _sicpynumerics.SICONOS_DPARAM_MLCP_SIGN_TOL_POS
[docs] class MLCP(object): r""" The Structure that contains and defines MLCProblem. Find :math:`(z,w)` such that: .. math:: \left\{ \begin{array}{l} M \ z + q = w \\ w_1=0 \\ 0 \le w_{2} \perp v \ge 0 \end{array} \right. \text{ with } z= \left[ \begin{array}{c} u\\ v\\ \end{array} \right] \text{ and } w= \left[ \begin{array}{c} w_{1}\\ w_{2}\\ \end{array} \right] :math:`u, w_{1}` are vectors of size n. :math:`v, w_{2}` are vectors of size m. ABCD format (see "R. W. {Cottle} and J. {Pang} and R. E. {Stone}", "The Linear Complementarity Problem, Academic Press, Inc., 1992, Section 1.5 ) \f[ \left[ \begin{array}{cc} A & C \\ D & B \\ \end{array} \right] \f] """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr isStorageType1 = property(_sicpynumerics.MLCP_isStorageType1_get, _sicpynumerics.MLCP_isStorageType1_set, doc=r""" boolean for storageType1 1 if the problem is saved using (M,q), 0 otherwise """) isStorageType2 = property(_sicpynumerics.MLCP_isStorageType2_get, _sicpynumerics.MLCP_isStorageType2_set, doc=r""" boolean for storageType2 1 if the problem is saved using (A,B,C,D,a,b), 0 otherwise """) n = property(_sicpynumerics.MLCP_n_get, _sicpynumerics.MLCP_n_set, doc=r""" number of equality constraints""") m = property(_sicpynumerics.MLCP_m_get, _sicpynumerics.MLCP_m_set, doc=r""" number of complementarity constraints""") blocksRows = property(_sicpynumerics.MLCP_blocksRows_get, _sicpynumerics.MLCP_blocksRows_set, doc=r""" The rows from blocksRows[i] to blocksRows[i+1]-1 forms a block of equalities iif bloksIsComp[i]=0, else the block is a complementarity block. The number of total blocks is given by NbBlocks such that blocksRows[NbBlocks] = n+m """) blocksIsComp = property(_sicpynumerics.MLCP_blocksIsComp_get, _sicpynumerics.MLCP_blocksIsComp_set, doc=r""" if bloksIsComp[i]=0, then block i formed by the rows from blocksRows[i] to blocksRows[i+1]-1 is an equality block else the block is a complementarity block. """) M = property(_sicpynumerics.MLCP_M_get, _sicpynumerics.MLCP_M_set, doc=r""" M matrix of the MLCP""") q = property(_sicpynumerics.MLCP_q_get, _sicpynumerics.MLCP_q_set, doc=r""" q vector of the MLCP""") A = property(_sicpynumerics.MLCP_A_get, _sicpynumerics.MLCP_A_set, doc=r""" A matrix of the MLCP""") B = property(_sicpynumerics.MLCP_B_get, _sicpynumerics.MLCP_B_set, doc=r""" B matrix of the MLCP""") C = property(_sicpynumerics.MLCP_C_get, _sicpynumerics.MLCP_C_set, doc=r""" C matrix of the MLCP""") D = property(_sicpynumerics.MLCP_D_get, _sicpynumerics.MLCP_D_set, doc=r""" D matrix of the MLCP""") a = property(_sicpynumerics.MLCP_a_get, _sicpynumerics.MLCP_a_set, doc=r""" a vector of the MLCP""") b = property(_sicpynumerics.MLCP_b_get, _sicpynumerics.MLCP_b_set, doc=r""" b vector of the MLCP""") def __init__(self, *args): _sicpynumerics.MLCP_swiginit(self, _sicpynumerics.new_MLCP(*args)) __swig_destroy__ = _sicpynumerics.delete_MLCP
# Register MLCP in _sicpynumerics: _sicpynumerics.MLCP_swigregister(MLCP) SICONOS_NONAME_STR = cvar.SICONOS_NONAME_STR SICONOS_MLCP_PGS_STR = cvar.SICONOS_MLCP_PGS_STR SICONOS_MLCP_RPGS_STR = cvar.SICONOS_MLCP_RPGS_STR SICONOS_MLCP_PSOR_STR = cvar.SICONOS_MLCP_PSOR_STR SICONOS_MLCP_RPSOR_STR = cvar.SICONOS_MLCP_RPSOR_STR SICONOS_MLCP_PATH_STR = cvar.SICONOS_MLCP_PATH_STR SICONOS_MLCP_ENUM_STR = cvar.SICONOS_MLCP_ENUM_STR SICONOS_MLCP_SIMPLEX_STR = cvar.SICONOS_MLCP_SIMPLEX_STR SICONOS_MLCP_DIRECT_ENUM_STR = cvar.SICONOS_MLCP_DIRECT_ENUM_STR SICONOS_MLCP_PATH_ENUM_STR = cvar.SICONOS_MLCP_PATH_ENUM_STR SICONOS_MLCP_DIRECT_SIMPLEX_STR = cvar.SICONOS_MLCP_DIRECT_SIMPLEX_STR SICONOS_MLCP_DIRECT_PATH_STR = cvar.SICONOS_MLCP_DIRECT_PATH_STR SICONOS_MLCP_DIRECT_PATH_ENUM_STR = cvar.SICONOS_MLCP_DIRECT_PATH_ENUM_STR SICONOS_MLCP_FB_STR = cvar.SICONOS_MLCP_FB_STR SICONOS_MLCP_DIRECT_FB_STR = cvar.SICONOS_MLCP_DIRECT_FB_STR SICONOS_MLCP_PGS_SBM_STR = cvar.SICONOS_MLCP_PGS_SBM_STR SICONOS_MLCP_LCP_LEMKE_STR = cvar.SICONOS_MLCP_LCP_LEMKE_STR
[docs] def mixedLinearComplementarity_free(problem: "MLCP") -> "void": r""" function to delete a MixedLinearComplementarityProblem :type problem: :py:class:`MixedLinearComplementarityProblem` :param problem: pointer to a MixedLinearComplementarityProblem to delete """ return _sicpynumerics.mixedLinearComplementarity_free(problem)
[docs] def mixedLinearComplementarity_new() -> "MixedLinearComplementarityProblem *": r""" create empty MLCP :rtype: :py:class:`MixedLinearComplementarityProblem` :return: empy MLCP """ return _sicpynumerics.mixedLinearComplementarity_new()
[docs] def mixedLinearComplementarity_display(p: "MLCP") -> "void": r""" display a MLCP""" return _sicpynumerics.mixedLinearComplementarity_display(p)
[docs] def mixedLinearComplementarity_printInFile(problem: "MLCP", file: "FILE *") -> "int": r""" function to write in a file a MixedLinearComplementarityProblem :type problem: :py:class:`MixedLinearComplementarityProblem` :param problem: pointer to a MixedLinearComplementarityProblem to print :type file: FILE :param file: pointer to a FILE :rtype: int :return: 0 if ok """ return _sicpynumerics.mixedLinearComplementarity_printInFile(problem, file)
[docs] def mixedLinearComplementarity_newFromFile(problem: "MLCP", file: "FILE *") -> "int": r""" Function to read and create a MixedLinearComplementarityProblem from a file :type problem: :py:class:`MixedLinearComplementarityProblem` :param problem: pointer to a MixedLinearComplementarityProblem to create :type file: FILE :param file: pointer to a FILE :rtype: int :return: 0 if ok """ return _sicpynumerics.mixedLinearComplementarity_newFromFile(problem, file)
[docs] def mixedLinearComplementarity_newFromFileOld(problem: "MLCP", file: "FILE *") -> "int": r""" Function to read and create a MixedLinearComplementarityProblem from a file :type problem: :py:class:`MixedLinearComplementarityProblem` :param problem: pointer to a MixedLinearComplementarityProblem to create :type file: FILE :param file: pointer to a FILE :rtype: int :return: 0 if ok """ return _sicpynumerics.mixedLinearComplementarity_newFromFileOld(problem, file)
[docs] def mixedLinearComplementarity_newFromFilename(problem: "MLCP", filename: "char const *") -> "int": r""" Function to read and create a MixedLinearComplementarityProblem from a file :type problem: :py:class:`MixedLinearComplementarityProblem` :param problem: pointer to a MixedLinearComplementarityProblem to create :type filename: string :param filename: that contains the mlcp :rtype: int :return: 0 if ok """ return _sicpynumerics.mixedLinearComplementarity_newFromFilename(problem, filename)
[docs] def mixedLinearComplementarity_fromMtoABCD(problem: "MLCP") -> "MixedLinearComplementarityProblem *": r""" Function to create a MLCP with ABCD format from M formatted MLCP""" return _sicpynumerics.mixedLinearComplementarity_fromMtoABCD(problem)
[docs] def mlcp_driver_init(problem: "MLCP", options: "SolverOptions") -> "void": r""" General interface to initialize a solver. Must be call for the following solvers: - mlcp_enum - mlcp_path - mlcp_simplex - mlcp_direct_enum - mlcp_direct_path - mlcp_direct_simplex :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: the MixedLinearComplementarityProblem structure which handles the problem (M,q) :type options: :py:class:`SolverOptions`, in :param options: structure used to define the solver(s) and their parameters """ return _sicpynumerics.mlcp_driver_init(problem, options)
[docs] def mlcp_driver_reset(problem: "MLCP", options: "SolverOptions") -> "void": r""" General interface to reset a solver. Must be call for the following solvers: - mlcp_enum - mlcp_path - mlcp_simplex - mlcp_direct_enum - mlcp_direct_path - mlcp_direct_simplex :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: the MixedLinearComplementarityProblem structure which handles the problem (M,q) :type options: :py:class:`SolverOptions`, in :param options: structure used to define the solver(s) and their parameters """ return _sicpynumerics.mlcp_driver_reset(problem, options)
[docs] def mlcp_pgs(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" mlcp_pgs (Projected Gauss-Seidel) is a basic Projected Gauss-Seidel solver for MLCP. :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,m,M, q...) :type z: float, in/out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_pgs(problem, z, w, options)
[docs] def mlcp_rpgs(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" mlcp_rpgs (Projected Gauss-Seidel) is a basic Projected Gauss-Seidel solver for MLCP. :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,m,M, q...) :type z: float, in/out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_rpgs(problem, z, w, options)
[docs] def mlcp_psor(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" mlcp_psor (projected successive overrelaxation method) is a solver for MLCP. :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,m,M, q...) :type z: float, in/out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_psor(problem, z, w, options)
[docs] def mlcp_rpsor(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" mlcp_rpsor (regularized projected successive overrelaxation method) is a solver for MLCP. :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,m,M, q...) :type z: float, in/out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_rpsor(problem, z, w, options)
[docs] def mlcp_path(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" path solver :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,m,M, q...) :type z: float, in/out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_path(problem, z, w, options)
[docs] def mlcp_enum(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" enum solver :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,mM, q...) :type z: float, out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_enum(problem, z, w, options)
[docs] def mlcp_direct(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" direct solver :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: MixedLinearComplementarityProblem* problem structure that represents the MLCP (n,mM, q...) :type z: float, out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_direct(problem, z, w, options)
[docs] def mlcp_direct_enum(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" direct-enum solver :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,mM, q...) :type z: float, out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_direct_enum(problem, z, w, options)
[docs] def mlcp_direct_simplex(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" direct-simplex solver :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,mM, q...) :type z: float, out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_direct_simplex(problem, z, w, options)
[docs] def mlcp_direct_path(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" direct-path solver :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,mM, q...) :type z: float, out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : success, solution found 1 : failure,it did not find any solution :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_direct_path(problem, z, w, options)
[docs] def mlcp_simplex(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" simplex solver :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,mM, q...) :type z: float, out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_simplex(problem, z, w, options)
[docs] def mlcp_FB(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" Fischer Burmeister solver :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,mM, q...) :type z: float, out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_FB(problem, z, w, options)
[docs] def mlcp_direct_FB(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" Direct Fischer Burmeister solver :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,mM, q...) :type z: float, out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, out :param w: a m+n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : success, solution found 1 : failure,it did not find any solution :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_direct_FB(problem, z, w, options)
[docs] def mlcp_pgs_SBM(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" generic interface used to call any MLCP solver applied on a Sparse-Block structured matrix M, with a Gauss-Seidel process to solve the global problem (formulation/solving of local problems for each row of blocks) :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...). M must be a SparseBlockStructuredMatrix :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int :param info: an integer which returns the termination value: 0 : convergence >0 : failed, depends on local solver :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mlcp_pgs_SBM(problem, z, w, options)
def mlcp_lcp_lemke(problem: "MLCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": return _sicpynumerics.mlcp_lcp_lemke(problem, z, w, options) def mlcp_lcp_lemke_default(options: "SolverOptions") -> "void": return _sicpynumerics.mlcp_lcp_lemke_default(options)
[docs] def mlcp_compute_error(problem: "MLCP", z: "double *", w: "double *", tolerance: "double") -> "double *": r""" This function checks the validity of the vector z as a solution of the MLCP. :type problem: :py:class:`MixedLinearComplementarityProblem`, in :param problem: structure that represents the MLCP (n,m,M, q... or (A,B,C...)) :type z: float, in/out :param z: a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a m+n-vector of doubles which returns the solution of the problem. :type tolerance: float, in :param tolerance: threshold used to validate the solution: if the error is less than this value, the solution is accepted :type error: float, in/out :param error: :rtype: int :return: status: 0 : convergence, 1: error > tolerance """ return _sicpynumerics.mlcp_compute_error(problem, z, w, tolerance)
def mlcp_pgs_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.mlcp_pgs_set_default(options) def mlcp_pgs_sbm_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.mlcp_pgs_sbm_set_default(options) def mlcp_rpgs_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.mlcp_rpgs_set_default(options) def mlcp_psor_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.mlcp_psor_set_default(options) def mlcp_rpsor_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.mlcp_rpsor_set_default(options) def mlcp_direct_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.mlcp_direct_set_default(options) def mlcp_direct_enum_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.mlcp_direct_enum_set_default(options) def mlcp_enum_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.mlcp_enum_set_default(options)
[docs] class LCP(object): r""" Structure that contains and defines a LCP Problem.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr size = property(_sicpynumerics.LCP_size_get, _sicpynumerics.LCP_size_set, doc=r""" size of the problem""") M = property(_sicpynumerics.LCP_M_get, _sicpynumerics.LCP_M_set, doc=r""" M matrix of the LCP (see the mathematical description)""") q = property(_sicpynumerics.LCP_q_get, _sicpynumerics.LCP_q_set, doc=r""" vector of the LCP (see the mathematical description)""") def __init__(self, M: "PyObject *", q: "PyObject *"): _sicpynumerics.LCP_swiginit(self, _sicpynumerics.new_LCP(M, q)) __swig_destroy__ = _sicpynumerics.delete_LCP
# Register LCP in _sicpynumerics: _sicpynumerics.LCP_swigregister(LCP)
[docs] def linearComplementarity_display(problem: "LCP") -> "void": r""" display a LinearComplementarityProblem :type problem: :py:class:`LinearComplementarityProblem` :param problem: pointer to a LinearComplementarityProblem to display """ return _sicpynumerics.linearComplementarity_display(problem)
[docs] def linearComplementarity_printInFile(problem: "LCP", file: "FILE *") -> "int": r""" function to write in a file a LinearComplementarityProblem :type problem: :py:class:`LinearComplementarityProblem` :param problem: pointer to a LinearComplementarityProblem to print :type file: FILE :param file: pointer to a FILE :rtype: int :return: 0 if ok """ return _sicpynumerics.linearComplementarity_printInFile(problem, file)
[docs] def linearComplementarity_newFromFile(problem: "LCP", file: "FILE *") -> "int": r""" Read and create a LinearComplementarityProblem from a file :type problem: :py:class:`LinearComplementarityProblem` :param problem: pointer to a LinearComplementarityProblem to create :type file: FILE :param file: pointer to a FILE :rtype: int :return: 0 if ok """ return _sicpynumerics.linearComplementarity_newFromFile(problem, file)
[docs] def linearComplementarity_newFromFilename(problem: "LCP", filename: "char const *") -> "int": r""" Read and create a LinearComplementarityProblem from a file :type problem: :py:class:`LinearComplementarityProblem` :param problem: pointer to a LinearComplementarityProblem to create :type filename: string :param filename: that contains the lcp :rtype: int :return: 0 if ok """ return _sicpynumerics.linearComplementarity_newFromFilename(problem, filename)
[docs] def freeLinearComplementarityProblem(problem: "LCP") -> "void": r""" Delete a LinearComplementarityProblem :type problem: :py:class:`LinearComplementarityProblem` :param problem: pointer to a LinearComplementarityProblem to delete """ return _sicpynumerics.freeLinearComplementarityProblem(problem)
[docs] def newLCP() -> "LinearComplementarityProblem *": r""" Create new LCP and clear its fields :rtype: :py:class:`LinearComplementarityProblem` :return: a LinearComplementarityProblem """ return _sicpynumerics.newLCP()
[docs] def lcp_qp(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_qp uses a quadratic programm formulation for solving a LCP :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence / minimization sucessfull 1 : Too Many iterations 2 : Accuracy insuficient to satisfy convergence criterion 5 : Length of working array insufficient Other : The constraints are inconstent :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_qp(problem, z, w, options)
[docs] def lcp_cpg(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_cpg is a CPG (Conjugated Projected Gradient) solver for LCP based on quadratic minimization. :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0: convergence 1: iter = itermax 2: negative diagonal term 3: pWp nul :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_cpg(problem, z, w, options)
[docs] def lcp_pgs(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_pgs (Projected Gauss-Seidel) is a basic Projected Gauss-Seidel solver for LCP. :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_pgs(problem, z, w, options)
[docs] def lcp_rpgs(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_rpgs (Regularized Projected Gauss-Seidel ) is a solver for LCP, able to handle matrices with null diagonal terms. :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. TODO: Sizing the regularization paramter and apply it only on null diagnal term """ return _sicpynumerics.lcp_rpgs(problem, z, w, options)
[docs] def lcp_psor(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_psor Projected Succesive over relaxation solver for LCP. See cottle, Pang Stone Chap 5 :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. TODO: use the relax parameter add test add a vector of relaxation parameter wtith an auto sizing (see SOR algorithm for linear solver.) """ return _sicpynumerics.lcp_psor(problem, z, w, options)
[docs] def lcp_nsqp(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_nsqp use a quadratic programm formulation for solving an non symmetric LCP :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence / minimization sucessfull 1 : Too Many iterations 2 : Accuracy insuficient to satisfy convergence criterion 5 : Length of working array insufficient Other : The constraints are inconstent :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_nsqp(problem, z, w, options)
[docs] def lcp_latin(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_latin (LArge Time INcrements) is a basic latin solver for LCP. :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : Cholesky Factorization failed 3 : nul diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_latin(problem, z, w, options)
[docs] def lcp_latin_w(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_latin_w (LArge Time INcrements) is a basic latin solver with relaxation for LCP. :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : Cholesky Factorization failed 3 : nul diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_latin_w(problem, z, w, options)
[docs] def lcp_lexicolemke(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_lexicolemke is a direct solver for LCP based on pivoting method principle for degenerate problem Choice of pivot variable is performed via lexicographic ordering Ref: "The Linear Complementarity Problem" Cottle, Pang, Stone (1992) :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_lexicolemke(problem, z, w, options)
[docs] def lcp_newton_min(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_newton_min uses a nonsmooth Newton method based on the min formulation (or max formulation) of the LCP :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence / minimization sucessfull 1 : Too Many iterations 2 : Accuracy insuficient to satisfy convergence criterion 5 : Length of working array insufficient Other : The constraints are inconstent :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. TODO: Optimizing the memory allocation (Try to avoid the copy of JacH into A) Add rules for the computation of the penalization rho Add a globalization strategy based on a decrease of a merit function. (Nonmonotone LCP) Reference in Ferris Kanzow 2002 """ return _sicpynumerics.lcp_newton_min(problem, z, w, options)
[docs] def lcp_newton_FB(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_newton_FB use a nonsmooth newton method based on the Fischer-Bursmeister convex function :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 - convergence 1 - iter = itermax 2 - failure in the descent direction search (in LAPACK) :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. TODO: Optimizing the memory allocation (Try to avoid the copy of JacH into A) Add rules for the computation of the penalization rho Add a globalization strategy based on a decrease of a merit function. (Nonmonotone LCP) Reference in Ferris Kanzow 2002 """ return _sicpynumerics.lcp_newton_FB(problem, z, w, options)
[docs] def lcp_newton_minFB(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_newton_minFB use a nonsmooth newton method based on both a min and Fischer-Bursmeister reformulation References: Facchinei--Pang (2003) :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 - convergence 1 - iter = itermax 2 - failure in the descent direction search (in LAPACK) :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_newton_minFB(problem, z, w, options)
[docs] def lcp_path(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" path solver :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_path(problem, z, w, options)
[docs] def lcp_enum(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" enumerative solver :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : success 1 : failed :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_enum(problem, z, w, options)
[docs] def lcp_enum_init(problem: "LCP", options: "SolverOptions", withMemAlloc: "int") -> "void": r""" Proceed with initialisation required before any call of the enum solver. :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. :type withMemAlloc: int, in :param withMemAlloc: If it is not 0, then the necessary work memory is allocated. """ return _sicpynumerics.lcp_enum_init(problem, options, withMemAlloc)
[docs] def lcp_enum_reset(problem: "LCP", options: "SolverOptions", withMemAlloc: "int") -> "void": r""" Reset state for enum solver parameters. :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. :type withMemAlloc: int, in :param withMemAlloc: If it is not 0, then the work memory is free. """ return _sicpynumerics.lcp_enum_reset(problem, options, withMemAlloc)
[docs] def lcp_avi_caoferris(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_avi_caoferris is a direct solver for LCP based on an Affine Variational Inequalities (AVI) reformulation The AVI solver is here the one from Cao and Ferris Ref: "A Pivotal Method for Affine Variational Inequalities" Menglin Cao et Michael Ferris (1996) :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_avi_caoferris(problem, z, w, options)
[docs] def lcp_pivot(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_pivot is a direct solver for LCP based on a pivoting method It can currently use Bard, Murty's least-index or Lemke rule for choosing the pivot. The default one is Lemke and it can be changed by setting iparam[SICONOS_LCP_IPARAM_PIVOTING_METHOD_TYPE]. The list of choices are in the enum LCP_PIVOT (see lcp_cst.h). :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_pivot(problem, z, w, options)
def lcp_pivot_covering_vector(problem: "LCP", u: "double *", s: "double *", options: "SolverOptions", cov_vec: "double *") -> "int *": return _sicpynumerics.lcp_pivot_covering_vector(problem, u, s, options, cov_vec) def lcp_pivot_lumod(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": return _sicpynumerics.lcp_pivot_lumod(problem, z, w, options) def lcp_pivot_lumod_covering_vector(problem: "LCP", u: "double *", s: "double *", options: "SolverOptions", cov_vec: "double *") -> "int *": return _sicpynumerics.lcp_pivot_lumod_covering_vector(problem, u, s, options, cov_vec)
[docs] def lcp_pathsearch(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_pathsearch is a direct solver for LCP based on the pathsearch algorithm Warning: this solver is available for testing purposes only! consider using lcp_pivot() if you are looking for simular solvers :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_pathsearch(problem, z, w, options)
[docs] def lcp_gams(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" lcp_gams uses the solver provided by GAMS :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int, out :param info: an integer which returns the termination value: 0 : convergence 1 : iter = itermax :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_gams(problem, z, w, options)
[docs] def lcp_nsgs_SBM(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" generic interface used to call any LCP solver applied on a Sparse-Block structured matrix M, with a Gauss-Seidel process to solve the global problem (formulation/solving of local problems for each row of blocks) :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...). M must be a SparseBlockStructuredMatrix :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type info: int :param info: an integer which returns the termination value: 0 : convergence >0 : failed, depends on local solver :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.lcp_nsgs_SBM(problem, z, w, options)
[docs] def lcp_nsgs_SBM_buildLocalProblem(rowNumber: "int", blmat: "SparseBlockStructuredMatrix", local_problem: "LCP", q: "double *", z: "double *") -> "void": r""" Construct local problem from a "global" one :type rowNumber: int :param rowNumber: index of the local problem :type blmat: :py:class:`SparseBlockStructuredMatrix` :param blmat: matrix containing the problem :type local_problem: :py:class:`LinearComplementarityProblem` :param local_problem: problem to fill :type q: float :param q: big q :type z: float :param z: big z """ return _sicpynumerics.lcp_nsgs_SBM_buildLocalProblem(rowNumber, blmat, local_problem, q, z)
[docs] def lcp_compute_error(problem: "LCP", z: "double *", w: "double *", tolerance: "double") -> "double *": r""" Computes error criterion and update :math:`w = Mz + q`. :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: structure that represents the LCP (M, q...) :type z: float, in/out :param z: a n-vector of doubles which contains the initial solution and returns the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which returns the solution of the problem. :type tolerance: float, in :param tolerance: threshold used to validate the solution: if the error is less than this value, the solution is accepted :type error: float, out :param error: the actual error of the solution with respect to the problem :rtype: int :return: status: 0 : convergence, 1: error > tolerance """ return _sicpynumerics.lcp_compute_error(problem, z, w, tolerance)
[docs] def lcp_driver_DenseMatrix(problem: "LCP", z: "double *", w: "double *", options: "SolverOptions") -> "int": r""" Interface to solvers for Linear Complementarity Problems, dedicated to dense matrix storage :type problem: :py:class:`LinearComplementarityProblem`, in :param problem: the LinearComplementarityProblem structure which handles the problem (M,q) :type z: float, in/out :param z: a n-vector of doubles which contains the solution of the problem. :type w: float, in/out :param w: a n-vector of doubles which contains the solution of the problem. :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver(s) and their parameters :rtype: int :return: info termination value - 0 : successful - >0 : otherwise see each solver for more information about the log info """ return _sicpynumerics.lcp_driver_DenseMatrix(problem, z, w, options)
def lcp_ConvexQP_ProjectedGradient(problem: "LCP", reaction: "double *", velocity: "double *", options: "SolverOptions") -> "int *": return _sicpynumerics.lcp_ConvexQP_ProjectedGradient(problem, reaction, velocity, options) def lcp_lexicolemke_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.lcp_lexicolemke_set_default(options) def lcp_nsgs_sbm_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.lcp_nsgs_sbm_set_default(options) def lcp_latin_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.lcp_latin_set_default(options) def lcp_latin_w_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.lcp_latin_w_set_default(options) def lcp_newton_FB_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.lcp_newton_FB_set_default(options) def lcp_psor_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.lcp_psor_set_default(options) def lcp_rpgs_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.lcp_rpgs_set_default(options) def lcp_enum_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.lcp_enum_set_default(options) def lcp_pivot_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.lcp_pivot_set_default(options) def lcp_pathsearch_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.lcp_pathsearch_set_default(options) def lcp_pivot_lumod_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.lcp_pivot_lumod_set_default(options) SICONOS_LCP_LEMKE = _sicpynumerics.SICONOS_LCP_LEMKE SICONOS_LCP_NSGS_SBM = _sicpynumerics.SICONOS_LCP_NSGS_SBM SICONOS_LCP_PGS = _sicpynumerics.SICONOS_LCP_PGS SICONOS_LCP_CPG = _sicpynumerics.SICONOS_LCP_CPG SICONOS_LCP_LATIN = _sicpynumerics.SICONOS_LCP_LATIN SICONOS_LCP_LATIN_W = _sicpynumerics.SICONOS_LCP_LATIN_W SICONOS_LCP_QP = _sicpynumerics.SICONOS_LCP_QP SICONOS_LCP_NSQP = _sicpynumerics.SICONOS_LCP_NSQP SICONOS_LCP_NEWTONMIN = _sicpynumerics.SICONOS_LCP_NEWTONMIN SICONOS_LCP_NEWTON_FB_FBLSA = _sicpynumerics.SICONOS_LCP_NEWTON_FB_FBLSA SICONOS_LCP_PSOR = _sicpynumerics.SICONOS_LCP_PSOR SICONOS_LCP_RPGS = _sicpynumerics.SICONOS_LCP_RPGS SICONOS_LCP_PATH = _sicpynumerics.SICONOS_LCP_PATH SICONOS_LCP_ENUM = _sicpynumerics.SICONOS_LCP_ENUM SICONOS_LCP_AVI_CAOFERRIS = _sicpynumerics.SICONOS_LCP_AVI_CAOFERRIS SICONOS_LCP_PIVOT = _sicpynumerics.SICONOS_LCP_PIVOT SICONOS_LCP_BARD = _sicpynumerics.SICONOS_LCP_BARD SICONOS_LCP_MURTY = _sicpynumerics.SICONOS_LCP_MURTY SICONOS_LCP_NEWTON_MIN_FBLSA = _sicpynumerics.SICONOS_LCP_NEWTON_MIN_FBLSA SICONOS_LCP_PATHSEARCH = _sicpynumerics.SICONOS_LCP_PATHSEARCH SICONOS_LCP_PIVOT_LUMOD = _sicpynumerics.SICONOS_LCP_PIVOT_LUMOD SICONOS_LCP_GAMS = _sicpynumerics.SICONOS_LCP_GAMS SICONOS_LCP_CONVEXQP_PG = _sicpynumerics.SICONOS_LCP_CONVEXQP_PG SICONOS_LCP_IPARAM_NSGS_ITERATIONS_SUM = _sicpynumerics.SICONOS_LCP_IPARAM_NSGS_ITERATIONS_SUM r""" index in iparam to store the sum of local solver iterations number""" SICONOS_LCP_IPARAM_PIVOTING_METHOD_TYPE = _sicpynumerics.SICONOS_LCP_IPARAM_PIVOTING_METHOD_TYPE r""" index in iparam to store type of pivoting methods""" SICONOS_LCP_IPARAM_SKIP_TRIVIAL = _sicpynumerics.SICONOS_LCP_IPARAM_SKIP_TRIVIAL r""" index in iparam to skip trivial solution""" SICONOS_LCP_IPARAM_ENUM_NUMBER_OF_SOLUTIONS = _sicpynumerics.SICONOS_LCP_IPARAM_ENUM_NUMBER_OF_SOLUTIONS r""" index in iparam to store the number of solutions""" SICONOS_LCP_IPARAM_ENUM_CURRENT_ENUM = _sicpynumerics.SICONOS_LCP_IPARAM_ENUM_CURRENT_ENUM r""" index in iparam to store the current enum""" SICONOS_LCP_IPARAM_ENUM_SEED = _sicpynumerics.SICONOS_LCP_IPARAM_ENUM_SEED r""" index in iparam to store the seed for starting enum""" SICONOS_LCP_IPARAM_ENUM_USE_DGELS = _sicpynumerics.SICONOS_LCP_IPARAM_ENUM_USE_DGELS r""" index in iparam to store the first seed for enum""" SICONOS_LCP_IPARAM_ENUM_MULTIPLE_SOLUTIONS = _sicpynumerics.SICONOS_LCP_IPARAM_ENUM_MULTIPLE_SOLUTIONS r""" index in iparam to store to activate multiple solutions search""" SICONOS_LCP_DPARAM_RHO = _sicpynumerics.SICONOS_LCP_DPARAM_RHO r""" index in dparam to store to the relaxation or regularization parameter""" SICONOS_LCP_DPARAM_NSGS_LOCAL_ERROR_SUM = _sicpynumerics.SICONOS_LCP_DPARAM_NSGS_LOCAL_ERROR_SUM r""" index in dparam to store the sum of local error values""" SICONOS_LCP_DPARAM_LATIN_PARAMETER = _sicpynumerics.SICONOS_LCP_DPARAM_LATIN_PARAMETER r""" index in dparam to store the latin parameter""" SICONOS_LCP_SKIP_TRIVIAL_NO = _sicpynumerics.SICONOS_LCP_SKIP_TRIVIAL_NO SICONOS_LCP_SKIP_TRIVIAL_YES = _sicpynumerics.SICONOS_LCP_SKIP_TRIVIAL_YES SICONOS_LCP_PIVOT_BARD = _sicpynumerics.SICONOS_LCP_PIVOT_BARD SICONOS_LCP_PIVOT_LEAST_INDEX = _sicpynumerics.SICONOS_LCP_PIVOT_LEAST_INDEX SICONOS_LCP_PIVOT_LEMKE = _sicpynumerics.SICONOS_LCP_PIVOT_LEMKE SICONOS_LCP_PIVOT_PATHSEARCH = _sicpynumerics.SICONOS_LCP_PIVOT_PATHSEARCH
[docs] class AVI(object): r""" Structure that contains and defines an AVI The problem is : given a matrix :math:`M` and a vector :math:`q`, find :math:`z` such that .. math:: \langle x - z, q + Mz \rangle \geq 0 \ \text{for all }x\in K See users'guide for details. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr size = property(_sicpynumerics.AVI_size_get, _sicpynumerics.AVI_size_set, doc=r""" size of the problem""") M = property(_sicpynumerics.AVI_M_get, _sicpynumerics.AVI_M_set, doc=r""" M matrix of the AVI (see the mathematical description)""") q = property(_sicpynumerics.AVI_q_get, _sicpynumerics.AVI_q_set, doc=r""" vector of the AVI (see the mathematical description)""") d = property(_sicpynumerics.AVI_d_get, _sicpynumerics.AVI_d_set, doc=r""" Covering vector (optional)""") poly = property(_sicpynumerics.AVI_poly_get, _sicpynumerics.AVI_poly_set, doc=r""" Polyhedra where the solution has to belong""") lb = property(_sicpynumerics.AVI_lb_get, _sicpynumerics.AVI_lb_set, doc=r""" Lower bounds for the variables""") ub = property(_sicpynumerics.AVI_ub_get, _sicpynumerics.AVI_ub_set, doc=r""" Upper bounds for the variables""") cones = property(_sicpynumerics.AVI_cones_get, _sicpynumerics.AVI_cones_set, doc=r""" Non-polyhedral Cones where the variable lives (not implemented yet) """) def __init__(self, *args): _sicpynumerics.AVI_swiginit(self, _sicpynumerics.new_AVI(*args)) def set_polyhedron(self, H_mat: "PyObject *", K_vec: "PyObject *") -> "void": return _sicpynumerics.AVI_set_polyhedron(self, H_mat, K_vec) __swig_destroy__ = _sicpynumerics.delete_AVI
# Register AVI in _sicpynumerics: _sicpynumerics.AVI_swigregister(AVI) SICONOS_LCP_LEMKE_STR = cvar.SICONOS_LCP_LEMKE_STR SICONOS_LCP_NSGS_SBM_STR = cvar.SICONOS_LCP_NSGS_SBM_STR SICONOS_LCP_PGS_STR = cvar.SICONOS_LCP_PGS_STR SICONOS_LCP_CPG_STR = cvar.SICONOS_LCP_CPG_STR SICONOS_LCP_LATIN_STR = cvar.SICONOS_LCP_LATIN_STR SICONOS_LCP_LATIN_W_STR = cvar.SICONOS_LCP_LATIN_W_STR SICONOS_LCP_QP_STR = cvar.SICONOS_LCP_QP_STR SICONOS_LCP_NSQP_STR = cvar.SICONOS_LCP_NSQP_STR SICONOS_LCP_NEWTONMIN_STR = cvar.SICONOS_LCP_NEWTONMIN_STR SICONOS_LCP_NEWTON_FB_FBLSA_STR = cvar.SICONOS_LCP_NEWTON_FB_FBLSA_STR SICONOS_LCP_NEWTON_MIN_FBLSA_STR = cvar.SICONOS_LCP_NEWTON_MIN_FBLSA_STR SICONOS_LCP_PSOR_STR = cvar.SICONOS_LCP_PSOR_STR SICONOS_LCP_RPGS_STR = cvar.SICONOS_LCP_RPGS_STR SICONOS_LCP_PATH_STR = cvar.SICONOS_LCP_PATH_STR SICONOS_LCP_ENUM_STR = cvar.SICONOS_LCP_ENUM_STR SICONOS_LCP_AVI_CAOFERRIS_STR = cvar.SICONOS_LCP_AVI_CAOFERRIS_STR SICONOS_LCP_PIVOT_STR = cvar.SICONOS_LCP_PIVOT_STR SICONOS_LCP_BARD_STR = cvar.SICONOS_LCP_BARD_STR SICONOS_LCP_MURTY_STR = cvar.SICONOS_LCP_MURTY_STR SICONOS_LCP_PATHSEARCH_STR = cvar.SICONOS_LCP_PATHSEARCH_STR SICONOS_LCP_PIVOT_LUMOD_STR = cvar.SICONOS_LCP_PIVOT_LUMOD_STR SICONOS_LCP_GAMS_STR = cvar.SICONOS_LCP_GAMS_STR SICONOS_LCP_CONVEXQP_PG_STR = cvar.SICONOS_LCP_CONVEXQP_PG_STR
[docs] def AVI_display(avi: "AVI") -> "void": r""" Affine Variational Inequalities display :type avi: :py:class:`AffineVariationalInequalities` :param avi: pointer to the AffineVariationalInequalities to display """ return _sicpynumerics.AVI_display(avi)
[docs] def AVI_printInFile(avi: "AVI", file: "FILE *") -> "int": r""" write AVI to file :type avi: :py:class:`AffineVariationalInequalities` :param avi: pointer to a AffineVariationalInequalities to print :type file: FILE :param file: pointer to a FILE :rtype: int :return: 1 if successfull """ return _sicpynumerics.AVI_printInFile(avi, file)
[docs] def AVI_newFromFile(avi: "AVI", file: "FILE *") -> "int": r""" read from file and create AffineVariationalInequalities :type avi: :py:class:`AffineVariationalInequalities` :param avi: pointer to a AffineVariationalInequalities to create :type file: FILE :param file: pointer to a FILE :rtype: int :return: 1 if successfull """ return _sicpynumerics.AVI_newFromFile(avi, file)
[docs] def AVI_newFromFilename(avi: "AVI", filename: "char *") -> "int": r""" function to read and create a AffineVariationalInequalities from a file :type avi: :py:class:`AffineVariationalInequalities` :param avi: pointer to a AffineVariationalInequalities to create :type filename: string :param filename: that contains the AVI :rtype: int :return: 1 if successfull """ return _sicpynumerics.AVI_newFromFilename(avi, filename)
[docs] def freeAVI(avi: "AVI") -> "void": r""" function to delete a AffineVariationalInequalities :type avi: :py:class:`AffineVariationalInequalities` :param avi: pointer to a AffineVariationalInequalities to delete """ return _sicpynumerics.freeAVI(avi)
[docs] def newAVI() -> "AffineVariationalInequalities *": r""" Create an empty AVI struct :rtype: :py:class:`AffineVariationalInequalities` :return: an empty AffineVariationalInequalities """ return _sicpynumerics.newAVI()
[docs] def avi_caoferris(problem: "AVI", z: "double *", w: "double *", options: "SolverOptions") -> "int": r""" avi_caoferris is a direct solver for AVI based on pivoting method principle for degenerate problem Choice of pivot variable is performed via lexicographic ordering Ref: "A Pivotal Method for Affine Variational Inequalities" Menglin Cao et Michael Ferris (1996) :type problem: :py:class:`AffineVariationalInequalities`, in :param problem: structure that represents the AVI (M, q, K) :type z: float, in/out :param z: on call contains the initial solution and on return holds the solution of the problem. :type w: float, in/out :param w: defined as Mz + q :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. :rtype: int :return: info about the convergence: 0 ok; 1 ... """ return _sicpynumerics.avi_caoferris(problem, z, w, options)
[docs] def avi_pathavi(problem: "AVI", z: "double *", w: "double *", options: "SolverOptions") -> "int": r""" avi_pathavi is using PATHVI, a direct solver for VI based on pivoting method principle for degenerate problem Ref: "A structure-preserving Pivotal Method for Affine Variational Inequalities" Y. Kim, O. Huber, M.C. Ferris, Math Prog B (2017) :type problem: :py:class:`AffineVariationalInequalities`, in :param problem: structure that represents the AVI (M, q, K) :type z: float, in/out :param z: on call contains the initial solution and on return holds the solution of the problem. :type w: float, in/out :param w: defined as Mz + q :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. :rtype: int :return: info about the convergence: 0 ok; 1 ... """ return _sicpynumerics.avi_pathavi(problem, z, w, options)
SICONOS_AVI_CAOFERRIS = _sicpynumerics.SICONOS_AVI_CAOFERRIS SICONOS_AVI_PATHAVI = _sicpynumerics.SICONOS_AVI_PATHAVI def mixedLinearComplementarityProblemFromFile(filename: "char const *") -> "MixedLinearComplementarityProblem *": return _sicpynumerics.mixedLinearComplementarityProblemFromFile(filename) SICONOS_RELAY_PGS = _sicpynumerics.SICONOS_RELAY_PGS SICONOS_RELAY_ENUM = _sicpynumerics.SICONOS_RELAY_ENUM SICONOS_RELAY_PATH = _sicpynumerics.SICONOS_RELAY_PATH SICONOS_RELAY_LEMKE = _sicpynumerics.SICONOS_RELAY_LEMKE SICONOS_RELAY_AVI_CAOFERRIS = _sicpynumerics.SICONOS_RELAY_AVI_CAOFERRIS SICONOS_RELAY_AVI_CAOFERRIS_TEST = _sicpynumerics.SICONOS_RELAY_AVI_CAOFERRIS_TEST SICONOS_FRICTION_2D_NSGS = _sicpynumerics.SICONOS_FRICTION_2D_NSGS r""" 2D Frictional Contact solvers""" SICONOS_FRICTION_2D_CPG = _sicpynumerics.SICONOS_FRICTION_2D_CPG SICONOS_FRICTION_2D_LEMKE = _sicpynumerics.SICONOS_FRICTION_2D_LEMKE SICONOS_FRICTION_2D_ENUM = _sicpynumerics.SICONOS_FRICTION_2D_ENUM SICONOS_FRICTION_3D_NSGS = _sicpynumerics.SICONOS_FRICTION_3D_NSGS r""" Non-smooth Gauss Seidel, local formulation""" SICONOS_FRICTION_3D_NSGSV = _sicpynumerics.SICONOS_FRICTION_3D_NSGSV r""" Non-smooth Gauss Seidel-velocity, local formulation""" SICONOS_FRICTION_3D_PROX = _sicpynumerics.SICONOS_FRICTION_3D_PROX r""" proximal, local formulation""" SICONOS_FRICTION_3D_TFP = _sicpynumerics.SICONOS_FRICTION_3D_TFP r""" Tresca, fixed point, local formulation""" SICONOS_FRICTION_3D_NSN_AC = _sicpynumerics.SICONOS_FRICTION_3D_NSN_AC r""" Non-smooth Newton Alart-Curnier, local formulation""" SICONOS_FRICTION_3D_DSFP = _sicpynumerics.SICONOS_FRICTION_3D_DSFP r""" De Saxce fixed point, local formulation""" SICONOS_FRICTION_3D_VI_FPP = _sicpynumerics.SICONOS_FRICTION_3D_VI_FPP r""" VI formulation, fixed point projection, local formulation""" SICONOS_FRICTION_3D_VI_EG = _sicpynumerics.SICONOS_FRICTION_3D_VI_EG r""" VI formulation, Extra-gradient, local formulation""" SICONOS_FRICTION_3D_HP = _sicpynumerics.SICONOS_FRICTION_3D_HP r""" Hyperplane projection, local formulation""" SICONOS_FRICTION_3D_NCPGlockerFBFixedPoint = _sicpynumerics.SICONOS_FRICTION_3D_NCPGlockerFBFixedPoint r""" Fischer Burmeister fixed point, local formulation""" SICONOS_FRICTION_3D_FPP = _sicpynumerics.SICONOS_FRICTION_3D_FPP r""" Fixed point projection, local formulation""" SICONOS_FRICTION_3D_EG = _sicpynumerics.SICONOS_FRICTION_3D_EG r""" Extra-gradient, local formulation""" SICONOS_FRICTION_3D_NSN_FB = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FB r""" Non-smooth Newton Fischer Burmeister, local formulation""" SICONOS_FRICTION_3D_GAMS_PATH = _sicpynumerics.SICONOS_FRICTION_3D_GAMS_PATH r""" GAMS/Path (Ferris), local formulation""" SICONOS_FRICTION_3D_GAMS_PATHVI = _sicpynumerics.SICONOS_FRICTION_3D_GAMS_PATHVI r""" VI formulation, GAMS/Path (Ferris), local formulation""" SICONOS_FRICTION_3D_ACLMFP = _sicpynumerics.SICONOS_FRICTION_3D_ACLMFP r""" Alart-Curnier fixed point, local formulation""" SICONOS_FRICTION_3D_SOCLCP = _sicpynumerics.SICONOS_FRICTION_3D_SOCLCP r""" Second-order Cone LCP, local formulation""" SICONOS_FRICTION_3D_GAMS_LCP_PATH = _sicpynumerics.SICONOS_FRICTION_3D_GAMS_LCP_PATH r""" GAMS/PATH (Ferris) LCP, local formulation""" SICONOS_FRICTION_3D_GAMS_LCP_PATHVI = _sicpynumerics.SICONOS_FRICTION_3D_GAMS_LCP_PATHVI r""" VI formulation, GAMS/PATH (Ferris) LCP, local formulation""" SICONOS_FRICTION_3D_NSN_NM = _sicpynumerics.SICONOS_FRICTION_3D_NSN_NM r""" Non-smooth Newton, natural map, local formulation""" SICONOS_FRICTION_3D_NSN_AC_TEST = _sicpynumerics.SICONOS_FRICTION_3D_NSN_AC_TEST SICONOS_FRICTION_3D_PFP = _sicpynumerics.SICONOS_FRICTION_3D_PFP r""" Panagiotopoulos, fixed point, local formulation""" SICONOS_FRICTION_3D_ADMM = _sicpynumerics.SICONOS_FRICTION_3D_ADMM r""" ADMM local formulation""" SICONOS_FRICTION_3D_ONECONTACT_NSN = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_NSN r""" Non-smooth Newton Alart-Curnier, 'direct', one contact solver""" SICONOS_FRICTION_3D_ONECONTACT_NSN_GP = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_NSN_GP r""" Non-smooth Newton Alart-Curnier, 'damped', one contact solver""" SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCone = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCone r""" Projection on cone, one contact solver""" SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration r""" Projection on cone, one contact solver""" SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithRegularization = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithRegularization SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithDiagonalization = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithDiagonalization SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCone_velocity = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCone_velocity SICONOS_FRICTION_3D_NCPGlockerFBPATH = _sicpynumerics.SICONOS_FRICTION_3D_NCPGlockerFBPATH r""" Fischer Burmeister/Path, Glocker formulation, one contact solver""" SICONOS_FRICTION_3D_NCPGlockerFBNewton = _sicpynumerics.SICONOS_FRICTION_3D_NCPGlockerFBNewton r""" Newton/Fischer Burmeister, Glocker formulation, one contact solver""" SICONOS_FRICTION_3D_ONECONTACT_QUARTIC = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_QUARTIC SICONOS_FRICTION_3D_ONECONTACT_QUARTIC_NU = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_QUARTIC_NU SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCylinder = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCylinder SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCylinderWithLocalIteration = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCylinderWithLocalIteration SICONOS_FRICTION_3D_ONECONTACT_NSN_GP_HYBRID = _sicpynumerics.SICONOS_FRICTION_3D_ONECONTACT_NSN_GP_HYBRID SICONOS_FRICTION_3D_VI_FPP_Cylinder = _sicpynumerics.SICONOS_FRICTION_3D_VI_FPP_Cylinder SICONOS_FRICTION_3D_CONVEXQP_PG_CYLINDER = _sicpynumerics.SICONOS_FRICTION_3D_CONVEXQP_PG_CYLINDER SICONOS_GLOBAL_FRICTION_3D_NSGS_WR = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_NSGS_WR r""" 3D Frictional contact local solvers on global formulation""" SICONOS_GLOBAL_FRICTION_3D_NSGSV_WR = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_NSGSV_WR SICONOS_GLOBAL_FRICTION_3D_PROX_WR = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_PROX_WR SICONOS_GLOBAL_FRICTION_3D_DSFP_WR = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_DSFP_WR SICONOS_GLOBAL_FRICTION_3D_TFP_WR = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_TFP_WR SICONOS_GLOBAL_FRICTION_3D_NSGS = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_NSGS SICONOS_GLOBAL_FRICTION_3D_NSN_AC_WR = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_NSN_AC_WR SICONOS_GLOBAL_FRICTION_3D_NSN_AC = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_NSN_AC SICONOS_GLOBAL_FRICTION_3D_GAMS_PATH = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_GAMS_PATH SICONOS_GLOBAL_FRICTION_3D_GAMS_PATHVI = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_GAMS_PATHVI SICONOS_GLOBAL_FRICTION_3D_VI_FPP = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_VI_FPP r""" VI formulation, Fixed Point Projection, local formulation""" SICONOS_GLOBAL_FRICTION_3D_VI_EG = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_VI_EG r""" VI formulation, Extra-gradient, local formulation""" SICONOS_GLOBAL_FRICTION_3D_ACLMFP = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_ACLMFP SICONOS_GLOBAL_FRICTION_3D_ADMM = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_ADMM SICONOS_GLOBAL_FRICTION_3D_ADMM_WR = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_ADMM_WR SICONOS_GLOBAL_FRICTION_3D_IPM = _sicpynumerics.SICONOS_GLOBAL_FRICTION_3D_IPM SICONOS_ROLLING_FRICTION_3D_NSGS = _sicpynumerics.SICONOS_ROLLING_FRICTION_3D_NSGS r""" Non-smooth Gauss Seidel, local formulation""" SICONOS_ROLLING_FRICTION_3D_ONECONTACT_ProjectionOnCone = _sicpynumerics.SICONOS_ROLLING_FRICTION_3D_ONECONTACT_ProjectionOnCone SICONOS_ROLLING_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration = _sicpynumerics.SICONOS_ROLLING_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration SICONOS_ROLLING_FRICTION_3D_ADMM = _sicpynumerics.SICONOS_ROLLING_FRICTION_3D_ADMM SICONOS_ROLLING_FRICTION_2D_NSGS = _sicpynumerics.SICONOS_ROLLING_FRICTION_2D_NSGS r""" Non-smooth Gauss Seidel, local formulation""" SICONOS_ROLLING_FRICTION_2D_ONECONTACT_ProjectionOnCone = _sicpynumerics.SICONOS_ROLLING_FRICTION_2D_ONECONTACT_ProjectionOnCone SICONOS_ROLLING_FRICTION_2D_ONECONTACT_ProjectionOnConeWithLocalIteration = _sicpynumerics.SICONOS_ROLLING_FRICTION_2D_ONECONTACT_ProjectionOnConeWithLocalIteration SICONOS_GLOBAL_ROLLING_FRICTION_3D_NSGS_WR = _sicpynumerics.SICONOS_GLOBAL_ROLLING_FRICTION_3D_NSGS_WR r""" Non-smooth Gauss Seidel, global formulation""" SICONOS_GLOBAL_ROLLING_FRICTION_3D_IPM = _sicpynumerics.SICONOS_GLOBAL_ROLLING_FRICTION_3D_IPM SICONOS_FRICTION_3D_IPARAM_INTERNAL_ERROR_STRATEGY = _sicpynumerics.SICONOS_FRICTION_3D_IPARAM_INTERNAL_ERROR_STRATEGY r""" index in iparam to store the error strategy for the internal solver""" SICONOS_FRICTION_3D_IPARAM_RESCALING = _sicpynumerics.SICONOS_FRICTION_3D_IPARAM_RESCALING r""" index in iparam to store the rescaling""" SICONOS_FRICTION_3D_IPARAM_RESCALING_CONE = _sicpynumerics.SICONOS_FRICTION_3D_IPARAM_RESCALING_CONE r""" index in iparam to store the rescaling""" SICONOS_FRICTION_3D_CURRENT_CONTACT_NUMBER = _sicpynumerics.SICONOS_FRICTION_3D_CURRENT_CONTACT_NUMBER r""" current contact number (example of use: one contact solvers) *""" SICONOS_FRICTION_3D_IPARAM_ERROR_EVALUATION = _sicpynumerics.SICONOS_FRICTION_3D_IPARAM_ERROR_EVALUATION r""" index in iparam to store the error evaluation method""" SICONOS_FRICTION_3D_IPARAM_ERROR_EVALUATION_FREQUENCY = _sicpynumerics.SICONOS_FRICTION_3D_IPARAM_ERROR_EVALUATION_FREQUENCY r""" index in iparam to store the frequency of error evaluation method""" SICONOS_FRICTION_3D_NUMBER_OF_CONTACTS = _sicpynumerics.SICONOS_FRICTION_3D_NUMBER_OF_CONTACTS SICONOS_FRICTION_3D_INTERNAL_ERROR_STRATEGY_ADAPTIVE = _sicpynumerics.SICONOS_FRICTION_3D_INTERNAL_ERROR_STRATEGY_ADAPTIVE SICONOS_FRICTION_3D_INTERNAL_ERROR_STRATEGY_GIVEN_VALUE = _sicpynumerics.SICONOS_FRICTION_3D_INTERNAL_ERROR_STRATEGY_GIVEN_VALUE SICONOS_FRICTION_3D_INTERNAL_ERROR_STRATEGY_ADAPTIVE_N_CONTACT = _sicpynumerics.SICONOS_FRICTION_3D_INTERNAL_ERROR_STRATEGY_ADAPTIVE_N_CONTACT SICONOS_FRICTION_3D_RESCALING_NO = _sicpynumerics.SICONOS_FRICTION_3D_RESCALING_NO SICONOS_FRICTION_3D_RESCALING_SCALAR = _sicpynumerics.SICONOS_FRICTION_3D_RESCALING_SCALAR SICONOS_FRICTION_3D_RESCALING_BALANCING_M = _sicpynumerics.SICONOS_FRICTION_3D_RESCALING_BALANCING_M SICONOS_FRICTION_3D_RESCALING_BALANCING_MH = _sicpynumerics.SICONOS_FRICTION_3D_RESCALING_BALANCING_MH SICONOS_FRICTION_3D_RESCALING_BALANCING_MHHT = _sicpynumerics.SICONOS_FRICTION_3D_RESCALING_BALANCING_MHHT SICONOS_FRICTION_3D_RESCALING_CONE_NO = _sicpynumerics.SICONOS_FRICTION_3D_RESCALING_CONE_NO SICONOS_FRICTION_3D_RESCALING_CONE_YES = _sicpynumerics.SICONOS_FRICTION_3D_RESCALING_CONE_YES SICONOS_FRICTION_3D_DPARAM_INTERNAL_ERROR_RATIO = _sicpynumerics.SICONOS_FRICTION_3D_DPARAM_INTERNAL_ERROR_RATIO r""" index in dparam to store the internal solver error ratio""" SICONOS_FRICTION_3D_NSGS_RELAXATION = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_RELAXATION r""" index in iparam to store the relaxation strategy""" SICONOS_FRICTION_3D_NSGS_SHUFFLE = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_SHUFFLE r""" index in iparam to store the shuffle strategy""" SICONOS_FRICTION_3D_NSGS_SHUFFLE_SEED = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_SHUFFLE_SEED r""" index in iparam to store the shuffle seed""" SICONOS_FRICTION_3D_NSGS_FREEZING_CONTACT = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_FREEZING_CONTACT r""" index in iparam to store the""" SICONOS_FRICTION_3D_NSGS_FILTER_LOCAL_SOLUTION = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_FILTER_LOCAL_SOLUTION r""" index in iparam to store the""" SICONOS_FRICTION_3D_NSGS_RELAXATION_VALUE = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_RELAXATION_VALUE r""" index in dparam to store the relaxation strategy""" SICONOS_FRICTION_3D_NSGS_LOCALSOLVER_IPARAM_USE_TRIVIAL_SOLUTION = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_LOCALSOLVER_IPARAM_USE_TRIVIAL_SOLUTION SICONOS_FRICTION_3D_NSGS_LOCALSOLVER_USE_TRIVIAL_SOLUTION_FALSE = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_LOCALSOLVER_USE_TRIVIAL_SOLUTION_FALSE SICONOS_FRICTION_3D_NSGS_LOCALSOLVER_USE_TRIVIAL_SOLUTION_TRUE = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_LOCALSOLVER_USE_TRIVIAL_SOLUTION_TRUE SICONOS_FRICTION_3D_NSGS_ERROR_EVALUATION_FULL = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_ERROR_EVALUATION_FULL r""" Evaluation of the error with the expensive function fc3d_compute_error *""" SICONOS_FRICTION_3D_NSGS_ERROR_EVALUATION_LIGHT = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_ERROR_EVALUATION_LIGHT r""" Evaluation of the error with the cheap incremental variation *""" SICONOS_FRICTION_3D_NSGS_ERROR_EVALUATION_LIGHT_WITH_FULL_FINAL = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_ERROR_EVALUATION_LIGHT_WITH_FULL_FINAL r""" Evaluation of the error with the cheap incremental variation but we modify the incremental toleranve to reach the requred accuracy * """ SICONOS_FRICTION_3D_NSGS_ERROR_EVALUATION_ADAPTIVE = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_ERROR_EVALUATION_ADAPTIVE r""" Evaluation of the error with the expensive function fc3d_compute_error and an adaptive frequency for calling the error function * """ SICONOS_FRICTION_3D_NSGS_SHUFFLE_FALSE = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_SHUFFLE_FALSE SICONOS_FRICTION_3D_NSGS_SHUFFLE_TRUE = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_SHUFFLE_TRUE SICONOS_FRICTION_3D_NSGS_SHUFFLE_TRUE_EACH_LOOP = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_SHUFFLE_TRUE_EACH_LOOP SICONOS_FRICTION_3D_NSGS_RELAXATION_FALSE = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_RELAXATION_FALSE SICONOS_FRICTION_3D_NSGS_RELAXATION_TRUE = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_RELAXATION_TRUE SICONOS_FRICTION_3D_NSGS_FILTER_LOCAL_SOLUTION_FALSE = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_FILTER_LOCAL_SOLUTION_FALSE SICONOS_FRICTION_3D_NSGS_FILTER_LOCAL_SOLUTION_TRUE = _sicpynumerics.SICONOS_FRICTION_3D_NSGS_FILTER_LOCAL_SOLUTION_TRUE SICONOS_FRICTION_3D_NSN_RHO_STRATEGY = _sicpynumerics.SICONOS_FRICTION_3D_NSN_RHO_STRATEGY r""" index in iparam to store the strategy for computing rho""" SICONOS_FRICTION_3D_NSN_FORMULATION = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FORMULATION r""" index in iparam to store the formulation""" SICONOS_FRICTION_3D_NSN_LINESEARCH = _sicpynumerics.SICONOS_FRICTION_3D_NSN_LINESEARCH r""" index in iparam to store the line-search""" SICONOS_FRICTION_3D_NSN_LINESEARCH_MAX_ITER = _sicpynumerics.SICONOS_FRICTION_3D_NSN_LINESEARCH_MAX_ITER r""" index in iparam to store the maximum number of iterations""" SICONOS_FRICTION_3D_NSN_LINEAR_SOLVER = _sicpynumerics.SICONOS_FRICTION_3D_NSN_LINEAR_SOLVER r""" index in iparam to set the linear solver used at each Newton iteration cs_lusol or mumps """ SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY = _sicpynumerics.SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY r""" index in iparam to store the strategy for the hybrid solver""" SICONOS_FRICTION_3D_NSN_HYBRID_MAX_LOOP = _sicpynumerics.SICONOS_FRICTION_3D_NSN_HYBRID_MAX_LOOP r""" index in iparam to store the maximum number of loop for the hybrid solver""" SICONOS_FRICTION_3D_NSN_HYBRID_MAX_ITER = _sicpynumerics.SICONOS_FRICTION_3D_NSN_HYBRID_MAX_ITER r""" index in iparam to store the maximum number of iterations for the projection solver""" SICONOS_FRICTION_3D_NSN_MEMORY_ALLOCATED = _sicpynumerics.SICONOS_FRICTION_3D_NSN_MEMORY_ALLOCATED r""" index in iparam used to check if memory allocation has already be done (if true/1) or not (if 0/false) for internal work array.""" SICONOS_FRICTION_3D_NSN_MPI_COM = _sicpynumerics.SICONOS_FRICTION_3D_NSN_MPI_COM r""" index in iparam to store the boolean to know if allocation of dwork is needed""" SICONOS_FRICTION_3D_NSN_USE_CSLUSOL = _sicpynumerics.SICONOS_FRICTION_3D_NSN_USE_CSLUSOL SICONOS_FRICTION_3D_NSN_USE_MUMPS = _sicpynumerics.SICONOS_FRICTION_3D_NSN_USE_MUMPS SICONOS_FRICTION_3D_NSN_RHO = _sicpynumerics.SICONOS_FRICTION_3D_NSN_RHO r""" index in dparam to store the rho value for projection formulation""" SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_CONSTANT = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_CONSTANT r""" A constant value given in dparam[SICONOS_FRICTION_3D_NSN_RHO] is used""" SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_SPECTRAL_NORM = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_SPECTRAL_NORM r""" A computed value stored in dparam[SICONOS_FRICTION_3D_NSN_RHO] is used""" SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_SPLIT_SPECTRAL_NORM_COND = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_SPLIT_SPECTRAL_NORM_COND r""" A computed value stored in dparam[SICONOS_FRICTION_3D_NSN_RHO] is used""" SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_SPLIT_SPECTRAL_NORM = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_SPLIT_SPECTRAL_NORM r""" An adaptive strategy for rho is used""" SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_ADAPTIVE = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_ADAPTIVE r""" An adaptive strategy for rho is used""" SICONOS_FRICTION_3D_NSN_FORMULATION_ALARTCURNIER_STD = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FORMULATION_ALARTCURNIER_STD SICONOS_FRICTION_3D_NSN_FORMULATION_JEANMOREAU_STD = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FORMULATION_JEANMOREAU_STD SICONOS_FRICTION_3D_NSN_FORMULATION_ALARTCURNIER_GENERATED = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FORMULATION_ALARTCURNIER_GENERATED SICONOS_FRICTION_3D_NSN_FORMULATION_JEANMOREAU_GENERATED = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FORMULATION_JEANMOREAU_GENERATED SICONOS_FRICTION_3D_NSN_FORMULATION_NULL = _sicpynumerics.SICONOS_FRICTION_3D_NSN_FORMULATION_NULL SICONOS_FRICTION_3D_NSN_LINESEARCH_GOLDSTEINPRICE = _sicpynumerics.SICONOS_FRICTION_3D_NSN_LINESEARCH_GOLDSTEINPRICE SICONOS_FRICTION_3D_NSN_LINESEARCH_ARMIJO = _sicpynumerics.SICONOS_FRICTION_3D_NSN_LINESEARCH_ARMIJO SICONOS_FRICTION_3D_NSN_LINESEARCH_NO = _sicpynumerics.SICONOS_FRICTION_3D_NSN_LINESEARCH_NO SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_NO = _sicpynumerics.SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_NO r""" No strategy for the hybrid solver""" SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_PLI_NSN_LOOP = _sicpynumerics.SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_PLI_NSN_LOOP r""" Loop PLI-NSN strategy for the hybrid solver""" SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_NSN_AND_PLI_NSN_LOOP = _sicpynumerics.SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_NSN_AND_PLI_NSN_LOOP r""" NSN and after Loop PLI-NSN strategy for the hybrid solver""" SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_VI_EG_NSN = _sicpynumerics.SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_VI_EG_NSN r""" VI_EG preconditionning to NSN strategy for the hybrid solver""" SICONOS_FRICTION_3D_FP_ERROR_STRATEGY = _sicpynumerics.SICONOS_FRICTION_3D_FP_ERROR_STRATEGY r""" index in iparam to store the error strategy for the internal solver""" SICONOS_FRICTION_3D_PROXIMAL_IPARAM_CUMULATIVE_ITER_DONE = _sicpynumerics.SICONOS_FRICTION_3D_PROXIMAL_IPARAM_CUMULATIVE_ITER_DONE r""" index in iparam to store the relaxation strategy""" SICONOS_FRICTION_3D_PROXIMAL_IPARAM_RELAXATION = _sicpynumerics.SICONOS_FRICTION_3D_PROXIMAL_IPARAM_RELAXATION r""" index in iparam to store the relaxation strategy""" SICONOS_FRICTION_3D_PROXIMAL_IPARAM_STRATEGY = _sicpynumerics.SICONOS_FRICTION_3D_PROXIMAL_IPARAM_STRATEGY r""" index in iparam to store the proximal strategy""" SICONOS_FRICTION_3D_PROXIMAL_DPARAM_ALPHA = _sicpynumerics.SICONOS_FRICTION_3D_PROXIMAL_DPARAM_ALPHA r""" index in dparam to store the parameter alpha""" SICONOS_FRICTION_3D_PROXIMAL_DPARAM_SIGMA = _sicpynumerics.SICONOS_FRICTION_3D_PROXIMAL_DPARAM_SIGMA SICONOS_FRICTION_3D_PROXIMAL_DPARAM_NU = _sicpynumerics.SICONOS_FRICTION_3D_PROXIMAL_DPARAM_NU SICONOS_FRICTION_3D_PROXIMAL_DPARAM_RELAXATION = _sicpynumerics.SICONOS_FRICTION_3D_PROXIMAL_DPARAM_RELAXATION SICONOS_FRICTION_3D_PROXIMAL_PROX = _sicpynumerics.SICONOS_FRICTION_3D_PROXIMAL_PROX r""" Proximal algorithm""" SICONOS_FRICTION_3D_PROXIMAL_REGULARIZATION = _sicpynumerics.SICONOS_FRICTION_3D_PROXIMAL_REGULARIZATION r""" Regularization algorithm""" SICONOS_FRICTION_3D_ADMM_IPARAM_RHO_STRATEGY = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_IPARAM_RHO_STRATEGY r""" index in iparam to store the strategy for computing rho""" SICONOS_FRICTION_3D_ADMM_IPARAM_INITIAL_RHO = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_IPARAM_INITIAL_RHO r""" index in iparam to store the strategy for computing rho""" SICONOS_FRICTION_3D_ADMM_IPARAM_ACCELERATION = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_IPARAM_ACCELERATION r""" index in iparam to store the acceleration parameter""" SICONOS_FRICTION_3D_ADMM_IPARAM_SYMMETRY = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_IPARAM_SYMMETRY r""" index in iparam to store the symmetry parameter""" SICONOS_FRICTION_3D_ADMM_IPARAM_SPARSE_STORAGE = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_IPARAM_SPARSE_STORAGE r""" index in iparam to store the sparse storage parameter""" SICONOS_FRICTION_3D_ADMM_IPARAM_GET_PROBLEM_INFO = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_IPARAM_GET_PROBLEM_INFO r""" index in iparam to get problem info""" SICONOS_FRICTION_3D_ADMM_IPARAM_UPDATE_S = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_IPARAM_UPDATE_S SICONOS_FRICTION_3D_ADMM_IPARAM_FULL_H = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_IPARAM_FULL_H SICONOS_FRICTION_3D_ADMM_RHO = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_RHO r""" index in dparam to store the rho value for projection formulation""" SICONOS_FRICTION_3D_ADMM_RESTART_ETA = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_RESTART_ETA r""" index in dparam to store the eta value for the restarting criteria""" SICONOS_FRICTION_3D_ADMM_BALANCING_RESIDUAL_TAU = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_BALANCING_RESIDUAL_TAU r""" index in dparam to store the tau value for the balancing residual technique""" SICONOS_FRICTION_3D_ADMM_BALANCING_RESIDUAL_PHI = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_BALANCING_RESIDUAL_PHI r""" index in dparam to store the phi value for the balancing residual technique""" SICONOS_FRICTION_3D_ADMM_NO_ACCELERATION = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_NO_ACCELERATION SICONOS_FRICTION_3D_ADMM_ACCELERATION = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_ACCELERATION SICONOS_FRICTION_3D_ADMM_ACCELERATION_AND_RESTART = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_ACCELERATION_AND_RESTART SICONOS_FRICTION_3D_ADMM_CHECK_SYMMETRY = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_CHECK_SYMMETRY SICONOS_FRICTION_3D_ADMM_FORCED_SYMMETRY = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_FORCED_SYMMETRY SICONOS_FRICTION_3D_ADMM_FORCED_ASYMMETRY = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_FORCED_ASYMMETRY SICONOS_FRICTION_3D_ADMM_SYMMETRIZE = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_SYMMETRIZE SICONOS_FRICTION_3D_ADMM_ASSUME_SYMMETRY = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_ASSUME_SYMMETRY SICONOS_FRICTION_3D_ADMM_KEEP_STORAGE = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_KEEP_STORAGE SICONOS_FRICTION_3D_ADMM_FORCED_SPARSE_STORAGE = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_FORCED_SPARSE_STORAGE SICONOS_FRICTION_3D_ADMM_GET_PROBLEM_INFO_NO = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_GET_PROBLEM_INFO_NO SICONOS_FRICTION_3D_ADMM_GET_PROBLEM_INFO_YES = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_GET_PROBLEM_INFO_YES SICONOS_FRICTION_3D_ADMM_UPDATE_S_YES = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_UPDATE_S_YES SICONOS_FRICTION_3D_ADMM_UPDATE_S_NO = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_UPDATE_S_NO SICONOS_FRICTION_3D_ADMM_FULL_H_NO = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_FULL_H_NO SICONOS_FRICTION_3D_ADMM_FULL_H_YES = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_FULL_H_YES SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_CONSTANT = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_CONSTANT r""" A constant value given in dparam[SICONOS_FRICTION_3D_NSN_RHO] is used""" SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_RESIDUAL_BALANCING = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_RESIDUAL_BALANCING r""" An adaptive strategy for rho is used""" SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_SCALED_RESIDUAL_BALANCING = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_SCALED_RESIDUAL_BALANCING r""" An adaptive strategy for rho is used""" SICONOS_FRICTION_3D_ADMM_INITIAL_RHO_GIVEN = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_INITIAL_RHO_GIVEN r""" A constant value given in dparam[SICONOS_FRICTION_3D_NSN_RHO] is used""" SICONOS_FRICTION_3D_ADMM_INITIAL_RHO_NORM_INF = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_INITIAL_RHO_NORM_INF r""" A computed value stored in dparam[SICONOS_FRICTION_3D_NSN_RHO] is used""" SICONOS_FRICTION_3D_ADMM_INITIAL_RHO_EIGENVALUES = _sicpynumerics.SICONOS_FRICTION_3D_ADMM_INITIAL_RHO_EIGENVALUES r""" An adaptive strategy for rho is used""" SICONOS_FRICTION_3D_IPM_IPARAM_NESTEROV_TODD_SCALING = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_NESTEROV_TODD_SCALING r""" index in iparam to use NT scaling technique""" SICONOS_FRICTION_3D_IPM_IPARAM_SPARSE_STORAGE = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_SPARSE_STORAGE r""" index in iparam to store the sparse storage parameter""" SICONOS_FRICTION_3D_IPM_IPARAM_GET_PROBLEM_INFO = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_GET_PROBLEM_INFO r""" index in iparam to get problem info""" SICONOS_FRICTION_3D_IPM_IPARAM_ITERATES_MATLAB_FILE = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_ITERATES_MATLAB_FILE r""" index in iparam to print iterates (including problem data) into a Matlab file""" SICONOS_FRICTION_3D_IPM_IPARAM_REDUCED_SYSTEM = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_REDUCED_SYSTEM r""" index in iparam to use reduce the linear system""" SICONOS_FRICTION_3D_IPM_IPARAM_FINISH_WITHOUT_SCALING = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_FINISH_WITHOUT_SCALING r""" index in iparam to finish the solution without scaling""" SICONOS_FRICTION_3D_IPM_IPARAM_UPDATE_S = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_UPDATE_S r""" index in iparam to update the vector w for solving nonconvex problem""" SICONOS_FRICTION_3D_IPM_IPARAM_NESTEROV_TODD_SCALING_METHOD = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_NESTEROV_TODD_SCALING_METHOD r""" index in iparam to use Qp or F formula for computing Nesterov-Todd scaling *""" SICONOS_FRICTION_3D_IPM_IPARAM_REDUCED_SYSTEM_METHOD = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_REDUCED_SYSTEM_METHOD r""" index in iparam to use a reduced symmetric system with Qp2 or QpH inside the matrix *""" SICONOS_FRICTION_3D_IPM_IPARAM_LS_FORM = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_LS_FORM r""" index in iparam to choose the linear system formulation *""" SICONOS_FRICTION_3D_IPM_IPARAM_REFINEMENT = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_REFINEMENT r""" index in iparam to perform iterative refinement with MA57 (LDT) *""" SICONOS_FRICTION_3D_IPM_IPARAM_CHOLESKY = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_CHOLESKY r""" index in iparam to perform Cholesky factorization *""" SICONOS_FRICTION_3D_IPM_IPARAM_ITERATES_PYTHON_FILE = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_ITERATES_PYTHON_FILE r""" index in iparam to print iterates (including problem data) into a Python file""" SICONOS_FRICTION_3D_IPM_SIGMA_PARAMETER_1 = _sicpynumerics.SICONOS_FRICTION_3D_IPM_SIGMA_PARAMETER_1 r""" index in dparam to store the parameter for computation the power of sigma""" SICONOS_FRICTION_3D_IPM_SIGMA_PARAMETER_2 = _sicpynumerics.SICONOS_FRICTION_3D_IPM_SIGMA_PARAMETER_2 SICONOS_FRICTION_3D_IPM_SIGMA_PARAMETER_3 = _sicpynumerics.SICONOS_FRICTION_3D_IPM_SIGMA_PARAMETER_3 SICONOS_FRICTION_3D_IPM_GAMMA_PARAMETER_1 = _sicpynumerics.SICONOS_FRICTION_3D_IPM_GAMMA_PARAMETER_1 r""" index in dparam to store the parameter for computation the safity coefficient of step length""" SICONOS_FRICTION_3D_IPM_GAMMA_PARAMETER_2 = _sicpynumerics.SICONOS_FRICTION_3D_IPM_GAMMA_PARAMETER_2 SICONOS_FRICTION_3D_IPM_KEEP_STORAGE = _sicpynumerics.SICONOS_FRICTION_3D_IPM_KEEP_STORAGE SICONOS_FRICTION_3D_IPM_FORCED_SPARSE_STORAGE = _sicpynumerics.SICONOS_FRICTION_3D_IPM_FORCED_SPARSE_STORAGE SICONOS_FRICTION_3D_IPM_GET_PROBLEM_INFO_NO = _sicpynumerics.SICONOS_FRICTION_3D_IPM_GET_PROBLEM_INFO_NO SICONOS_FRICTION_3D_IPM_GET_PROBLEM_INFO_YES = _sicpynumerics.SICONOS_FRICTION_3D_IPM_GET_PROBLEM_INFO_YES SICONOS_FRICTION_3D_IPM_NESTEROV_TODD_SCALING_WITH_QP = _sicpynumerics.SICONOS_FRICTION_3D_IPM_NESTEROV_TODD_SCALING_WITH_QP SICONOS_FRICTION_3D_IPM_NESTEROV_TODD_SCALING_WITH_F = _sicpynumerics.SICONOS_FRICTION_3D_IPM_NESTEROV_TODD_SCALING_WITH_F SICONOS_FRICTION_3D_IPM_IPARAM_REDUCED_SYSTEM_WITH_QP2 = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_REDUCED_SYSTEM_WITH_QP2 SICONOS_FRICTION_3D_IPM_IPARAM_REDUCED_SYSTEM_WITH_QPH = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_REDUCED_SYSTEM_WITH_QPH SICONOS_FRICTION_3D_IPM_IPARAM_LS_3X3_NOSCAL = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_LS_3X3_NOSCAL SICONOS_FRICTION_3D_IPM_IPARAM_LS_3X3_QP2 = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_LS_3X3_QP2 SICONOS_FRICTION_3D_IPM_IPARAM_LS_3X3_QPH = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_LS_3X3_QPH SICONOS_FRICTION_3D_IPM_IPARAM_LS_2X2_QP2 = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_LS_2X2_QP2 SICONOS_FRICTION_3D_IPM_IPARAM_LS_2X2_QPH = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_LS_2X2_QPH SICONOS_FRICTION_3D_IPM_IPARAM_LS_1X1_QPH = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_LS_1X1_QPH SICONOS_FRICTION_3D_IPM_IPARAM_LS_1X1_JQJ = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_LS_1X1_JQJ SICONOS_FRICTION_3D_IPM_IPARAM_LS_2X2_JQJ = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_LS_2X2_JQJ SICONOS_FRICTION_3D_IPM_IPARAM_LS_2X2_invPH = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_LS_2X2_invPH SICONOS_FRICTION_3D_IPM_IPARAM_LS_3X3_JQinv = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_LS_3X3_JQinv SICONOS_FRICTION_3D_IPM_IPARAM_FINISH_WITHOUT_SCALING_NO = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_FINISH_WITHOUT_SCALING_NO SICONOS_FRICTION_3D_IPM_IPARAM_FINISH_WITHOUT_SCALING_YES = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_FINISH_WITHOUT_SCALING_YES SICONOS_FRICTION_3D_IPM_IPARAM_REFINEMENT_NO = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_REFINEMENT_NO SICONOS_FRICTION_3D_IPM_IPARAM_REFINEMENT_YES = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_REFINEMENT_YES SICONOS_FRICTION_3D_IPM_IPARAM_REFINEMENT_AFTER = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_REFINEMENT_AFTER SICONOS_FRICTION_3D_IPM_IPARAM_CHOLESKY_NO = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_CHOLESKY_NO SICONOS_FRICTION_3D_IPM_IPARAM_CHOLESKY_YES = _sicpynumerics.SICONOS_FRICTION_3D_IPM_IPARAM_CHOLESKY_YES SICONOS_MCP_NEWTON_FB_FBLSA = _sicpynumerics.SICONOS_MCP_NEWTON_FB_FBLSA SICONOS_MCP_NEWTON_MIN_FBLSA = _sicpynumerics.SICONOS_MCP_NEWTON_MIN_FBLSA SICONOS_MCP_OLD_FB = _sicpynumerics.SICONOS_MCP_OLD_FB SICONOS_NCP_NEWTON_FB_FBLSA = _sicpynumerics.SICONOS_NCP_NEWTON_FB_FBLSA SICONOS_NCP_NEWTON_MIN_FBLSA = _sicpynumerics.SICONOS_NCP_NEWTON_MIN_FBLSA SICONOS_NCP_PATHSEARCH = _sicpynumerics.SICONOS_NCP_PATHSEARCH SICONOS_NCP_PATH = _sicpynumerics.SICONOS_NCP_PATH SICONOS_VI_EG = _sicpynumerics.SICONOS_VI_EG SICONOS_VI_FPP = _sicpynumerics.SICONOS_VI_FPP SICONOS_VI_HP = _sicpynumerics.SICONOS_VI_HP SICONOS_VI_BOX_QI = _sicpynumerics.SICONOS_VI_BOX_QI SICONOS_VI_BOX_AVI_LSA = _sicpynumerics.SICONOS_VI_BOX_AVI_LSA SICONOS_VI_BOX_PATH = _sicpynumerics.SICONOS_VI_BOX_PATH SICONOS_VI_IPARAM_DECREASE_RHO = _sicpynumerics.SICONOS_VI_IPARAM_DECREASE_RHO SICONOS_VI_IPARAM_LINESEARCH_METHOD = _sicpynumerics.SICONOS_VI_IPARAM_LINESEARCH_METHOD r""" index in iparam to store the linesearch method""" SICONOS_VI_IPARAM_ERROR_EVALUATION = _sicpynumerics.SICONOS_VI_IPARAM_ERROR_EVALUATION r""" index in iparam to store the error evaluation method""" SICONOS_VI_IPARAM_ERROR_EVALUATION_FREQUENCY = _sicpynumerics.SICONOS_VI_IPARAM_ERROR_EVALUATION_FREQUENCY r""" index in iparam to store the frequency of error evaluation method""" SICONOS_VI_IPARAM_LS_MAX_ITER = _sicpynumerics.SICONOS_VI_IPARAM_LS_MAX_ITER r""" index for max number of iterations allowed in line search""" SICONOS_VI_IPARAM_ACTIVATE_UPDATE = _sicpynumerics.SICONOS_VI_IPARAM_ACTIVATE_UPDATE r""" activate the update in the loop (0:false default choice)""" SICONOS_VI_LS_ARMIJO = _sicpynumerics.SICONOS_VI_LS_ARMIJO r""" : Armijo rule with Khotbotov ratio (default)""" SICONOS_VI_LS_SOLODOV = _sicpynumerics.SICONOS_VI_LS_SOLODOV r""" : Armijo rule with Solodov.Tseng ratio""" SICONOS_VI_LS_HANSUN = _sicpynumerics.SICONOS_VI_LS_HANSUN r""" Armijo rule with Han.Sun ratio""" SICONOS_VI_DPARAM_RHO = _sicpynumerics.SICONOS_VI_DPARAM_RHO r""" index in dparam to store the initial value of rho""" SICONOS_VI_DPARAM_LS_TAU = _sicpynumerics.SICONOS_VI_DPARAM_LS_TAU r""" index in dparam to store the tau coeff of line-search""" SICONOS_VI_DPARAM_LS_TAUINV = _sicpynumerics.SICONOS_VI_DPARAM_LS_TAUINV r""" index in dparam to store the tauinv coeff of line-search""" SICONOS_VI_DPARAM_LS_L = _sicpynumerics.SICONOS_VI_DPARAM_LS_L r""" index in dparam to store the L coeff of line-search""" SICONOS_VI_DPARAM_LS_LMIN = _sicpynumerics.SICONOS_VI_DPARAM_LS_LMIN r""" index in dparam to store the LMIN coeff of line-search""" SICONOS_VI_DPARAM_SIGMA = _sicpynumerics.SICONOS_VI_DPARAM_SIGMA r""" index in dparam to store the sigma coeff (HP)""" SICONOS_VI_ERROR_EVALUATION_FULL = _sicpynumerics.SICONOS_VI_ERROR_EVALUATION_FULL SICONOS_VI_ERROR_EVALUATION_LIGHT_WITH_FULL_FINAL = _sicpynumerics.SICONOS_VI_ERROR_EVALUATION_LIGHT_WITH_FULL_FINAL SICONOS_VI_ERROR_EVALUATION_LIGHT = _sicpynumerics.SICONOS_VI_ERROR_EVALUATION_LIGHT SICONOS_VI_ERROR_EVALUATION_ADAPTIVE = _sicpynumerics.SICONOS_VI_ERROR_EVALUATION_ADAPTIVE SICONOS_GENERIC_MECHANICAL_NSGS = _sicpynumerics.SICONOS_GENERIC_MECHANICAL_NSGS SICONOS_GENERIC_MECHANICAL_IPARAM_ISREDUCED = _sicpynumerics.SICONOS_GENERIC_MECHANICAL_IPARAM_ISREDUCED SICONOS_GENERIC_MECHANICAL_IPARAM_WITH_LINESEARCH = _sicpynumerics.SICONOS_GENERIC_MECHANICAL_IPARAM_WITH_LINESEARCH SICONOS_DPARAM_GMP_ERROR_LS = _sicpynumerics.SICONOS_DPARAM_GMP_ERROR_LS SICONOS_DPARAM_GMP_COEFF_LS = _sicpynumerics.SICONOS_DPARAM_GMP_COEFF_LS SICONOS_GENERIC_MECHANICAL_GS_ON_ALLBLOCKS = _sicpynumerics.SICONOS_GENERIC_MECHANICAL_GS_ON_ALLBLOCKS SICONOS_GENERIC_MECHANICAL_SUBS_EQUALITIES = _sicpynumerics.SICONOS_GENERIC_MECHANICAL_SUBS_EQUALITIES SICONOS_GENERIC_MECHANICAL_ASSEMBLE_EQUALITIES = _sicpynumerics.SICONOS_GENERIC_MECHANICAL_ASSEMBLE_EQUALITIES SICONOS_GENERIC_MECHANICAL_MLCP_LIKE = _sicpynumerics.SICONOS_GENERIC_MECHANICAL_MLCP_LIKE
[docs] class functions_LSA(object): r""" Struct holding the necessary pointers to functions needed by the newton_LSA() procedure. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr compute_F = property(_sicpynumerics.functions_LSA_compute_F_get, _sicpynumerics.functions_LSA_compute_F_set, doc=r""" function to evaluate w = F(z)""") compute_F_merit = property(_sicpynumerics.functions_LSA_compute_F_merit_get, _sicpynumerics.functions_LSA_compute_F_merit_set, doc=r""" function to evaluate F_merit(z) (e.g. F_FB, F_{min}, ...) """) compute_H = property(_sicpynumerics.functions_LSA_compute_H_get, _sicpynumerics.functions_LSA_compute_H_set, doc=r""" function to get an element H of T""") compute_error = property(_sicpynumerics.functions_LSA_compute_error_get, _sicpynumerics.functions_LSA_compute_error_set, doc=r""" function to compute the error""") compute_RHS_desc = property(_sicpynumerics.functions_LSA_compute_RHS_desc_get, _sicpynumerics.functions_LSA_compute_RHS_desc_set, doc=r""" function to evaluate F_desc(z) (e.g. F_FB, F_{min}, ...), optional """) compute_H_desc = property(_sicpynumerics.functions_LSA_compute_H_desc_get, _sicpynumerics.functions_LSA_compute_H_desc_set, doc=r""" function to get an element H_desc of T_desc, optional""") compute_descent_direction = property(_sicpynumerics.functions_LSA_compute_descent_direction_get, _sicpynumerics.functions_LSA_compute_descent_direction_set, doc=r""" function to get the descent direction, used for instance in the Newton-Josephy method """) compute_JacTheta_merit = property(_sicpynumerics.functions_LSA_compute_JacTheta_merit_get, _sicpynumerics.functions_LSA_compute_JacTheta_merit_set, doc=r""" function to get the descent direction, used for instance in the Newton-Josephy method """) get_set_from_problem_data = property(_sicpynumerics.functions_LSA_get_set_from_problem_data_get, _sicpynumerics.functions_LSA_get_set_from_problem_data_set, doc=r""" Function returning the set description from the""") ls_failure_fn = property(_sicpynumerics.functions_LSA_ls_failure_fn_get, _sicpynumerics.functions_LSA_ls_failure_fn_set, doc=r""" Function to call when the line search fails""") def __init__(self): _sicpynumerics.functions_LSA_swiginit(self, _sicpynumerics.new_functions_LSA()) __swig_destroy__ = _sicpynumerics.delete_functions_LSA
# Register functions_LSA in _sicpynumerics: _sicpynumerics.functions_LSA_swigregister(functions_LSA) SICONOS_AVI_CAOFERRIS_STR = cvar.SICONOS_AVI_CAOFERRIS_STR SICONOS_AVI_PATHAVI_STR = cvar.SICONOS_AVI_PATHAVI_STR SICONOS_RELAY_PGS_STR = cvar.SICONOS_RELAY_PGS_STR SICONOS_RELAY_PATH_STR = cvar.SICONOS_RELAY_PATH_STR SICONOS_RELAY_ENUM_STR = cvar.SICONOS_RELAY_ENUM_STR SICONOS_RELAY_LEMKE_STR = cvar.SICONOS_RELAY_LEMKE_STR SICONOS_RELAY_AVI_CAOFERRIS_STR = cvar.SICONOS_RELAY_AVI_CAOFERRIS_STR SICONOS_RELAY_AVI_CAOFERRIS_TEST_STR = cvar.SICONOS_RELAY_AVI_CAOFERRIS_TEST_STR SICONOS_FRICTION_2D_NSGS_STR = cvar.SICONOS_FRICTION_2D_NSGS_STR SICONOS_FRICTION_2D_CPG_STR = cvar.SICONOS_FRICTION_2D_CPG_STR SICONOS_FRICTION_2D_LEMKE_STR = cvar.SICONOS_FRICTION_2D_LEMKE_STR SICONOS_FRICTION_2D_ENUM_STR = cvar.SICONOS_FRICTION_2D_ENUM_STR SICONOS_FRICTION_3D_NSGS_STR = cvar.SICONOS_FRICTION_3D_NSGS_STR SICONOS_FRICTION_3D_NSGSV_STR = cvar.SICONOS_FRICTION_3D_NSGSV_STR SICONOS_FRICTION_3D_PROX_STR = cvar.SICONOS_FRICTION_3D_PROX_STR SICONOS_FRICTION_3D_TFP_STR = cvar.SICONOS_FRICTION_3D_TFP_STR SICONOS_FRICTION_3D_PFP_STR = cvar.SICONOS_FRICTION_3D_PFP_STR SICONOS_FRICTION_3D_NSN_AC_STR = cvar.SICONOS_FRICTION_3D_NSN_AC_STR SICONOS_FRICTION_3D_NSN_AC_TEST_STR = cvar.SICONOS_FRICTION_3D_NSN_AC_TEST_STR SICONOS_FRICTION_3D_NSN_FB_STR = cvar.SICONOS_FRICTION_3D_NSN_FB_STR SICONOS_FRICTION_3D_NSN_NM_STR = cvar.SICONOS_FRICTION_3D_NSN_NM_STR SICONOS_FRICTION_3D_DSFP_STR = cvar.SICONOS_FRICTION_3D_DSFP_STR SICONOS_FRICTION_3D_VI_EG_STR = cvar.SICONOS_FRICTION_3D_VI_EG_STR SICONOS_FRICTION_3D_VI_FPP_STR = cvar.SICONOS_FRICTION_3D_VI_FPP_STR SICONOS_FRICTION_3D_EG_STR = cvar.SICONOS_FRICTION_3D_EG_STR SICONOS_FRICTION_3D_FPP_STR = cvar.SICONOS_FRICTION_3D_FPP_STR SICONOS_FRICTION_3D_HP_STR = cvar.SICONOS_FRICTION_3D_HP_STR SICONOS_FRICTION_3D_NCPGlockerFBFixedPoint_STR = cvar.SICONOS_FRICTION_3D_NCPGlockerFBFixedPoint_STR SICONOS_FRICTION_3D_ONECONTACT_NSN_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_NSN_STR SICONOS_FRICTION_3D_ONECONTACT_NSN_GP_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_NSN_GP_STR SICONOS_FRICTION_3D_ONECONTACT_NSN_GP_HYBRID_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_NSN_GP_HYBRID_STR SICONOS_FRICTION_3D_NCPGlockerFBNewton_STR = cvar.SICONOS_FRICTION_3D_NCPGlockerFBNewton_STR SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithDiagonalization_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithDiagonalization_STR SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCone_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCone_STR SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration_STR SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithRegularization_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithRegularization_STR SICONOS_FRICTION_3D_NCPGlockerFBPATH_STR = cvar.SICONOS_FRICTION_3D_NCPGlockerFBPATH_STR SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCylinder_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCylinder_STR SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCylinderWithLocalIteration_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCylinderWithLocalIteration_STR SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCone_velocity_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCone_velocity_STR SICONOS_FRICTION_3D_CONVEXQP_PG_CYLINDER_STR = cvar.SICONOS_FRICTION_3D_CONVEXQP_PG_CYLINDER_STR SICONOS_FRICTION_3D_VI_FPP_Cylinder_STR = cvar.SICONOS_FRICTION_3D_VI_FPP_Cylinder_STR SICONOS_FRICTION_3D_GAMS_PATH_STR = cvar.SICONOS_FRICTION_3D_GAMS_PATH_STR SICONOS_FRICTION_3D_GAMS_PATHVI_STR = cvar.SICONOS_FRICTION_3D_GAMS_PATHVI_STR SICONOS_FRICTION_3D_GAMS_LCP_PATH_STR = cvar.SICONOS_FRICTION_3D_GAMS_LCP_PATH_STR SICONOS_FRICTION_3D_GAMS_LCP_PATHVI_STR = cvar.SICONOS_FRICTION_3D_GAMS_LCP_PATHVI_STR SICONOS_FRICTION_3D_SOCLCP_STR = cvar.SICONOS_FRICTION_3D_SOCLCP_STR SICONOS_FRICTION_3D_ACLMFP_STR = cvar.SICONOS_FRICTION_3D_ACLMFP_STR SICONOS_FRICTION_3D_ADMM_STR = cvar.SICONOS_FRICTION_3D_ADMM_STR SICONOS_GLOBAL_FRICTION_3D_NSGS_WR_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_NSGS_WR_STR SICONOS_GLOBAL_FRICTION_3D_NSGSV_WR_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_NSGSV_WR_STR SICONOS_GLOBAL_FRICTION_3D_PROX_WR_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_PROX_WR_STR SICONOS_GLOBAL_FRICTION_3D_DSFP_WR_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_DSFP_WR_STR SICONOS_GLOBAL_FRICTION_3D_TFP_WR_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_TFP_WR_STR SICONOS_GLOBAL_FRICTION_3D_NSGS_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_NSGS_STR SICONOS_GLOBAL_FRICTION_3D_NSN_AC_WR_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_NSN_AC_WR_STR SICONOS_GLOBAL_FRICTION_3D_NSN_AC_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_NSN_AC_STR SICONOS_GLOBAL_FRICTION_3D_GAMS_PATH_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_GAMS_PATH_STR SICONOS_GLOBAL_FRICTION_3D_GAMS_PATHVI_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_GAMS_PATHVI_STR SICONOS_GLOBAL_FRICTION_3D_VI_FPP_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_VI_FPP_STR SICONOS_GLOBAL_FRICTION_3D_VI_EG_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_VI_EG_STR SICONOS_GLOBAL_FRICTION_3D_ACLMFP_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_ACLMFP_STR SICONOS_GLOBAL_FRICTION_3D_ADMM_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_ADMM_STR SICONOS_GLOBAL_FRICTION_3D_ADMM_WR_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_ADMM_WR_STR SICONOS_GLOBAL_FRICTION_3D_IPM_STR = cvar.SICONOS_GLOBAL_FRICTION_3D_IPM_STR SICONOS_FRICTION_3D_ONECONTACT_QUARTIC_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_QUARTIC_STR SICONOS_FRICTION_3D_ONECONTACT_QUARTIC_NU_STR = cvar.SICONOS_FRICTION_3D_ONECONTACT_QUARTIC_NU_STR SICONOS_ROLLING_FRICTION_3D_NSGS_STR = cvar.SICONOS_ROLLING_FRICTION_3D_NSGS_STR SICONOS_ROLLING_FRICTION_3D_ONECONTACT_ProjectionOnCone_STR = cvar.SICONOS_ROLLING_FRICTION_3D_ONECONTACT_ProjectionOnCone_STR SICONOS_ROLLING_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration_STR = cvar.SICONOS_ROLLING_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration_STR SICONOS_ROLLING_FRICTION_3D_ADMM_STR = cvar.SICONOS_ROLLING_FRICTION_3D_ADMM_STR SICONOS_ROLLING_FRICTION_2D_NSGS_STR = cvar.SICONOS_ROLLING_FRICTION_2D_NSGS_STR SICONOS_ROLLING_FRICTION_2D_ONECONTACT_ProjectionOnCone_STR = cvar.SICONOS_ROLLING_FRICTION_2D_ONECONTACT_ProjectionOnCone_STR SICONOS_ROLLING_FRICTION_2D_ONECONTACT_ProjectionOnConeWithLocalIteration_STR = cvar.SICONOS_ROLLING_FRICTION_2D_ONECONTACT_ProjectionOnConeWithLocalIteration_STR SICONOS_GLOBAL_ROLLING_FRICTION_3D_NSGS_WR_STR = cvar.SICONOS_GLOBAL_ROLLING_FRICTION_3D_NSGS_WR_STR SICONOS_GLOBAL_ROLLING_FRICTION_3D_IPM_STR = cvar.SICONOS_GLOBAL_ROLLING_FRICTION_3D_IPM_STR SICONOS_MCP_OLD_FB_STR = cvar.SICONOS_MCP_OLD_FB_STR SICONOS_MCP_NEWTON_FB_FBLSA_STR = cvar.SICONOS_MCP_NEWTON_FB_FBLSA_STR SICONOS_MCP_NEWTON_MIN_FBLSA_STR = cvar.SICONOS_MCP_NEWTON_MIN_FBLSA_STR SICONOS_NCP_NEWTON_FB_FBLSA_STR = cvar.SICONOS_NCP_NEWTON_FB_FBLSA_STR SICONOS_NCP_NEWTON_MIN_FBLSA_STR = cvar.SICONOS_NCP_NEWTON_MIN_FBLSA_STR SICONOS_NCP_PATHSEARCH_STR = cvar.SICONOS_NCP_PATHSEARCH_STR SICONOS_NCP_PATH_STR = cvar.SICONOS_NCP_PATH_STR SICONOS_VI_EG_STR = cvar.SICONOS_VI_EG_STR SICONOS_VI_FPP_STR = cvar.SICONOS_VI_FPP_STR SICONOS_VI_HP_STR = cvar.SICONOS_VI_HP_STR SICONOS_VI_BOX_QI_STR = cvar.SICONOS_VI_BOX_QI_STR SICONOS_VI_BOX_AVI_LSA_STR = cvar.SICONOS_VI_BOX_AVI_LSA_STR SICONOS_VI_BOX_PATH_STR = cvar.SICONOS_VI_BOX_PATH_STR SICONOS_GENERIC_MECHANICAL_NSGS_STR = cvar.SICONOS_GENERIC_MECHANICAL_NSGS_STR NEWTON_STATS_ITERATION = _sicpynumerics.NEWTON_STATS_ITERATION class newton_stats(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr id = property(_sicpynumerics.newton_stats_id_get, _sicpynumerics.newton_stats_id_set, doc=r""" id of this structure""") merit_value = property(_sicpynumerics.newton_stats_merit_value_get, _sicpynumerics.newton_stats_merit_value_set, doc=r""" value of the merit function at the end of the iteration """) alpha = property(_sicpynumerics.newton_stats_alpha_get, _sicpynumerics.newton_stats_alpha_set, doc=r""" value of the LS parameter""") status = property(_sicpynumerics.newton_stats_status_get, _sicpynumerics.newton_stats_status_set, doc=r""" status of this newton iteration""") def __init__(self): _sicpynumerics.newton_stats_swiginit(self, _sicpynumerics.new_newton_stats()) __swig_destroy__ = _sicpynumerics.delete_newton_stats # Register newton_stats in _sicpynumerics: _sicpynumerics.newton_stats_swigregister(newton_stats) class newton_LSA_param(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr p = property(_sicpynumerics.newton_LSA_param_p_get, _sicpynumerics.newton_LSA_param_p_set, doc=r""" p value for the acceptance test of the direction solution of the linear system """) sigma = property(_sicpynumerics.newton_LSA_param_sigma_get, _sicpynumerics.newton_LSA_param_sigma_set, doc=r""" ratio for the decrease in norm of the C-function (:math:`gamma'` in VFBLSA) """) rho = property(_sicpynumerics.newton_LSA_param_rho_get, _sicpynumerics.newton_LSA_param_rho_set, doc=r""" coefficient for the direction check""") keep_H = property(_sicpynumerics.newton_LSA_param_keep_H_get, _sicpynumerics.newton_LSA_param_keep_H_set, doc=r""" keep the matrix H untouched. Only used in the dense case, where a copy of the matrix is factorized """) check_dir_quality = property(_sicpynumerics.newton_LSA_param_check_dir_quality_get, _sicpynumerics.newton_LSA_param_check_dir_quality_set, doc=r""" Check the quality of the descent direction (Eqn 9.1.6 p. 805 in Facchinei & Pang) """) def __init__(self): _sicpynumerics.newton_LSA_param_swiginit(self, _sicpynumerics.new_newton_LSA_param()) __swig_destroy__ = _sicpynumerics.delete_newton_LSA_param # Register newton_LSA_param in _sicpynumerics: _sicpynumerics.newton_LSA_param_swigregister(newton_LSA_param) class newton_LSA_data(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr H = property(_sicpynumerics.newton_LSA_data_H_get, _sicpynumerics.newton_LSA_data_H_set, doc=r""" matrix""") def __init__(self): _sicpynumerics.newton_LSA_data_swiginit(self, _sicpynumerics.new_newton_LSA_data()) __swig_destroy__ = _sicpynumerics.delete_newton_LSA_data # Register newton_LSA_data in _sicpynumerics: _sicpynumerics.newton_LSA_data_swigregister(newton_LSA_data) SICONOS_NEWTON_LSA = _sicpynumerics.SICONOS_NEWTON_LSA SICONOS_IPARAM_LSA_NONMONOTONE_LS = _sicpynumerics.SICONOS_IPARAM_LSA_NONMONOTONE_LS r""" line search based algo use this""" SICONOS_IPARAM_LSA_NONMONOTONE_LS_M = _sicpynumerics.SICONOS_IPARAM_LSA_NONMONOTONE_LS_M SICONOS_IPARAM_LSA_FORCE_ARCSEARCH = _sicpynumerics.SICONOS_IPARAM_LSA_FORCE_ARCSEARCH SICONOS_IPARAM_LSA_SEARCH_CRITERION = _sicpynumerics.SICONOS_IPARAM_LSA_SEARCH_CRITERION SICONOS_IPARAM_STOPPING_CRITERION = _sicpynumerics.SICONOS_IPARAM_STOPPING_CRITERION SICONOS_STOPPING_CRITERION_RESIDU = _sicpynumerics.SICONOS_STOPPING_CRITERION_RESIDU SICONOS_STOPPING_CRITERION_STATIONARITY = _sicpynumerics.SICONOS_STOPPING_CRITERION_STATIONARITY SICONOS_STOPPING_CRITERION_RESIDU_AND_STATIONARITY = _sicpynumerics.SICONOS_STOPPING_CRITERION_RESIDU_AND_STATIONARITY SICONOS_STOPPING_CRITERION_USER_ROUTINE = _sicpynumerics.SICONOS_STOPPING_CRITERION_USER_ROUTINE SICONOS_IPARAM_GOLDSTEIN_ITERMAX = _sicpynumerics.SICONOS_IPARAM_GOLDSTEIN_ITERMAX SICONOS_IPARAM_NMS_WATCHDOG_TYPE = _sicpynumerics.SICONOS_IPARAM_NMS_WATCHDOG_TYPE r""" non-monotone specific part""" SICONOS_IPARAM_NMS_PROJECTED_GRADIENT_TYPE = _sicpynumerics.SICONOS_IPARAM_NMS_PROJECTED_GRADIENT_TYPE SICONOS_IPARAM_NMS_N_MAX = _sicpynumerics.SICONOS_IPARAM_NMS_N_MAX SICONOS_DPARAM_LSA_ALPHA_MIN = _sicpynumerics.SICONOS_DPARAM_LSA_ALPHA_MIN r""" line-search""" SICONOS_DPARAM_GOLDSTEIN_C = _sicpynumerics.SICONOS_DPARAM_GOLDSTEIN_C SICONOS_DPARAM_GOLDSTEIN_ALPHAMAX = _sicpynumerics.SICONOS_DPARAM_GOLDSTEIN_ALPHAMAX SICONOS_DPARAM_NMS_DELTA = _sicpynumerics.SICONOS_DPARAM_NMS_DELTA r""" non-monotone specific part""" SICONOS_DPARAM_NMS_DELTA_VAR = _sicpynumerics.SICONOS_DPARAM_NMS_DELTA_VAR SICONOS_DPARAM_NMS_SIGMA = _sicpynumerics.SICONOS_DPARAM_NMS_SIGMA SICONOS_DPARAM_NMS_ALPHA_MIN_WATCHDOG = _sicpynumerics.SICONOS_DPARAM_NMS_ALPHA_MIN_WATCHDOG SICONOS_DPARAM_NMS_ALPHA_MIN_PGRAD = _sicpynumerics.SICONOS_DPARAM_NMS_ALPHA_MIN_PGRAD SICONOS_DPARAM_NMS_MERIT_INCR = _sicpynumerics.SICONOS_DPARAM_NMS_MERIT_INCR NEWTON_STATS_NEWTON_STEP = _sicpynumerics.NEWTON_STATS_NEWTON_STEP NEWTON_STATS_DESC_DIR = _sicpynumerics.NEWTON_STATS_DESC_DIR
[docs] def newton_LSA(n: "unsigned int", z: "double *", w: "double *", data: "void *", options: "SolverOptions", functions: "functions_LSA") -> "int *": r""" Newton algorithm for finding the zero of a function with a line search. Mainly used for equation-based reformulation of CP or VI. :type n: int :param n: size of the problem :type z: float :param z: variable :type w: float :param w: value of F(z) :type info: int :param info: solver-specific values :type data: void :param data: opaque problem definition :type options: :py:class:`SolverOptions` :param options: options for this solver :type functions: :py:class:`functions_LSA` :param functions: struct of function pointers to compute F, H and the error """ return _sicpynumerics.newton_LSA(n, z, w, data, options, functions)
[docs] def init_lsa_functions(functions: "functions_LSA", compute_F: "compute_F_ptr", merit_function: "compute_F_merit_ptr") -> "void": r""" Set the functions to compute F and F_merit and all the other pointers to NULL :type functions: :py:class:`functions_LSA` :param functions: structure to fill :type compute_F: void :param compute_F: function to compute F :type merit_function: void :param merit_function: function to compute F_merit """ return _sicpynumerics.init_lsa_functions(functions, compute_F, merit_function)
[docs] def set_lsa_params_data(options: "SolverOptions", mat: "NumericsMatrix") -> "void": r""" Set the parameters and data for newton_LSA :type options: :py:class:`SolverOptions` :param options: the solver option :type mat: :py:class:`NumericsMatrix` :param mat: the """ return _sicpynumerics.set_lsa_params_data(options, mat)
[docs] def newton_LSA_free_solverOptions(options: "SolverOptions") -> "void": r""" clear the solver-specific data :type options: :py:class:`SolverOptions` :param options: the SolverOption structure """ return _sicpynumerics.newton_LSA_free_solverOptions(options)
def newton_lsa_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.newton_lsa_set_default(options) PROJCONE_DUAL = _sicpynumerics.PROJCONE_DUAL PROJCONE_INSIDE = _sicpynumerics.PROJCONE_INSIDE PROJCONE_BOUNDARY = _sicpynumerics.PROJCONE_BOUNDARY
[docs] def projectionOnCone(r: "double *", mu: "double") -> "unsigned int": r""" projectionOnCone Projection on the second Order Cone in :math:`R^3`, :math:`K \{ r, r_1 \geq 0, 0 \sqrt(r_2^2+r_3^2) \geq mu r_1 \}` :type r: float, in/out :param r: the vector to be projected :type mu: float, in :param mu: the angle of the cone :rtype: int :return: the type of projection """ return _sicpynumerics.projectionOnCone(r, mu)
[docs] def projectionOnDualCone(u: "double *", mu: "double") -> "unsigned int": r""" projectionOnDualCone Projection on the second Order Cone in :math:`R^3`, :math:`K \{ r, r_1 \geq 0, 0 mu \sqrt(u_2^2+u_3^2) \geq u_1 \}` :type u: float, in/out :param u: the vector to be projected :type mu: float, in :param mu: the angle of the cone :rtype: int :return: the type of projection """ return _sicpynumerics.projectionOnDualCone(u, mu)
[docs] def projectionOnSecondOrderCone(r: "double *", mu: "double", size: "int") -> "void": r""" projectionOnCone Projection on the second Order Cone in :math:`R^n`, :math:`K \{ r, r_1 \geq 0, 0 \|[r_2,r_n]\| \geq mu r_1 \}` :type r: float, in/out :param r: the vector to be projected :type mu: float, in :param mu: the angle of the cone :type size: int, in :param size: dimension """ return _sicpynumerics.projectionOnSecondOrderCone(r, mu, size)
PROJRCONE_DUAL = _sicpynumerics.PROJRCONE_DUAL PROJRCONE_INSIDE = _sicpynumerics.PROJRCONE_INSIDE PROJRCONE_BOUNDARY_FRICTION = _sicpynumerics.PROJRCONE_BOUNDARY_FRICTION PROJRCONE_BOUNDARY_ROLLING = _sicpynumerics.PROJRCONE_BOUNDARY_ROLLING PROJRCONE_BOUNDARY_FRICTION_ROLLING = _sicpynumerics.PROJRCONE_BOUNDARY_FRICTION_ROLLING
[docs] def projectionOnRollingCone(r: "double *", mu: "double", mur: "double") -> "unsigned int": r""" projectionOnCone Projection on the second Order Cone in :math:`R^3`, :math:`K \{ r, r_1 \geq 0, 0 \sqrt(r_2^2+r_3^2) \geq mu r_1 \}` :type r: float, in/out :param r: the vector to be projected :type mu: float, in :param mu: the angle of the cone :rtype: int :return: the type of projection """ return _sicpynumerics.projectionOnRollingCone(r, mu, mur)
[docs] def projectionOn2DRollingCone(r: "double *", mu: "double", mur: "double") -> "unsigned int": r""" projectionOnCone Projection on the second Order Cone in :math:`R^3`, :math:`K \{ r, r_1 \geq 0, 0 \sqrt(r_2^2+r_3^2) \geq mu r_1 \}` :type r: float, in/out :param r: the vector to be projected :type mu: float, in :param mu: the angle of the cone :rtype: int :return: the type of projection """ return _sicpynumerics.projectionOn2DRollingCone(r, mu, mur)
[docs] def projectionOnDualRollingCone(u: "double *", mu: "double", mur: "double") -> "unsigned int": r""" projectionOnDualCone Projection on the second Order Cone in :math:`R^3`, :math:`K \{ r, r_1 \geq 0, 0 mu \sqrt(u_2^2+u_3^2) \geq u_1 \}` :type u: float, in/out :param u: the vector to be projected :type mu: float, in :param mu: the angle of the cone :rtype: int :return: the type of projection """ return _sicpynumerics.projectionOnDualRollingCone(u, mu, mur)
def display_status_rolling_cone(status: "unsigned int") -> "void": return _sicpynumerics.display_status_rolling_cone(status) ENV_IS_C_STRUCT = _sicpynumerics.ENV_IS_C_STRUCT ENV_IS_UNKNOWN = _sicpynumerics.ENV_IS_UNKNOWN ENV_IS_PYTHON_CLASS = _sicpynumerics.ENV_IS_PYTHON_CLASS ENV_IS_PYTHON_FUNCTIONS = _sicpynumerics.ENV_IS_PYTHON_FUNCTIONS ENV_IS_PYTHON_FUNCTIONS_WITH_PROJ = _sicpynumerics.ENV_IS_PYTHON_FUNCTIONS_WITH_PROJ ENV_IS_MATLAB_FUNCTION_HANDLES = _sicpynumerics.ENV_IS_MATLAB_FUNCTION_HANDLES ENV_IS_MATLAB_FUNCTION_NAMES = _sicpynumerics.ENV_IS_MATLAB_FUNCTION_NAMES
[docs] class MCP(object): r""" Structure that contains and defines a MixedComplementarityProblem""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr n1 = property(_sicpynumerics.MCP_n1_get, _sicpynumerics.MCP_n1_set, doc=r""" number of equalities constraints""") n2 = property(_sicpynumerics.MCP_n2_get, _sicpynumerics.MCP_n2_set, doc=r""" size of complementarity variables""") compute_Fmcp = property(_sicpynumerics.MCP_compute_Fmcp_get, _sicpynumerics.MCP_compute_Fmcp_set, doc=r""" pointer to the function used to compute :math:`F_{mcp}(z) = (G(z), H(z))` """) compute_nabla_Fmcp = property(_sicpynumerics.MCP_compute_nabla_Fmcp_get, _sicpynumerics.MCP_compute_nabla_Fmcp_set, doc=r""" pointer to the function used to compute :math:`\nabla_z F_{mcp}` """) nabla_Fmcp = property(_sicpynumerics.MCP_nabla_Fmcp_get, _sicpynumerics.MCP_nabla_Fmcp_set, doc=r""" storage for :math:`\nabla_z F_{mcp}`""") env = property(_sicpynumerics.MCP_env_get, _sicpynumerics.MCP_env_set, doc=r""" environment for the compute_Fmcp and compute_nabla_Fmcp function. When called from Python, it contains an object with compute_Fmcp and compute_nabla_Fmcp as methods. When called from C, it can reference a data struct containing variables needed for the computations. """) @staticmethod def call_compute_F(problem: "void *", n: "int", z: "double *", F: "double *") -> "void": return _sicpynumerics.MCP_call_compute_F(problem, n, z, F) @staticmethod def call_compute_nabla_F(problem: "void *", n: "int", z: "double *", nabla_F: "NumericsMatrix") -> "void": return _sicpynumerics.MCP_call_compute_nabla_F(problem, n, z, nabla_F) def __init__(self, *args): _sicpynumerics.MCP_swiginit(self, _sicpynumerics.new_MCP(*args)) def set_compute_F_and_nabla_F_as_C_functions(self, lib_name: "PyObject *", compute_F_name: "PyObject *", compute_nabla_F_name: "PyObject *") -> "void": return _sicpynumerics.MCP_set_compute_F_and_nabla_F_as_C_functions(self, lib_name, compute_F_name, compute_nabla_F_name) def get_env_as_long(self) -> "PyObject *": return _sicpynumerics.MCP_get_env_as_long(self) __swig_destroy__ = _sicpynumerics.delete_MCP
# Register MCP in _sicpynumerics: _sicpynumerics.MCP_swigregister(MCP) SICONOS_NEWTON_LSA_STR = cvar.SICONOS_NEWTON_LSA_STR def MCP_call_compute_F(problem: "void *", n: "int", z: "double *", F: "double *") -> "void": return _sicpynumerics.MCP_call_compute_F(problem, n, z, F) def MCP_call_compute_nabla_F(problem: "void *", n: "int", z: "double *", nabla_F: "NumericsMatrix") -> "void": return _sicpynumerics.MCP_call_compute_nabla_F(problem, n, z, nabla_F)
[docs] class MCP_old(object): r""" The structure that defines a Mixed Complementarity problem (MCP) : find two vectors :math:`(z,w \in {{\mathrm{I\!R}}}^{n+m})` such that: .. math:: w &= \begin{pmatrix}w_e\\w_i\end{pmatrix} = F(z) \ \ w_e &=0 \ \ 0 &\le w_i \perp z_i \ge 0 where "i" (resp. "e") stands for inequalities (resp. equalities). The vector :math:`z` is splitted like :math:`w`: .. math:: z =\begin{pmatrix}z_e\\z_i\end{pmatrix} :math:`z_i,w_i` are vectors of size sizeEqualities, :math:`z_e,w_e` vectors of size sizeInequalities and :math:`F` is a non linear function that must be user-defined. """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr sizeEqualities = property(_sicpynumerics.MCP_old_sizeEqualities_get, _sicpynumerics.MCP_old_sizeEqualities_set, doc=r""" size of equalities :math:`z_e, w_e` size""") sizeInequalities = property(_sicpynumerics.MCP_old_sizeInequalities_get, _sicpynumerics.MCP_old_sizeInequalities_set, doc=r""" size of inequalities :math:`z_i,w_i` size""") computeFmcp = property(_sicpynumerics.MCP_old_computeFmcp_get, _sicpynumerics.MCP_old_computeFmcp_set, doc=r""" pointer to the function to compute F(z)""") computeNablaFmcp = property(_sicpynumerics.MCP_old_computeNablaFmcp_get, _sicpynumerics.MCP_old_computeNablaFmcp_set) Fmcp = property(_sicpynumerics.MCP_old_Fmcp_get, _sicpynumerics.MCP_old_Fmcp_set, doc=r""" pointer to the function to compute the jacobian of F(z) The value F(z) """) nablaFmcp = property(_sicpynumerics.MCP_old_nablaFmcp_get, _sicpynumerics.MCP_old_nablaFmcp_set, doc=r""" jacobian of F(z)""") def set_computeFmcp(self, o: "PyObject *") -> "void": return _sicpynumerics.MCP_old_set_computeFmcp(self, o) def set_computeNablaFmcp(self, o: "PyObject *") -> "void": return _sicpynumerics.MCP_old_set_computeNablaFmcp(self, o) def test_call_to_callback(self) -> "void": return _sicpynumerics.MCP_old_test_call_to_callback(self) def __init__(self, *args): _sicpynumerics.MCP_old_swiginit(self, _sicpynumerics.new_MCP_old(*args)) __swig_destroy__ = _sicpynumerics.delete_MCP_old
# Register MCP_old in _sicpynumerics: _sicpynumerics.MCP_old_swigregister(MCP_old)
[docs] def mixedComplementarityProblem_free(mcp: "MCP") -> "void": r""" free a MCP problem :type mcp: :py:class:`MixedComplementarityProblem` :param mcp: structure to free """ return _sicpynumerics.mixedComplementarityProblem_free(mcp)
[docs] def mixedComplementarityProblem_new() -> "MixedComplementarityProblem *": r""" :rtype: :py:class:`MixedComplementarityProblem` :return: an empty MixedComplementarityProblem instance """ return _sicpynumerics.mixedComplementarityProblem_new()
[docs] def mixedComplementarityProblem_old_free(problem: "MCP_old") -> "void": r""" Delete a MixedComplementarityProblem_old :type problem: :py:class:`MixedComplementarityProblem_old` :param problem: pointer to a MixedComplementarityProblem_old to delete """ return _sicpynumerics.mixedComplementarityProblem_old_free(problem)
[docs] def mcp_newton_FB_FBLSA(problem: "MCP", z: "double *", Fmcp: "double *", options: "SolverOptions") -> "int *": r""" Solver based on Fischer-Burmeister reformulation and line search (VFBLSA in Facchinei--Pang 2003 p. 834) :type problem: :py:class:`MixedComplementarityProblem`, in :param problem: a structure which represents the MCP :type z: float, in/out :param z: a n1+n2-vector, initial solution + returns the solution of the problem. :type Fmcp: float, out :param Fmcp: n1+n2-vector which contains the value of Fmcp(z) = (G(z), H(z)) :type info: int, out :param info: termination value: 0 if success else >0. :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mcp_newton_FB_FBLSA(problem, z, Fmcp, options)
[docs] def mcp_newton_min_FBLSA(problem: "MCP", z: "double *", Fmcp: "double *", options: "SolverOptions") -> "int *": r""" Solver based on Fischer-Burmeister reformulation and line search. The descent direction is found using a min reformulation (minFBLSA in Facchinei--Pang 2003 p. 855) :type problem: :py:class:`MixedComplementarityProblem`, in :param problem: a structure which represents the MCP :type z: float, in/out :param z: a n1+n2-vector, initial solution + returns the solution of the problem. :type Fmcp: float, out :param Fmcp: n1+n2-vector which contains the value of Fmcp(z) = (G(z), H(z)) :type info: int, out :param info: termination value: 0 if success else >0. :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mcp_newton_min_FBLSA(problem, z, Fmcp, options)
def mcp_compute_error(problem: "MCP", z: "double *", w: "double *") -> "double *": return _sicpynumerics.mcp_compute_error(problem, z, w)
[docs] def mcp_old_driver_init(problem: "MCP_old", options: "SolverOptions") -> "void": r""" Initialisation of the MCP solver (set problem, allocate working memory and so on. This routine must be called before any attempt to run the mcp_old_driver. :type problem: :py:class:`MixedComplementarityProblem_old`, in :param problem: the description of the MCP :type options: :py:class:`SolverOptions`, in :param options: for the solver """ return _sicpynumerics.mcp_old_driver_init(problem, options)
[docs] def mcp_old_driver_reset(problem: "MCP_old", options: "SolverOptions") -> "void": r""" Reset of the MCP solver :type problem: :py:class:`MixedComplementarityProblem_old`, in :param problem: the description of the MCP :type options: :py:class:`SolverOptions`, in :param options: for the solver """ return _sicpynumerics.mcp_old_driver_reset(problem, options)
[docs] def mcp_old_FischerBurmeister(problem: "MCP_old", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" Fischer Burmeister solver :type problem: :py:class:`MixedComplementarityProblem_old`, in :param problem: a structure which represents the MCP :type z: float, in/out :param z: a m+n-vector, initial solution + returns the solution of the problem. :type w: float, out :param w: not used :type info: int, out :param info: termination value: 0 if success else >0. :type options: :py:class:`SolverOptions`, in/out :param options: structure used to define the solver and its parameters. """ return _sicpynumerics.mcp_old_FischerBurmeister(problem, z, w, options)
[docs] def mcp_old_FischerBurmeister_init(problem: "MCP_old", options: "SolverOptions") -> "void": r""" Initialisation of the MCP Fischer solver (set problem, allocate working memory and so on. This routine must be called before any attempt to run the mcp_old_driver. :type problem: :py:class:`MixedComplementarityProblem_old`, in :param problem: description of the MCP :type options: :py:class:`SolverOptions`, in :param options: for the solver """ return _sicpynumerics.mcp_old_FischerBurmeister_init(problem, options)
[docs] def mcp_old_FischerBurmeister_reset(problem: "MCP_old", options: "SolverOptions") -> "void": r""" Reset of the MCP Fischer solver (free local variable) :type problem: :py:class:`MixedComplementarityProblem_old`, in :param problem: description of the MCP :type options: :py:class:`SolverOptions`, in :param options: for the solver """ return _sicpynumerics.mcp_old_FischerBurmeister_reset(problem, options)
def mcp_old_compute_error(problem: "MCP_old", z: "double *", w: "double *") -> "double *": return _sicpynumerics.mcp_old_compute_error(problem, z, w)
[docs] class NCP(object): r""" The structure that defines a Nonlinear Complementarity Problem (NCP) : Find two vectors :math:`(z,w \in {{\mathrm{I\!R}}}^{n})` such that: .. math:: w &= F(z) \\ 0 &\le w \perp z \ge 0 """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr n = property(_sicpynumerics.NCP_n_get, _sicpynumerics.NCP_n_set, doc=r""" size of the problem""") compute_F = property(_sicpynumerics.NCP_compute_F_get, _sicpynumerics.NCP_compute_F_set, doc=r""" pointer to the function used to compute :math:`F(z)`""") compute_nabla_F = property(_sicpynumerics.NCP_compute_nabla_F_get, _sicpynumerics.NCP_compute_nabla_F_set, doc=r""" pointer to the function used to compute :math:`\nabla_z F(z)` """) nabla_F = property(_sicpynumerics.NCP_nabla_F_get, _sicpynumerics.NCP_nabla_F_set, doc=r""" storage for :math:`\nabla_z F`""") env = property(_sicpynumerics.NCP_env_get, _sicpynumerics.NCP_env_set, doc=r""" environment for the compute_Fmcp and compute_nabla_F function. When called from Python, it contains an object with compute_F and compute_nabla_F as methods. When called from C, it can reference a data struct containing variables needed for the computations. """) @staticmethod def call_compute_F(problem: "void *", n: "int", z: "double *", F: "double *") -> "void": return _sicpynumerics.NCP_call_compute_F(problem, n, z, F) @staticmethod def call_compute_nabla_F(problem: "void *", n: "int", z: "double *", nabla_F: "NumericsMatrix") -> "void": return _sicpynumerics.NCP_call_compute_nabla_F(problem, n, z, nabla_F) def __init__(self, *args): _sicpynumerics.NCP_swiginit(self, _sicpynumerics.new_NCP(*args)) def set_compute_F_and_nabla_F_as_C_functions(self, lib_name: "PyObject *", compute_F_name: "PyObject *", compute_nabla_F_name: "PyObject *") -> "void": return _sicpynumerics.NCP_set_compute_F_and_nabla_F_as_C_functions(self, lib_name, compute_F_name, compute_nabla_F_name) def get_env_as_long(self) -> "PyObject *": return _sicpynumerics.NCP_get_env_as_long(self) __swig_destroy__ = _sicpynumerics.delete_NCP
# Register NCP in _sicpynumerics: _sicpynumerics.NCP_swigregister(NCP) def NCP_call_compute_F(problem: "void *", n: "int", z: "double *", F: "double *") -> "void": return _sicpynumerics.NCP_call_compute_F(problem, n, z, F) def NCP_call_compute_nabla_F(problem: "void *", n: "int", z: "double *", nabla_F: "NumericsMatrix") -> "void": return _sicpynumerics.NCP_call_compute_nabla_F(problem, n, z, nabla_F)
[docs] def freeNCP(ncp: "NCP") -> "void": r""" free an NCP problem :type ncp: :py:class:`NonlinearComplementarityProblem` :param ncp: structure to free """ return _sicpynumerics.freeNCP(ncp)
[docs] def newNCP() -> "NonlinearComplementarityProblem *": r""" create an empty NCP problem :rtype: :py:class:`NonlinearComplementarityProblem` :return: an MixedComplementarityProblem instance """ return _sicpynumerics.newNCP()
[docs] def ncp_compute_error(n: "int", z: "double *", F: "double *", tol: "double", err: "double *") -> "int": r""" This function compute the complementarity error of the NCP: :math:`0 \leq z \perp F(z) \geq 0`. :type n: int :param n: size of the vectors :type z: float, in :param z: solution :type F: float, in :param F: value of the function at the solution :type tol: float, in :param tol: tolerance for the error :type err: float, out :param err: value of the error :rtype: int :return: 0 if the solution is good enough, 1 otherwise """ return _sicpynumerics.ncp_compute_error(n, z, F, tol, err)
[docs] def ncp_newton_FBLSA(problem: "NCP", z: "double *", F: "double *", options: "SolverOptions") -> "int *": r""" NCP Solver using the FB merit function and a Newton-based method with line-search :type problem: :py:class:`NonlinearComplementarityProblem` :param problem: the formalization of the NCP problem :type z: float, in/out :param z: on input, initial guess; on output the solution :type F: float :param F: the value of the function at the solution :type info: int :param info: 0 if everything worked :type options: :py:class:`SolverOptions` :param options: struct used to specify the solver parameters """ return _sicpynumerics.ncp_newton_FBLSA(problem, z, F, options)
[docs] def ncp_newton_minFBLSA(problem: "NCP", z: "double *", F: "double *", options: "SolverOptions") -> "int *": r""" NCP Solver using the min merit function (+ the FB as backup) and a Newton-based method with line-search :type problem: :py:class:`NonlinearComplementarityProblem` :param problem: the formalization of the NCP problem :type z: float, in/out :param z: on input, initial guess; on output the solution :type F: float :param F: the value of the function at the solution :type info: int :param info: 0 if everything worked :type options: :py:class:`SolverOptions` :param options: struct used to specify the solver parameters """ return _sicpynumerics.ncp_newton_minFBLSA(problem, z, F, options)
[docs] def ncp_pathsearch(problem: "NCP", z: "double *", F: "double *", options: "SolverOptions") -> "int *": r""" NCP Solver using a path search algorithm, following the work of D. Ralph. M. Ferris, and many other collaborators of the latter. :type problem: :py:class:`NonlinearComplementarityProblem` :param problem: the formalization of the NCP problem :type z: float, in/out :param z: on input, initial guess; on output the solution :type F: float :param F: the value of the function at the solution :type info: int :param info: 0 if everything worked :type options: :py:class:`SolverOptions` :param options: struct used to specify the solver parameters """ return _sicpynumerics.ncp_pathsearch(problem, z, F, options)
[docs] def ncp_path(problem: "NCP", z: "double *", F: "double *", options: "SolverOptions") -> "int *": r""" NCP Solver using the PATH solver :type problem: :py:class:`NonlinearComplementarityProblem` :param problem: the formalization of the NCP problem :type z: float, in/out :param z: on input, initial guess; on output the solution :type F: float :param F: the value of the function at the solution :type info: int :param info: 0 if everything worked :type options: :py:class:`SolverOptions` :param options: struct used to specify the solver parameters """ return _sicpynumerics.ncp_path(problem, z, F, options)
class VI(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr size = property(_sicpynumerics.VI_size_get, _sicpynumerics.VI_size_set, doc=r""" size of the VI :math:`n`""") env = property(_sicpynumerics.VI_env_get, _sicpynumerics.VI_env_set, doc=r""" pointer onto env object (which is self is the simplest case)""") F = property(_sicpynumerics.VI_F_get, _sicpynumerics.VI_F_set, doc=r""" Function of the VI""") compute_nabla_F = property(_sicpynumerics.VI_compute_nabla_F_get, _sicpynumerics.VI_compute_nabla_F_set, doc=r""" Function to compute the jacobian of F""") ProjectionOnX = property(_sicpynumerics.VI_ProjectionOnX_get, _sicpynumerics.VI_ProjectionOnX_set, doc=r""" Projection on X of the VI""") normVI = property(_sicpynumerics.VI_normVI_get, _sicpynumerics.VI_normVI_set, doc=r""" Norm of the VI problem to compute relative solution""") istheNormVIset = property(_sicpynumerics.VI_istheNormVIset_get, _sicpynumerics.VI_istheNormVIset_set, doc=r""" Boolean to know if the norm is set If not (istheNormVIset=0) it will be computed in the first call of variationalInequality_computeError By default, set istheNormVIset =0 """) set = property(_sicpynumerics.VI_set_get, _sicpynumerics.VI_set_set, doc=r""" opaque struct that represent the set K (possibly empty)""") nabla_F = property(_sicpynumerics.VI_nabla_F_get, _sicpynumerics.VI_nabla_F_set, doc=r""" storage for :math:`\nabla_x F`""") @staticmethod def call_compute_F(problem: "void *", n: "int", z: "double *", F: "double *") -> "void": return _sicpynumerics.VI_call_compute_F(problem, n, z, F) @staticmethod def call_compute_nabla_F(problem: "void *", n: "int", z: "double *", nabla_F: "NumericsMatrix") -> "void": return _sicpynumerics.VI_call_compute_nabla_F(problem, n, z, nabla_F) def __init__(self, *args): _sicpynumerics.VI_swiginit(self, _sicpynumerics.new_VI(*args)) def set_compute_nabla_F(self, compute_nabla_F: "PyObject *") -> "void": return _sicpynumerics.VI_set_compute_nabla_F(self, compute_nabla_F) def set_box_constraints(self, box_lower_bound: "PyObject *", box_upper_bound: "PyObject *") -> "void": return _sicpynumerics.VI_set_box_constraints(self, box_lower_bound, box_upper_bound) def set_compute_F_and_nabla_F_as_C_functions(self, lib_name: "PyObject *", compute_F_name: "PyObject *", compute_nabla_F_name: "PyObject *") -> "void": return _sicpynumerics.VI_set_compute_F_and_nabla_F_as_C_functions(self, lib_name, compute_F_name, compute_nabla_F_name) def get_env_as_long(self) -> "PyObject *": return _sicpynumerics.VI_get_env_as_long(self) __swig_destroy__ = _sicpynumerics.delete_VI # Register VI in _sicpynumerics: _sicpynumerics.VI_swigregister(VI) def VI_call_compute_F(problem: "void *", n: "int", z: "double *", F: "double *") -> "void": return _sicpynumerics.VI_call_compute_F(problem, n, z, F) def VI_call_compute_nabla_F(problem: "void *", n: "int", z: "double *", nabla_F: "NumericsMatrix") -> "void": return _sicpynumerics.VI_call_compute_nabla_F(problem, n, z, nabla_F)
[docs] def variationalInequality_display(vi: "VI") -> "void": r""" display a VariationalInequalityProblem :type vi: :py:class:`VariationalInequality` :param vi: the problem to display """ return _sicpynumerics.variationalInequality_display(vi)
[docs] def variationalInequality_printInFile(vi: "VI", file: "FILE *") -> "int": r""" print a VariationalInequalityProblem in a file (numerics .dat format) :type vi: :py:class:`VariationalInequality` :param vi: the problem to print out :type file: FILE :param file: the dest file :rtype: int :return: ok if successfull """ return _sicpynumerics.variationalInequality_printInFile(vi, file)
[docs] def variationalInequality_newFromFile(vi: "VI", file: "FILE *") -> "int": r""" read a VariationalInequalityProblem in a file (numerics .dat format) :type vi: :py:class:`VariationalInequality` :param vi: the problem to read :type file: FILE :param file: the target file :rtype: int :return: ok if successfull """ return _sicpynumerics.variationalInequality_newFromFile(vi, file)
[docs] def freeVariationalInequalityProblem(vi: "VI") -> "void": r""" free a VariationalInequalityProblem :type vi: :py:class:`VariationalInequality` :param vi: the problem to free """ return _sicpynumerics.freeVariationalInequalityProblem(vi)
[docs] def variationalInequality_clear(vi: "VI") -> "void": r""" Clear VariationalInequality structure: set all pointeurs to NULL, double and int to 0 :type vi: :py:class:`VariationalInequality` :param vi: the problem to clear """ return _sicpynumerics.variationalInequality_clear(vi)
[docs] def variationalInequality_new(size: "int") -> "VariationalInequality *": r""" new VariationalInequality problem :type size: int :param size: size of the ambient space for the VI :rtype: :py:class:`VariationalInequality` :return: a initialized VariationalInequality struct """ return _sicpynumerics.variationalInequality_new(size)
[docs] def newVI() -> "VariationalInequality *": r""" new VariationalInequality problem :rtype: :py:class:`VariationalInequality` :return: an empty VI """ return _sicpynumerics.newVI()
[docs] def VI_get_env(vi: "void *") -> "void *": r""" get the environment from the struct :type vi: void :param vi: a VariationalInequality problem :rtype: void :return: the environment from the struct """ return _sicpynumerics.VI_get_env(vi)
[docs] def variationalInequality_ExtraGradient(problem: "VI", x: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" Extra Gradient solver forvariational inequality problem based on the De Saxce Formulation :type problem: :py:class:`VariationalInequality` :param problem: the variational inequality problem to solve :type x: float :param x: global vector (n), in-out parameter :type w: float :param w: global vector (n), in-out parameters :type info: int :param info: return 0 if the solution is found :type options: :py:class:`SolverOptions` :param options: the solver options iparam[SICONOS_IPARAM_MAX_ITER] : Maximum iteration number iparam[SICONOS_VI_IPARAM_LINESEARCH_METHOD] : Choice of the line search SICONOS_VI_LS_ARMIJO : Armijo rule with Khotbotov ratio (default) SICONOS_VI_LS_SOLODOV : Armijo rule with Solodov.Tseng ratio iparam[SICONOS_IPARAM_PREALLOC] : bool activate the update in the loop (0:false default choice) iparam[SICONOS_VI_IPARAM_DECREASE_RHO] : use rho_k * tau * min(1.0,a2/(rho_k*a1)) to decrease rho; commented in the code dparam[SICONOS_VI_DPARAM_RHO] : rho parameter. If rho >0, then self-adaptive (Armijo like) procedure. If rho <0, then constant rho parameter (rho <-- -rho) Adaptive step-size parameters: Adaptive step-size parameters: dparam[SICONOS_VI_DPARAM_LS_TAU] = 2/3.0; tau dparam[SICONOS_VI_DPARAM_LS_TAUINV] = 3.0/2.0; tauinv dparam[SICONOS_VI_DPARAM_LS_L] = 0.9; L dparam[SICONOS_VI_DPARAM_LS_MIN] = 0.3; Lmin """ return _sicpynumerics.variationalInequality_ExtraGradient(problem, x, w, options)
[docs] def variationalInequality_FixedPointProjection(problem: "VI", x: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" Fixed Point Projection solver for variational inequality problem based on the De Saxce Formulation :type problem: :py:class:`VariationalInequality` :param problem: the variational inequality problem to solve :type x: float :param x: global vector (n), in-out parameter :type w: float :param w: global vector (n), in-out parameters :type info: int :param info: return 0 if the solution is found :type options: :py:class:`SolverOptions` :param options: the solver options : iparam[SICONOS_IPARAM_MAX_ITER] : Maximum iteration number iparam[SICONOS_VI_IPARAM_LINESEARCH_METHOD] : Choice of the line search SICONOS_VI_LS_ARMIJO : Armijo rule with Khotbotov ratio (default) SICONOS_VI_LS_SOLODOV : Armijo rule with Solodov.Tseng ratio SICONOS_VI_LS_HANSUN : Armijo rule with Han.Sun ratio iparam[SICONOS_IPARAM_PREALLOC] : bool activate the update in the loop (0:false default choice) iparam[SICONOS_VI_IPARAM_DECREASE_RHO] : use rho_k * tau * min(1.0,a2/(rho_k*a1)) to decrease rho; commented in the code dparam[SICONOS_VI_DPARAM_RHO] : rho parameter. - If rho >0, then self-adaptive (Armijo like) procedure. - If rho <0, then constant rho parameter (rho <-- -rho) Adaptive step-size parameters: dparam[SICONOS_VI_DPARAM_LS_TAU] = 2/3.0; tau dparam[SICONOS_VI_DPARAM_LS_TAUINV] = 3.0/2.0; tauinv dparam[SICONOS_VI_DPARAM_LS_L] = 0.9; L dparam[SICONOS_VI_DPARAM_LS_MIN] = 0.3; Lmin """ return _sicpynumerics.variationalInequality_FixedPointProjection(problem, x, w, options)
[docs] def variationalInequality_HyperplaneProjection(problem: "VI", x: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" Hyperplane Projection solver for variational inequality problem based on the De Saxce Formulation :type problem: :py:class:`VariationalInequality` :param problem: the variational inequality problem to solve :type x: float :param x: global vector (n), in-out parameter :type w: float :param w: global vector (n), in-out parameters :type info: int :param info: return 0 if the solution is found :type options: :py:class:`SolverOptions` :param options: the solver options """ return _sicpynumerics.variationalInequality_HyperplaneProjection(problem, x, w, options)
[docs] def variationalInequality_box_newton_QiLSA(problem: "VI", x: "double *", F: "double *", options: "SolverOptions") -> "int *": r""" VI Solver based on a merit function minimization with a line-search type algorithm :type problem: :py:class:`VariationalInequality` :param problem: the variational inequality problem to solve :type x: float, in/out :param x: as input, the initial guess; as output the solution if the algorithm is successful :type F: float, in/out :param F: value of the function :type info: int :param info: 0 if a solution is found :type options: :py:class:`SolverOptions` :param options: the solver options """ return _sicpynumerics.variationalInequality_box_newton_QiLSA(problem, x, F, options)
[docs] def vi_box_AVI_LSA(problem: "VI", x: "double *", F: "double *", options: "SolverOptions") -> "int *": r""" VI Solver based on the Newton-Josephy method globalized with a line-search type algorithm using the Qi merit function. :type problem: :py:class:`VariationalInequality` :param problem: the variational inequality problem to solve :type x: float, in/out :param x: as input, the initial guess; as output the solution if the algorithm is successful :type F: float, in/out :param F: value of the function :type info: int :param info: 0 if a solution is found :type options: :py:class:`SolverOptions` :param options: the solver options """ return _sicpynumerics.vi_box_AVI_LSA(problem, x, F, options)
[docs] def vi_get_set(problem: "void *") -> "void *": r""" Get the set from the VariationalInequality :type problem: void :param problem: the VI """ return _sicpynumerics.vi_get_set(problem)
[docs] def vi_box_path(problem: "VI", z: "double *", F: "double *", options: "SolverOptions") -> "int *": r""" Solver for box constrainted VI using PATH. :type problem: :py:class:`VariationalInequality` :param problem: the variational inequality problem to solve :type z: float, in/out :param z: as input, the initial guess; as output the solution if the algorithm is successful :type F: float, in/out :param F: value of the function :type info: int :param info: 0 if a solution is found :type options: :py:class:`SolverOptions` :param options: the solver options """ return _sicpynumerics.vi_box_path(problem, z, F, options)
[docs] def checkTrivialCase_vi(problem: "VI", x: "double *", fx: "double *", options: "SolverOptions") -> "int": r""" Check for trivial solution in the variational inequality problem :type problem: :py:class:`VariationalInequality` :param problem: VariationalInequality* the problem :type x: float :param x: global vector (n), in-out parameter :type fx: float :param fx: global vector (n), in-out parameters :type options: :py:class:`SolverOptions` :param options: the pointer to the array of options to set :rtype: int :return: info =0 if a trivial solution has been found, else = -1 """ return _sicpynumerics.checkTrivialCase_vi(problem, x, fx, options)
def variationalInequality_ExtraGradient_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.variationalInequality_ExtraGradient_set_default(options) def variationalInequality_HyperplaneProjection_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.variationalInequality_HyperplaneProjection_set_default(options) def variationalInequality_FixedPointProjection_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.variationalInequality_FixedPointProjection_set_default(options) def variationalInequality_BOX_QI_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.variationalInequality_BOX_QI_set_default(options) def variationalInequality_BOX_AVI_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.variationalInequality_BOX_AVI_set_default(options) class ConvexQP(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr size = property(_sicpynumerics.ConvexQP_size_get, _sicpynumerics.ConvexQP_size_set, doc=r""" size :math:`n`""") m = property(_sicpynumerics.ConvexQP_m_get, _sicpynumerics.ConvexQP_m_set, doc=r""" m :math:`m`""") env = property(_sicpynumerics.ConvexQP_env_get, _sicpynumerics.ConvexQP_env_set, doc=r""" pointer onto env object (which is self is the simplest case)""") M = property(_sicpynumerics.ConvexQP_M_get, _sicpynumerics.ConvexQP_M_set, doc=r""" a n x n matrix M that defines the quadratic term in the cost function. *""") q = property(_sicpynumerics.ConvexQP_q_get, _sicpynumerics.ConvexQP_q_set, doc=r""" a vector q of size n that defines the linear term in the cost function. *""") A = property(_sicpynumerics.ConvexQP_A_get, _sicpynumerics.ConvexQP_A_set, doc=r""" a m x n matrix A that defines the constraints. If it is NULL, we assume that A is the identity matrix *""") b = property(_sicpynumerics.ConvexQP_b_get, _sicpynumerics.ConvexQP_b_set, doc=r""" a vector b of size m that defines the constant term in the constraints. *""") ProjectionOnC = property(_sicpynumerics.ConvexQP_ProjectionOnC_get, _sicpynumerics.ConvexQP_ProjectionOnC_set, doc=r""" Projection on C""") normConvexQP = property(_sicpynumerics.ConvexQP_normConvexQP_get, _sicpynumerics.ConvexQP_normConvexQP_set, doc=r""" Norm of the problem to compute relative solution""") istheNormConvexQPset = property(_sicpynumerics.ConvexQP_istheNormConvexQPset_get, _sicpynumerics.ConvexQP_istheNormConvexQPset_set, doc=r""" Boolean to know if the norm is set If not (istheNormConvexQPset=0) it will be computed in the first call of convexQP_compute_error By default, set istheNormConvexQPset =0 """) set = property(_sicpynumerics.ConvexQP_set_get, _sicpynumerics.ConvexQP_set_set, doc=r""" opaque struct that represent the set C (possibly empty)""") def __init__(self): _sicpynumerics.ConvexQP_swiginit(self, _sicpynumerics.new_ConvexQP()) __swig_destroy__ = _sicpynumerics.delete_ConvexQP # Register ConvexQP in _sicpynumerics: _sicpynumerics.ConvexQP_swigregister(ConvexQP)
[docs] def convexQP_display(cqp: "ConvexQP") -> "void": r""" display a ConvexQPProblem :type cqp: :py:class:`ConvexQP` :param cqp: the problem to display """ return _sicpynumerics.convexQP_display(cqp)
[docs] def convexQP_printInFile(cqp: "ConvexQP", file: "FILE *") -> "int": r""" print a ConvexQPProblem in a file (numerics .dat format) :type cqp: :py:class:`ConvexQP` :param cqp: the problem to print out :type file: FILE :param file: the dest file :rtype: int :return: ok if successfull """ return _sicpynumerics.convexQP_printInFile(cqp, file)
[docs] def convexQP_newFromFile(cqp: "ConvexQP", file: "FILE *") -> "int": r""" read a ConvexQPProblem in a file (numerics .dat format) :type cqp: :py:class:`ConvexQP` :param cqp: the problem to read :type file: FILE :param file: the target file :rtype: int :return: ok if successfull """ return _sicpynumerics.convexQP_newFromFile(cqp, file)
[docs] def convexQP_free(cqp: "ConvexQP") -> "void": r""" free a ConvexQPProblem :type cqp: :py:class:`ConvexQP` :param cqp: the problem to free """ return _sicpynumerics.convexQP_free(cqp)
[docs] def convexQP_clear(cqp: "ConvexQP") -> "void": r""" Clear ConvexQP structure: set all pointeurs to NULL, double and int to 0. :type cqp: :py:class:`ConvexQP` :param cqp: the problem to clear """ return _sicpynumerics.convexQP_clear(cqp)
[docs] def convexQP_new(size: "int") -> "ConvexQP *": r""" new ConvexQP problem :type size: int :param size: size of the ambient space for the CQP :rtype: :py:class:`ConvexQP` :return: a initialized ConvexQP struct """ return _sicpynumerics.convexQP_new(size)
[docs] def convexQP_get_env(cqp: "void *") -> "void *": r""" get the environment from the struct :type cqp: void :param cqp: a ConvexQP problem :rtype: void :return: the environment from the struct """ return _sicpynumerics.convexQP_get_env(cqp)
[docs] def convexQP_ProjectedGradient(problem: "ConvexQP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": r""" Projected Gradient solver for Convex QP problem :type problem: :py:class:`ConvexQP` :param problem: the variational inequality problem to solve :type z: float :param z: global vector (n), in-out parameter :type w: float :param w: global vector (n), in-out parameters :type info: int :param info: return 0 if the solution is found :type options: :py:class:`SolverOptions` :param options: the solver options : iparam[0] : Maximum iteration number dparam[3] : rho parameter. If rho >0, then self-adaptive (Armijo like) procedure. If rho <0, then constant rho parameter (rho <-- -rho) Adaptive step-size parameters: Adaptive step-size parameters: dparam[4] = 2/3.0; tau dparam[5] = 3.0/2.0; tauinv dparam[6] = 0.9; L dparam[7] = 0.3; Lmin """ return _sicpynumerics.convexQP_ProjectedGradient(problem, z, w, options)
def convexQP_VI_solver(problem: "ConvexQP", z: "double *", w: "double *", options: "SolverOptions") -> "int *": return _sicpynumerics.convexQP_VI_solver(problem, z, w, options) def convexQP_ADMM(problem: "ConvexQP", z: "double *", w: "double *", xi: "double *", u: "double *", options: "SolverOptions") -> "int *": return _sicpynumerics.convexQP_ADMM(problem, z, w, xi, u, options) def convexQP_ADMM_init(problem: "ConvexQP", options: "SolverOptions") -> "void": return _sicpynumerics.convexQP_ADMM_init(problem, options) def convexQP_ADMM_free(problem: "ConvexQP", options: "SolverOptions") -> "void": return _sicpynumerics.convexQP_ADMM_free(problem, options) def convexQP_ProjectedGradient_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.convexQP_ProjectedGradient_set_default(options) def convexQP_ADMM_set_default(options: "SolverOptions") -> "void": return _sicpynumerics.convexQP_ADMM_set_default(options) SICONOS_CONVEXQP_PG = _sicpynumerics.SICONOS_CONVEXQP_PG r""" convex QP, projected gradient""" SICONOS_CONVEXQP_VI_FPP = _sicpynumerics.SICONOS_CONVEXQP_VI_FPP r""" convex QP, VI solver, fixed point projection""" SICONOS_CONVEXQP_VI_EG = _sicpynumerics.SICONOS_CONVEXQP_VI_EG r""" convex QP, VI solver, extra-gradient""" SICONOS_CONVEXQP_ADMM = _sicpynumerics.SICONOS_CONVEXQP_ADMM r""" convex QP, alternating direction method of multipliers (ADMM)""" SICONOS_CONVEXQP_PGOC_LINESEARCH_MAX_ITER = _sicpynumerics.SICONOS_CONVEXQP_PGOC_LINESEARCH_MAX_ITER r""" index in iparam to store the maximum number of iterations""" SICONOS_CONVEXQP_PGOC_RHO = _sicpynumerics.SICONOS_CONVEXQP_PGOC_RHO r""" index in dparam to store the rho value for projection formulation""" SICONOS_CONVEXQP_PGOC_RHOMIN = _sicpynumerics.SICONOS_CONVEXQP_PGOC_RHOMIN r""" index in dparam to store the minrho value for projection formulation""" SICONOS_CONVEXQP_PGOC_LINESEARCH_MU = _sicpynumerics.SICONOS_CONVEXQP_PGOC_LINESEARCH_MU r""" index in dparam to store the mu value for line search algo""" SICONOS_CONVEXQP_PGOC_LINESEARCH_TAU = _sicpynumerics.SICONOS_CONVEXQP_PGOC_LINESEARCH_TAU r""" index in dparam to store the tau value for line search algo""" SICONOS_CONVEXQP_ADMM_IPARAM_RHO_STRATEGY = _sicpynumerics.SICONOS_CONVEXQP_ADMM_IPARAM_RHO_STRATEGY r""" index in iparam to store the strategy for computing rho""" SICONOS_CONVEXQP_ADMM_IPARAM_ACCELERATION = _sicpynumerics.SICONOS_CONVEXQP_ADMM_IPARAM_ACCELERATION r""" index in iparam to store the acceleration paramter""" SICONOS_CONVEXQP_ADMM_RHO = _sicpynumerics.SICONOS_CONVEXQP_ADMM_RHO r""" index in dparam to store the rho value for projection formulation""" SICONOS_CONVEXQP_ADMM_RESTART_ETA = _sicpynumerics.SICONOS_CONVEXQP_ADMM_RESTART_ETA r""" index in dparam to store the rho value for projection formulation""" SICONOS_CONVEXQP_ADMM_BALANCING_RESIDUAL_TAU = _sicpynumerics.SICONOS_CONVEXQP_ADMM_BALANCING_RESIDUAL_TAU r""" index in dparam to store the tau value for the balancing residual technique""" SICONOS_CONVEXQP_ADMM_BALANCING_RESIDUAL_PHI = _sicpynumerics.SICONOS_CONVEXQP_ADMM_BALANCING_RESIDUAL_PHI r""" index in dparam to store the phi value for the balancing residual technique""" SICONOS_CONVEXQP_ADMM_NO_ACCELERATION = _sicpynumerics.SICONOS_CONVEXQP_ADMM_NO_ACCELERATION SICONOS_CONVEXQP_ADMM_ACCELERATION = _sicpynumerics.SICONOS_CONVEXQP_ADMM_ACCELERATION SICONOS_CONVEXQP_ADMM_ACCELERATION_AND_RESTART = _sicpynumerics.SICONOS_CONVEXQP_ADMM_ACCELERATION_AND_RESTART SICONOS_CONVEXQP_RHO_STRATEGY_CONSTANT = _sicpynumerics.SICONOS_CONVEXQP_RHO_STRATEGY_CONSTANT r""" A constant value given in dparam[CONVEXQP_RHO_RHO] is used""" SICONOS_CONVEXQP_ADMM_RHO_STRATEGY_NORM_INF = _sicpynumerics