# 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.kernel as sk
>>> help(sk.LagrangianDS)
"""
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 _pykernel
else:
import _pykernel
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__)
import weakref
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__ = _pykernel.delete_SwigPyIterator
def value(self) -> "PyObject *":
return _pykernel.SwigPyIterator_value(self)
def incr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
return _pykernel.SwigPyIterator_incr(self, n)
def decr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
return _pykernel.SwigPyIterator_decr(self, n)
def distance(self, x: "SwigPyIterator") -> "ptrdiff_t":
return _pykernel.SwigPyIterator_distance(self, x)
def equal(self, x: "SwigPyIterator") -> "bool":
return _pykernel.SwigPyIterator_equal(self, x)
def copy(self) -> "swig::SwigPyIterator *":
return _pykernel.SwigPyIterator_copy(self)
def next(self) -> "PyObject *":
return _pykernel.SwigPyIterator_next(self)
def __next__(self) -> "PyObject *":
return _pykernel.SwigPyIterator___next__(self)
def previous(self) -> "PyObject *":
return _pykernel.SwigPyIterator_previous(self)
def advance(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
return _pykernel.SwigPyIterator_advance(self, n)
def __eq__(self, x: "SwigPyIterator") -> "bool":
return _pykernel.SwigPyIterator___eq__(self, x)
def __ne__(self, x: "SwigPyIterator") -> "bool":
return _pykernel.SwigPyIterator___ne__(self, x)
def __iadd__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
return _pykernel.SwigPyIterator___iadd__(self, n)
def __isub__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
return _pykernel.SwigPyIterator___isub__(self, n)
def __add__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
return _pykernel.SwigPyIterator___add__(self, n)
def __sub__(self, *args) -> "ptrdiff_t":
return _pykernel.SwigPyIterator___sub__(self, *args)
def __iter__(self):
return self
# Register SwigPyIterator in _pykernel:
_pykernel.SwigPyIterator_swigregister(SwigPyIterator)
SHARED_PTR_DISOWN = _pykernel.SHARED_PTR_DISOWN
class VectorOfVectors(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self) -> "swig::SwigPyIterator *":
return _pykernel.VectorOfVectors_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self) -> "bool":
return _pykernel.VectorOfVectors___nonzero__(self)
def __bool__(self) -> "bool":
return _pykernel.VectorOfVectors___bool__(self)
def __len__(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type":
return _pykernel.VectorOfVectors___len__(self)
def __getslice__(self, i: "std::vector< std::shared_ptr< SiconosVector > >::difference_type", j: "std::vector< std::shared_ptr< SiconosVector > >::difference_type") -> "std::vector< std::shared_ptr< SiconosVector >,std::allocator< std::shared_ptr< SiconosVector > > > *":
return _pykernel.VectorOfVectors___getslice__(self, i, j)
def __setslice__(self, *args) -> "void":
return _pykernel.VectorOfVectors___setslice__(self, *args)
def __delslice__(self, i: "std::vector< std::shared_ptr< SiconosVector > >::difference_type", j: "std::vector< std::shared_ptr< SiconosVector > >::difference_type") -> "void":
return _pykernel.VectorOfVectors___delslice__(self, i, j)
def __delitem__(self, *args) -> "void":
return _pykernel.VectorOfVectors___delitem__(self, *args)
def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &":
return _pykernel.VectorOfVectors___getitem__(self, *args)
def __setitem__(self, *args) -> "void":
return _pykernel.VectorOfVectors___setitem__(self, *args)
def pop(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type":
return _pykernel.VectorOfVectors_pop(self)
def append(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void":
return _pykernel.VectorOfVectors_append(self, x)
def empty(self) -> "bool":
return _pykernel.VectorOfVectors_empty(self)
def size(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type":
return _pykernel.VectorOfVectors_size(self)
def begin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator":
return _pykernel.VectorOfVectors_begin(self)
def end(self) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator":
return _pykernel.VectorOfVectors_end(self)
def rbegin(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator":
return _pykernel.VectorOfVectors_rbegin(self)
def rend(self) -> "std::vector< std::shared_ptr< SiconosVector > >::reverse_iterator":
return _pykernel.VectorOfVectors_rend(self)
def clear(self) -> "void":
return _pykernel.VectorOfVectors_clear(self)
def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosVector > >::allocator_type":
return _pykernel.VectorOfVectors_get_allocator(self)
def pop_back(self) -> "void":
return _pykernel.VectorOfVectors_pop_back(self)
def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosVector > >::iterator":
return _pykernel.VectorOfVectors_erase(self, *args)
def __init__(self, *args):
_pykernel.VectorOfVectors_swiginit(self, _pykernel.new_VectorOfVectors(*args))
def push_back(self, x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void":
return _pykernel.VectorOfVectors_push_back(self, x)
def front(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &":
return _pykernel.VectorOfVectors_front(self)
def back(self) -> "std::vector< std::shared_ptr< SiconosVector > >::value_type const &":
return _pykernel.VectorOfVectors_back(self)
def assign(self, n: "std::vector< std::shared_ptr< SiconosVector > >::size_type", x: "std::vector< std::shared_ptr< SiconosVector > >::value_type const &") -> "void":
return _pykernel.VectorOfVectors_assign(self, n, x)
def resize(self, *args) -> "void":
return _pykernel.VectorOfVectors_resize(self, *args)
def insert(self, *args) -> "void":
return _pykernel.VectorOfVectors_insert(self, *args)
def reserve(self, n: "std::vector< std::shared_ptr< SiconosVector > >::size_type") -> "void":
return _pykernel.VectorOfVectors_reserve(self, n)
def capacity(self) -> "std::vector< std::shared_ptr< SiconosVector > >::size_type":
return _pykernel.VectorOfVectors_capacity(self)
__swig_destroy__ = _pykernel.delete_VectorOfVectors
# Register VectorOfVectors in _pykernel:
_pykernel.VectorOfVectors_swigregister(VectorOfVectors)
class VectorOfBlockVectors(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self) -> "swig::SwigPyIterator *":
return _pykernel.VectorOfBlockVectors_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self) -> "bool":
return _pykernel.VectorOfBlockVectors___nonzero__(self)
def __bool__(self) -> "bool":
return _pykernel.VectorOfBlockVectors___bool__(self)
def __len__(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type":
return _pykernel.VectorOfBlockVectors___len__(self)
def __getslice__(self, i: "std::vector< std::shared_ptr< BlockVector > >::difference_type", j: "std::vector< std::shared_ptr< BlockVector > >::difference_type") -> "std::vector< std::shared_ptr< BlockVector >,std::allocator< std::shared_ptr< BlockVector > > > *":
return _pykernel.VectorOfBlockVectors___getslice__(self, i, j)
def __setslice__(self, *args) -> "void":
return _pykernel.VectorOfBlockVectors___setslice__(self, *args)
def __delslice__(self, i: "std::vector< std::shared_ptr< BlockVector > >::difference_type", j: "std::vector< std::shared_ptr< BlockVector > >::difference_type") -> "void":
return _pykernel.VectorOfBlockVectors___delslice__(self, i, j)
def __delitem__(self, *args) -> "void":
return _pykernel.VectorOfBlockVectors___delitem__(self, *args)
def __getitem__(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &":
return _pykernel.VectorOfBlockVectors___getitem__(self, *args)
def __setitem__(self, *args) -> "void":
return _pykernel.VectorOfBlockVectors___setitem__(self, *args)
def pop(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type":
return _pykernel.VectorOfBlockVectors_pop(self)
def append(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void":
return _pykernel.VectorOfBlockVectors_append(self, x)
def empty(self) -> "bool":
return _pykernel.VectorOfBlockVectors_empty(self)
def size(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type":
return _pykernel.VectorOfBlockVectors_size(self)
def begin(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator":
return _pykernel.VectorOfBlockVectors_begin(self)
def end(self) -> "std::vector< std::shared_ptr< BlockVector > >::iterator":
return _pykernel.VectorOfBlockVectors_end(self)
def rbegin(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator":
return _pykernel.VectorOfBlockVectors_rbegin(self)
def rend(self) -> "std::vector< std::shared_ptr< BlockVector > >::reverse_iterator":
return _pykernel.VectorOfBlockVectors_rend(self)
def clear(self) -> "void":
return _pykernel.VectorOfBlockVectors_clear(self)
def get_allocator(self) -> "std::vector< std::shared_ptr< BlockVector > >::allocator_type":
return _pykernel.VectorOfBlockVectors_get_allocator(self)
def pop_back(self) -> "void":
return _pykernel.VectorOfBlockVectors_pop_back(self)
def erase(self, *args) -> "std::vector< std::shared_ptr< BlockVector > >::iterator":
return _pykernel.VectorOfBlockVectors_erase(self, *args)
def __init__(self, *args):
_pykernel.VectorOfBlockVectors_swiginit(self, _pykernel.new_VectorOfBlockVectors(*args))
def push_back(self, x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void":
return _pykernel.VectorOfBlockVectors_push_back(self, x)
def front(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &":
return _pykernel.VectorOfBlockVectors_front(self)
def back(self) -> "std::vector< std::shared_ptr< BlockVector > >::value_type const &":
return _pykernel.VectorOfBlockVectors_back(self)
def assign(self, n: "std::vector< std::shared_ptr< BlockVector > >::size_type", x: "std::vector< std::shared_ptr< BlockVector > >::value_type const &") -> "void":
return _pykernel.VectorOfBlockVectors_assign(self, n, x)
def resize(self, *args) -> "void":
return _pykernel.VectorOfBlockVectors_resize(self, *args)
def insert(self, *args) -> "void":
return _pykernel.VectorOfBlockVectors_insert(self, *args)
def reserve(self, n: "std::vector< std::shared_ptr< BlockVector > >::size_type") -> "void":
return _pykernel.VectorOfBlockVectors_reserve(self, n)
def capacity(self) -> "std::vector< std::shared_ptr< BlockVector > >::size_type":
return _pykernel.VectorOfBlockVectors_capacity(self)
__swig_destroy__ = _pykernel.delete_VectorOfBlockVectors
# Register VectorOfBlockVectors in _pykernel:
_pykernel.VectorOfBlockVectors_swigregister(VectorOfBlockVectors)
class VectorOfMatrices(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self) -> "swig::SwigPyIterator *":
return _pykernel.VectorOfMatrices_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self) -> "bool":
return _pykernel.VectorOfMatrices___nonzero__(self)
def __bool__(self) -> "bool":
return _pykernel.VectorOfMatrices___bool__(self)
def __len__(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type":
return _pykernel.VectorOfMatrices___len__(self)
def __getslice__(self, i: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type") -> "std::vector< std::shared_ptr< SiconosMatrix >,std::allocator< std::shared_ptr< SiconosMatrix > > > *":
return _pykernel.VectorOfMatrices___getslice__(self, i, j)
def __setslice__(self, *args) -> "void":
return _pykernel.VectorOfMatrices___setslice__(self, *args)
def __delslice__(self, i: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SiconosMatrix > >::difference_type") -> "void":
return _pykernel.VectorOfMatrices___delslice__(self, i, j)
def __delitem__(self, *args) -> "void":
return _pykernel.VectorOfMatrices___delitem__(self, *args)
def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &":
return _pykernel.VectorOfMatrices___getitem__(self, *args)
def __setitem__(self, *args) -> "void":
return _pykernel.VectorOfMatrices___setitem__(self, *args)
def pop(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type":
return _pykernel.VectorOfMatrices_pop(self)
def append(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void":
return _pykernel.VectorOfMatrices_append(self, x)
def empty(self) -> "bool":
return _pykernel.VectorOfMatrices_empty(self)
def size(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type":
return _pykernel.VectorOfMatrices_size(self)
def begin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator":
return _pykernel.VectorOfMatrices_begin(self)
def end(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator":
return _pykernel.VectorOfMatrices_end(self)
def rbegin(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator":
return _pykernel.VectorOfMatrices_rbegin(self)
def rend(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::reverse_iterator":
return _pykernel.VectorOfMatrices_rend(self)
def clear(self) -> "void":
return _pykernel.VectorOfMatrices_clear(self)
def get_allocator(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::allocator_type":
return _pykernel.VectorOfMatrices_get_allocator(self)
def pop_back(self) -> "void":
return _pykernel.VectorOfMatrices_pop_back(self)
def erase(self, *args) -> "std::vector< std::shared_ptr< SiconosMatrix > >::iterator":
return _pykernel.VectorOfMatrices_erase(self, *args)
def __init__(self, *args):
_pykernel.VectorOfMatrices_swiginit(self, _pykernel.new_VectorOfMatrices(*args))
def push_back(self, x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void":
return _pykernel.VectorOfMatrices_push_back(self, x)
def front(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &":
return _pykernel.VectorOfMatrices_front(self)
def back(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &":
return _pykernel.VectorOfMatrices_back(self)
def assign(self, n: "std::vector< std::shared_ptr< SiconosMatrix > >::size_type", x: "std::vector< std::shared_ptr< SiconosMatrix > >::value_type const &") -> "void":
return _pykernel.VectorOfMatrices_assign(self, n, x)
def resize(self, *args) -> "void":
return _pykernel.VectorOfMatrices_resize(self, *args)
def insert(self, *args) -> "void":
return _pykernel.VectorOfMatrices_insert(self, *args)
def reserve(self, n: "std::vector< std::shared_ptr< SiconosMatrix > >::size_type") -> "void":
return _pykernel.VectorOfMatrices_reserve(self, n)
def capacity(self) -> "std::vector< std::shared_ptr< SiconosMatrix > >::size_type":
return _pykernel.VectorOfMatrices_capacity(self)
__swig_destroy__ = _pykernel.delete_VectorOfMatrices
# Register VectorOfMatrices in _pykernel:
_pykernel.VectorOfMatrices_swigregister(VectorOfMatrices)
class VectorOfSMatrices(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self) -> "swig::SwigPyIterator *":
return _pykernel.VectorOfSMatrices_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self) -> "bool":
return _pykernel.VectorOfSMatrices___nonzero__(self)
def __bool__(self) -> "bool":
return _pykernel.VectorOfSMatrices___bool__(self)
def __len__(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type":
return _pykernel.VectorOfSMatrices___len__(self)
def __getslice__(self, i: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type") -> "std::vector< std::shared_ptr< SimpleMatrix >,std::allocator< std::shared_ptr< SimpleMatrix > > > *":
return _pykernel.VectorOfSMatrices___getslice__(self, i, j)
def __setslice__(self, *args) -> "void":
return _pykernel.VectorOfSMatrices___setslice__(self, *args)
def __delslice__(self, i: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type", j: "std::vector< std::shared_ptr< SimpleMatrix > >::difference_type") -> "void":
return _pykernel.VectorOfSMatrices___delslice__(self, i, j)
def __delitem__(self, *args) -> "void":
return _pykernel.VectorOfSMatrices___delitem__(self, *args)
def __getitem__(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &":
return _pykernel.VectorOfSMatrices___getitem__(self, *args)
def __setitem__(self, *args) -> "void":
return _pykernel.VectorOfSMatrices___setitem__(self, *args)
def pop(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type":
return _pykernel.VectorOfSMatrices_pop(self)
def append(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void":
return _pykernel.VectorOfSMatrices_append(self, x)
def empty(self) -> "bool":
return _pykernel.VectorOfSMatrices_empty(self)
def size(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type":
return _pykernel.VectorOfSMatrices_size(self)
def begin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator":
return _pykernel.VectorOfSMatrices_begin(self)
def end(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator":
return _pykernel.VectorOfSMatrices_end(self)
def rbegin(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator":
return _pykernel.VectorOfSMatrices_rbegin(self)
def rend(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::reverse_iterator":
return _pykernel.VectorOfSMatrices_rend(self)
def clear(self) -> "void":
return _pykernel.VectorOfSMatrices_clear(self)
def get_allocator(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::allocator_type":
return _pykernel.VectorOfSMatrices_get_allocator(self)
def pop_back(self) -> "void":
return _pykernel.VectorOfSMatrices_pop_back(self)
def erase(self, *args) -> "std::vector< std::shared_ptr< SimpleMatrix > >::iterator":
return _pykernel.VectorOfSMatrices_erase(self, *args)
def __init__(self, *args):
_pykernel.VectorOfSMatrices_swiginit(self, _pykernel.new_VectorOfSMatrices(*args))
def push_back(self, x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void":
return _pykernel.VectorOfSMatrices_push_back(self, x)
def front(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &":
return _pykernel.VectorOfSMatrices_front(self)
def back(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &":
return _pykernel.VectorOfSMatrices_back(self)
def assign(self, n: "std::vector< std::shared_ptr< SimpleMatrix > >::size_type", x: "std::vector< std::shared_ptr< SimpleMatrix > >::value_type const &") -> "void":
return _pykernel.VectorOfSMatrices_assign(self, n, x)
def resize(self, *args) -> "void":
return _pykernel.VectorOfSMatrices_resize(self, *args)
def insert(self, *args) -> "void":
return _pykernel.VectorOfSMatrices_insert(self, *args)
def reserve(self, n: "std::vector< std::shared_ptr< SimpleMatrix > >::size_type") -> "void":
return _pykernel.VectorOfSMatrices_reserve(self, n)
def capacity(self) -> "std::vector< std::shared_ptr< SimpleMatrix > >::size_type":
return _pykernel.VectorOfSMatrices_capacity(self)
__swig_destroy__ = _pykernel.delete_VectorOfSMatrices
# Register VectorOfSMatrices in _pykernel:
_pykernel.VectorOfSMatrices_swigregister(VectorOfSMatrices)
class VectorOfMemories(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self) -> "swig::SwigPyIterator *":
return _pykernel.VectorOfMemories_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self) -> "bool":
return _pykernel.VectorOfMemories___nonzero__(self)
def __bool__(self) -> "bool":
return _pykernel.VectorOfMemories___bool__(self)
def __len__(self) -> "std::vector< SiconosMemory >::size_type":
return _pykernel.VectorOfMemories___len__(self)
def __getslice__(self, i: "std::vector< SiconosMemory >::difference_type", j: "std::vector< SiconosMemory >::difference_type") -> "std::vector< SiconosMemory,std::allocator< SiconosMemory > > *":
return _pykernel.VectorOfMemories___getslice__(self, i, j)
def __setslice__(self, *args) -> "void":
return _pykernel.VectorOfMemories___setslice__(self, *args)
def __delslice__(self, i: "std::vector< SiconosMemory >::difference_type", j: "std::vector< SiconosMemory >::difference_type") -> "void":
return _pykernel.VectorOfMemories___delslice__(self, i, j)
def __delitem__(self, *args) -> "void":
return _pykernel.VectorOfMemories___delitem__(self, *args)
def __getitem__(self, *args) -> "std::vector< SiconosMemory >::value_type const &":
return _pykernel.VectorOfMemories___getitem__(self, *args)
def __setitem__(self, *args) -> "void":
return _pykernel.VectorOfMemories___setitem__(self, *args)
def pop(self) -> "std::vector< SiconosMemory >::value_type":
return _pykernel.VectorOfMemories_pop(self)
def append(self, x: "SiconosMemory") -> "void":
return _pykernel.VectorOfMemories_append(self, x)
def empty(self) -> "bool":
return _pykernel.VectorOfMemories_empty(self)
def size(self) -> "std::vector< SiconosMemory >::size_type":
return _pykernel.VectorOfMemories_size(self)
def begin(self) -> "std::vector< SiconosMemory >::iterator":
return _pykernel.VectorOfMemories_begin(self)
def end(self) -> "std::vector< SiconosMemory >::iterator":
return _pykernel.VectorOfMemories_end(self)
def rbegin(self) -> "std::vector< SiconosMemory >::reverse_iterator":
return _pykernel.VectorOfMemories_rbegin(self)
def rend(self) -> "std::vector< SiconosMemory >::reverse_iterator":
return _pykernel.VectorOfMemories_rend(self)
def clear(self) -> "void":
return _pykernel.VectorOfMemories_clear(self)
def get_allocator(self) -> "std::vector< SiconosMemory >::allocator_type":
return _pykernel.VectorOfMemories_get_allocator(self)
def pop_back(self) -> "void":
return _pykernel.VectorOfMemories_pop_back(self)
def erase(self, *args) -> "std::vector< SiconosMemory >::iterator":
return _pykernel.VectorOfMemories_erase(self, *args)
def __init__(self, *args):
_pykernel.VectorOfMemories_swiginit(self, _pykernel.new_VectorOfMemories(*args))
def push_back(self, x: "SiconosMemory") -> "void":
return _pykernel.VectorOfMemories_push_back(self, x)
def front(self) -> "std::vector< SiconosMemory >::value_type const &":
return _pykernel.VectorOfMemories_front(self)
def back(self) -> "std::vector< SiconosMemory >::value_type const &":
return _pykernel.VectorOfMemories_back(self)
def assign(self, n: "std::vector< SiconosMemory >::size_type", x: "SiconosMemory") -> "void":
return _pykernel.VectorOfMemories_assign(self, n, x)
def resize(self, *args) -> "void":
return _pykernel.VectorOfMemories_resize(self, *args)
def insert(self, *args) -> "void":
return _pykernel.VectorOfMemories_insert(self, *args)
def reserve(self, n: "std::vector< SiconosMemory >::size_type") -> "void":
return _pykernel.VectorOfMemories_reserve(self, n)
def capacity(self) -> "std::vector< SiconosMemory >::size_type":
return _pykernel.VectorOfMemories_capacity(self)
__swig_destroy__ = _pykernel.delete_VectorOfMemories
# Register VectorOfMemories in _pykernel:
_pykernel.VectorOfMemories_swigregister(VectorOfMemories)
class UnsignedIntVector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self) -> "swig::SwigPyIterator *":
return _pykernel.UnsignedIntVector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self) -> "bool":
return _pykernel.UnsignedIntVector___nonzero__(self)
def __bool__(self) -> "bool":
return _pykernel.UnsignedIntVector___bool__(self)
def __len__(self) -> "std::vector< unsigned int >::size_type":
return _pykernel.UnsignedIntVector___len__(self)
def __getslice__(self, i: "std::vector< unsigned int >::difference_type", j: "std::vector< unsigned int >::difference_type") -> "std::vector< unsigned int,std::allocator< unsigned int > > *":
return _pykernel.UnsignedIntVector___getslice__(self, i, j)
def __setslice__(self, *args) -> "void":
return _pykernel.UnsignedIntVector___setslice__(self, *args)
def __delslice__(self, i: "std::vector< unsigned int >::difference_type", j: "std::vector< unsigned int >::difference_type") -> "void":
return _pykernel.UnsignedIntVector___delslice__(self, i, j)
def __delitem__(self, *args) -> "void":
return _pykernel.UnsignedIntVector___delitem__(self, *args)
def __getitem__(self, *args) -> "std::vector< unsigned int >::value_type const &":
return _pykernel.UnsignedIntVector___getitem__(self, *args)
def __setitem__(self, *args) -> "void":
return _pykernel.UnsignedIntVector___setitem__(self, *args)
def pop(self) -> "std::vector< unsigned int >::value_type":
return _pykernel.UnsignedIntVector_pop(self)
def append(self, x: "std::vector< unsigned int >::value_type const &") -> "void":
return _pykernel.UnsignedIntVector_append(self, x)
def empty(self) -> "bool":
return _pykernel.UnsignedIntVector_empty(self)
def size(self) -> "std::vector< unsigned int >::size_type":
return _pykernel.UnsignedIntVector_size(self)
def begin(self) -> "std::vector< unsigned int >::iterator":
return _pykernel.UnsignedIntVector_begin(self)
def end(self) -> "std::vector< unsigned int >::iterator":
return _pykernel.UnsignedIntVector_end(self)
def rbegin(self) -> "std::vector< unsigned int >::reverse_iterator":
return _pykernel.UnsignedIntVector_rbegin(self)
def rend(self) -> "std::vector< unsigned int >::reverse_iterator":
return _pykernel.UnsignedIntVector_rend(self)
def clear(self) -> "void":
return _pykernel.UnsignedIntVector_clear(self)
def get_allocator(self) -> "std::vector< unsigned int >::allocator_type":
return _pykernel.UnsignedIntVector_get_allocator(self)
def pop_back(self) -> "void":
return _pykernel.UnsignedIntVector_pop_back(self)
def erase(self, *args) -> "std::vector< unsigned int >::iterator":
return _pykernel.UnsignedIntVector_erase(self, *args)
def __init__(self, *args):
_pykernel.UnsignedIntVector_swiginit(self, _pykernel.new_UnsignedIntVector(*args))
def push_back(self, x: "std::vector< unsigned int >::value_type const &") -> "void":
return _pykernel.UnsignedIntVector_push_back(self, x)
def front(self) -> "std::vector< unsigned int >::value_type const &":
return _pykernel.UnsignedIntVector_front(self)
def back(self) -> "std::vector< unsigned int >::value_type const &":
return _pykernel.UnsignedIntVector_back(self)
def assign(self, n: "std::vector< unsigned int >::size_type", x: "std::vector< unsigned int >::value_type const &") -> "void":
return _pykernel.UnsignedIntVector_assign(self, n, x)
def resize(self, *args) -> "void":
return _pykernel.UnsignedIntVector_resize(self, *args)
def insert(self, *args) -> "void":
return _pykernel.UnsignedIntVector_insert(self, *args)
def reserve(self, n: "std::vector< unsigned int >::size_type") -> "void":
return _pykernel.UnsignedIntVector_reserve(self, n)
def capacity(self) -> "std::vector< unsigned int >::size_type":
return _pykernel.UnsignedIntVector_capacity(self)
__swig_destroy__ = _pykernel.delete_UnsignedIntVector
# Register UnsignedIntVector in _pykernel:
_pykernel.UnsignedIntVector_swigregister(UnsignedIntVector)
[docs]class MATRIX_UBLAS_TYPE(object):
r""" Union of DenseMat pointer, TriangMat pointer BandedMat, SparseMat, SymMat, Zero and Identity mat pointers."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
Dense = property(_pykernel.MATRIX_UBLAS_TYPE_Dense_get, _pykernel.MATRIX_UBLAS_TYPE_Dense_set)
Triang = property(_pykernel.MATRIX_UBLAS_TYPE_Triang_get, _pykernel.MATRIX_UBLAS_TYPE_Triang_set)
Sym = property(_pykernel.MATRIX_UBLAS_TYPE_Sym_get, _pykernel.MATRIX_UBLAS_TYPE_Sym_set)
Sparse = property(_pykernel.MATRIX_UBLAS_TYPE_Sparse_get, _pykernel.MATRIX_UBLAS_TYPE_Sparse_set)
Banded = property(_pykernel.MATRIX_UBLAS_TYPE_Banded_get, _pykernel.MATRIX_UBLAS_TYPE_Banded_set)
Zero = property(_pykernel.MATRIX_UBLAS_TYPE_Zero_get, _pykernel.MATRIX_UBLAS_TYPE_Zero_set)
Identity = property(_pykernel.MATRIX_UBLAS_TYPE_Identity_get, _pykernel.MATRIX_UBLAS_TYPE_Identity_set)
SparseCoordinate = property(_pykernel.MATRIX_UBLAS_TYPE_SparseCoordinate_get, _pykernel.MATRIX_UBLAS_TYPE_SparseCoordinate_set)
def __init__(self):
_pykernel.MATRIX_UBLAS_TYPE_swiginit(self, _pykernel.new_MATRIX_UBLAS_TYPE())
__swig_destroy__ = _pykernel.delete_MATRIX_UBLAS_TYPE
# Register MATRIX_UBLAS_TYPE in _pykernel:
_pykernel.MATRIX_UBLAS_TYPE_swigregister(MATRIX_UBLAS_TYPE)
[docs]class SiconosMatrix(object):
r"""
Abstract class to provide interface for matrices handling
Matrices can be either block or Simple.
See Derived classes for details.
In Siconos, a "matrix" can be either a SimpleMatrix or a BlockMatrix, ie a container of several pointers to SiconosMatrix
You can find an overview on how to build and use vectors and matrices in siconos users guide .
"""
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__ = _pykernel.delete_SiconosMatrix
[docs] def isBlock(self) -> "bool":
r"""
true if the matrix is block else false.
:rtype: boolean
:return: a bool
"""
return _pykernel.SiconosMatrix_isBlock(self)
[docs] def isPLUInversed(self) -> "bool":
r"""
determines if the matrix has been inversed in place
:rtype: boolean
:return: true if the matrix is inversed
"""
return _pykernel.SiconosMatrix_isPLUInversed(self)
[docs] def isSymmetric(self) -> "bool":
r"""
true if the matrix is symmetric (the flag is just returned)
:rtype: boolean
:return: true if the matrix is symmetric
"""
return _pykernel.SiconosMatrix_isSymmetric(self)
[docs] def setIsSymmetric(self, b: "bool") -> "void":
r""" set the flag _isSymmetric"""
return _pykernel.SiconosMatrix_setIsSymmetric(self, b)
[docs] def isPositiveDefinite(self) -> "bool":
r"""
true if the matrix is definite positive (the flag is just returned)
:rtype: boolean
:return: true if the matrix is
"""
return _pykernel.SiconosMatrix_isPositiveDefinite(self)
[docs] def setIsPositiveDefinite(self, b: "bool") -> "void":
r""" set the flag _isPositiveDefinite"""
return _pykernel.SiconosMatrix_setIsPositiveDefinite(self, b)
[docs] def checkSymmetry(self, tol: "double") -> "bool":
r"""
determines if the matrix is symmetric up to a given tolerance
:rtype: boolean
:return: true if the matrix is inversed
"""
return _pykernel.SiconosMatrix_checkSymmetry(self, tol)
[docs] def isPLUFactorized(self) -> "bool":
r"""
determines if the matrix has been PLU factorized
:rtype: boolean
:return: true if the matrix is factorized
"""
return _pykernel.SiconosMatrix_isPLUFactorized(self)
[docs] def isPLUFactorizedInPlace(self) -> "bool":
r"""
determines if the matrix has been PLU factorized in place
:rtype: boolean
:return: true if the matrix is factorized
"""
return _pykernel.SiconosMatrix_isPLUFactorizedInPlace(self)
[docs] def isCholeskyFactorized(self) -> "bool":
r"""
determines if the matrix has been Cholesky factorized
:rtype: boolean
:return: true if the matrix is factorized
"""
return _pykernel.SiconosMatrix_isCholeskyFactorized(self)
[docs] def isQRFactorized(self) -> "bool":
r"""
determines if the matrix has been QR factorized
:rtype: boolean
:return: true if the matrix is factorized
"""
return _pykernel.SiconosMatrix_isQRFactorized(self)
def ipiv(self) -> "SP::VInt":
return _pykernel.SiconosMatrix_ipiv(self)
[docs] def isFactorized(self) -> "bool":
r"""
determines if the matrix has been factorized
:rtype: boolean
:return: true if the matrix is factorized
"""
return _pykernel.SiconosMatrix_isFactorized(self)
[docs] def size(self, index: "unsigned int") -> "unsigned int":
r"""
get the number of rows or columns of the matrix
:type index: int
:param index: 0 for rows, 1 for columns
:rtype: int
:return: an int
"""
return _pykernel.SiconosMatrix_size(self, index)
[docs] def num(self) -> "Siconos::UBLAS_TYPE":
r"""
get the attribute num of current matrix
:rtype: int
:return: an unsigned int.
"""
return _pykernel.SiconosMatrix_num(self)
[docs] def numberOfBlocks(self, i: "unsigned int") -> "unsigned int":
r"""
get the number of block (i=0, row, i=1 col)
:type i: int
:param i: unsigned int(i=0, row, i=1 col)
:rtype: int
:return: an unsigned int. 1 as default for SimpleMatrix.
"""
return _pykernel.SiconosMatrix_numberOfBlocks(self, i)
[docs] def tabRow(self) -> "SP::Index const":
r"""
reserved to BlockMatrix - get the index tab for rows
:rtype: SP::Index
:return: a pointer to a standard vector of int
"""
return _pykernel.SiconosMatrix_tabRow(self)
[docs] def tabCol(self) -> "SP::Index const":
r"""
reserved to BlockMatrix - get the index tab of columns
:rtype: SP::Index
:return: a pointer to a standard vector of int
"""
return _pykernel.SiconosMatrix_tabCol(self)
[docs] def getDense(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "DenseMat const":
r"""
get DenseMat matrix
:type row: int, optional
:param row: an unsigned int position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int position of the block (column) - Useless for SimpleMatrix
:rtype: DenseMat
:return: a DenseMat
"""
return _pykernel.SiconosMatrix_getDense(self, row, col)
[docs] def getTriang(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "TriangMat const":
r"""
get TriangMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: TriangMat
:return: a TriangMat
"""
return _pykernel.SiconosMatrix_getTriang(self, row, col)
[docs] def getSym(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SymMat const":
r"""
get SymMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: SymMat
:return: a SymMat
"""
return _pykernel.SiconosMatrix_getSym(self, row, col)
[docs] def getBanded(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "BandedMat const":
r"""
get BandedMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: BandedMat
:return: a BandedMat
"""
return _pykernel.SiconosMatrix_getBanded(self, row, col)
[docs] def getSparse(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseMat const":
r"""
get SparseMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: SparseMat
:return: a SparseMat
"""
return _pykernel.SiconosMatrix_getSparse(self, row, col)
[docs] def getSparseCoordinate(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseCoordinateMat const":
r"""
get SparseCoordinateMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: SparseCoordinateMat
:return: a SparseCoordinateMat
"""
return _pykernel.SiconosMatrix_getSparseCoordinate(self, row, col)
[docs] def getZero(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "ZeroMat const":
r"""
get ZeroMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: ZeroMat
:return: a ZeroMat
"""
return _pykernel.SiconosMatrix_getZero(self, row, col)
[docs] def getIdentity(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "IdentityMat const":
r"""
get getIdentity matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: IdentityMat
:return: an IdentityMat
"""
return _pykernel.SiconosMatrix_getIdentity(self, row, col)
[docs] def dense(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "DenseMat *":
r"""
get a pointer on DenseMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: DenseMat
:return: a DenseMat*
"""
return _pykernel.SiconosMatrix_dense(self, row, col)
[docs] def triang(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "TriangMat *":
r"""
get a pointer on TriangMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: TriangMat
:return: a TriangMat*
"""
return _pykernel.SiconosMatrix_triang(self, row, col)
[docs] def sym(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SymMat *":
r"""
get a pointer on SymMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: SymMat
:return: a SymMat*
"""
return _pykernel.SiconosMatrix_sym(self, row, col)
[docs] def banded(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "BandedMat *":
r"""
get a pointer on BandedMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: BandedMat
:return: a BandedMat*
"""
return _pykernel.SiconosMatrix_banded(self, row, col)
[docs] def sparse(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseMat *":
r"""
get a pointer on SparseMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: SparseMat
:return: a SparseMat*
"""
return _pykernel.SiconosMatrix_sparse(self, row, col)
[docs] def sparseCoordinate(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseCoordinateMat *":
r"""
get a pointer on SparseCoordinateMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: SparseCoordinateMat
:return: a SparseCoordinateMat*
"""
return _pykernel.SiconosMatrix_sparseCoordinate(self, row, col)
[docs] def zero_mat(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "ZeroMat *":
r"""
get a pointer on ZeroMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: ZeroMat
:return: a ZeroMat*
"""
return _pykernel.SiconosMatrix_zero_mat(self, row, col)
[docs] def identity(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "IdentityMat *":
r"""
get a pointer on Identity matrix
:type row: int, optional
:param row: an unsigned int, position of the block (row) - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block (column) - Useless for SimpleMatrix
:rtype: IdentityMat
:return: an IdentityMat*
"""
return _pykernel.SiconosMatrix_identity(self, row, col)
[docs] def getArray(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "double *":
r"""
return the address of the array of double values of the matrix
( for block(i,j) if this is a block matrix)
:type row: int, optional
:param row: position for the required block
:type col: int, optional
:param col: position for the required block
:rtype: float
:return: double* : the pointer on the double array
"""
return _pykernel.SiconosMatrix_getArray(self, row, col)
[docs] def zero(self) -> "void":
r""" sets all the values of the matrix to 0.0"""
return _pykernel.SiconosMatrix_zero(self)
[docs] def randomize(self) -> "void":
r""" Initialize the matrix with random values"""
return _pykernel.SiconosMatrix_randomize(self)
[docs] def randomize_sym(self) -> "void":
r""" Initialize a symmetric matrix with random values"""
return _pykernel.SiconosMatrix_randomize_sym(self)
[docs] def eye(self) -> "void":
r""" set an identity matrix"""
return _pykernel.SiconosMatrix_eye(self)
[docs] def resize(self, nbrow: "unsigned int", nbcol: "unsigned int", lower: "unsigned int"=0, upper: "unsigned int"=0, preserve: "bool"=True) -> "void":
r"""
resize the matrix with nbrow rows and nbcol columns, upper and lower are only useful for BandedMatrix .
The existing elements of the matrix are preseved when specified.
:type nbrow: int
:param nbrow:
:type nbcol: int
:param nbcol:
:param lower,upper: for banded matrices
:type preserve: boolean, optional
:param preserve:
"""
return _pykernel.SiconosMatrix_resize(self, nbrow, nbcol, lower, upper, preserve)
[docs] def normInf(self) -> "double":
r"""
compute the infinite norm of the matrix
:rtype: float
:return: a double
"""
return _pykernel.SiconosMatrix_normInf(self)
[docs] def display(self) -> "void":
r""" display data on standard output"""
return _pykernel.SiconosMatrix_display(self)
[docs] def displayExpert(self, brief: "bool"=True) -> "void":
r""" display data on standard output"""
return _pykernel.SiconosMatrix_displayExpert(self, brief)
[docs] def toString(self) -> "std::string":
r"""
put data of the matrix into a std::string
:rtype: string
:return: std::string
"""
return _pykernel.SiconosMatrix_toString(self)
[docs] def getValue(self, i: "unsigned int", j: "unsigned int") -> "double":
r"""
return the element matrix[i,j]
:type i: int
:param i: an unsigned int i
:type j: int
:param j: an unsigned int j
:rtype: float
:return: a double
"""
return _pykernel.SiconosMatrix_getValue(self, i, j)
[docs] def setValue(self, i: "unsigned int", j: "unsigned int", value: "double") -> "void":
r"""
set the element matrix[i,j]
:type i: int
:param i: an unsigned int i
:type j: int
:param j: an unsigned int j
:type value: float
:param value:
"""
return _pykernel.SiconosMatrix_setValue(self, i, j, value)
[docs] def block(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SP::SiconosMatrix":
r"""
get block at position row-col if BlockMatrix, else if SimpleMatrix return this
:type row: int, optional
:param row: unsigned int row
:type col: int, optional
:param col: unsigned int col
:rtype: :py:class:`SiconosMatrix`
:return: SP::SiconosMatrix
"""
return _pykernel.SiconosMatrix_block(self, row, col)
[docs] def getRow(self, index: "unsigned int", vOut: "SiconosVector") -> "void":
r"""
get row index of current matrix and save it into vOut
:type index: int
:param index: row we want to get
:type vOut: :py:class:`SiconosVector`, out
:param vOut: SiconosVector that will contain the desired row
"""
return _pykernel.SiconosMatrix_getRow(self, index, vOut)
[docs] def getCol(self, index: "unsigned int", vOut: "SiconosVector") -> "void":
r"""
get column index of current matrix and save it into vOut
:type index: int
:param index: column we want to get
:type vOut: :py:class:`SiconosVector`, out
:param vOut: SiconosVector that will contain the desired column
"""
return _pykernel.SiconosMatrix_getCol(self, index, vOut)
[docs] def setRow(self, index: "unsigned int", vIn: "SiconosVector") -> "void":
r"""
set line row of the current matrix with vector v
:type index: int
:param index: row we want to set
:type vIn: :py:class:`SiconosVector`
:param vIn: SiconosVector containing the new row
"""
return _pykernel.SiconosMatrix_setRow(self, index, vIn)
[docs] def setCol(self, index: "unsigned int", vIn: "SiconosVector") -> "void":
r"""
set column col of the current matrix with vector v
:type index: int
:param index: column we want to set
:type vIn: :py:class:`SiconosVector`
:param vIn: a SiconosVector containing the new column
"""
return _pykernel.SiconosMatrix_setCol(self, index, vIn)
[docs] def trans(self, *args) -> "void":
r"""
*Overload 1:*
transpose in place: x->trans() is x = transpose of x.
|
*Overload 2:*
transpose a matrix: x->trans(m) is x = transpose of m.
:type m: :py:class:`SiconosMatrix`
:param m: the matrix to be transposed.
"""
return _pykernel.SiconosMatrix_trans(self, *args)
def __copy__(self, *args) -> "SiconosMatrix &":
r"""
*Overload 1:*
operator =
:type m: :py:class:`SiconosMatrix`
:param m: the matrix to be copied
:rtype: :py:class:`SiconosMatrix`
:return: SiconosMatrix
|
*Overload 2:*
operator = to a DenseMat
:type m: DenseMat
:param m: the DenseMat to be copied
:rtype: :py:class:`SiconosMatrix`
:return: SiconosMatrix
"""
return _pykernel.SiconosMatrix___copy__(self, *args)
def __iadd__(self, m: "SiconosMatrix") -> "SiconosMatrix &":
r"""
operator +=
:type m: :py:class:`SiconosMatrix`
:param m: a matrix to add
:rtype: :py:class:`SiconosMatrix`
:return: SiconosMatrix
"""
return _pykernel.SiconosMatrix___iadd__(self, m)
def __isub__(self, m: "SiconosMatrix") -> "SiconosMatrix &":
r"""
operator -=
:type m: :py:class:`SiconosMatrix`
:param m: a matrix to subtract
:rtype: :py:class:`SiconosMatrix`
:return: SiconosMatrix
"""
return _pykernel.SiconosMatrix___isub__(self, m)
def updateNumericsMatrix(self) -> "void":
return _pykernel.SiconosMatrix_updateNumericsMatrix(self)
def numericsMatrix(self) -> "NumericsMatrix *":
return _pykernel.SiconosMatrix_numericsMatrix(self)
[docs] def PLUFactorizationInPlace(self) -> "void":
r"""
computes a LU factorization of a general M-by-N matrix
with partial pivoting and row interchanges.
The result is returned in this (InPlace).
Based on Blas dgetrf function for dense matrix and
ublas cholesky decomposition for sparse matrix
(work only for a symmetric matrix and very slow because it uses
matric accessor)
use preferably PLUFactorize()
"""
return _pykernel.SiconosMatrix_PLUFactorizationInPlace(self)
[docs] def Factorize(self) -> "void":
r"""
computes a factorization of a general M-by-N matrix
The implementation is based on an internal NumericsMatrix
"""
return _pykernel.SiconosMatrix_Factorize(self)
[docs] def PLUInverseInPlace(self) -> "void":
r"""
compute inverse of this thanks to LU factorization with partial pivoting.
This method inverts U and then computes inv(A) by solving the system
inv(A)*L = inv(U) for inv(A).
The result is returned in this (InPlace).
Based on Blas dgetri function for dense function
"""
return _pykernel.SiconosMatrix_PLUInverseInPlace(self)
[docs] def solve_matrix(self, B: "SiconosMatrix") -> "void":
r"""
solves a system of linear equations A * X = B (A=this)
for a general N-by-N matrix A using the LU factorization computed
by PLUFactorize.
:type B: :py:class:`SiconosMatrix`, in/out
:param B: on input the RHS matrix b; on output the result x
"""
return _pykernel.SiconosMatrix_solve_matrix(self, B)
[docs] def PLUForwardBackwardInPlace(self, *args) -> "void":
r"""
*Overload 1:*
solves a system of linear equations A * X = B (A=this)
for a general N-by-N matrix A using the LU factorization computed
by PLUFactorizationInPlace.
Based on Blas dgetrs function for dense matrix.
:type B: :py:class:`SiconosMatrix`, in/out
:param B: on input the RHS matrix b; on output the result x
|
*Overload 2:*
solves a system of linear equations A * X = B (A=this)
for a general N-by-N matrix A using the LU factorization computed
by PLUFactorizationInPlace.
Based on Blas dgetrs function for dense matrix.
:type B: :py:class:`SiconosVector`, in/out
:param B: on input the RHS matrix b; on output the result x
"""
return _pykernel.SiconosMatrix_PLUForwardBackwardInPlace(self, *args)
[docs] def solve_vector(self, B: "SiconosVector") -> "void":
r"""
solves a system of linear equations A * X = B (A=this)
for a general N-by-N matrix A using the LU factorization computed
by PLUFactorize.
:type B: :py:class:`SiconosVector`, in/out
:param B: on input the RHS matrix b; on output the result x
"""
return _pykernel.SiconosMatrix_solve_vector(self, B)
[docs] def resetLU(self) -> "void":
r"""
set to false all LU indicators. Useful in case of
assignment for example.
"""
return _pykernel.SiconosMatrix_resetLU(self)
[docs] def resetFactorizationFlags(self) -> "void":
r"""
set to false all factorization indicators. Useful in case of
assignment for example.
"""
return _pykernel.SiconosMatrix_resetFactorizationFlags(self)
[docs] def nnz(self, tol: "double"=1e-14) -> "size_t":
r"""
return the number of non-zero in the matrix
:type tol: float, optional
:param tol: the tolerance to consider a number zero (not used if the matrix is sparse)
:rtype: int
:return: the number of non-zeros
"""
return _pykernel.SiconosMatrix_nnz(self, tol)
[docs] def fillCSC(self, *args) -> "bool":
r"""
*Overload 1:*
Fill CSparseMatrix compresses column sparse matrix
:type csc: CSparseMatrix
:param csc: the compressed column sparse matrix
:type row_off: int
:param row_off:
:type col_off: int
:param col_off:
:type tol: float, optional
:param tol: the tolerance under which a number is considered as equal to zero
:rtype: boolean
:return: true if function worked.
Warning: not clear that it works for an empty csr matrix with row_off =0 and col_off =0
|
*Overload 2:*
Fill CSparseMatrix compresses column sparse matrix
:type csc: CSparseMatrix
:param csc: the compressed column sparse matrix
:type tol: float, optional
:param tol: the tolerance under which a number is considered as equal to zero
:rtype: boolean
:return: true if function worked.
|
*Overload 3:*
Fill CSparseMatrix compresses column sparse matrix
:type csc: CSparseMatrix
:param csc: the compressed column sparse matrix
:param tol: the tolerance under which a number is considered as equal to zero
:rtype: boolean
:return: true if function worked.
"""
return _pykernel.SiconosMatrix_fillCSC(self, *args)
def fromCSC(self, csc: "CSparseMatrix *") -> "bool":
return _pykernel.SiconosMatrix_fromCSC(self, csc)
[docs] def fillTriplet(self, csc: "CSparseMatrix *", row_off: "size_t", col_off: "size_t", tol: "double"=1e-14) -> "bool":
r"""
return the number of non-zero in the matrix
:type csc: CSparseMatrix
:param csc: the compressed column sparse matrix
:type row_off: int
:param row_off:
:type col_off: int
:param col_off:
:type tol: float, optional
:param tol: the tolerance to consider a number zero (not used if the matrix is sparse)
:rtype: boolean
:return: the number of non-zeros
"""
return _pykernel.SiconosMatrix_fillTriplet(self, csc, row_off, col_off, tol)
def __str__(self) -> "std::string":
return _pykernel.SiconosMatrix___str__(self)
def __getitem__(self, args: "PyObject *") -> "PyObject *":
return _pykernel.SiconosMatrix___getitem__(self, args)
def __setitem__(self, args: "PyObject *", value: "double") -> "PyObject *":
return _pykernel.SiconosMatrix___setitem__(self, args, value)
# Register SiconosMatrix in _pykernel:
_pykernel.SiconosMatrix_swigregister(SiconosMatrix)
def prod(*args) -> "void":
return _pykernel.prod(*args)
[docs]class SimpleMatrix(SiconosMatrix):
r"""
Matrix (embedded various types of Boost matrices of double)
SimpleMatrix is used in the platform to store matrices (mathematical object) of double.
Possible types: Siconos::DENSE (default),
TRIANGULAR, SYMMETRIC, SPARSE, BANDED, ZERO,
Siconos::IDENTITY,
Siconos::SPARSE_COORDINATE.
TODO: : review resize function for Banded, Symetric and Triangular. Error in tests.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
Default constructor
|
*Overload 2:*
constructor with the type and the dimension of the Boost matrix
:type row: int
:param row: number of rows.
:type col: int
:param col: number of columns.
:type typ: int, optional
:param typ: the type of matrix
:type upper: int, optional
:param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal
:type lower: int, optional
:param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal
|
*Overload 3:*
constructor with the type and the dimension of the Boost matrix
:type row: int
:param row: number of rows.
:type col: int
:param col: number of columns.
:type typ: int, optional
:param typ: the type of matrix
:type upper: int, optional
:param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal
:param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal
|
*Overload 4:*
constructor with the type and the dimension of the Boost matrix
:type row: int
:param row: number of rows.
:type col: int
:param col: number of columns.
:type typ: int, optional
:param typ: the type of matrix
:param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal
:param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal
|
*Overload 5:*
constructor with the type and the dimension of the Boost matrix
:type row: int
:param row: number of rows.
:type col: int
:param col: number of columns.
:param typ: the type of matrix
:param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal
:param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal
|
*Overload 6:*
constructor with the the dimensions of the Boost matrix, a default value and the type.
:type row: int
:param row: number of rows.
:type col: int
:param col: number of columns.
:type inputValue: float
:param inputValue: double a, so that *this = [a a a ...]
:type typ: int, optional
:param typ: the type of matrix
:type upper: int, optional
:param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal
:type lower: int, optional
:param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal
|
*Overload 7:*
constructor with the the dimensions of the Boost matrix, a default value and the type.
:type row: int
:param row: number of rows.
:type col: int
:param col: number of columns.
:type inputValue: float
:param inputValue: double a, so that *this = [a a a ...]
:type typ: int, optional
:param typ: the type of matrix
:type upper: int, optional
:param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal
:param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal
|
*Overload 8:*
constructor with the the dimensions of the Boost matrix, a default value and the type.
:type row: int
:param row: number of rows.
:type col: int
:param col: number of columns.
:type inputValue: float
:param inputValue: double a, so that *this = [a a a ...]
:type typ: int, optional
:param typ: the type of matrix
:param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal
:param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal
|
*Overload 9:*
constructor with the the dimensions of the Boost matrix, a default value and the type.
:type row: int
:param row: number of rows.
:type col: int
:param col: number of columns.
:type inputValue: float
:param inputValue: double a, so that *this = [a a a ...]
:param typ: the type of matrix
:param upper: if Siconos::UBLAS_TYPE==SPARSE, number of non-zero terms, if Siconos::UBLAS_TYPE == BANDED, number of diags. under the main diagonal
:param lower: if Siconos::UBLAS_TYPE == BANDED, number of diags. over the main diagonal
|
*Overload 10:*
copy constructor
:type smat: :py:class:`SimpleMatrix`
:param smat: the matrix to copy
|
*Overload 11:*
copy constructor of a block given by the coord = [r0A r1A c0A c1A]
:type A: :py:class:`SimpleMatrix`
:param A: the matrix which contains the block to extract
:type coord: Index
:param coord: positions of the block to be extracted (row:start, row:end, col:start, col:end)
|
*Overload 12:*
constructor with a DenseMat matrix (see SiconosMatrix.h for details)
:type m: DenseMat
:param m: a DenseMat
|
*Overload 13:*
constructor with a TriangMat matrix (see SiconosMatrix.h for details)
:type m: TriangMat
:param m: a TriangMat
|
*Overload 14:*
constructor with a SymMat matrix (see SiconosMatrix.h for details)
:type m: SymMat
:param m: a SymMat
|
*Overload 15:*
constructor with a BandedMat matrix (see SiconosMatrix.h for details)
:type m: BandedMat
:param m: a BandedMat
|
*Overload 16:*
constructor with a SparseMat matrix (see SiconosMatrix.h for details)
:type m: SparseMat
:param m: a SparseMat
|
*Overload 17:*
constructor with a SparseCoordinateMat matrix (see SiconosMatrix.h for details)
:type m: SparseCoordinateMat
:param m: a SparseMat
|
*Overload 18:*
constructor with a ZeroMat matrix (see SiconosMatrix.h for details)
:type m: ZeroMat
:param m: a ZeroMat
|
*Overload 19:*
constructor with a IdentityMat matrix (see SiconosMatrix.h for details)
:type m: IdentityMat
:param m: a IdentityMat
|
*Overload 20:*
constructor with an input file
:type file: string
:param file: the input file path
:type ascii: boolean, optional
:param ascii: a boolean to indicate if the file is in ascii
|
*Overload 21:*
constructor with an input file
:type file: string
:param file: the input file path
:param ascii: a boolean to indicate if the file is in ascii
"""
_pykernel.SimpleMatrix_swiginit(self, _pykernel.new_SimpleMatrix(*args))
__swig_destroy__ = _pykernel.delete_SimpleMatrix
def updateNumericsMatrix(self) -> "void":
return _pykernel.SimpleMatrix_updateNumericsMatrix(self)
def numericsMatrix(self) -> "NumericsMatrix *":
return _pykernel.SimpleMatrix_numericsMatrix(self)
[docs] def isPLUInversed(self) -> "bool":
r"""
determines if the matrix has been inversed
:rtype: boolean
:return: true if the matrix is inversed
"""
return _pykernel.SimpleMatrix_isPLUInversed(self)
[docs] def isPLUFactorized(self) -> "bool":
r"""
determines if the matrix has been factorized
:rtype: boolean
:return: true if the matrix is factorized
"""
return _pykernel.SimpleMatrix_isPLUFactorized(self)
[docs] def isPLUFactorizedInPlace(self) -> "bool":
r"""
determines if the matrix has been factorized
:rtype: boolean
:return: true if the matrix is factorized
"""
return _pykernel.SimpleMatrix_isPLUFactorizedInPlace(self)
[docs] def isCholeskyFactorized(self) -> "bool":
r"""
determines if the matrix has been factorized
:rtype: boolean
:return: true if the matrix is factorized
"""
return _pykernel.SimpleMatrix_isCholeskyFactorized(self)
[docs] def isCholeskyFactorizedInPlace(self) -> "bool":
r"""
determines if the matrix has been factorized
:rtype: boolean
:return: true if the matrix is factorized
"""
return _pykernel.SimpleMatrix_isCholeskyFactorizedInPlace(self)
[docs] def isQRFactorized(self) -> "bool":
r"""
determines if the matrix has been factorized
:rtype: boolean
:return: true if the matrix is factorized
"""
return _pykernel.SimpleMatrix_isQRFactorized(self)
def ipiv(self) -> "SP::VInt":
return _pykernel.SimpleMatrix_ipiv(self)
[docs] def checkSymmetry(self, tol: "double") -> "bool":
return _pykernel.SimpleMatrix_checkSymmetry(self, tol)
[docs] def getDense(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "DenseMat const":
r"""
get DenseMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: DenseMat
:return: a DenseMat
"""
return _pykernel.SimpleMatrix_getDense(self, row, col)
[docs] def getTriang(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "TriangMat const":
r"""
get TriangMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: TriangMat
:return: a TriangMat
"""
return _pykernel.SimpleMatrix_getTriang(self, row, col)
[docs] def getSym(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SymMat const":
r"""
get SymMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: SymMat
:return: a SymMat
"""
return _pykernel.SimpleMatrix_getSym(self, row, col)
[docs] def getBanded(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "BandedMat const":
r"""
get BandedMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: BandedMat
:return: a BandedMat
"""
return _pykernel.SimpleMatrix_getBanded(self, row, col)
[docs] def getSparse(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseMat const":
r"""
get SparseMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: SparseMat
:return: a SparseMat
"""
return _pykernel.SimpleMatrix_getSparse(self, row, col)
[docs] def getSparseCoordinate(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseCoordinateMat const":
r"""
get SparseCoordinateMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: SparseCoordinateMat
:return: a SparseCoordinateMat
"""
return _pykernel.SimpleMatrix_getSparseCoordinate(self, row, col)
[docs] def getZero(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "ZeroMat const":
r"""
get ZeroMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: ZeroMat
:return: a ZeroMat
"""
return _pykernel.SimpleMatrix_getZero(self, row, col)
[docs] def getIdentity(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "IdentityMat const":
r"""
get getIdentity matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: IdentityMat
:return: an IdentityMat
"""
return _pykernel.SimpleMatrix_getIdentity(self, row, col)
[docs] def dense(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "DenseMat *":
r"""
get a pointer on DenseMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: DenseMat
:return: a DenseMat*
"""
return _pykernel.SimpleMatrix_dense(self, row, col)
[docs] def triang(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "TriangMat *":
r"""
get a pointer on TriangMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: TriangMat
:return: a TriangMat*
"""
return _pykernel.SimpleMatrix_triang(self, row, col)
[docs] def sym(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SymMat *":
r"""
get a pointer on SymMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: SymMat
:return: a SymMat*
"""
return _pykernel.SimpleMatrix_sym(self, row, col)
[docs] def banded(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "BandedMat *":
r"""
get a pointer on BandedMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: BandedMat
:return: a BandedMat*
"""
return _pykernel.SimpleMatrix_banded(self, row, col)
[docs] def sparse(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseMat *":
r"""
get a pointer on SparseMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: SparseMat
:return: a SparseMat*
"""
return _pykernel.SimpleMatrix_sparse(self, row, col)
[docs] def sparseCoordinate(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "SparseCoordinateMat *":
r"""
get a pointer on SparseCoordinateMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: SparseCoordinateMat
:return: a SparseCoordinateMat*
"""
return _pykernel.SimpleMatrix_sparseCoordinate(self, row, col)
[docs] def zero_mat(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "ZeroMat *":
r"""
get a pointer on ZeroMat matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: ZeroMat
:return: a ZeroMat*
"""
return _pykernel.SimpleMatrix_zero_mat(self, row, col)
[docs] def identity(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "IdentityMat *":
r"""
get a pointer on Identity matrix
:type row: int, optional
:param row: an unsigned int, position of the block - Useless for SimpleMatrix
:type col: int, optional
:param col: an unsigned int, position of the block - Useless for SimpleMatrix
:rtype: IdentityMat
:return: an IdentityMat*
"""
return _pykernel.SimpleMatrix_identity(self, row, col)
[docs] def getArray(self, row: "unsigned int"=0, col: "unsigned int"=0) -> "double *":
r"""
return the address of the array of double values of the matrix
:type row: int, optional
:param row: position for the required block ->useless for SimpleMatrix
:type col: int, optional
:param col: position for the required block ->useless for SimpleMatrix
:rtype: float
:return: double* : the pointer on the double array
"""
return _pykernel.SimpleMatrix_getArray(self, row, col)
[docs] def zero(self) -> "void":
r""" sets all the values of the matrix to 0.0"""
return _pykernel.SimpleMatrix_zero(self)
[docs] def randomize(self) -> "void":
r""" Initialize the matrix with random values"""
return _pykernel.SimpleMatrix_randomize(self)
[docs] def randomize_sym(self) -> "void":
r""" Initialize a symmetric matrix with random values"""
return _pykernel.SimpleMatrix_randomize_sym(self)
[docs] def eye(self) -> "void":
r""" set an identity matrix"""
return _pykernel.SimpleMatrix_eye(self)
[docs] def copyData(self, data: "double *") -> "unsigned int":
r"""
copy the matrix data to the array given in parameter'
Works only for dense matrices !
:type data: float
:param data: array where the matrix is copied
:rtype: int
:return: the size of the matrix
"""
return _pykernel.SimpleMatrix_copyData(self, data)
def assign(self, smat: "SimpleMatrix") -> "void":
return _pykernel.SimpleMatrix_assign(self, smat)
[docs] def size(self, index: "unsigned int") -> "unsigned int":
r"""
get the number of rows or columns of the matrix
:type index: int
:param index: 0 for rows, 1 for columns
:rtype: int
:return: the size
"""
return _pykernel.SimpleMatrix_size(self, index)
[docs] def resize(self, row: "unsigned int", col: "unsigned int", lower: "unsigned int"=0, upper: "unsigned int"=0, preserve: "bool"=True) -> "void":
r"""
resize the matrix with nbrow rows and nbcol columns The existing elements of the matrix are preseved when specified.
:type row: int
:param row: the new number of rows
:type col: int
:param col: the mew number of columns
:type lower: int, optional
:param lower: (only for Banded)
:type upper: int, optional
:param upper: (only for Banded)
:type preserve: boolean, optional
:param preserve: preserve existing elements
"""
return _pykernel.SimpleMatrix_resize(self, row, col, lower, upper, preserve)
[docs] def normInf(self) -> "double":
r"""
compute the infinite norm of the matrix
:rtype: float
:return: a double
"""
return _pykernel.SimpleMatrix_normInf(self)
[docs] def normInfByColumn(self, vIn: "SP::SiconosVector") -> "void":
r"""
Compute the normInf for each column
:type vIn: :py:class:`SiconosVector`
:param vIn: column
"""
return _pykernel.SimpleMatrix_normInfByColumn(self, vIn)
[docs] def det(self) -> "double":
r"""
compute the determinant of the matrix (use LU factorization)
:rtype: float
:return: a double
"""
return _pykernel.SimpleMatrix_det(self)
[docs] def display(self) -> "void":
r""" display data on standard output"""
return _pykernel.SimpleMatrix_display(self)
[docs] def displayExpert(self, brief: "bool"=True) -> "void":
return _pykernel.SimpleMatrix_displayExpert(self, brief)
[docs] def toString(self) -> "std::string":
r"""
put data of the matrix into a std::string
:rtype: string
:return: std::string
"""
return _pykernel.SimpleMatrix_toString(self)
[docs] def getValue(self, i: "unsigned int", j: "unsigned int") -> "double":
r"""
return the element matrix[i,j]
:type i: int
:param i: an unsigned int
:type j: int
:param j: an unsigned int
:rtype: float
:return: a double
"""
return _pykernel.SimpleMatrix_getValue(self, i, j)
[docs] def setValue(self, i: "unsigned int", j: "unsigned int", value: "double") -> "void":
r"""
set the element matrix[i,j]
:type i: int
:param i: an unsigned int
:type j: int
:param j: an unsigned int
:type value: float
:param value:
"""
return _pykernel.SimpleMatrix_setValue(self, i, j, value)
[docs] def getRow(self, row: "unsigned int", vOut: "SiconosVector") -> "void":
r"""
get row index of current matrix and save it into vOut
:type row: int
:param row: index row we want to get
:type vOut: :py:class:`SiconosVector`, out
:param vOut: SiconosVector that will contain the desired row
"""
return _pykernel.SimpleMatrix_getRow(self, row, vOut)
[docs] def getCol(self, col: "unsigned int", vOut: "SiconosVector") -> "void":
r"""
get column index of current matrix and save it into vOut
:type col: int
:param col: index column we want to get
:type vOut: :py:class:`SiconosVector`, out
:param vOut: SiconosVector that will contain the desired column
"""
return _pykernel.SimpleMatrix_getCol(self, col, vOut)
[docs] def setRow(self, row: "unsigned int", vIn: "SiconosVector") -> "void":
r"""
set line row of the current matrix with vector v
:type row: int
:param row: index row we want to set
:type vIn: :py:class:`SiconosVector`
:param vIn: SiconosVector containing the new row
"""
return _pykernel.SimpleMatrix_setRow(self, row, vIn)
[docs] def setCol(self, col: "unsigned int", vIn: "SiconosVector") -> "void":
r"""
set column col of the current matrix with vector v
:type col: int
:param col: index column we want to set
:type vIn: :py:class:`SiconosVector`
:param vIn: a SiconosVector containing the new column
"""
return _pykernel.SimpleMatrix_setCol(self, col, vIn)
[docs] def getSubCol(self, index: "unsigned int", pos: "unsigned int", vOut: "SP::SiconosVector") -> "void":
r"""
get column number index of current matrix, starting from element at position pos and save it into vOut
:type index: int
:param index: index of required column
:type pos: int
:param pos: index of the first required element in the column
:type vOut: :py:class:`SiconosVector`, out
:param vOut: a SP::SiconosVector
"""
return _pykernel.SimpleMatrix_getSubCol(self, index, pos, vOut)
[docs] def getSubRow(self, index: "unsigned int", pos: "unsigned int", vOut: "SP::SiconosVector") -> "void":
r"""
get row number index of current matrix, starting from element at position pos and save it into vOut
:type index: int
:param index: index of the required row
:type pos: int
:param pos: index of the first required element in the row
:type vOut: :py:class:`SiconosVector`, out
:param vOut: a SP::SiconosVector that will contain the sub row
"""
return _pykernel.SimpleMatrix_getSubRow(self, index, pos, vOut)
[docs] def setSubCol(self, index: "unsigned int", pos: "unsigned int", vIn: "SP::SiconosVector") -> "void":
r"""
set column number index of current matrix, starting from element at position pos, with vIn
:type index: int
:param index: index of required column
:type pos: int
:param pos: index of the first required element in the column
:type vIn: :py:class:`SiconosVector`
:param vIn: a vector
"""
return _pykernel.SimpleMatrix_setSubCol(self, index, pos, vIn)
[docs] def setSubRow(self, index: "unsigned int", pos: "unsigned int", vIn: "SP::SiconosVector") -> "void":
r"""
set row number index of current matrix, starting from element at position pos, with vIn
:type index: int
:param index: index of required row
:type pos: int
:param pos: index of the first required element in the row
:type vIn: :py:class:`SiconosVector`
:param vIn: a vector
"""
return _pykernel.SimpleMatrix_setSubRow(self, index, pos, vIn)
[docs] def addBlock(self, i: "unsigned int", j: "unsigned int", m: "SiconosMatrix") -> "void":
r"""
add the input matrix to the elements starting from position i (row) and j (col).
:type i: int
:param i: an unsigned int
:type j: int
:param j: an unsigned int
:type m: :py:class:`SiconosMatrix`
:param m: a SiconosMatrix
"""
return _pykernel.SimpleMatrix_addBlock(self, i, j, m)
[docs] def subBlock(self, i: "unsigned int", j: "unsigned int", m: "SiconosMatrix") -> "void":
r"""
subtract the input matrix to the elements starting from position i (row) and j (col).
:type i: int
:param i: an unsigned int
:type j: int
:param j: an unsigned int
:type m: :py:class:`SiconosMatrix`
:param m: a SiconosMatrix
"""
return _pykernel.SimpleMatrix_subBlock(self, i, j, m)
[docs] def trans(self, *args) -> "void":
r"""
*Overload 1:*
transpose in place: x->trans() is x = transpose of x.
|
*Overload 2:*
transpose a matrix: x->trans(m) is x = transpose of m.
:type mat: :py:class:`SiconosMatrix`
:param mat: the matrix to be transposed.
"""
return _pykernel.SimpleMatrix_trans(self, *args)
def __copy__(self, *args) -> "SimpleMatrix &":
r"""
*Overload 1:*
assignment
:type m: :py:class:`SimpleMatrix`
:param m: the matrix to be copied
:rtype: :py:class:`SimpleMatrix`
:return: SimpleMatrix
|
*Overload 2:*
assignment to a DenseMat
:type m: DenseMat
:param m: the matrix to be copied
:rtype: :py:class:`SimpleMatrix`
:return: SimpleMatrix
"""
return _pykernel.SimpleMatrix___copy__(self, *args)
def __iadd__(self, m: "SiconosMatrix") -> "SimpleMatrix &":
r"""
operator +=
:type m: :py:class:`SiconosMatrix`
:param m: a matrix to add
:rtype: :py:class:`SimpleMatrix`
:return: SimpleMatrix
"""
return _pykernel.SimpleMatrix___iadd__(self, m)
def __isub__(self, m: "SiconosMatrix") -> "SimpleMatrix &":
r"""
operator -=
:type m: :py:class:`SiconosMatrix`
:param m: a matrix to subtract
:rtype: :py:class:`SimpleMatrix`
:return: SimpleMatrix
"""
return _pykernel.SimpleMatrix___isub__(self, m)
[docs] def PLUFactorizationInPlace(self) -> "void":
r"""
computes an LU factorization of a general M-by-N matrix using partial pivoting with row interchanges.
The result is returned in this (InPlace). Based on Blas dgetrf function.
"""
return _pykernel.SimpleMatrix_PLUFactorizationInPlace(self)
[docs] def Factorize(self) -> "void":
r""" computes a factorization of a general M-by-N matrix"""
return _pykernel.SimpleMatrix_Factorize(self)
[docs] def PLUInverseInPlace(self) -> "void":
r"""
compute inverse of this thanks to LU factorization with Partial pivoting.
This method inverts U and then computes inv(A) by solving the system
inv(A)*L = inv(U) for inv(A). The result is returned in this (InPlace). Based on Blas dgetri function.
"""
return _pykernel.SimpleMatrix_PLUInverseInPlace(self)
[docs] def solve_matrix(self, B: "SiconosMatrix") -> "void":
return _pykernel.SimpleMatrix_solve_matrix(self, B)
[docs] def PLUForwardBackwardInPlace(self, *args) -> "void":
r"""
*Overload 1:*
solves a system of linear equations A * X = B (A=this) with a general N-by-N matrix A using the LU factorization computed
by PLUFactorizationInPlace. Based on Blas dgetrs function.
:type B: :py:class:`SiconosMatrix`, in/out
:param B: on input the RHS matrix b; on output the result x
|
*Overload 2:*
solves a system of linear equations A * X = B (A=this) with a general N-by-N matrix A using the LU factorization computed
by PLUFactorizationInPlace. Based on Blas dgetrs function.
:type B: :py:class:`SiconosVector`, in/out
:param B: on input the RHS matrix b; on output the result x
"""
return _pykernel.SimpleMatrix_PLUForwardBackwardInPlace(self, *args)
[docs] def solve_vector(self, B: "SiconosVector") -> "void":
return _pykernel.SimpleMatrix_solve_vector(self, B)
[docs] def SolveByLeastSquares(self, *args) -> "void":
r"""
*Overload 1:*
solves a system of linear equations A * X = B (A=this)
with a general N-by-N matrix A using the Least squares method
:type B: :py:class:`SiconosMatrix`, in/out
:param B: on input the RHS matrix b; on output the result x
|
*Overload 2:*
solves a system of linear equations A * X = B (A=this)
with a general N-by-N matrix A using the Least squares method
:type B: :py:class:`SiconosVector`, in/out
:param B: on input the RHS matrix b; on output the result x
"""
return _pykernel.SimpleMatrix_SolveByLeastSquares(self, *args)
[docs] def resetLU(self) -> "void":
r"""
set to false all LU indicators. Useful in case of
assignment for example.
"""
return _pykernel.SimpleMatrix_resetLU(self)
[docs] def resetCholesky(self) -> "void":
r"""
set to false all Cholesky indicators. Useful in case of
assignment for example.
"""
return _pykernel.SimpleMatrix_resetCholesky(self)
[docs] def resetQR(self) -> "void":
r"""
set to false all QR indicators. Useful in case of
assignment for example.
"""
return _pykernel.SimpleMatrix_resetQR(self)
[docs] def resetFactorizationFlags(self) -> "void":
r"""
set to false all factorization indicators. Useful in case of
assignment for example.
"""
return _pykernel.SimpleMatrix_resetFactorizationFlags(self)
def __str__(self) -> "std::string":
return _pykernel.SimpleMatrix___str__(self)
def __getitem__(self, args: "PyObject *") -> "PyObject *":
return _pykernel.SimpleMatrix___getitem__(self, args)
def __setitem__(self, args: "PyObject *", value: "double") -> "PyObject *":
return _pykernel.SimpleMatrix___setitem__(self, args, value)
# Register SimpleMatrix in _pykernel:
_pykernel.SimpleMatrix_swigregister(SimpleMatrix)
def __mul__(arg1: "SP::SimpleMatrix const", arg2: "SP::SimpleMatrix const") -> "SP::SimpleMatrix":
return _pykernel.__mul__(arg1, arg2)
def __iadd__(arg1: "SP::SiconosMatrix", arg2: "SP::SimpleMatrix") -> "void":
return _pykernel.__iadd__(arg1, arg2)
def __eq__(arg1: "SiconosMatrix", arg2: "SiconosMatrix") -> "bool":
return _pykernel.__eq__(arg1, arg2)
def __ne__(arg1: "SiconosMatrix", arg2: "SiconosMatrix") -> "bool":
return _pykernel.__ne__(arg1, arg2)
[docs]class VECTOR_UBLAS_TYPE(object):
r""" Union to gather all types of ublas vectors used in Siconos"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
Dense = property(_pykernel.VECTOR_UBLAS_TYPE_Dense_get, _pykernel.VECTOR_UBLAS_TYPE_Dense_set)
Sparse = property(_pykernel.VECTOR_UBLAS_TYPE_Sparse_get, _pykernel.VECTOR_UBLAS_TYPE_Sparse_set)
def __init__(self):
_pykernel.VECTOR_UBLAS_TYPE_swiginit(self, _pykernel.new_VECTOR_UBLAS_TYPE())
__swig_destroy__ = _pykernel.delete_VECTOR_UBLAS_TYPE
# Register VECTOR_UBLAS_TYPE in _pykernel:
_pykernel.VECTOR_UBLAS_TYPE_swigregister(VECTOR_UBLAS_TYPE)
[docs]class SiconosVector(object):
r"""
Vectors of double. (Interface to various types of Boost-Ublas vectors).
Two possible types: Siconos::DENSE (default) and Siconos:SPARSE.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
Creates a zero-size vector.
|
*Overload 2:*
creates a vector, all components set to zero.
:type row: int
:param row: the size of the vector
:type type: int, optional
:param type: the type of vector (dense or sparse)
|
*Overload 3:*
creates a vector, all components set to zero.
:type row: int
:param row: the size of the vector
:param type: the type of vector (dense or sparse)
|
*Overload 4:*
creates a vector and initializes its content with a single value
:type row: int
:param row: size of the new vector
:type val: float
:param val: value to initialize its content
:type type: int, optional
:param type: type of vector (dense or sparse)
|
*Overload 5:*
creates a vector and initializes its content with a single value
:type row: int
:param row: size of the new vector
:type val: float
:param val: value to initialize its content
:param type: type of vector (dense or sparse)
|
*Overload 6:*
creates a dense vector from a copy of a stl vector.
:type vec: std::vector< double,std::allocator< double > >
:param vec: vector to be copied
:type type: int, optional
:param type: of the vector (dense or sparse)
|
*Overload 7:*
creates a dense vector from a copy of a stl vector.
:type vec: std::vector< double,std::allocator< double > >
:param vec: vector to be copied
:param type: of the vector (dense or sparse)
|
*Overload 8:*
copy constructor
:type v: :py:class:`SiconosVector`
:param v: source vector to be copied
|
*Overload 9:*
creates a dense vector, with a copy.
:type v: DenseVect
:param v: source vector (ublas dense)
|
*Overload 10:*
creates a sparse vector, with a copy.
:type v: SparseVect
:param v: source vector (ublas sparse)
|
*Overload 11:*
creates a vector from data in a file
:type filename: string
:param filename: file name (possibly with path)
:type is_ascii: boolean
:param is_ascii: file format (true if ascii, false if binary)
|
*Overload 12:*
constructor from the concatenation of two vectors
:type v1: :py:class:`SiconosVector`
:param v1: the first vector
:type v2: :py:class:`SiconosVector`
:param v2: the second vector
|
*Overload 13:*
constructor from a BlockVector.
explicit to forbid implicit conversion/conversion constructor.
:type input: :py:class:`BlockVector`
:param input: source vector
"""
_pykernel.SiconosVector_swiginit(self, _pykernel.new_SiconosVector(*args))
__swig_destroy__ = _pykernel.delete_SiconosVector
[docs] def size(self) -> "unsigned int":
r"""
get the vector size, ie the total number of (double) elements in the vector
:rtype: int
:return: unsigned int
"""
return _pykernel.SiconosVector_size(self)
[docs] def num(self) -> "Siconos::UBLAS_TYPE":
r"""
Get the type number of the current vector.
:rtype: int
:return: an unsigned int
"""
return _pykernel.SiconosVector_num(self)
[docs] def dense(self) -> "DenseVect *":
r"""
get a pointer to the ublas embedded vector if it's type is Dense
:rtype: DenseVect
:return: a DenseVect*
"""
return _pykernel.SiconosVector_dense(self)
[docs] def sparse(self) -> "SparseVect *":
r"""
get a pointer to the ublas embedded vector if it's type is Sparse
:rtype: SparseVect
:return: a SparseVect*
"""
return _pykernel.SiconosVector_sparse(self)
[docs] def getArray(self) -> "double *":
r"""
:rtype: float
:return: the array of double values of the vector
"""
return _pykernel.SiconosVector_getArray(self)
[docs] def zero(self) -> "void":
r""" sets all the values of the vector to 0.0"""
return _pykernel.SiconosVector_zero(self)
[docs] def resize(self, size: "unsigned int", preserve: "bool"=True) -> "void":
r"""
Resize the vector. The existing elements may be preseved if specified.
:type size: int
:param size: new size of the vector
:type preserve: boolean, optional
:param preserve: true if the content of the vector must be preserved.
"""
return _pykernel.SiconosVector_resize(self, size, preserve)
[docs] def normInf(self) -> "double":
r"""
:rtype: float
:return: the infinite norm of the vector
"""
return _pykernel.SiconosVector_normInf(self)
[docs] def norm2(self) -> "double":
r"""
:rtype: float
:return: the Euclidian norm of the vector
"""
return _pykernel.SiconosVector_norm2(self)
[docs] def vector_sum(self) -> "double":
r"""
:rtype: float
:return: the sum of all elements of the vector
"""
return _pykernel.SiconosVector_vector_sum(self)
[docs] def display(self) -> "void":
r""" display vector content"""
return _pykernel.SiconosVector_display(self)
[docs] def fill(self, a: "double") -> "void":
r"""
set all values of the vector to input value.
:type a: float
:param a: input value
"""
return _pykernel.SiconosVector_fill(self, a)
[docs] def toString(self) -> "std::string":
r"""
:rtype: string
:return: the content of the vector as a string
"""
return _pykernel.SiconosVector_toString(self)
[docs] def getValue(self, i: "unsigned int") -> "double":
r"""
Get a component of the vector
:type i: int
:param i: index of the required component
:rtype: float
:return: the component value
"""
return _pykernel.SiconosVector_getValue(self, i)
[docs] def setValue(self, i: "unsigned int", value: "double") -> "void":
r"""
set a component of the vector
:type i: int
:param i: index of the required component
:type value: float
:param value: of the component
"""
return _pykernel.SiconosVector_setValue(self, i, value)
def __call__(self, i: "unsigned int") -> "double &":
r"""
get a component of the vector
:type i: int
:param i: index of the required component
:rtype: float
:return: value of the component
"""
return _pykernel.SiconosVector___call__(self, i)
[docs] def toBlock(self, vOut: "SiconosVector", sizeB: "unsigned int", startIn: "unsigned int", startOut: "unsigned int") -> "void":
r"""
copy a part of the vector into another
:type vOut: :py:class:`SiconosVector`
:param vOut: destination vector
:type sizeB: int
:param sizeB: number of the elements to copy
:type startIn: int
:param startIn: the beginning of the range of elements to copy from
:type startOut: int
:param startOut: the beginning of the destination range
"""
return _pykernel.SiconosVector_toBlock(self, vOut, sizeB, startIn, startOut)
[docs] def addBlock(self, i: "unsigned int", v: "SiconosVector") -> "void":
r"""
add the input vector to a sub-block of the current vector
:type i: int
:param i: the beginning of the destination range
:type v: :py:class:`SiconosVector`
:param v: the source vector to be added
"""
return _pykernel.SiconosVector_addBlock(self, i, v)
[docs] def subBlock(self, i: "unsigned int", v: "SiconosVector") -> "void":
r"""
subtract the input vector to a sub-block of the current vector
:type i: int
:param i: the beginning of the destination range
:type v: :py:class:`SiconosVector`
:param v: the source vector to be added
"""
return _pykernel.SiconosVector_subBlock(self, i, v)
[docs] def copyData(self, data: "double *") -> "unsigned int":
r"""
copy the vector into an array
:type data: float
:param data: the memory where to copy the data
:rtype: int
:return: the number of element written (size of the vector)
"""
return _pykernel.SiconosVector_copyData(self, data)
def __copy__(self, *args) -> "SiconosVector &":
r"""
*Overload 1:*
operator =
:type v: :py:class:`SiconosVector`
:param v: the vector to be copied
:rtype: :py:class:`SiconosVector`
:return: SiconosVector
|
*Overload 2:*
operator =
:type b: :py:class:`BlockVector`
:param b: the vector to be copied
:rtype: :py:class:`SiconosVector`
:return: SiconosVector
|
*Overload 3:*
operator =
:type v: DenseVect
:param v: the vector to be copied
:rtype: :py:class:`SiconosVector`
:return: SiconosVector
|
*Overload 4:*
operator =
:type sp: SparseVect
:param sp: the vector to be copied
:rtype: :py:class:`SiconosVector`
:return: SiconosVector
|
*Overload 5:*
operator =
:type d: float
:param d: data to put the in vector
:rtype: :py:class:`SiconosVector`
:return: SiconosVector
"""
return _pykernel.SiconosVector___copy__(self, *args)
def __iadd__(self, *args) -> "SiconosVector &":
r"""
*Overload 1:*
operator +=
:type v: :py:class:`SiconosVector`
:param v: the vector to add
:rtype: :py:class:`SiconosVector`
:return: SiconosVector
|
*Overload 2:*
operator +=
:type v: :py:class:`BlockVector`
:param v: the vector to add
:rtype: :py:class:`SiconosVector`
:return: SiconosVector
"""
return _pykernel.SiconosVector___iadd__(self, *args)
def __isub__(self, *args) -> "SiconosVector &":
r"""
*Overload 1:*
operator -=
:type v: :py:class:`SiconosVector`
:param v: the vector to subtract
:rtype: :py:class:`SiconosVector`
:return: SiconosVector
|
*Overload 2:*
operator -=
:type v: :py:class:`BlockVector`
:param v: the vector to subtract
:rtype: :py:class:`SiconosVector`
:return: SiconosVector
"""
return _pykernel.SiconosVector___isub__(self, *args)
def __str__(self) -> "std::string":
return _pykernel.SiconosVector___str__(self)
def __getitem__(self, i: "size_t") -> "PyObject *":
return _pykernel.SiconosVector___getitem__(self, i)
def __setitem__(self, i: "size_t", value: "double") -> "PyObject *":
return _pykernel.SiconosVector___setitem__(self, i, value)
def __len__(self) -> "double":
return _pykernel.SiconosVector___len__(self)
def __iter__(self) -> "SiconosVectorIterator":
return _pykernel.SiconosVector___iter__(self)
def __array__(self):
import numpy
return numpy.fromiter(self, dtype=float)
# Register SiconosVector in _pykernel:
_pykernel.SiconosVector_swigregister(SiconosVector)
def __imul__(*args) -> "SiconosVector &":
return _pykernel.__imul__(*args)
def __idiv__(*args) -> "SiconosVector &":
return _pykernel.__idiv__(*args)
def abs_wise(arg1: "SiconosVector", arg2: "SiconosVector") -> "void":
return _pykernel.abs_wise(arg1, arg2)
def getMax(arg1: "SiconosVector", arg2: "double &", arg3: "unsigned int &") -> "void":
return _pykernel.getMax(arg1, arg2, arg3)
def getMin(arg1: "SiconosVector", arg2: "double &", arg3: "unsigned int &") -> "void":
return _pykernel.getMin(arg1, arg2, arg3)
class TestDense(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __call__(self, input: "SP::SiconosVector") -> "bool":
return _pykernel.TestDense___call__(self, input)
def __init__(self):
_pykernel.TestDense_swiginit(self, _pykernel.new_TestDense())
__swig_destroy__ = _pykernel.delete_TestDense
# Register TestDense in _pykernel:
_pykernel.TestDense_swigregister(TestDense)
class SiconosVectorIterator(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
_pykernel.SiconosVectorIterator_swiginit(self, _pykernel.new_SiconosVectorIterator(*args))
def __iter__(self):
return SiconosVectorIterator(self)
def next(self) -> "PyObject *":
return _pykernel.SiconosVectorIterator_next(self)
__next__ = next
__swig_destroy__ = _pykernel.delete_SiconosVectorIterator
# Register SiconosVectorIterator in _pykernel:
_pykernel.SiconosVectorIterator_swigregister(SiconosVectorIterator)
class SiconosVectorConstIterator(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
_pykernel.SiconosVectorConstIterator_swiginit(self, _pykernel.new_SiconosVectorConstIterator(*args))
__swig_destroy__ = _pykernel.delete_SiconosVectorConstIterator
# Register SiconosVectorConstIterator in _pykernel:
_pykernel.SiconosVectorConstIterator_swigregister(SiconosVectorConstIterator)
[docs]class BlockVector(object):
r"""
"Block" vector : container (list) of SiconosVector
A block vector is a stl vector that handles pointers to SiconosVector.
Insertion of nullptr SP::SiconosVector is not allowed.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
default contructor
|
*Overload 2:*
copy contructor
:type v: :py:class:`BlockVector`
:param v: BlockVector
|
*Overload 3:*
contructor with 2 SiconosVectors
:type v1: :py:class:`SiconosVector`
:param v1: first vector
:type v2: :py:class:`SiconosVector`
:param v2: second vector
|
*Overload 4:*
contructor with a BlockVector of n (numberOfBlocks) blocks
of the same size (dim) filled with a new vector
:type numberOfBlocks: int
:param numberOfBlocks: number of blocks
:type dim: int
:param dim: dimension of the vector
|
*Overload 5:*
contructor with a BlockVector of n (numberOfBlocks) blocks that point on nullptr
:type numberOfBlocks: int
:param numberOfBlocks: number of blocks
"""
_pykernel.BlockVector_swiginit(self, _pykernel.new_BlockVector(*args))
__swig_destroy__ = _pykernel.delete_BlockVector
[docs] def size(self) -> "unsigned int":
r"""
:rtype: int
:return: the size of the vector (sum of the sizes of all its blocks)
"""
return _pykernel.BlockVector_size(self)
[docs] def begin(self) -> "VectorOfVectors::iterator":
r"""
:rtype: VectorOfVectors::iterator
:return: an iterator pointing to the first block in the container.
"""
return _pykernel.BlockVector_begin(self)
[docs] def end(self) -> "VectorOfVectors::iterator":
r"""
:rtype: VectorOfVectors::iterator
:return: an iterator referring to the past-the-end element in the container.
"""
return _pykernel.BlockVector_end(self)
[docs] def getAllVect(self) -> "VectorOfVectors":
r"""
:rtype: :py:class:`VectorOfVectors`
:return: the complete stl container
"""
return _pykernel.BlockVector_getAllVect(self)
[docs] def numberOfBlocks(self) -> "Index::size_type":
r"""
:rtype: Index::size_type
:return: the number of SiconosVectors in the container
"""
return _pykernel.BlockVector_numberOfBlocks(self)
[docs] def isDense(self) -> "bool":
r"""
:rtype: boolean
:return: true if all SiconosVector in the container are dense *
"""
return _pykernel.BlockVector_isDense(self)
[docs] def zero(self) -> "void":
r""" sets all the values of the vector to 0.0"""
return _pykernel.BlockVector_zero(self)
[docs] def fill(self, a: "double") -> "void":
r"""
set all values of the vector component to value.
:type a: float
:param a: double
"""
return _pykernel.BlockVector_fill(self, a)
[docs] def display(self) -> "void":
r""" display data on standard output"""
return _pykernel.BlockVector_display(self)
[docs] def toString(self) -> "std::string":
r"""
put data of the vector into a std::string
:rtype: string
:return: std::string
"""
return _pykernel.BlockVector_toString(self)
[docs] def getValue(self, i: "unsigned int") -> "double":
r"""
Get a component of the vector
:type i: int
:param i: index of the required component
:rtype: float
:return: the component value
"""
return _pykernel.BlockVector_getValue(self, i)
[docs] def setValue(self, i: "unsigned int", value: "double") -> "void":
r"""
set a component of the vector
:type i: int
:param i: index of the required component
:type value: float
:param value: of the component
"""
return _pykernel.BlockVector_setValue(self, i, value)
def __call__(self, i: "unsigned int") -> "double &":
r"""
get a component of the vector
:type i: int
:param i: index of the required component
:rtype: float
:return: value of the component
"""
return _pykernel.BlockVector___call__(self, i)
[docs] def vector(self, pos: "unsigned int") -> "SP::SiconosVector":
r"""
get a block (SiconosVector) of the vector
:type pos: int
:param pos: index of the required block
:rtype: :py:class:`SiconosVector`
:return: the expected block
"""
return _pykernel.BlockVector_vector(self, pos)
[docs] def setVector(self, pos: "unsigned int", v: "SiconosVector") -> "void":
r"""
set a block with a given vector (copy!)
:type pos: int
:param pos: index of the block to set
:type v: :py:class:`SiconosVector`
:param v: source vector to be copied at position i
"""
return _pykernel.BlockVector_setVector(self, pos, v)
[docs] def setVectorPtr(self, pos: "unsigned int", v: "SP::SiconosVector") -> "void":
r"""
set a block with a given vector (pointer link!)
:type pos: int
:param pos: index of the block to set
:type v: :py:class:`SiconosVector`
:param v: source vector to be inserted at position i
"""
return _pykernel.BlockVector_setVectorPtr(self, pos, v)
[docs] def setAllVect(self, v: "VectorOfVectors") -> "void":
r"""
Fill the container with a list of SiconosVector.
Warning: pointer links, no copy
:type v: :py:class:`VectorOfVectors`
:param v: the vectors to be inserted
"""
return _pykernel.BlockVector_setAllVect(self, v)
[docs] def tabIndex(self) -> "SP::Index const":
r"""
:rtype: SP::Index
:return: a pointer to the index tab
"""
return _pykernel.BlockVector_tabIndex(self)
[docs] def getNumVectorAtPos(self, pos: "unsigned int") -> "unsigned int":
r"""
get the number of the vector that handles element at position "pos"
:type pos: int
:param pos: unsigned int, position of the element
:rtype: int
:return: unsigned int number of the searched vector
"""
return _pykernel.BlockVector_getNumVectorAtPos(self, pos)
def __copy__(self, *args) -> "BlockVector &":
r"""
*Overload 1:*
Assignment operator
:type vIn: :py:class:`BlockVector`
:param vIn: the vector to be copied
:rtype: :py:class:`BlockVector`
:return: BlockVector
|
*Overload 2:*
Assignment operator
:type data: float
:param data: data to put in the BlockVector
:rtype: :py:class:`BlockVector`
:return: BlockVector
|
*Overload 3:*
Assignment operator
:type vIn: :py:class:`SiconosVector`
:param vIn: the vector to be copied
:rtype: :py:class:`BlockVector`
:return: BlockVector
"""
return _pykernel.BlockVector___copy__(self, *args)
def __iadd__(self, *args) -> "BlockVector &":
r"""
*Overload 1:*
Add in place operator
:param vIn: rhs of the operator
:rtype: :py:class:`BlockVector`
:return: BlockVector
|
*Overload 2:*
Add in place operator
:type vIn: :py:class:`SiconosVector`
:param vIn: rhs of the operator
:rtype: :py:class:`BlockVector`
:return: BlockVector
"""
return _pykernel.BlockVector___iadd__(self, *args)
def __isub__(self, *args) -> "BlockVector &":
r"""
*Overload 1:*
Subtract in place operator
:type vIn: :py:class:`BlockVector`
:param vIn: rhs of the operator
:rtype: :py:class:`BlockVector`
:return: BlockVector
|
*Overload 2:*
Subtract in place operator
:type vIn: :py:class:`SiconosVector`
:param vIn: rhs of the operator
:rtype: :py:class:`BlockVector`
:return: BlockVector
"""
return _pykernel.BlockVector___isub__(self, *args)
def __imul__(self, s: "double") -> "BlockVector &":
r"""
multiply by a scalar, result in place
:type s: float
:param s: the scalar factor
:rtype: :py:class:`BlockVector`
:return: BlockVector
"""
return _pykernel.BlockVector___imul__(self, s)
def __itruediv__(self, *args):
return _pykernel.BlockVector___idiv__(self, *args)
__idiv__ = __itruediv__
[docs] def insertPtr(self, v: "SP::SiconosVector") -> "void":
r"""
Insert a new block (no allocation and nor copy)
:type v: :py:class:`SiconosVector`
:param v: the vector to be inserted
"""
return _pykernel.BlockVector_insertPtr(self, v)
[docs] def norm2(self) -> "double":
r"""
:rtype: float
:return: the Euclidian norm of the vector
"""
return _pykernel.BlockVector_norm2(self)
[docs] def normInf(self) -> "double":
r"""
:rtype: float
:return: the infinite norm of the vector
"""
return _pykernel.BlockVector_normInf(self)
[docs] def prepareVectorForPlugin(self) -> "SP::SiconosVector":
r"""
Tranform a BlockVector into a SiconosVector.
Required for plugins, that need contiguous memory for their parameters.
:rtype: :py:class:`SiconosVector`
:return: a vector (the result depends on the number of blocks in input.
1 block : link to first component of the container, more : copy of all components into a SiconosVector)
"""
return _pykernel.BlockVector_prepareVectorForPlugin(self)
def __str__(self) -> "std::string":
return _pykernel.BlockVector___str__(self)
# Register BlockVector in _pykernel:
_pykernel.BlockVector_swigregister(BlockVector)
[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(_pykernel.Callback_env_get, _pykernel.Callback_env_set, doc=r""" general user environment""")
collectStatsIteration = property(_pykernel.Callback_collectStatsIteration_get, _pykernel.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):
_pykernel.Callback_swiginit(self, _pykernel.new_Callback())
__swig_destroy__ = _pykernel.delete_Callback
# Register Callback in _pykernel:
_pykernel.Callback_swigregister(Callback)
OPTIONS_PARAM_SIZE = _pykernel.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(_pykernel.SolverOptions_solverId_get, _pykernel.SolverOptions_solverId_set, doc=r""" id number of the solver.""")
isSet = property(_pykernel.SolverOptions_isSet_get, _pykernel.SolverOptions_isSet_set, doc=r"""
true(1) if the structure is ready to be used by a numerics
driver.
""")
iSize = property(_pykernel.SolverOptions_iSize_get, _pykernel.SolverOptions_iSize_set, doc=r""" iSize size of vector iparam""")
iparam = property(_pykernel.SolverOptions_iparam_get, _pykernel.SolverOptions_iparam_set, doc=r"""
list of solver parameters (integer type); Check solvers doc
for details.
""")
dSize = property(_pykernel.SolverOptions_dSize_get, _pykernel.SolverOptions_dSize_set, doc=r""" size of vector dparam""")
dparam = property(_pykernel.SolverOptions_dparam_get, _pykernel.SolverOptions_dparam_set, doc=r"""
list of solver parameters (double type); Check solvers
doc for details.
""")
filterOn = property(_pykernel.SolverOptions_filterOn_get, _pykernel.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(_pykernel.SolverOptions_dWorkSize_get, _pykernel.SolverOptions_dWorkSize_set, doc=r""" size of double type internal work array.""")
dWork = property(_pykernel.SolverOptions_dWork_get, _pykernel.SolverOptions_dWork_set, doc=r""" internal (double type) work array.""")
iWorkSize = property(_pykernel.SolverOptions_iWorkSize_get, _pykernel.SolverOptions_iWorkSize_set, doc=r""" size of integer type internal work array.""")
iWork = property(_pykernel.SolverOptions_iWork_get, _pykernel.SolverOptions_iWork_set, doc=r""" internal (integer type) work array.""")
numberOfInternalSolvers = property(_pykernel.SolverOptions_numberOfInternalSolvers_get, _pykernel.SolverOptions_numberOfInternalSolvers_set, doc=r"""
the number of internal or local
'sub-solvers' used by the solver (size of
internalSolvers) .
""")
internalSolvers = property(_pykernel.SolverOptions_internalSolvers_get, _pykernel.SolverOptions_internalSolvers_set, doc=r""" list of internal solver options""")
callback = property(_pykernel.SolverOptions_callback_get, _pykernel.SolverOptions_callback_set, doc=r""" pointer to user-defined callback""")
solverParameters = property(_pykernel.SolverOptions_solverParameters_get, _pykernel.SolverOptions_solverParameters_set, doc=r"""
additional parameters specific to the solver
(GAMS and NewtonMethod only)
""")
solverData = property(_pykernel.SolverOptions_solverData_get, _pykernel.SolverOptions_solverData_set, doc=r""" additional data specific to the solver""")
def __init__(self):
_pykernel.SolverOptions_swiginit(self, _pykernel.new_SolverOptions())
__swig_destroy__ = _pykernel.delete_SolverOptions
# Register SolverOptions in _pykernel:
_pykernel.SolverOptions_swigregister(SolverOptions)
SICONOS_IPARAM_MAX_ITER = _pykernel.SICONOS_IPARAM_MAX_ITER
SICONOS_IPARAM_ITER_DONE = _pykernel.SICONOS_IPARAM_ITER_DONE
SICONOS_IPARAM_PREALLOC = _pykernel.SICONOS_IPARAM_PREALLOC
SICONOS_IPARAM_NSGS_SHUFFLE = _pykernel.SICONOS_IPARAM_NSGS_SHUFFLE
SICONOS_IPARAM_ERROR_EVALUATION = _pykernel.SICONOS_IPARAM_ERROR_EVALUATION
SICONOS_IPARAM_PATHSEARCH_STACKSIZE = _pykernel.SICONOS_IPARAM_PATHSEARCH_STACKSIZE
SICONOS_ERROR_FULL_EVALUATION = _pykernel.SICONOS_ERROR_FULL_EVALUATION
r""" Complete error computation, including v computation"""
SICONOS_ERROR_LIGHT_EVALUATION = _pykernel.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 = _pykernel.SICONOS_ERROR_LIGHT_EVALUATION_NO_UPDATE
r""" only light error computation, do not update v unknown)"""
SICONOS_DPARAM_TOL = _pykernel.SICONOS_DPARAM_TOL
SICONOS_DPARAM_RESIDU = _pykernel.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 _pykernel.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 _pykernel.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 _pykernel.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 _pykernel.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 _pykernel.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 _pykernel.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 _pykernel.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 _pykernel.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 _pykernel.solver_options_set_internal_solver(options, n, NSO)
LEVELMAX = _pykernel.LEVELMAX
r"""
Internal bound max levels for time integrators.
This value may be checked to see if initialization has occured.
"""
class InteractionsGraph(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def interactions(self) -> "PyObject *":
return _pykernel.InteractionsGraph_interactions(self)
def dynamicalSystems(self) -> "PyObject *":
return _pykernel.InteractionsGraph_dynamicalSystems(self)
def __init__(self):
_pykernel.InteractionsGraph_swiginit(self, _pykernel.new_InteractionsGraph())
__swig_destroy__ = _pykernel.delete_InteractionsGraph
# Register InteractionsGraph in _pykernel:
_pykernel.InteractionsGraph_swigregister(InteractionsGraph)
class DynamicalSystemsGraph(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def interactions(self) -> "PyObject *":
return _pykernel.DynamicalSystemsGraph_interactions(self)
def dynamicalSystems(self) -> "PyObject *":
return _pykernel.DynamicalSystemsGraph_dynamicalSystems(self)
def __init__(self):
_pykernel.DynamicalSystemsGraph_swiginit(self, _pykernel.new_DynamicalSystemsGraph())
__swig_destroy__ = _pykernel.delete_DynamicalSystemsGraph
# Register DynamicalSystemsGraph in _pykernel:
_pykernel.DynamicalSystemsGraph_swigregister(DynamicalSystemsGraph)
vertex_properties = _pykernel.vertex_properties
edge_properties = _pykernel.edge_properties
graph_properties = _pykernel.graph_properties
vertex_siconos_bundle = _pykernel.vertex_siconos_bundle
edge_siconos_bundle = _pykernel.edge_siconos_bundle
class _DynamicalSystemsGraph(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
_stamp = property(_pykernel._DynamicalSystemsGraph__stamp_get, _pykernel._DynamicalSystemsGraph__stamp_set)
vertex_descriptor = property(_pykernel._DynamicalSystemsGraph_vertex_descriptor_get, _pykernel._DynamicalSystemsGraph_vertex_descriptor_set)
def __init__(self):
r""" default constructor"""
_pykernel._DynamicalSystemsGraph_swiginit(self, _pykernel.new__DynamicalSystemsGraph())
__swig_destroy__ = _pykernel.delete__DynamicalSystemsGraph
def storage(self) -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::graph_t const &":
return _pykernel._DynamicalSystemsGraph_storage(self)
def edge(self, u: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor", v: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor") -> "std::pair< SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EDescriptor,bool >":
return _pykernel._DynamicalSystemsGraph_edge(self, u, v)
def edge_exists(self, vd1: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &") -> "bool":
return _pykernel._DynamicalSystemsGraph_edge_exists(self, vd1, vd2)
def is_edge(self, vd1: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &", e_bundle: "std::shared_ptr< Interaction > const &") -> "bool":
return _pykernel._DynamicalSystemsGraph_is_edge(self, vd1, vd2, e_bundle)
def adjacent_vertex_exists(self, vd: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &") -> "bool":
return _pykernel._DynamicalSystemsGraph_adjacent_vertex_exists(self, vd)
def size(self) -> "size_t":
return _pykernel._DynamicalSystemsGraph_size(self)
def vertices_number(self) -> "size_t":
return _pykernel._DynamicalSystemsGraph_vertices_number(self)
def edges_number(self) -> "size_t":
return _pykernel._DynamicalSystemsGraph_edges_number(self)
def properties(self, *args) -> "InteractionProperties &":
return _pykernel._DynamicalSystemsGraph_properties(self, *args)
def is_vertex(self, vertex: "std::shared_ptr< DynamicalSystem > const &") -> "bool":
return _pykernel._DynamicalSystemsGraph_is_vertex(self, vertex)
def descriptor(self, vertex: "std::shared_ptr< DynamicalSystem > const &") -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &":
return _pykernel._DynamicalSystemsGraph_descriptor(self, vertex)
def vertices(self) -> "std::pair< SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VIterator,SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VIterator >":
return _pykernel._DynamicalSystemsGraph_vertices(self)
def begin(self) -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VIterator":
return _pykernel._DynamicalSystemsGraph_begin(self)
def end(self) -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VIterator":
return _pykernel._DynamicalSystemsGraph_end(self)
def adjacent_vertices(self, vd: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &") -> "std::pair< SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::AVIterator,SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::AVIterator >":
return _pykernel._DynamicalSystemsGraph_adjacent_vertices(self, vd)
def edges(self, *args) -> "std::pair< SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EIterator,SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EIterator >":
return _pykernel._DynamicalSystemsGraph_edges(self, *args)
def out_edges(self, vd: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &") -> "std::pair< SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::OEIterator,SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::OEIterator >":
return _pykernel._DynamicalSystemsGraph_out_edges(self, vd)
def target(self, ed: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EDescriptor const &") -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor":
return _pykernel._DynamicalSystemsGraph_target(self, ed)
def source(self, ed: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EDescriptor const &") -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor":
return _pykernel._DynamicalSystemsGraph_source(self, ed)
def add_vertex(self, vertex_bundle: "std::shared_ptr< DynamicalSystem > const &") -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor":
return _pykernel._DynamicalSystemsGraph_add_vertex(self, vertex_bundle)
def remove_vertex(self, vertex_bundle: "std::shared_ptr< DynamicalSystem > const &") -> "void":
return _pykernel._DynamicalSystemsGraph_remove_vertex(self, vertex_bundle)
def add_edge(self, vd1: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VDescriptor const &", e_bundle: "std::shared_ptr< Interaction > const &") -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EDescriptor":
return _pykernel._DynamicalSystemsGraph_add_edge(self, vd1, vd2, e_bundle)
def remove_edge(self, ed: "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::EDescriptor const &") -> "void":
return _pykernel._DynamicalSystemsGraph_remove_edge(self, ed)
def stamp(self) -> "int":
return _pykernel._DynamicalSystemsGraph_stamp(self)
def update_vertices_indices(self) -> "void":
return _pykernel._DynamicalSystemsGraph_update_vertices_indices(self)
def update_edges_indices(self) -> "void":
return _pykernel._DynamicalSystemsGraph_update_edges_indices(self)
def clear(self) -> "void":
return _pykernel._DynamicalSystemsGraph_clear(self)
def vertex_descriptor_map(self) -> "SiconosGraph< std::shared_ptr< DynamicalSystem >,std::shared_ptr< Interaction >,DynamicalSystemProperties,InteractionProperties,GraphProperties >::VMap":
return _pykernel._DynamicalSystemsGraph_vertex_descriptor_map(self)
def display(self) -> "void":
return _pykernel._DynamicalSystemsGraph_display(self)
# Register _DynamicalSystemsGraph in _pykernel:
_pykernel._DynamicalSystemsGraph_swigregister(_DynamicalSystemsGraph)
class SP_DynamicalSystemsGraph(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pykernel.SP_DynamicalSystemsGraph_swiginit(self, _pykernel.new_SP_DynamicalSystemsGraph())
__swig_destroy__ = _pykernel.delete_SP_DynamicalSystemsGraph
# Register SP_DynamicalSystemsGraph in _pykernel:
_pykernel.SP_DynamicalSystemsGraph_swigregister(SP_DynamicalSystemsGraph)
class _InteractionsGraph(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
_stamp = property(_pykernel._InteractionsGraph__stamp_get, _pykernel._InteractionsGraph__stamp_set)
vertex_descriptor = property(_pykernel._InteractionsGraph_vertex_descriptor_get, _pykernel._InteractionsGraph_vertex_descriptor_set)
def __init__(self):
r""" default constructor"""
_pykernel._InteractionsGraph_swiginit(self, _pykernel.new__InteractionsGraph())
__swig_destroy__ = _pykernel.delete__InteractionsGraph
def storage(self) -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::graph_t const &":
return _pykernel._InteractionsGraph_storage(self)
def edge(self, u: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor", v: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor") -> "std::pair< SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EDescriptor,bool >":
return _pykernel._InteractionsGraph_edge(self, u, v)
def edge_exists(self, vd1: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &") -> "bool":
return _pykernel._InteractionsGraph_edge_exists(self, vd1, vd2)
def is_edge(self, vd1: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &", e_bundle: "std::shared_ptr< DynamicalSystem > const &") -> "bool":
return _pykernel._InteractionsGraph_is_edge(self, vd1, vd2, e_bundle)
def adjacent_vertex_exists(self, vd: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &") -> "bool":
return _pykernel._InteractionsGraph_adjacent_vertex_exists(self, vd)
def size(self) -> "size_t":
return _pykernel._InteractionsGraph_size(self)
def vertices_number(self) -> "size_t":
return _pykernel._InteractionsGraph_vertices_number(self)
def edges_number(self) -> "size_t":
return _pykernel._InteractionsGraph_edges_number(self)
def properties(self, *args) -> "DynamicalSystemProperties &":
return _pykernel._InteractionsGraph_properties(self, *args)
def is_vertex(self, vertex: "std::shared_ptr< Interaction > const &") -> "bool":
return _pykernel._InteractionsGraph_is_vertex(self, vertex)
def descriptor(self, vertex: "std::shared_ptr< Interaction > const &") -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &":
return _pykernel._InteractionsGraph_descriptor(self, vertex)
def vertices(self) -> "std::pair< SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VIterator,SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VIterator >":
return _pykernel._InteractionsGraph_vertices(self)
def begin(self) -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VIterator":
return _pykernel._InteractionsGraph_begin(self)
def end(self) -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VIterator":
return _pykernel._InteractionsGraph_end(self)
def adjacent_vertices(self, vd: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &") -> "std::pair< SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::AVIterator,SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::AVIterator >":
return _pykernel._InteractionsGraph_adjacent_vertices(self, vd)
def edges(self, *args) -> "std::pair< SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EIterator,SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EIterator >":
return _pykernel._InteractionsGraph_edges(self, *args)
def out_edges(self, vd: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &") -> "std::pair< SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::OEIterator,SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::OEIterator >":
return _pykernel._InteractionsGraph_out_edges(self, vd)
def target(self, ed: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EDescriptor const &") -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor":
return _pykernel._InteractionsGraph_target(self, ed)
def source(self, ed: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EDescriptor const &") -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor":
return _pykernel._InteractionsGraph_source(self, ed)
def add_vertex(self, vertex_bundle: "std::shared_ptr< Interaction > const &") -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor":
return _pykernel._InteractionsGraph_add_vertex(self, vertex_bundle)
def remove_vertex(self, vertex_bundle: "std::shared_ptr< Interaction > const &") -> "void":
return _pykernel._InteractionsGraph_remove_vertex(self, vertex_bundle)
def add_edge(self, vd1: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &", vd2: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VDescriptor const &", e_bundle: "std::shared_ptr< DynamicalSystem > const &") -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EDescriptor":
return _pykernel._InteractionsGraph_add_edge(self, vd1, vd2, e_bundle)
def remove_edge(self, ed: "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::EDescriptor const &") -> "void":
return _pykernel._InteractionsGraph_remove_edge(self, ed)
def stamp(self) -> "int":
return _pykernel._InteractionsGraph_stamp(self)
def update_vertices_indices(self) -> "void":
return _pykernel._InteractionsGraph_update_vertices_indices(self)
def update_edges_indices(self) -> "void":
return _pykernel._InteractionsGraph_update_edges_indices(self)
def clear(self) -> "void":
return _pykernel._InteractionsGraph_clear(self)
def vertex_descriptor_map(self) -> "SiconosGraph< std::shared_ptr< Interaction >,std::shared_ptr< DynamicalSystem >,InteractionProperties,DynamicalSystemProperties,GraphProperties >::VMap":
return _pykernel._InteractionsGraph_vertex_descriptor_map(self)
def display(self) -> "void":
return _pykernel._InteractionsGraph_display(self)
# Register _InteractionsGraph in _pykernel:
_pykernel._InteractionsGraph_swigregister(_InteractionsGraph)
class SP_InteractionsGraph(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pykernel.SP_InteractionsGraph_swiginit(self, _pykernel.new_SP_InteractionsGraph())
__swig_destroy__ = _pykernel.delete_SP_InteractionsGraph
# Register SP_InteractionsGraph in _pykernel:
_pykernel.SP_InteractionsGraph_swigregister(SP_InteractionsGraph)
[docs]def ioMatrix_read(fileName: "std::string const &", mode: "std::string const &", m: "SiconosMatrix") -> "bool":
r"""
Read a SiconosMatrix
:type fileName: string, in
:param fileName: the name of the file to read
:type mode: string, in
:param mode: the storage type used in the file (either ascii or binary)
:type m: :py:class:`SiconosMatrix`, in/out
:param m: the SiconosMatrix to be filled
:rtype: boolean
:return: true if read ok, else false ...
"""
return _pykernel.ioMatrix_read(fileName, mode, m)
[docs]def ioMatrix_write(*args) -> "bool":
r"""
Write a SiconosMatrix
:type fileName: string, in
:param fileName: the name of the file to write in
:type mode: string, in
:param mode: the storage type used in the file (either ascii or binary)
:type m: :py:class:`SiconosMatrix`, in
:param m: the SiconosMatrix to write
:type outputType: string, in, optional
:param outputType: type of output:
- "python"(default):
row col
a00 a01 a02 ...
a10 ...
- "noDim":
a00 a01 a02 ...
a10 ...
Reading input format is the one corresponding to "python".
:rtype: boolean
:return: true if read ok, else false ...
"""
return _pykernel.ioMatrix_write(*args)
[docs]def compareRefFile(*args) -> "double":
r"""
Function to load data from a file and compare it with the provided
data. Returns the measured difference between files if the file
was loaded and the comparison was performed, which must be >= 0.0,
otherwise -1.0 is returned. Caller needs to check diff <= epsilon
to verify the result.
:type data: :py:class:`SimpleMatrix`
:param data: The data to compare against the file.
:type filename: string
:param filename: The name of the file to load and compare.
:type epsilon: float
:param epsilon: The comparison threshold.
:type index: Index, optional
:param index: An optional list of column indexes, size==0 indicates all columns.
:type ref: :py:class:`SimpleMatrix`, optional
:param ref: If provided, loaded matrix is returned in this pointer.
:type mode: string, optional
:param mode: Mode string to pass to ioMatrix::read.
:type verbose: boolean, optional
:param verbose: True to print verbose output.
:rtype: float
:return: Positive or 0.0 if the file was loaded and the comparison was performed,
otherwise -1.
"""
return _pykernel.compareRefFile(*args)
SICONOS_OSNSP_DEFAULT = _pykernel.SICONOS_OSNSP_DEFAULT
SICONOS_OSNSP_ED_SMOOTH_ACC = _pykernel.SICONOS_OSNSP_ED_SMOOTH_ACC
SICONOS_OSNSP_ED_IMPACT = _pykernel.SICONOS_OSNSP_ED_IMPACT
SICONOS_OSNSP_ED_SMOOTH_POS = _pykernel.SICONOS_OSNSP_ED_SMOOTH_POS
SICONOS_OSNSP_TS_VELOCITY = _pykernel.SICONOS_OSNSP_TS_VELOCITY
SICONOS_OSNSP_TS_POS = _pykernel.SICONOS_OSNSP_TS_POS
TD_EVENT = _pykernel.TD_EVENT
r""" Event constants"""
NS_EVENT = _pykernel.NS_EVENT
def dynamicalSystems(dsg: "SP::DynamicalSystemsGraph") -> "std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > >":
return _pykernel.dynamicalSystems(dsg)
def interactions(dsg: "SP::InteractionsGraph") -> "std::vector< SP::Interaction,std::allocator< SP::Interaction > >":
return _pykernel.interactions(dsg)
def dynamicalSystemsVector() -> "std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > >":
return _pykernel.dynamicalSystemsVector()
def graphLayout(dsg: "SP::DynamicalSystemsGraph") -> "std::vector< std::pair< SP::DynamicalSystem,SP::DynamicalSystem >,std::allocator< std::pair< SP::DynamicalSystem,SP::DynamicalSystem > > >":
return _pykernel.graphLayout(dsg)
def graphLayoutInt(dsg: "SP::DynamicalSystemsGraph") -> "std::vector< std::pair< unsigned int,unsigned int >,std::allocator< std::pair< unsigned int,unsigned int > > >":
return _pykernel.graphLayoutInt(dsg)
class graphAccess(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
graph = property(_pykernel.graphAccess_graph_get, _pykernel.graphAccess_graph_set)
vertices = property(_pykernel.graphAccess_vertices_get, _pykernel.graphAccess_vertices_set)
edges = property(_pykernel.graphAccess_edges_get, _pykernel.graphAccess_edges_set)
def update(self) -> "void":
return _pykernel.graphAccess_update(self)
def __init__(self, ig: "std::shared_ptr< _InteractionsGraph >"):
_pykernel.graphAccess_swiginit(self, _pykernel.new_graphAccess(ig))
__swig_destroy__ = _pykernel.delete_graphAccess
# Register graphAccess in _pykernel:
_pykernel.graphAccess_swigregister(graphAccess)
cvar = _pykernel.cvar
SICONOS_NB_OSNSP_TS = cvar.SICONOS_NB_OSNSP_TS
SICONOS_NB_OSNSP_TSP = cvar.SICONOS_NB_OSNSP_TSP
class __mpz_struct(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pykernel.__mpz_struct_swiginit(self, _pykernel.new___mpz_struct())
__swig_destroy__ = _pykernel.delete___mpz_struct
# Register __mpz_struct in _pykernel:
_pykernel.__mpz_struct_swigregister(__mpz_struct)
BLOCK = _pykernel.BLOCK
DENSE = _pykernel.DENSE
r""" id for dense matrix or vector"""
TRIANGULAR = _pykernel.TRIANGULAR
r""" id for triangular matrix"""
SYMMETRIC = _pykernel.SYMMETRIC
r""" id for symmetric matrix"""
SPARSE = _pykernel.SPARSE
r""" id for sparse matrix or vector"""
BANDED = _pykernel.BANDED
r""" id for banded matrix"""
ZERO = _pykernel.ZERO
r""" id for zero matrix"""
IDENTITY = _pykernel.IDENTITY
r""" id for identity matrix"""
SPARSE_COORDINATE = _pykernel.SPARSE_COORDINATE
r""" id for sparse matrix or vector"""
def axisAngleFromQuaternion(q0: "double", q1: "double", q2: "double", q3: "double", axis: "SP::SiconosVector") -> "double":
return _pykernel.axisAngleFromQuaternion(q0, q1, q2, q3, axis)
def axisAngleFromConfiguration(q: "SP::SiconosVector", axis: "SP::SiconosVector") -> "double":
return _pykernel.axisAngleFromConfiguration(q, axis)
def rotationVectorFromQuaternion(q0: "double", q1: "double", q2: "double", q3: "double", rotationVector: "SP::SiconosVector") -> "void":
return _pykernel.rotationVectorFromQuaternion(q0, q1, q2, q3, rotationVector)
def rotationVectorFromConfiguration(q: "SP::SiconosVector", rotationVector: "SP::SiconosVector") -> "void":
return _pykernel.rotationVectorFromConfiguration(q, rotationVector)
def quaternionFromAxisAngle(axis: "SP::SiconosVector", angle: "double", q: "SP::SiconosVector") -> "void":
return _pykernel.quaternionFromAxisAngle(axis, angle, q)
def quaternionFromRotationVector(rotationVector: "SP::SiconosVector", q: "SP::SiconosVector") -> "void":
return _pykernel.quaternionFromRotationVector(rotationVector, q)
def quaternionFromTwistVector(twist: "SiconosVector", q: "SiconosVector") -> "void":
return _pykernel.quaternionFromTwistVector(twist, q)
def quaternionNorm(q: "SiconosVector") -> "double":
return _pykernel.quaternionNorm(q)
def normalizeq(q: "SP::SiconosVector") -> "void":
return _pykernel.normalizeq(q)
def computeRotationMatrix(*args) -> "void":
return _pykernel.computeRotationMatrix(*args)
def computeRotationMatrixTransposed(q: "SP::SiconosVector", rotationMatrix: "SP::SimpleMatrix") -> "void":
return _pykernel.computeRotationMatrixTransposed(q, rotationMatrix)
def quaternionRotate(*args) -> "void":
return _pykernel.quaternionRotate(*args)
def changeFrameAbsToBody(*args) -> "void":
return _pykernel.changeFrameAbsToBody(*args)
def changeFrameBodyToAbs(*args) -> "void":
return _pykernel.changeFrameBodyToAbs(*args)
def compositionLawLieGroup(*args) -> "void":
return _pykernel.compositionLawLieGroup(*args)
class dspv(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self) -> "swig::SwigPyIterator *":
return _pykernel.dspv_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self) -> "bool":
return _pykernel.dspv___nonzero__(self)
def __bool__(self) -> "bool":
return _pykernel.dspv___bool__(self)
def __len__(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::size_type":
return _pykernel.dspv___len__(self)
def __getslice__(self, i: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::difference_type", j: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::difference_type") -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > >,std::allocator< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > > > *":
return _pykernel.dspv___getslice__(self, i, j)
def __setslice__(self, *args) -> "void":
return _pykernel.dspv___setslice__(self, *args)
def __delslice__(self, i: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::difference_type", j: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::difference_type") -> "void":
return _pykernel.dspv___delslice__(self, i, j)
def __delitem__(self, *args) -> "void":
return _pykernel.dspv___delitem__(self, *args)
def __getitem__(self, *args) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::value_type const &":
return _pykernel.dspv___getitem__(self, *args)
def __setitem__(self, *args) -> "void":
return _pykernel.dspv___setitem__(self, *args)
def pop(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::value_type":
return _pykernel.dspv_pop(self)
def append(self, x: "dsp") -> "void":
return _pykernel.dspv_append(self, x)
def empty(self) -> "bool":
return _pykernel.dspv_empty(self)
def size(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::size_type":
return _pykernel.dspv_size(self)
def begin(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::iterator":
return _pykernel.dspv_begin(self)
def end(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::iterator":
return _pykernel.dspv_end(self)
def rbegin(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::reverse_iterator":
return _pykernel.dspv_rbegin(self)
def rend(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::reverse_iterator":
return _pykernel.dspv_rend(self)
def clear(self) -> "void":
return _pykernel.dspv_clear(self)
def get_allocator(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::allocator_type":
return _pykernel.dspv_get_allocator(self)
def pop_back(self) -> "void":
return _pykernel.dspv_pop_back(self)
def erase(self, *args) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::iterator":
return _pykernel.dspv_erase(self, *args)
def __init__(self, *args):
_pykernel.dspv_swiginit(self, _pykernel.new_dspv(*args))
def push_back(self, x: "dsp") -> "void":
return _pykernel.dspv_push_back(self, x)
def front(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::value_type const &":
return _pykernel.dspv_front(self)
def back(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::value_type const &":
return _pykernel.dspv_back(self)
def assign(self, n: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::size_type", x: "dsp") -> "void":
return _pykernel.dspv_assign(self, n, x)
def resize(self, *args) -> "void":
return _pykernel.dspv_resize(self, *args)
def insert(self, *args) -> "void":
return _pykernel.dspv_insert(self, *args)
def reserve(self, n: "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::size_type") -> "void":
return _pykernel.dspv_reserve(self, n)
def capacity(self) -> "std::vector< std::pair< std::shared_ptr< DynamicalSystem >,std::shared_ptr< DynamicalSystem > > >::size_type":
return _pykernel.dspv_capacity(self)
__swig_destroy__ = _pykernel.delete_dspv
# Register dspv in _pykernel:
_pykernel.dspv_swigregister(dspv)
N_DOUBLE_PRECISION = cvar.N_DOUBLE_PRECISION
M_MAXSIZEFORDISPLAY = cvar.M_MAXSIZEFORDISPLAY
DEFAULT_FORMAT = cvar.DEFAULT_FORMAT
class dsiv(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self) -> "swig::SwigPyIterator *":
return _pykernel.dsiv_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self) -> "bool":
return _pykernel.dsiv___nonzero__(self)
def __bool__(self) -> "bool":
return _pykernel.dsiv___bool__(self)
def __len__(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::size_type":
return _pykernel.dsiv___len__(self)
def __getslice__(self, i: "std::vector< std::pair< unsigned int,unsigned int > >::difference_type", j: "std::vector< std::pair< unsigned int,unsigned int > >::difference_type") -> "std::vector< std::pair< unsigned int,unsigned int >,std::allocator< std::pair< unsigned int,unsigned int > > > *":
return _pykernel.dsiv___getslice__(self, i, j)
def __setslice__(self, *args) -> "void":
return _pykernel.dsiv___setslice__(self, *args)
def __delslice__(self, i: "std::vector< std::pair< unsigned int,unsigned int > >::difference_type", j: "std::vector< std::pair< unsigned int,unsigned int > >::difference_type") -> "void":
return _pykernel.dsiv___delslice__(self, i, j)
def __delitem__(self, *args) -> "void":
return _pykernel.dsiv___delitem__(self, *args)
def __getitem__(self, *args) -> "std::vector< std::pair< unsigned int,unsigned int > >::value_type const &":
return _pykernel.dsiv___getitem__(self, *args)
def __setitem__(self, *args) -> "void":
return _pykernel.dsiv___setitem__(self, *args)
def pop(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::value_type":
return _pykernel.dsiv_pop(self)
def append(self, x: "dsi") -> "void":
return _pykernel.dsiv_append(self, x)
def empty(self) -> "bool":
return _pykernel.dsiv_empty(self)
def size(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::size_type":
return _pykernel.dsiv_size(self)
def begin(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::iterator":
return _pykernel.dsiv_begin(self)
def end(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::iterator":
return _pykernel.dsiv_end(self)
def rbegin(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::reverse_iterator":
return _pykernel.dsiv_rbegin(self)
def rend(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::reverse_iterator":
return _pykernel.dsiv_rend(self)
def clear(self) -> "void":
return _pykernel.dsiv_clear(self)
def get_allocator(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::allocator_type":
return _pykernel.dsiv_get_allocator(self)
def pop_back(self) -> "void":
return _pykernel.dsiv_pop_back(self)
def erase(self, *args) -> "std::vector< std::pair< unsigned int,unsigned int > >::iterator":
return _pykernel.dsiv_erase(self, *args)
def __init__(self, *args):
_pykernel.dsiv_swiginit(self, _pykernel.new_dsiv(*args))
def push_back(self, x: "dsi") -> "void":
return _pykernel.dsiv_push_back(self, x)
def front(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::value_type const &":
return _pykernel.dsiv_front(self)
def back(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::value_type const &":
return _pykernel.dsiv_back(self)
def assign(self, n: "std::vector< std::pair< unsigned int,unsigned int > >::size_type", x: "dsi") -> "void":
return _pykernel.dsiv_assign(self, n, x)
def resize(self, *args) -> "void":
return _pykernel.dsiv_resize(self, *args)
def insert(self, *args) -> "void":
return _pykernel.dsiv_insert(self, *args)
def reserve(self, n: "std::vector< std::pair< unsigned int,unsigned int > >::size_type") -> "void":
return _pykernel.dsiv_reserve(self, n)
def capacity(self) -> "std::vector< std::pair< unsigned int,unsigned int > >::size_type":
return _pykernel.dsiv_capacity(self)
__swig_destroy__ = _pykernel.delete_dsiv
# Register dsiv in _pykernel:
_pykernel.dsiv_swigregister(dsiv)
class dsi(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
_pykernel.dsi_swiginit(self, _pykernel.new_dsi(*args))
first = property(_pykernel.dsi_first_get, _pykernel.dsi_first_set)
second = property(_pykernel.dsi_second_get, _pykernel.dsi_second_set)
def __len__(self):
return 2
def __repr__(self):
return str((self.first, self.second))
def __getitem__(self, index):
if not (index % 2):
return self.first
else:
return self.second
def __setitem__(self, index, val):
if not (index % 2):
self.first = val
else:
self.second = val
__swig_destroy__ = _pykernel.delete_dsi
# Register dsi in _pykernel:
_pykernel.dsi_swigregister(dsi)
class dsp(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
_pykernel.dsp_swiginit(self, _pykernel.new_dsp(*args))
first = property(_pykernel.dsp_first_get, _pykernel.dsp_first_set)
second = property(_pykernel.dsp_second_get, _pykernel.dsp_second_set)
def __len__(self):
return 2
def __repr__(self):
return str((self.first, self.second))
def __getitem__(self, index):
if not (index % 2):
return self.first
else:
return self.second
def __setitem__(self, index, val):
if not (index % 2):
self.first = val
else:
self.second = val
__swig_destroy__ = _pykernel.delete_dsp
# Register dsp in _pykernel:
_pykernel.dsp_swigregister(dsp)
class unsignedintv(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pykernel.unsignedintv_swiginit(self, _pykernel.new_unsignedintv())
__swig_destroy__ = _pykernel.delete_unsignedintv
# Register unsignedintv in _pykernel:
_pykernel.unsignedintv_swigregister(unsignedintv)
class MemoryContainer(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self) -> "swig::SwigPyIterator *":
return _pykernel.MemoryContainer_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self) -> "bool":
return _pykernel.MemoryContainer___nonzero__(self)
def __bool__(self) -> "bool":
return _pykernel.MemoryContainer___bool__(self)
def __len__(self) -> "std::vector< SiconosVector >::size_type":
return _pykernel.MemoryContainer___len__(self)
def __getslice__(self, i: "std::vector< SiconosVector >::difference_type", j: "std::vector< SiconosVector >::difference_type") -> "std::vector< SiconosVector,std::allocator< SiconosVector > > *":
return _pykernel.MemoryContainer___getslice__(self, i, j)
def __setslice__(self, *args) -> "void":
return _pykernel.MemoryContainer___setslice__(self, *args)
def __delslice__(self, i: "std::vector< SiconosVector >::difference_type", j: "std::vector< SiconosVector >::difference_type") -> "void":
return _pykernel.MemoryContainer___delslice__(self, i, j)
def __delitem__(self, *args) -> "void":
return _pykernel.MemoryContainer___delitem__(self, *args)
def __getitem__(self, *args) -> "std::vector< SiconosVector >::value_type const &":
return _pykernel.MemoryContainer___getitem__(self, *args)
def __setitem__(self, *args) -> "void":
return _pykernel.MemoryContainer___setitem__(self, *args)
def pop(self) -> "std::vector< SiconosVector >::value_type":
return _pykernel.MemoryContainer_pop(self)
def append(self, x: "SiconosVector") -> "void":
return _pykernel.MemoryContainer_append(self, x)
def empty(self) -> "bool":
return _pykernel.MemoryContainer_empty(self)
def size(self) -> "std::vector< SiconosVector >::size_type":
return _pykernel.MemoryContainer_size(self)
def begin(self) -> "std::vector< SiconosVector >::iterator":
return _pykernel.MemoryContainer_begin(self)
def end(self) -> "std::vector< SiconosVector >::iterator":
return _pykernel.MemoryContainer_end(self)
def rbegin(self) -> "std::vector< SiconosVector >::reverse_iterator":
return _pykernel.MemoryContainer_rbegin(self)
def rend(self) -> "std::vector< SiconosVector >::reverse_iterator":
return _pykernel.MemoryContainer_rend(self)
def clear(self) -> "void":
return _pykernel.MemoryContainer_clear(self)
def get_allocator(self) -> "std::vector< SiconosVector >::allocator_type":
return _pykernel.MemoryContainer_get_allocator(self)
def pop_back(self) -> "void":
return _pykernel.MemoryContainer_pop_back(self)
def erase(self, *args) -> "std::vector< SiconosVector >::iterator":
return _pykernel.MemoryContainer_erase(self, *args)
def __init__(self, *args):
_pykernel.MemoryContainer_swiginit(self, _pykernel.new_MemoryContainer(*args))
def push_back(self, x: "SiconosVector") -> "void":
return _pykernel.MemoryContainer_push_back(self, x)
def front(self) -> "std::vector< SiconosVector >::value_type const &":
return _pykernel.MemoryContainer_front(self)
def back(self) -> "std::vector< SiconosVector >::value_type const &":
return _pykernel.MemoryContainer_back(self)
def assign(self, n: "std::vector< SiconosVector >::size_type", x: "SiconosVector") -> "void":
return _pykernel.MemoryContainer_assign(self, n, x)
def resize(self, *args) -> "void":
return _pykernel.MemoryContainer_resize(self, *args)
def insert(self, *args) -> "void":
return _pykernel.MemoryContainer_insert(self, *args)
def reserve(self, n: "std::vector< SiconosVector >::size_type") -> "void":
return _pykernel.MemoryContainer_reserve(self, n)
def capacity(self) -> "std::vector< SiconosVector >::size_type":
return _pykernel.MemoryContainer_capacity(self)
__swig_destroy__ = _pykernel.delete_MemoryContainer
# Register MemoryContainer in _pykernel:
_pykernel.MemoryContainer_swigregister(MemoryContainer)
[docs]class SiconosMemory(MemoryContainer):
r"""
Interface to stl container of SiconosVector.
This class is used as a backup during simulation, to save vectors (e.g. state) computed during previous time steps.
- The size of the container is fixed, with a first-in first-out mechanism
used through swap method.
- All saved vectors must have the same dimension.
This class must be reviewed and backup should probably be moved to graph rather than in this object.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
creates an empty SiconosMemory.
|
*Overload 2:*
creates a SiconosMemory
:type size: int
:param size: number of elements in the container
:type vectorSize: int
:param vectorSize: size of each vector in the container
|
*Overload 3:*
creates a SiconosMemory, copy constructor
Required because of resize call in DS initMemory function.
:type mem: :py:class:`SiconosMemory`
:param mem: a SiconosMemory
"""
_pykernel.SiconosMemory_swiginit(self, _pykernel.new_SiconosMemory(*args))
__swig_destroy__ = _pykernel.delete_SiconosMemory
def __copy__(self, arg2: "SiconosMemory") -> "void":
r""" Assignment"""
return _pykernel.SiconosMemory___copy__(self, arg2)
[docs] def getSiconosVector(self, arg2: "unsigned int const") -> "SiconosVector const &":
r"""
To get SiconosVector number i of the memory
:param int: i: the position in the memory of the wanted SiconosVector
:rtype: :py:class:`SiconosVector`
:return: a SP::SiconosVector
"""
return _pykernel.SiconosMemory_getSiconosVector(self, arg2)
[docs] def getSiconosVectorMutable(self, arg2: "unsigned int const") -> "SiconosVector &":
r"""
To get SiconosVector number i of the memory as mutable reference.
Use should be avoided whenever possible.
(Used in LinearSMC::actuate)
:param int: i: the position in the memory of the wanted SiconosVector
:rtype: :py:class:`SiconosVector`
:return: a SP::SiconosVector
"""
return _pykernel.SiconosMemory_getSiconosVectorMutable(self, arg2)
[docs] def setMemorySize(self, steps: "unsigned int const", vectorSize: "unsigned int const") -> "void":
r"""
set size of the SiconosMemory (number of vectors and size of vector)
:type steps: int
:param steps: the max size for this SiconosMemory, size of the container
:type vectorSize: int
:param vectorSize: size of each vector of the container
"""
return _pykernel.SiconosMemory_setMemorySize(self, steps, vectorSize)
[docs] def nbVectorsInMemory(self) -> "MemoryContainer::size_type":
r"""
gives the numbers of SiconosVectors currently stored in the memory
:rtype: int
:return: int >= 0
"""
return _pykernel.SiconosMemory_nbVectorsInMemory(self)
[docs] def display(self) -> "void":
r""" displays the data of the memory object"""
return _pykernel.SiconosMemory_display(self)
# Register SiconosMemory in _pykernel:
_pykernel.SiconosMemory_swigregister(SiconosMemory)
[docs]class NonSmoothLaw(object):
r"""
Non Smooth Laws (NSL) Base Class
This class is the base class for all nonsmooth laws in Siconos.
A nonsmooth law characterize the (nonsmooth) relationship between 2
variables, usually designated by :math:`y` and :math:`\lambda`. :math:`y` is most
of time seen as the "input" from DynamicalSystems and is given by a Relation
linked to this nonsmoothlaw. :math:`\lambda` is then the "output" and through
the same Relation is fed back to one or more DynamicalSystem.
classical examples of nonsmooth law include:
- RelayNSL: :math:`-y \in \mathcal{N}_{[-1,1]}(\lambda)\quad \Longleftrightarrow\quad -\lambda \in \mbox{sgn} (y)`
- NormalConeNSL: given a polytope :math:`K`, :math:`-\lambda \in \partial \sigma_{-K}(y)\quad\Longleftrightarrow\quad y\in\mathcal{N}_{-K}(-\lambda)`
- ComplementarityConditionNSL: :math:`0\leq y \perp \lambda \geq 0`
- NewtonImpactNSL and NewtonImpactFrictionNSL for impact, without or with
friction
- MultipleImpactNSL for a multiple impact law
- MixedComplementarityConditionNSL
The computation of both :math:`y` and :math:`\lambda` is carried on by a solver
in Numerics through a OneStepNSProblem object.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
_size = property(_pykernel.NonSmoothLaw__size_get, _pykernel.NonSmoothLaw__size_set, doc=r""" "size" of the NonSmoothLaw""")
def __init__(self, *args):
r"""
basic constructor
:type size: int
:param size: the nonsmooth law size
"""
if self.__class__ == NonSmoothLaw:
_self = None
else:
_self = self
_pykernel.NonSmoothLaw_swiginit(self, _pykernel.new_NonSmoothLaw(_self, *args))
__swig_destroy__ = _pykernel.delete_NonSmoothLaw
[docs] def isVerified(self) -> "bool":
r"""
:rtype: boolean
:return: a boolean value which determines if the NS Law is verified.
Not implemented for the moment.
"""
return _pykernel.NonSmoothLaw_isVerified(self)
[docs] def size(self) -> "unsigned int":
r"""
:rtype: int
:return: the size of the NS law
"""
return _pykernel.NonSmoothLaw_size(self)
[docs] def display(self) -> "void":
r""" display the data of the NonSmoothLaw on the standard output"""
return _pykernel.NonSmoothLaw_display(self)
def __disown__(self):
self.this.disown()
_pykernel.disown_NonSmoothLaw(self)
return weakref.proxy(self)
# Register NonSmoothLaw in _pykernel:
_pykernel.NonSmoothLaw_swigregister(NonSmoothLaw)
[docs]class NewtonImpactNSL(NonSmoothLaw):
r"""
Newton impact Non Smooth Law
This class formalizes the Newton Impact law together with a complementarity
condition. i.e.
.. math::
\left\{\begin{array}{l}
y \geq 0, \lambda \geq 0, y^{T} \lambda=0\ \
if y \leq 0 \quad \mbox{then} \quad \dot y(t^{+}) - e \dot y(t^{-}) \geq
0, \quad \lambda \geq 0, (\dot y(t^{+}) - e \dot y(t^{-}))^{T} \lambda=0
\end{array}\right.
nsLawSize is equal to 1.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
default constructor
|
*Overload 2:*
constructor with the value of the NewtonImpactNSL attributes
:type e: float
:param e: the value of the coefficient of restitution
|
*Overload 3:*
Apply multiple-axis impact
"""
if self.__class__ == NewtonImpactNSL:
_self = None
else:
_self = self
_pykernel.NewtonImpactNSL_swiginit(self, _pykernel.new_NewtonImpactNSL(_self, *args))
__swig_destroy__ = _pykernel.delete_NewtonImpactNSL
[docs] def isVerified(self) -> "bool":
r"""
check the ns law to see if it is verified
:rtype: boolean
:return: a boolean value whioch determines if the NS Law is verified
"""
return _pykernel.NewtonImpactNSL_isVerified(self)
[docs] def e(self) -> "double":
r"""
:rtype: float
:return: the value of e
"""
return _pykernel.NewtonImpactNSL_e(self)
[docs] def setE(self, newVal: "double") -> "void":
r"""
setter of e
:type newVal: float
:param newVal: a double to set e
"""
return _pykernel.NewtonImpactNSL_setE(self, newVal)
[docs] def display(self) -> "void":
r""" print the data to the screen"""
return _pykernel.NewtonImpactNSL_display(self)
def __disown__(self):
self.this.disown()
_pykernel.disown_NewtonImpactNSL(self)
return weakref.proxy(self)
# Register NewtonImpactNSL in _pykernel:
_pykernel.NewtonImpactNSL_swigregister(NewtonImpactNSL)
[docs]class NewtonImpactFrictionNSL(NonSmoothLaw):
r""" Newton Impact-Friction Non Smooth Law"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
basic constructor
:type size: int
:param size: size of the ns law
|
*Overload 2:*
constructor with the value of the NewtonImpactFrictionNSL attributes
:type en: float
:param en: double : normal e coefficient
:type et: float
:param et: double : tangent e coefficient
:type mu: float
:param mu: double : friction coefficient
:type size: int
:param size: unsigned int: size of the ns law
"""
if self.__class__ == NewtonImpactFrictionNSL:
_self = None
else:
_self = self
_pykernel.NewtonImpactFrictionNSL_swiginit(self, _pykernel.new_NewtonImpactFrictionNSL(_self, *args))
__swig_destroy__ = _pykernel.delete_NewtonImpactFrictionNSL
[docs] def isVerified(self) -> "bool":
r"""
check the ns law to see if it is verified
:rtype: boolean
:return: a boolean value whioch determines if the NS Law is verified
"""
return _pykernel.NewtonImpactFrictionNSL_isVerified(self)
[docs] def en(self) -> "double":
r"""
:rtype: float
:return: the value of en
"""
return _pykernel.NewtonImpactFrictionNSL_en(self)
[docs] def setEn(self, newVal: "double") -> "void":
r"""
setter of en
:type newVal: float
:param newVal: a double to set en
"""
return _pykernel.NewtonImpactFrictionNSL_setEn(self, newVal)
[docs] def et(self) -> "double":
r"""
:rtype: float
:return: the value of et
"""
return _pykernel.NewtonImpactFrictionNSL_et(self)
[docs] def setEt(self, newVal: "double") -> "void":
r"""
setter of et
:type newVal: float
:param newVal: a double to set et
"""
return _pykernel.NewtonImpactFrictionNSL_setEt(self, newVal)
[docs] def mu(self) -> "double":
r"""
:rtype: float
:return: the value of mu
"""
return _pykernel.NewtonImpactFrictionNSL_mu(self)
[docs] def setMu(self, newVal: "double") -> "void":
r"""
setter of mu
:type newVal: float
:param newVal: a double to set mu
"""
return _pykernel.NewtonImpactFrictionNSL_setMu(self, newVal)
[docs] def display(self) -> "void":
r""" print the data to the screen"""
return _pykernel.NewtonImpactFrictionNSL_display(self)
def __disown__(self):
self.this.disown()
_pykernel.disown_NewtonImpactFrictionNSL(self)
return weakref.proxy(self)
# Register NewtonImpactFrictionNSL in _pykernel:
_pykernel.NewtonImpactFrictionNSL_swigregister(NewtonImpactFrictionNSL)
[docs]class NewtonImpactRollingFrictionNSL(NonSmoothLaw):
r""" Newton Impact-Friction Non Smooth Law"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
basic constructor
:type size: int
:param size: size of the ns law
|
*Overload 2:*
constructor with the value of the NewtonImpactRollingFrictionNSL
attributes :type en: float
:param en: double : normal e coefficient
:type et: float
:param et: double tangent e coefficient
:type mu: float
:param mu: double : friction coefficient
:type muR: float
:param muR: double : rolling friction coefficient
:type size: int
:param size: unsigned int: size of the ns law
"""
if self.__class__ == NewtonImpactRollingFrictionNSL:
_self = None
else:
_self = self
_pykernel.NewtonImpactRollingFrictionNSL_swiginit(self, _pykernel.new_NewtonImpactRollingFrictionNSL(_self, *args))
__swig_destroy__ = _pykernel.delete_NewtonImpactRollingFrictionNSL
[docs] def isVerified(self) -> "bool":
r"""
check the ns law to see if it is verified
:rtype: boolean
:return: a boolean value whioch determines if the NS Law is verified
"""
return _pykernel.NewtonImpactRollingFrictionNSL_isVerified(self)
[docs] def en(self) -> "double":
r"""
:rtype: float
:return: the value of en
"""
return _pykernel.NewtonImpactRollingFrictionNSL_en(self)
[docs] def setEn(self, newVal: "double") -> "void":
r"""
setter of en
:type newVal: float
:param newVal: a double to set en
"""
return _pykernel.NewtonImpactRollingFrictionNSL_setEn(self, newVal)
[docs] def et(self) -> "double":
r"""
:rtype: float
:return: the value of et
"""
return _pykernel.NewtonImpactRollingFrictionNSL_et(self)
[docs] def setEt(self, newVal: "double") -> "void":
r"""
setter of et
:type newVal: float
:param newVal: a double to set et
"""
return _pykernel.NewtonImpactRollingFrictionNSL_setEt(self, newVal)
[docs] def mu(self) -> "double":
r"""
:rtype: float
:return: the value of mu
"""
return _pykernel.NewtonImpactRollingFrictionNSL_mu(self)
[docs] def muR(self) -> "double":
r"""
:rtype: float
:return: the value of mu
"""
return _pykernel.NewtonImpactRollingFrictionNSL_muR(self)
[docs] def setMu(self, newVal: "double") -> "void":
r"""
setter of mu
:type newVal: float
:param newVal: a double to set mu
"""
return _pykernel.NewtonImpactRollingFrictionNSL_setMu(self, newVal)
[docs] def setMuR(self, newVal: "double") -> "void":
r"""
setter of muR
:type newVal: float
:param newVal: a double to set muR
"""
return _pykernel.NewtonImpactRollingFrictionNSL_setMuR(self, newVal)
[docs] def display(self) -> "void":
r""" print the data to the screen"""
return _pykernel.NewtonImpactRollingFrictionNSL_display(self)
def __disown__(self):
self.this.disown()
_pykernel.disown_NewtonImpactRollingFrictionNSL(self)
return weakref.proxy(self)
# Register NewtonImpactRollingFrictionNSL in _pykernel:
_pykernel.NewtonImpactRollingFrictionNSL_swigregister(NewtonImpactRollingFrictionNSL)
[docs]class MixedComplementarityConditionNSL(NonSmoothLaw):
r"""
Complementarity NonSmoothLaw
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, newSize: "unsigned int", equalitySize: "unsigned int"):
r"""
basic constructor
:type newSize: int
:param newSize: size of the non smooth law
:type equalitySize: int
:param equalitySize: size of the equality relation
"""
if self.__class__ == MixedComplementarityConditionNSL:
_self = None
else:
_self = self
_pykernel.MixedComplementarityConditionNSL_swiginit(self, _pykernel.new_MixedComplementarityConditionNSL(_self, newSize, equalitySize))
__swig_destroy__ = _pykernel.delete_MixedComplementarityConditionNSL
[docs] def display(self) -> "void":
r""" print the data to the screen"""
return _pykernel.MixedComplementarityConditionNSL_display(self)
[docs] def equalitySize(self) -> "unsigned int":
r"""
get the number of equality present in the MLCP
:rtype: int
:return: an unsigned int
"""
return _pykernel.MixedComplementarityConditionNSL_equalitySize(self)
def __disown__(self):
self.this.disown()
_pykernel.disown_MixedComplementarityConditionNSL(self)
return weakref.proxy(self)
# Register MixedComplementarityConditionNSL in _pykernel:
_pykernel.MixedComplementarityConditionNSL_swigregister(MixedComplementarityConditionNSL)
[docs]class ComplementarityConditionNSL(NonSmoothLaw):
r"""
Complementarity NonSmoothLaw
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, size: "unsigned int"):
r"""
basic constructor
:type size: int
:param size: of the non smooth law
"""
if self.__class__ == ComplementarityConditionNSL:
_self = None
else:
_self = self
_pykernel.ComplementarityConditionNSL_swiginit(self, _pykernel.new_ComplementarityConditionNSL(_self, size))
__swig_destroy__ = _pykernel.delete_ComplementarityConditionNSL
[docs] def display(self) -> "void":
r""" print the data to the screen"""
return _pykernel.ComplementarityConditionNSL_display(self)
def __disown__(self):
self.this.disown()
_pykernel.disown_ComplementarityConditionNSL(self)
return weakref.proxy(self)
# Register ComplementarityConditionNSL in _pykernel:
_pykernel.ComplementarityConditionNSL_swigregister(ComplementarityConditionNSL)
[docs]class EqualityConditionNSL(NonSmoothLaw):
r"""
Equality NonSmoothLaw
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, size: "unsigned int"):
r"""
basic constructor
:type size: int
:param size: of the non smooth law
"""
if self.__class__ == EqualityConditionNSL:
_self = None
else:
_self = self
_pykernel.EqualityConditionNSL_swiginit(self, _pykernel.new_EqualityConditionNSL(_self, size))
__swig_destroy__ = _pykernel.delete_EqualityConditionNSL
[docs] def display(self) -> "void":
r""" display the data of the NonSmoothLaw on the standard output"""
return _pykernel.EqualityConditionNSL_display(self)
def __disown__(self):
self.this.disown()
_pykernel.disown_EqualityConditionNSL(self)
return weakref.proxy(self)
# Register EqualityConditionNSL in _pykernel:
_pykernel.EqualityConditionNSL_swigregister(EqualityConditionNSL)
[docs]class MultipleImpactNSL(NonSmoothLaw):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
if self.__class__ == MultipleImpactNSL:
_self = None
else:
_self = self
_pykernel.MultipleImpactNSL_swiginit(self, _pykernel.new_MultipleImpactNSL(_self, *args))
__swig_destroy__ = _pykernel.delete_MultipleImpactNSL
def ResCof(self) -> "double":
return _pykernel.MultipleImpactNSL_ResCof(self)
def Stiff(self) -> "double":
return _pykernel.MultipleImpactNSL_Stiff(self)
def ElasCof(self) -> "double":
return _pykernel.MultipleImpactNSL_ElasCof(self)
def setResCof(self, newResCof: "double") -> "void":
return _pykernel.MultipleImpactNSL_setResCof(self, newResCof)
def setStiff(self, newStiff: "double") -> "void":
return _pykernel.MultipleImpactNSL_setStiff(self, newStiff)
def setElasCoeff(self, _newElasCoef: "double") -> "void":
return _pykernel.MultipleImpactNSL_setElasCoeff(self, _newElasCoef)
[docs] def isVerified(self) -> "bool":
return _pykernel.MultipleImpactNSL_isVerified(self)
[docs] def display(self) -> "void":
return _pykernel.MultipleImpactNSL_display(self)
def __disown__(self):
self.this.disown()
_pykernel.disown_MultipleImpactNSL(self)
return weakref.proxy(self)
# Register MultipleImpactNSL in _pykernel:
_pykernel.MultipleImpactNSL_swigregister(MultipleImpactNSL)
[docs]class RelayNSL(NonSmoothLaw):
r"""
Relay NonSmoothLaw
This class formalizes the Relay nonsmooth law i.e.
.. math::
-y \in \mathcal{N}_{[lb,ub]}(\lambda),
where :math:`lb` is the lower bound and :math:`ub` is the upper bound of the
Relay law.
In this default case, the lower bound is set to :math:`lb=-1` and the upper bound
ub is set to :math:`ub=1`. We get the well-known form of the RelayNSL as the
multivalued sign function, i.e.
.. math::
y \in -\mathcal{N}_{[-1,1]}(\lambda) \Longleftrightarrow \lambda \in -\mbox{sgn} (y)
where the multi-valued sign function is defined as
.. math::
\mbox{sgn} (y) =
\left\{ \begin{array}{lcl}
1 && y >0 \\
[-1,1] && y =0 \\
-1 && y <0
\end{array}\right.
TODO: Build the Sgn NonSmoothLaw as the default instance of Relay
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, size: "unsigned int", lb: "double"=-1.0, ub: "double"=1.0):
r"""
constructor with the value of the RelayNSL attributes
:type size: int
:param size: size of the NonSmoothLaw
:type lb: float, optional
:param lb: lower endpoint of the interval, default value is -1.0
:type ub: float, optional
:param ub: upper endpoint of the interval, default value is 1.0
"""
if self.__class__ == RelayNSL:
_self = None
else:
_self = self
_pykernel.RelayNSL_swiginit(self, _pykernel.new_RelayNSL(_self, size, lb, ub))
__swig_destroy__ = _pykernel.delete_RelayNSL
[docs] def isVerified(self) -> "bool":
r"""
check the ns law to see if it is verified
:rtype: boolean
:return: true if the NS Law is verified, false otherwise
"""
return _pykernel.RelayNSL_isVerified(self)
[docs] def lb(self) -> "double":
r"""
to get lb
:rtype: float
:return: the value of lb
"""
return _pykernel.RelayNSL_lb(self)
[docs] def setLb(self, lb: "double") -> "void":
r"""
to set the lower bound
:type lb: float
:param lb: the new lower bound
"""
return _pykernel.RelayNSL_setLb(self, lb)
[docs] def ub(self) -> "double":
r"""
to get ub
:rtype: float
:return: the value of ub
"""
return _pykernel.RelayNSL_ub(self)
[docs] def setUb(self, ub: "double") -> "void":
r"""
to set ub
:type ub: float
:param ub: the new upper bound
"""
return _pykernel.RelayNSL_setUb(self, ub)
[docs] def display(self) -> "void":
r""" print the data to the screen"""
return _pykernel.RelayNSL_display(self)
def __disown__(self):
self.this.disown()
_pykernel.disown_RelayNSL(self)
return weakref.proxy(self)
# Register RelayNSL in _pykernel:
_pykernel.RelayNSL_swigregister(RelayNSL)
[docs]class NormalConeNSL(NonSmoothLaw):
r"""
NormalCone NonSmoothLaw
This class formalizes a nonsmooth law in the form of a normal cone inclusion i.e.
.. math::
0 \in y + \mathcal{N}_{P}(\lambda),
where :math:`P` is a polyhedral set. This is a generalization of the RelayNSL law,
where the set :math:`P` is a scaled box. Note that there exists an inverse of the
previous relation in the form
.. math::
\lambda \in \partial \sigma_{P} (-y),
with :math:`\sigma_{P}` the support function of :math:`P` and :math:`\partial \sigma_{P}`
the subdifferential of this support function.
Note that the polyhedral set :math:`P` is described as :math:`\{\lambda\mid H \lambda \geq K\}`,
where :math:`H` is a matrix and :math:`K` a vector.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, size: "unsigned int", H: "SP::SimpleMatrix", K: "SP::SiconosVector"):
r"""
Constructor with the polyhedral representation of P as Hx >= K
:type size: int
:param size: size of the NonSmoothLaw
:type H: :py:class:`SimpleMatrix`
:param H: matrix in the (H-K)-representation of the polytope P
:type K: :py:class:`SiconosVector`
:param K: vector in the (H-K)-representation of the polytope P
"""
if self.__class__ == NormalConeNSL:
_self = None
else:
_self = self
_pykernel.NormalConeNSL_swiginit(self, _pykernel.new_NormalConeNSL(_self, size, H, K))
__swig_destroy__ = _pykernel.delete_NormalConeNSL
[docs] def H(self) -> "SimpleMatrix &":
r"""
get H
:rtype: :py:class:`SimpleMatrix`
:return: a reference to the H matrix
"""
return _pykernel.NormalConeNSL_H(self)
[docs] def K(self) -> "SiconosVector &":
r"""
get K
:rtype: :py:class:`SiconosVector`
:return: a reference to the K vector
"""
return _pykernel.NormalConeNSL_K(self)
[docs] def isVerified(self) -> "bool":
r"""
check the ns law to see if it is verified
:rtype: boolean
:return: true if the NS Law is verified, false otherwise
"""
return _pykernel.NormalConeNSL_isVerified(self)
[docs] def display(self) -> "void":
r""" print the data to the screen"""
return _pykernel.NormalConeNSL_display(self)
def __disown__(self):
self.this.disown()
_pykernel.disown_NormalConeNSL(self)
return weakref.proxy(self)
# Register NormalConeNSL in _pykernel:
_pykernel.NormalConeNSL_swigregister(NormalConeNSL)
[docs]class DynamicalSystem(object):
r"""
Abstract interface to Dynamical Systems
This class is used to describe dynamical systems of the form :
:math:`g(\dot x, x, t, z) = 0`
where
- :math:`x \in R^{n}` is the state.
- :math:`z \in R^{zSize}` is a vector of arbitrary algebraic
variables, some sort of discret state. For example, z may be used
to set some perturbation parameters, to control the system (z
set by actuators) and so on.
- :math:`g : R^{n} \times R \to R^{n}` .
By default, the DynamicalSystem is considered to be an Initial Value
Problem (IVP) and the initial conditions are given by
:math:`x(t_0)=x_0`
Under some specific conditions, the system can be written as:
:math:`\dot x = rhs(x, t, z)`
In that case, :math:`\nabla_{\dot x} g` must be invertible.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
local_buffer = _pykernel.DynamicalSystem_local_buffer
freeresidu = _pykernel.DynamicalSystem_freeresidu
free = _pykernel.DynamicalSystem_free
acce_memory = _pykernel.DynamicalSystem_acce_memory
acce_like = _pykernel.DynamicalSystem_acce_like
sizeWorkV = _pykernel.DynamicalSystem_sizeWorkV
_number = property(_pykernel.DynamicalSystem__number_get, _pykernel.DynamicalSystem__number_set, doc=r""" An id number for the DynamicalSystem""")
_n = property(_pykernel.DynamicalSystem__n_get, _pykernel.DynamicalSystem__n_set, doc=r""" the dimension of the system (*ie* size of the state vector x)""")
_x0 = property(_pykernel.DynamicalSystem__x0_get, _pykernel.DynamicalSystem__x0_set, doc=r""" initial state of the system""")
_r = property(_pykernel.DynamicalSystem__r_get, _pykernel.DynamicalSystem__r_set, doc=r"""
the input vector due to the non-smooth law :math:`r \in R^{n}`
(multiplier, force, ...)
Remarks: V.A. 17/09/2011 :
This should be a VectorOfVectors as for _x when higher relative degree
systems will be simulated
""")
_x = property(_pykernel.DynamicalSystem__x_get, _pykernel.DynamicalSystem__x_set, doc=r"""
state of the system,
:math:`x \in R^{n}` - With _x[0]= :math:`x` , _x[1]= :math:`\dot{x}` .
""")
_jacxRhs = property(_pykernel.DynamicalSystem__jacxRhs_get, _pykernel.DynamicalSystem__jacxRhs_set, doc=r""" jacobian according to x of the right-hand side (:math:`rhs = \dot x = f(x,t) + r`)""")
_z = property(_pykernel.DynamicalSystem__z_get, _pykernel.DynamicalSystem__z_set, doc=r"""
Arbitrary algebraic values vector, z, discrete state of the
system.
""")
_xMemory = property(_pykernel.DynamicalSystem__xMemory_get, doc=r""" the previous state vectors stored in memory""")
_stepsInMemory = property(_pykernel.DynamicalSystem__stepsInMemory_get, _pykernel.DynamicalSystem__stepsInMemory_set, doc=r""" number of previous states stored in memory""")
def __init__(self, *args):
r"""
*Overload 1:*
default constructor
|
*Overload 2:*
minimal constructor, from state dimension
result in :math:`\dot x = r`
:type dimension: int
:param dimension: size of the system (n)
|
*Overload 3:*
Copy constructor
:type ds: :py:class:`DynamicalSystem`
:param ds: the DynamicalSystem to copy
"""
if self.__class__ == DynamicalSystem:
_self = None
else:
_self = self
_pykernel.DynamicalSystem_swiginit(self, _pykernel.new_DynamicalSystem(_self, *args))
def _zeroPlugin(self) -> "void":
r""" Initialize all PluggedObject whether they are used or not."""
return _pykernel.DynamicalSystem__zeroPlugin(self)
def _init(self) -> "void":
r"""
Common code for constructors
should be replaced in C++11 by delegating constructors
"""
return _pykernel.DynamicalSystem__init(self)
__swig_destroy__ = _pykernel.delete_DynamicalSystem
[docs] def initRhs(self, time: "double") -> "void":
r"""
allocate (if needed) and compute rhs and its jacobian.
:type time: float
:param time: of initialization
"""
return _pykernel.DynamicalSystem_initRhs(self, time)
[docs] def update(self, time: "double") -> "void":
r"""
compute all component of the dynamical system, for the current state.
:type time: float
:param time: current time (the one used to update ds component)
"""
return _pykernel.DynamicalSystem_update(self, time)
[docs] def computeRhs(self, time: "double") -> "void":
r"""
update right-hand side for the current state
:type time: float
:param time: of interest
"""
return _pykernel.DynamicalSystem_computeRhs(self, time)
[docs] def computeJacobianRhsx(self, time: "double") -> "void":
r"""
update :math:`\nabla_x rhs` for the current state
:type time: float
:param time: of interest
"""
return _pykernel.DynamicalSystem_computeJacobianRhsx(self, time)
[docs] def resetAllNonSmoothParts(self) -> "void":
r""" reset nonsmooth part of the rhs, for all 'levels'"""
return _pykernel.DynamicalSystem_resetAllNonSmoothParts(self)
[docs] def resetNonSmoothPart(self, level: "unsigned int") -> "void":
r"""
set nonsmooth part of the rhs to zero for a given level
:type level: int
:param level:
"""
return _pykernel.DynamicalSystem_resetNonSmoothPart(self, level)
[docs] def number(self) -> "size_t":
r""" returns the id of the dynamical system"""
return _pykernel.DynamicalSystem_number(self)
[docs] def setNumber(self, new_number: "size_t") -> "size_t":
r"""
set the id of the DynamicalSystem
:rtype: int
:return: the previous value of number
"""
return _pykernel.DynamicalSystem_setNumber(self, new_number)
[docs] def n(self) -> "unsigned int":
r""" returns the size of the vector state x"""
return _pykernel.DynamicalSystem_n(self)
[docs] def dimension(self) -> "unsigned int":
r"""
returns the dimension of the system
(depends on system type, e.g. n for first order,
ndof for Lagrangian).
"""
return _pykernel.DynamicalSystem_dimension(self)
[docs] def x0(self) -> "SP::SiconosVector":
r""" returns a pointer to the initial state vector"""
return _pykernel.DynamicalSystem_x0(self)
[docs] def getX0(self) -> "SiconosVector const":
r""" get a copy of the initial state vector"""
return _pykernel.DynamicalSystem_getX0(self)
[docs] def setX0(self, newValue: "SiconosVector") -> "void":
r"""
set initial state (copy)
:type newValue: :py:class:`SiconosVector`
:param newValue: input vector to copy
"""
return _pykernel.DynamicalSystem_setX0(self, newValue)
[docs] def setX0Ptr(self, newPtr: "SP::SiconosVector") -> "void":
r"""
set initial state (pointer link)
:type newPtr: :py:class:`SiconosVector`
:param newPtr: vector (pointer) to set x0
"""
return _pykernel.DynamicalSystem_setX0Ptr(self, newPtr)
[docs] def x(self) -> "SP::SiconosVector":
r"""
returns a pointer to the state vector :math:`x`
:rtype: :py:class:`SiconosVector`
:return: SP::SiconosVector
"""
return _pykernel.DynamicalSystem_x(self)
[docs] def getx(self) -> "SiconosVector const &":
r"""
get a copy of the current state vector :math:`x`
:rtype: :py:class:`SiconosVector`
:return: SiconosVector
"""
return _pykernel.DynamicalSystem_getx(self)
[docs] def setX(self, newValue: "SiconosVector") -> "void":
r"""
set content of current state vector :math:`x`
:type newValue: :py:class:`SiconosVector`
:param newValue: SiconosVector
"""
return _pykernel.DynamicalSystem_setX(self, newValue)
[docs] def setXPtr(self, newPtr: "SP::SiconosVector") -> "void":
r"""
set state vector :math:`x` (pointer link)
:type newPtr: :py:class:`SiconosVector`
:param newPtr: SP::SiconosVector
"""
return _pykernel.DynamicalSystem_setXPtr(self, newPtr)
[docs] def r(self) -> "SP::SiconosVector":
r"""
returns a pointer to r vector (input due to nonsmooth behavior)
:rtype: :py:class:`SiconosVector`
:return: SP::SiconosVector
"""
return _pykernel.DynamicalSystem_r(self)
[docs] def getR(self) -> "SiconosVector const":
r"""
get a copy of r vector (input due to nonsmooth behavior)
:rtype: :py:class:`SiconosVector`
:return: a SiconosVector
"""
return _pykernel.DynamicalSystem_getR(self)
[docs] def setR(self, newValue: "SiconosVector") -> "void":
r"""
set r vector (input due to nonsmooth behavior) content (copy)
:type newValue: :py:class:`SiconosVector`
:param newValue: SiconosVector
"""
return _pykernel.DynamicalSystem_setR(self, newValue)
[docs] def setRPtr(self, newPtr: "SP::SiconosVector") -> "void":
r"""
set r vector (input due to nonsmooth behavior) (pointer link)
:type newPtr: :py:class:`SiconosVector`
:param newPtr: SP::SiconosVector newPtr
"""
return _pykernel.DynamicalSystem_setRPtr(self, newPtr)
[docs] def rhs(self) -> "SP::SiconosVector":
r"""
returns a pointer to the right-hand side vector, (i.e. :math:`\dot x`)
:rtype: :py:class:`SiconosVector`
:return: SP::SiconosVector
"""
return _pykernel.DynamicalSystem_rhs(self)
[docs] def getRhs(self) -> "SiconosVector &":
r"""
get a copy of the right-hand side vector, (i.e. :math:`\dot x`)
:rtype: :py:class:`SiconosVector`
:return: SiconosVector
"""
return _pykernel.DynamicalSystem_getRhs(self)
[docs] def setRhs(self, newValue: "SiconosVector") -> "void":
r"""
set the value of the right-hand side, :math:`\dot x`
:type newValue: :py:class:`SiconosVector`
:param newValue: SiconosVector
"""
return _pykernel.DynamicalSystem_setRhs(self, newValue)
[docs] def setRhsPtr(self, newPtr: "SP::SiconosVector") -> "void":
r"""
set right-hand side, :math:`\dot x` (pointer link)
:type newPtr: :py:class:`SiconosVector`
:param newPtr: SP::SiconosVector
"""
return _pykernel.DynamicalSystem_setRhsPtr(self, newPtr)
[docs] def jacobianRhsx(self) -> "SP::SiconosMatrix":
r"""
returns a pointer to :math:`\nabla_x rhs()`
:rtype: :py:class:`SiconosMatrix`
:return: SP::SiconosMatrix
"""
return _pykernel.DynamicalSystem_jacobianRhsx(self)
[docs] def setJacobianRhsx(self, newValue: "SiconosMatrix") -> "void":
r"""
set the value of :math:`\nabla_x rhs()`
:type newValue: :py:class:`SiconosMatrix`
:param newValue: SiconosMatrix
"""
return _pykernel.DynamicalSystem_setJacobianRhsx(self, newValue)
[docs] def setJacobianRhsxPtr(self, newPtr: "SP::SiconosMatrix") -> "void":
r"""
set :math:`\nabla_x rhs()`, pointer link
:type newPtr: :py:class:`SiconosMatrix`
:param newPtr: SP::SiconosMatrix
"""
return _pykernel.DynamicalSystem_setJacobianRhsxPtr(self, newPtr)
[docs] def z(self) -> "SP::SiconosVector":
r"""
returns a pointer to :math:`z`, the vector of algebraic parameters.
:rtype: :py:class:`SiconosVector`
:return: SP::SiconosVector
"""
return _pykernel.DynamicalSystem_z(self)
[docs] def getz(self) -> "SiconosVector const &":
r"""
get a copy of :math:`z`, the vector of algebraic parameters.
:rtype: :py:class:`SiconosVector`
:return: a SiconosVector
"""
return _pykernel.DynamicalSystem_getz(self)
[docs] def setz(self, newValue: "SiconosVector") -> "void":
r"""
set the value of :math:`z` (copy)
:type newValue: :py:class:`SiconosVector`
:param newValue: SiconosVector
"""
return _pykernel.DynamicalSystem_setz(self, newValue)
[docs] def setzPtr(self, newPtr: "SP::SiconosVector") -> "void":
r"""
set :math:`z` (pointer link)
:type newPtr: :py:class:`SiconosVector`
:param newPtr: SP::SiconosVector
"""
return _pykernel.DynamicalSystem_setzPtr(self, newPtr)
[docs] def xMemory(self) -> "SiconosMemory &":
r"""
get all the values of the state vector x stored in a SiconosMemory object
(not const due to LinearSMC::actuate)
:rtype: :py:class:`SiconosMemory`
:return: a reference to the SiconosMemory object
"""
return _pykernel.DynamicalSystem_xMemory(self)
[docs] def stepsInMemory(self) -> "unsigned int":
r"""
returns the number of step saved in memory for state vector
:rtype: int
:return: int
"""
return _pykernel.DynamicalSystem_stepsInMemory(self)
[docs] def setStepsInMemory(self, steps: "unsigned int") -> "void":
r"""
set number of steps to be saved
:type steps: int
:param steps:
"""
return _pykernel.DynamicalSystem_setStepsInMemory(self, steps)
[docs] def initMemory(self, steps: "unsigned int") -> "void":
r"""
initialize the SiconosMemory objects: reserve memory for i vectors in memory and reset all to zero.
:type steps: int
:param steps: the size of the SiconosMemory (i)
"""
return _pykernel.DynamicalSystem_initMemory(self, steps)
[docs] def swapInMemory(self) -> "void":
r"""
push the current values of x and r in memory (index 0 of memory is the last inserted vector)
xMemory and rMemory,
"""
return _pykernel.DynamicalSystem_swapInMemory(self)
[docs] def updatePlugins(self, time: "double") -> "void":
r"""
call all plugged functions for the current state
:type time: float
:param time: the current time
"""
return _pykernel.DynamicalSystem_updatePlugins(self, time)
[docs] @staticmethod
def resetCount(new_count: "size_t"=0) -> "size_t":
r"""
reset the global DynamicSystem counter (for ids)
:rtype: int
:return: the previous value of count
"""
return _pykernel.DynamicalSystem_resetCount(new_count)
[docs] def resetToInitialState(self) -> "void":
r""" reset the state x() to the initial state x0"""
return _pykernel.DynamicalSystem_resetToInitialState(self)
[docs] def isLinear(self) -> "bool":
r"""
:rtype: boolean
:return: true if the system is linear
"""
return _pykernel.DynamicalSystem_isLinear(self)
[docs] def display(self, brief: "bool"=True) -> "void":
r""" print the data of the dynamical system on the standard output"""
return _pykernel.DynamicalSystem_display(self, brief)
def __disown__(self):
self.this.disown()
_pykernel.disown_DynamicalSystem(self)
return weakref.proxy(self)
# Register DynamicalSystem in _pykernel:
_pykernel.DynamicalSystem_swigregister(DynamicalSystem)
[docs]def DynamicalSystem_resetCount(new_count: "size_t"=0) -> "size_t":
r"""
reset the global DynamicSystem counter (for ids)
:rtype: int
:return: the previous value of count
"""
return _pykernel.DynamicalSystem_resetCount(new_count)
[docs]class NonSmoothDynamicalSystem(object):
r"""
the NonSmoothDynamicalSystem consists in Dynamical Systems and Interactions
structured into a graph defined in a Topology.
In the DynamicalSystem graph, DynamicalSystem objects are nodes and Interaction objects
are edges.
To add a DynamicalSystem, use insertDynamicalSystem method.
To add a new Interaction, use link method.
A dual graph is also contructed, where Interactions are vertices and DynamicalSystems
are edges.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
addDynamicalSystem = _pykernel.NonSmoothDynamicalSystem_addDynamicalSystem
rmDynamicalSystem = _pykernel.NonSmoothDynamicalSystem_rmDynamicalSystem
addInteraction = _pykernel.NonSmoothDynamicalSystem_addInteraction
rmInteraction = _pykernel.NonSmoothDynamicalSystem_rmInteraction
clearTopology = _pykernel.NonSmoothDynamicalSystem_clearTopology
def __init__(self, t0: "double", T: "double"):
r"""
NSDS constructor.
:type t0: float
:param t0: initial time
:type T: float
:param T: final time
"""
_pykernel.NonSmoothDynamicalSystem_swiginit(self, _pykernel.new_NonSmoothDynamicalSystem(t0, T))
__swig_destroy__ = _pykernel.delete_NonSmoothDynamicalSystem
[docs] def currentTime(self) -> "double":
r"""
:rtype: float
:return: the current time value
"""
return _pykernel.NonSmoothDynamicalSystem_currentTime(self)
[docs] def setCurrentTime(self, newValue: "double") -> "void":
r"""
set the current time
:type newValue: float
:param newValue: the new time
"""
return _pykernel.NonSmoothDynamicalSystem_setCurrentTime(self, newValue)
[docs] def t0(self) -> "double":
r"""
:rtype: float
:return: initial time
"""
return _pykernel.NonSmoothDynamicalSystem_t0(self)
[docs] def sett0(self, newT0: "double") -> "void":
r"""
set initial time of the time discretisation
:type newT0: float
:param newT0:
"""
return _pykernel.NonSmoothDynamicalSystem_sett0(self, newT0)
[docs] def finalT(self) -> "double":
r"""
:rtype: float
:return: final time
"""
return _pykernel.NonSmoothDynamicalSystem_finalT(self)
[docs] def setT(self, newValue: "double") -> "void":
r"""
set final time
:type newValue: float
:param newValue: the new final time for the Simulatiom
"""
return _pykernel.NonSmoothDynamicalSystem_setT(self, newValue)
[docs] def title(self) -> "std::string const":
r"""
get the title of the simulation
:rtype: string
:return: std::string : the title
"""
return _pykernel.NonSmoothDynamicalSystem_title(self)
[docs] def setTitle(self, s: "std::string const &") -> "void":
r"""
set the title of the simulation
:type s: string
:param s: : the title
"""
return _pykernel.NonSmoothDynamicalSystem_setTitle(self, s)
[docs] def author(self) -> "std::string const":
r"""
get the author of the simulation
:rtype: string
:return: std::string : the author
"""
return _pykernel.NonSmoothDynamicalSystem_author(self)
[docs] def setAuthor(self, s: "std::string const &") -> "void":
r"""
set the author of the simulation
:type s: string
:param s: std::string : the author
"""
return _pykernel.NonSmoothDynamicalSystem_setAuthor(self, s)
[docs] def description(self) -> "std::string const":
r"""
allows to get the description of the simulation
:rtype: string
:return: std::string : the description
"""
return _pykernel.NonSmoothDynamicalSystem_description(self)
[docs] def setDescription(self, s: "std::string const &") -> "void":
r"""
set the author of the simulation
:type s: string
:param s: std::string : the author
"""
return _pykernel.NonSmoothDynamicalSystem_setDescription(self, s)
[docs] def date(self) -> "std::string const":
r"""
allows to get the date of the simulation
:rtype: string
:return: std::string : the date
"""
return _pykernel.NonSmoothDynamicalSystem_date(self)
[docs] def setDate(self, s: "std::string const &") -> "void":
r"""
set the date of the simulation
:type s: string
:param s: std::string : the date
"""
return _pykernel.NonSmoothDynamicalSystem_setDate(self, s)
[docs] def isBVP(self) -> "bool":
r"""
get problem type (true if BVP)
:rtype: boolean
:return: a bool
"""
return _pykernel.NonSmoothDynamicalSystem_isBVP(self)
[docs] def isIVP(self) -> "bool":
r"""
get problem type (true if IVP)
:rtype: boolean
:return: a bool
"""
return _pykernel.NonSmoothDynamicalSystem_isIVP(self)
[docs] def setBVP(self, newBvp: "bool const &") -> "void":
r"""
set the NonSmoothDynamicalSystem to BVP, else it is IVP
:type newBvp: boolean
:param newBvp: true if BVP, false otherwise
"""
return _pykernel.NonSmoothDynamicalSystem_setBVP(self, newBvp)
[docs] def changeLog(self) -> "NonSmoothDynamicalSystem::ChangeLog const &":
r"""
get a reference to the changelog for an NSDS.
:rtype: NonSmoothDynamicalSystem::ChangeLog
:return: a reference to the changelog.
"""
return _pykernel.NonSmoothDynamicalSystem_changeLog(self)
[docs] def changeLogPosition(self) -> "NonSmoothDynamicalSystem::ChangeLogIter":
r"""
get an iterator to the last item in the changelog.
:rtype: NonSmoothDynamicalSystem::ChangeLogIter
:return: an iterator pointing at the last item in the changelog.
"""
return _pykernel.NonSmoothDynamicalSystem_changeLogPosition(self)
[docs] def changeLogBegin(self) -> "NonSmoothDynamicalSystem::ChangeLogIter":
r"""
get an iterator to the beginning of the changelog.
:rtype: NonSmoothDynamicalSystem::ChangeLogIter
:return: an iterator pointing at the beginning of the changelog.
"""
return _pykernel.NonSmoothDynamicalSystem_changeLogBegin(self)
[docs] def clearChangeLogTo(self, it: "NonSmoothDynamicalSystem::ChangeLogIter const &") -> "void":
r"""
clear the changelog up to a given position.
:type it: NonSmoothDynamicalSystem::ChangeLogIter
:param it: This iterator must point to somewhere in the changelog
for this NSDS.
"""
return _pykernel.NonSmoothDynamicalSystem_clearChangeLogTo(self, it)
[docs] def getNumberOfDS(self) -> "size_t":
r"""
:rtype: int
:return: the number of Dynamical Systems present in the NSDS
"""
return _pykernel.NonSmoothDynamicalSystem_getNumberOfDS(self)
[docs] def dynamicalSystems(self) -> "SP::DynamicalSystemsGraph const":
r"""
get all the dynamical systems declared in the NonSmoothDynamicalSystem.
:rtype: :py:class:`DynamicalSystemsGraph`
:return: a SP::DynamicalSystemsGraph
"""
return _pykernel.NonSmoothDynamicalSystem_dynamicalSystems(self)
[docs] def dynamicalSystemsVector(self) -> "std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > >":
r"""
get all the dynamical systems declared in the NonSmoothDynamicalSystem.
into a std::vector<SP::DynamicalSystem>
Useful for iterates on DynamicalSystems in Python for instance
:rtype: std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > >
:return: std::vector<SP::DynamicalSystem>
"""
return _pykernel.NonSmoothDynamicalSystem_dynamicalSystemsVector(self)
[docs] def insertDynamicalSystem(self, ds: "SP::DynamicalSystem") -> "void":
r"""
add a dynamical system into the DS graph (as a vertex)
:type ds: :py:class:`DynamicalSystem`
:param ds: a pointer to the system to add
"""
return _pykernel.NonSmoothDynamicalSystem_insertDynamicalSystem(self, ds)
[docs] def dynamicalSystem(self, nb: "unsigned int") -> "SP::DynamicalSystem":
r"""
get Dynamical system number I
:type nb: int
:param nb: the identifier of the DynamicalSystem to get
:rtype: :py:class:`DynamicalSystem`
:return: a pointer on DynamicalSystem
"""
return _pykernel.NonSmoothDynamicalSystem_dynamicalSystem(self, nb)
def displayDynamicalSystems(self) -> "void":
return _pykernel.NonSmoothDynamicalSystem_displayDynamicalSystems(self)
[docs] def removeDynamicalSystem(self, ds: "SP::DynamicalSystem") -> "void":
r"""
remove a dynamical system
:type ds: :py:class:`DynamicalSystem`
:param ds: a pointer to the dynamical system to remove
"""
return _pykernel.NonSmoothDynamicalSystem_removeDynamicalSystem(self, ds)
[docs] def getNumberOfInteractions(self) -> "size_t":
r"""
get the number of Interactions present in the NSDS.
:rtype: int
:return: an unsigned int
"""
return _pykernel.NonSmoothDynamicalSystem_getNumberOfInteractions(self)
[docs] def interactions(self) -> "SP::InteractionsGraph const":
r"""
return the graph of Interactions present in the NSDS.
:rtype: :py:class:`InteractionsGraph`
:return: SP::InteractionGraph
"""
return _pykernel.NonSmoothDynamicalSystem_interactions(self)
[docs] def removeInteraction(self, inter: "SP::Interaction") -> "void":
r"""
remove an interaction to the system
:type inter: :py:class:`Interaction`
:param inter: a pointer to the interaction to remove
"""
return _pykernel.NonSmoothDynamicalSystem_removeInteraction(self, inter)
[docs] def interaction(self, *args) -> "SP::Interaction":
r"""
*Overload 1:*
get Interaction number I
:type nb: int
:param nb: the identifier of the Interaction to get
:rtype: :py:class:`Interaction`
:return: a pointer to an Interaction
|
*Overload 2:*
get Interaction named name
:type name: string
:param name: of the Interaction to get
:rtype: :py:class:`Interaction`
:return: a pointer to an Interaction
"""
return _pykernel.NonSmoothDynamicalSystem_interaction(self, *args)
[docs] def InteractionsVector(self) -> "std::vector< SP::Interaction,std::allocator< SP::Interaction > >":
r"""
get all the interactions declared in the NonSmoothDynamicalSystem.
into a std::vector<SP::Interaction>
Useful for iterates on Interaction in Python for instance
:rtype: std::vector< SP::Interaction,std::allocator< SP::Interaction > >
:return: std::vector<SP::Interaction>
"""
return _pykernel.NonSmoothDynamicalSystem_InteractionsVector(self)
[docs] def link(self, *args) -> "void":
r"""
link an interaction to two dynamical systems
:type inter: :py:class:`Interaction`
:param inter: the interaction
:type ds1: :py:class:`DynamicalSystem`
:param ds1: a DynamicalSystem
:type ds2: :py:class:`DynamicalSystem`, optional
:param ds2: a DynamicalSystem (optional)
"""
return _pykernel.NonSmoothDynamicalSystem_link(self, *args)
[docs] def setName(self, *args) -> "void":
r"""
*Overload 1:*
set the name for this Dynamical System
:type ds: :py:class:`DynamicalSystem`
:param ds: a pointer to the system
:type name: string
:param name: the name of the DynamicalSystem
|
*Overload 2:*
set the name for this Interaction
:type interaction: :py:class:`Interaction`
:param interaction: a pointer to the Interaction
:type name: string
:param name: the name of the Interaction
"""
return _pykernel.NonSmoothDynamicalSystem_setName(self, *args)
[docs] def name(self, *args) -> "std::string":
r"""
*Overload 1:*
get the name for this Dynamical System
:type ds: :py:class:`DynamicalSystem`
:param ds: a pointer to the system
:rtype: string
:return: name the name of the DynamicalSystem, or empty string if not found.
|
*Overload 2:*
get the name for this Interaction
:type inter: :py:class:`Interaction`
:param inter: a pointer to the Interaction
:rtype: string
:return: name the name of the Interaction, or empty string if not found.
"""
return _pykernel.NonSmoothDynamicalSystem_name(self, *args)
[docs] def setControlProperty(self, inter: "SP::Interaction", isControlInteraction: "bool const") -> "void":
r"""
specify id the given Interaction is for controlling the DS
:type inter: :py:class:`Interaction`
:param inter: the Interaction
:type isControlInteraction: boolean
:param isControlInteraction: true if the Interaction is used for
control purposes
"""
return _pykernel.NonSmoothDynamicalSystem_setControlProperty(self, inter, isControlInteraction)
[docs] def topology(self) -> "SP::Topology":
r"""
get the topology of the system
:rtype: :py:class:`Topology`
:return: a pointer on Topology
"""
return _pykernel.NonSmoothDynamicalSystem_topology(self)
[docs] def display(self) -> "void":
r""" display the data of the Non Smooth Dynamical System"""
return _pykernel.NonSmoothDynamicalSystem_display(self)
[docs] def isLinear(self) -> "bool":
r"""
return false is one of the interations is not linear. else
return true.
:rtype: boolean
:return: a bool
"""
return _pykernel.NonSmoothDynamicalSystem_isLinear(self)
def clear(self) -> "void":
return _pykernel.NonSmoothDynamicalSystem_clear(self)
[docs] def setSymmetric(self, val: "bool") -> "void":
r"""
set symmetry in the blocks computation
:type val: boolean
:param val: a bool
"""
return _pykernel.NonSmoothDynamicalSystem_setSymmetric(self, val)
[docs] def reset(self, *args) -> "void":
r"""
*Overload 1:*
Set all DS non-smooth part to zero.
|
*Overload 2:*
Set all DS non-smooth part to zero for a given level.
:type level: int
:param level: the level to will be zeroed
"""
return _pykernel.NonSmoothDynamicalSystem_reset(self, *args)
[docs] def swapInMemory(self) -> "void":
r""" save DynamicalSystems and Interactions states in Memories"""
return _pykernel.NonSmoothDynamicalSystem_swapInMemory(self)
[docs] def pushInteractionsInMemory(self) -> "void":
r"""
save interaction states in memories. Applied to all interactions
of the connected topology
"""
return _pykernel.NonSmoothDynamicalSystem_pushInteractionsInMemory(self)
[docs] def updateDSPlugins(self, time: "double") -> "void":
r"""
update the plugins of the DS
:type time: float
:param time: to be used for plugins
"""
return _pykernel.NonSmoothDynamicalSystem_updateDSPlugins(self, time)
[docs] def updateOutput(self, *args) -> "void":
r"""
*Overload 1:*
compute output for all the interactions for a given level
:type time: float
:param time:
:type level: int, optional
:param level: y order to be computed
|
*Overload 2:*
compute output for all the interactions and for a level range
:type time: float
:param time:
:type level_min: int
:param level_min: y min order to be computed
:type level_max: int
:param level_max: y max order to be computed
"""
return _pykernel.NonSmoothDynamicalSystem_updateOutput(self, *args)
[docs] def computeInteractionJacobians(self, *args) -> "void":
r"""
*Overload 1:*
compute Jacobians for all the interactions (in indexSet0)
:type time: float
:param time:
|
*Overload 2:*
compute Jacobians for all the interactions of a given index set
:type time: float
:param time:
:type indexSet: :py:class:`InteractionsGraph`
:param indexSet: InteractionsGraph of interest
"""
return _pykernel.NonSmoothDynamicalSystem_computeInteractionJacobians(self, *args)
[docs] def visitDynamicalSystems(self, visitor: "SP::SiconosVisitor") -> "void":
r"""
visit all dynamical systems in this system
:type visitor: SP::SiconosVisitor
:param visitor: an SP::SiconosVisitor that can visit classes derived from DS
"""
return _pykernel.NonSmoothDynamicalSystem_visitDynamicalSystems(self, visitor)
# Register NonSmoothDynamicalSystem in _pykernel:
_pykernel.NonSmoothDynamicalSystem_swigregister(NonSmoothDynamicalSystem)
[docs]class LinearComplementaritySystemsNSDS(NonSmoothDynamicalSystem):
r"""
The LinearComplementaritySystemsNSDS_H inherits frim NSDS
for a direct instanciation of a LCS
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, t0: "double", T: "double", x0: "SP::SiconosVector", A: "SP::SimpleMatrix", B: "SP::SimpleMatrix", C: "SP::SimpleMatrix", D: "SP::SimpleMatrix", a: "SP::SiconosVector", b: "SP::SiconosVector"):
r"""
constructor with t0 and T
:type t0: float
:param t0: initial time
:type T: float
:param T: final time
"""
_pykernel.LinearComplementaritySystemsNSDS_swiginit(self, _pykernel.new_LinearComplementaritySystemsNSDS(t0, T, x0, A, B, C, D, a, b))
__swig_destroy__ = _pykernel.delete_LinearComplementaritySystemsNSDS
def ds(self) -> "SP::FirstOrderLinearTIDS":
return _pykernel.LinearComplementaritySystemsNSDS_ds(self)
def relation(self) -> "SP::FirstOrderLinearTIR":
return _pykernel.LinearComplementaritySystemsNSDS_relation(self)
def nslaw(self) -> "SP::ComplementarityConditionNSL":
return _pykernel.LinearComplementaritySystemsNSDS_nslaw(self)
[docs] def interaction(self) -> "SP::Interaction":
return _pykernel.LinearComplementaritySystemsNSDS_interaction(self)
# Register LinearComplementaritySystemsNSDS in _pykernel:
_pykernel.LinearComplementaritySystemsNSDS_swigregister(LinearComplementaritySystemsNSDS)
[docs]class Topology(object):
r"""
This class describes the topology of the non-smooth dynamical
system. It holds all the "potential" Interactions".
Topology is built in NSDS constructors but initialized in
Simulation->initialize(), ie when all Interactions have been
clearly defined.
Note that indexSet0 holds all the possible relations (declared by
user) not only those which are "actives".
Construction consists in:
- link with the NSDS that owns the topology.
Initialization consists in:
- scan of all the interactions of the NSDS
- initialization of each interaction
- insertion of the relations of all the Interaction into indexSet0
Insertion of an Interaction into the set indexSet0:
addInteractionInIndexSet0(SP::Interaction inter) for each relation
of the interaction, it creates a new Interaction and inserts it
into indexSet0 It also counts the total number of "constraints" in
the system.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
r""" default constructor"""
_pykernel.Topology_swiginit(self, _pykernel.new_Topology())
__swig_destroy__ = _pykernel.delete_Topology
[docs] def hasDynamicalSystem(self, ds: "SP::DynamicalSystem") -> "bool":
r"""
check if an dynamical system is already a vertex of the DSs graph.
:type ds: :py:class:`DynamicalSystem`
:param ds: the DS to test
:rtype: boolean
:return: true if ds is in the graph
"""
return _pykernel.Topology_hasDynamicalSystem(self, ds)
[docs] def hasInteraction(self, inter: "SP::Interaction") -> "bool":
r"""
check if an interaction is already a vertex of the Interactions graph.
:type inter: :py:class:`Interaction`
:param inter: the Interaction to test
:rtype: boolean
:return: true if inter is in the graph
"""
return _pykernel.Topology_hasInteraction(self, inter)
[docs] def removeInteraction(self, inter: "SP::Interaction") -> "void":
r"""
remove an Interaction from the topology. The interaction is
removed from Dynamical Systems graph and Interactions Graph.
The interaction is not removed from actives subgraphs : see updateIndexSet
:type inter: :py:class:`Interaction`
:param inter: the interaction to remove
"""
return _pykernel.Topology_removeInteraction(self, inter)
[docs] def insertDynamicalSystem(self, ds: "SP::DynamicalSystem") -> "void":
r"""
add a dynamical system
:type ds: :py:class:`DynamicalSystem`
:param ds: the DynamicalSystem to add
"""
return _pykernel.Topology_insertDynamicalSystem(self, ds)
[docs] def removeDynamicalSystem(self, ds: "SP::DynamicalSystem") -> "void":
r"""
remove a Dynamical System from the topology. The dynamical
system is removed from Dynamical Systems graph and Interactions
Graph. The dynamical system is not removed from actives
subgraphs : see updateIndexSet
:type ds: :py:class:`DynamicalSystem`
:param ds: the dynamical system to remove
"""
return _pykernel.Topology_removeDynamicalSystem(self, ds)
[docs] def setName(self, *args) -> "void":
r"""
*Overload 1:*
set the name for this Dynamical System
:type ds: :py:class:`DynamicalSystem`
:param ds: a pointer to the system
:type name: string
:param name: the name of the DynamicalSystem
|
*Overload 2:*
set the name for an Interaction
:type inter: :py:class:`Interaction`
:param inter: a pointer to the Interaction
:type name: string
:param name: the name of the Interaction
"""
return _pykernel.Topology_setName(self, *args)
[docs] def name(self, *args) -> "std::string":
r"""
*Overload 1:*
get the name for this Dynamical System
:type ds: :py:class:`DynamicalSystem`
:param ds: a pointer to the system
:rtype: string
:return: name the name of the DynamicalSystem, or empty string if not found.
|
*Overload 2:*
get the name for this Interaction
:type inter: :py:class:`Interaction`
:param inter: a pointer to the Interaction
:rtype: string
:return: name the name of the Interaction, or empty string if not found.
"""
return _pykernel.Topology_name(self, *args)
[docs] def setOSI(self, ds: "SP::DynamicalSystem", OSI: "SP::OneStepIntegrator") -> "void":
r"""
set the OSI for this DynamicalSystem
:type ds: :py:class:`DynamicalSystem`
:param ds: the DynamicalSystem
:type OSI: :py:class:`OneStepIntegrator`
:param OSI: the integrator to use for this DS
"""
return _pykernel.Topology_setOSI(self, ds, OSI)
[docs] def link(self, *args) -> "std::pair< DynamicalSystemsGraph::EDescriptor,InteractionsGraph::VDescriptor >":
r"""
link two dynamical systems to a relation
:type inter: :py:class:`Interaction`
:param inter: a SP::Interaction
:type ds: :py:class:`DynamicalSystem`
:param ds: a SP::DynamicalSystem
:type ds2: :py:class:`DynamicalSystem`, optional
:param ds2: a SP::DynamicalSystem (optional)
:rtype: std::pair< DynamicalSystemsGraph::EDescriptor,InteractionsGraph::VDescriptor >
:return: a vertex descriptor of the new vertex in IndexSet0
"""
return _pykernel.Topology_link(self, *args)
[docs] def setControlProperty(self, inter: "SP::Interaction", isControlInteraction: "bool const") -> "void":
r"""
specify if the given Interaction is for controlling the DS
:type inter: :py:class:`Interaction`
:param inter: Interaction
:type isControlInteraction: boolean
:param isControlInteraction: true if the Interaction is used for
control purposes
"""
return _pykernel.Topology_setControlProperty(self, inter, isControlInteraction)
[docs] def indexSet0(self) -> "SP::InteractionsGraph":
r"""
get a pointer to the graph of all Interactions.
:rtype: :py:class:`InteractionsGraph`
:return: a SP::InteractionsGraph
"""
return _pykernel.Topology_indexSet0(self)
def interaction_properties(self, index: "unsigned int", inter: "SP::Interaction") -> "SP::InteractionProperties":
return _pykernel.Topology_interaction_properties(self, index, inter)
[docs] def indexSet(self, num: "unsigned int") -> "SP::InteractionsGraph":
r"""
get a pointer to the graph at level num of Interactions
:type num: int
:param num: the number of indexSet
:rtype: :py:class:`InteractionsGraph`
:return: a SP::InteractionsGraph
"""
return _pykernel.Topology_indexSet(self, num)
[docs] def numberOfIndexSet(self) -> "size_t":
r"""
get a pointer to the graph at level num of Interactions
:rtype: int
:return: a SP::InteractionsGraph
"""
return _pykernel.Topology_numberOfIndexSet(self)
[docs] def resetIndexSetPtr(self, num: "unsigned int") -> "void":
r"""
reset graph at level num of Interactions
:type num: int
:param num: the indexSet to reset
"""
return _pykernel.Topology_resetIndexSetPtr(self, num)
[docs] def dSG(self, num: "unsigned int") -> "SP::DynamicalSystemsGraph":
r"""
get a pointer to the graph at level num of Dynamical System
:type num: int
:param num: the level
:rtype: :py:class:`DynamicalSystemsGraph`
:return: a SP::DynamicalSystemsGraph
"""
return _pykernel.Topology_dSG(self, num)
[docs] def indexSetsSize(self) -> "size_t":
r"""
get the number of Interactions Graphs
:rtype: int
:return: the number of Interactions Graphs
"""
return _pykernel.Topology_indexSetsSize(self)
[docs] def indexSetSize(self, level: "unsigned int") -> "size_t":
r"""
get the size of the InteractionGraphs at a given level
:type level: int
:param level:
:rtype: int
:return: size of the InteractionGraphs at a given level
"""
return _pykernel.Topology_indexSetSize(self, level)
[docs] def indexSetsResize(self, newSize: "unsigned int") -> "void":
r"""
resize Interactions Graphs
:type newSize: int
:param newSize: the new size
"""
return _pykernel.Topology_indexSetsResize(self, newSize)
[docs] def setHasChanged(self, val: "bool const") -> "void":
r"""
set _hasChanged to val
:type val: boolean
:param val: a bool
"""
return _pykernel.Topology_setHasChanged(self, val)
[docs] def hasChanged(self) -> "bool":
r"""
check
:rtype: boolean
:return: a bool
"""
return _pykernel.Topology_hasChanged(self)
[docs] def numberOfConstraints(self) -> "unsigned int":
r"""
get the total number of scalar constraints
:rtype: int
:return: an unsigned int
"""
return _pykernel.Topology_numberOfConstraints(self)
def clear(self) -> "void":
return _pykernel.Topology_clear(self)
[docs] def setSymmetric(self, val: "bool") -> "void":
r"""
set symmetry in the blocks computation
:type val: boolean
:param val: a bool
"""
return _pykernel.Topology_setSymmetric(self, val)
[docs] def setProperties(self) -> "void":
r""" initialize graphs properties"""
return _pykernel.Topology_setProperties(self)
[docs] def displayDynamicalSystems(self) -> "void":
r""" list and display all dynamical systems"""
return _pykernel.Topology_displayDynamicalSystems(self)
[docs] def getDynamicalSystem(self, *args) -> "SP::DynamicalSystem":
r"""
*Overload 1:*
Get a dynamical system using its number
Warning: O(n) complexity
:type requiredNumber: int
:param requiredNumber: the required number
:rtype: :py:class:`DynamicalSystem`
:return: a DynamicalSystem
|
*Overload 2:*
Get a dynamical system using its name
Warning: O(n) complexity
:type name: string
:param name: the name of the dynamical system
:rtype: :py:class:`DynamicalSystem`
:return: a DynamicalSystem
"""
return _pykernel.Topology_getDynamicalSystem(self, *args)
[docs] def getInteraction(self, *args) -> "SP::Interaction":
r"""
*Overload 1:*
Get a interaction using its number
Warning: O(n) complexity
:type requiredNumber: int
:param requiredNumber: the required number
:rtype: :py:class:`Interaction`
:return: an Interaction
|
*Overload 2:*
Get a interaction using its name
Warning: O(n) complexity
:type name: string
:param name: the name of the Interaction
:rtype: :py:class:`Interaction`
:return: an Interaction pointer
"""
return _pykernel.Topology_getInteraction(self, *args)
[docs] def interactionsForDS(self, arg2: "SP::DynamicalSystem") -> "std::vector< SP::Interaction,std::allocator< SP::Interaction > >":
r"""
get Interactions for a given DS
:rtype: std::vector< SP::Interaction,std::allocator< SP::Interaction > >
:return: a vector of pointers to Interaction
"""
return _pykernel.Topology_interactionsForDS(self, arg2)
[docs] def interactionsForPairOfDS(self, *args) -> "std::vector< SP::Interaction,std::allocator< SP::Interaction > >":
r"""
get Interactions for a given pair of DSs
:rtype: std::vector< SP::Interaction,std::allocator< SP::Interaction > >
:return: a vector of pointers to Interaction
"""
return _pykernel.Topology_interactionsForPairOfDS(self, *args)
[docs] def dynamicalSystemsForInteraction(self, arg2: "SP::Interaction") -> "std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > >":
r"""
get DynamicalSystems for a given Interaction
:rtype: std::vector< SP::DynamicalSystem,std::allocator< SP::DynamicalSystem > >
:return: a vector of pointers to DynamicalSystem
"""
return _pykernel.Topology_dynamicalSystemsForInteraction(self, arg2)
[docs] def getDSG0Descriptor(self, ds: "SP::DynamicalSystem") -> "DynamicalSystemsGraph::VDescriptor":
r"""
Helper to get the descriptor in DSG0 from a DynamicalSystem
:type ds: :py:class:`DynamicalSystem`
:param ds: DynamicalSystem of which we want the descriptor
:rtype: DynamicalSystemsGraph::VDescriptor
:return: the descriptor in DSG0 from a DynamicalSystem
"""
return _pykernel.Topology_getDSG0Descriptor(self, ds)
[docs] def numberOfInvolvedDS(self, inumber: "unsigned int") -> "unsigned int":
r"""
get the number of DynamicalSystem currently involved in an indexSet
:type inumber: int
:param inumber: the indexSet number
:rtype: int
:return: the number of DynamicalSystem involved
"""
return _pykernel.Topology_numberOfInvolvedDS(self, inumber)
# Register Topology in _pykernel:
_pykernel.Topology_swigregister(Topology)
[docs]class SecondOrderDS(DynamicalSystem):
r"""
Second Order non linear dynamical systems - :math:`M(q,z) \dot v = F(v, q, t, z) + p`
This class defines and computes a generic ndof-dimensional
second order Non Linear Dynamical System of the form :
.. math::
M(q,z) \dot v = F(v, q, t, z) + p \\
\dot q = G(q,v)
where
- :math:`q \in R^{ndof}` is the set of the coordinates,
- :math:`\dot q =v \in R^{ndof}` the velocity,
- :math:`\ddot q = \dot v \in R^{ndof}` the acceleration, i. e. the second
time derivative of the generalized coordinates.
- :math:`p \in R^{ndof}` the reaction forces due to the Non Smooth Interaction.
- :math:`M(q) \in R^{ndof \times ndof}` is the inertia term (access : mass() method).
- :math:`F( \dot q , q , t) \in R^{ndof}` are the forces (access forces()
method).
- :math:`z \in R^{zSize}` is a vector of arbitrary algebraic variables, some
sort of discrete state.
q[i] is the derivative number i of q.
Thus: q[0]= :math:`q`, global coordinates, q[1]= :math:`\dot q`, velocity,
q[2]= :math:`\ddot q`, acceleration.
The following operators (and their jacobians) can be plugged, in the usual way
(see User Guide, 'User-defined plugins')
- :math:`M(q)` (computeMass())
- :math:`F(v , q , t, z)` (computeF())
If required (e.g. for Event-Driven like simulation), formulation as a
first-order system is also available, and writes:
- :math:`n= 2 ndof`
- :math:`x = \left[\begin{array}{c}q \\ \dot q\end{array}\right]`
- rhs given by:
.. math::
\dot x = \left[\begin{array}{c}
\dot q\\
\ddot q = M^{-1}(q)\left[F(v, q , t, z) + p \right]\\
\end{array}\right]
- jacobian of the rhs, with respect to x
.. math::
\nabla_{x}rhs(x,t) = \left[\begin{array}{cc}
0 & I \\
\nabla_{q}(M^{-1}(q)F(v, q , t, z)) & \nabla_{\dot q}(M^{-1}(q)F(v, q ,
t, z)) \\ \end{array}\right]
with the input due to the non smooth law:
.. math::
\left[\begin{array}{c}
0 \\
p \end{array}\right]
In that case, use the following methods:
- initRhs() to allocate/initialize memory for these new operators,
- rhs() to get the rhs vector
- computeRhs(), computeJacobianRhsx() ..., to update the content of rhs, its
jacobians ...
"""
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
_ndof = property(_pykernel.SecondOrderDS__ndof_get, _pykernel.SecondOrderDS__ndof_set, doc=r""" number of degrees of freedom of the system""")
_mass = property(_pykernel.SecondOrderDS__mass_get, _pykernel.SecondOrderDS__mass_set, doc=r""" mass of the system""")
_hasConstantMass = property(_pykernel.SecondOrderDS__hasConstantMass_get, _pykernel.SecondOrderDS__hasConstantMass_set, doc=r""" true if the mass matrix is constant""")
_inverseMass = property(_pykernel.SecondOrderDS__inverseMass_get, _pykernel.SecondOrderDS__inverseMass_set, doc=r""" inverse or factorization of the mass of the system""")
_p = property(_pykernel.SecondOrderDS__p_get, _pykernel.SecondOrderDS__p_set, doc=r"""
"Reaction", generalized forces or imuplses due to the non smooth law
The index corresponds to the kinematic
level of the corresponding constraints. It mainly depends on what the
simulation part want to store, but some rules have to be followed. For
instance :
- for the constraints at the acceleration level, _p[2] stores the reaction
forces,
- for the constraints at the veocity level, _p[1] stores the (discrete)
reaction impulse
- for the constraints at the position level, _p[0] stores the multiplier
for a constraint in position
""")
_q0 = property(_pykernel.SecondOrderDS__q0_get, _pykernel.SecondOrderDS__q0_set, doc=r""" Initial position""")
_pMemory = property(_pykernel.SecondOrderDS__pMemory_get, _pykernel.SecondOrderDS__pMemory_set, doc=r""" memory of previous generalized forces due to constraints""")
_boundaryConditions = property(_pykernel.SecondOrderDS__boundaryConditions_get, _pykernel.SecondOrderDS__boundaryConditions_set, doc=r""" Boundary condition applied to a dynamical system""")
_reactionToBoundaryConditions = property(_pykernel.SecondOrderDS__reactionToBoundaryConditions_get, _pykernel.SecondOrderDS__reactionToBoundaryConditions_set, doc=r""" Reaction to an applied boundary condition""")
__swig_destroy__ = _pykernel.delete_SecondOrderDS
[docs] def p(self, level: "unsigned int"=2) -> "SP::SiconosVector":
r"""
get p
:type level: int, optional
:param level: unsigned int, required level for p, default = 2
:rtype: :py:class:`SiconosVector`
:return: pointer on a SiconosVector
"""
return _pykernel.SecondOrderDS_p(self, level)
[docs] def mass(self) -> "SP::SiconosMatrix":
r"""
get mass matrix (pointer link)
:rtype: :py:class:`SiconosMatrix`
:return: SP::SiconosMatrix
"""
return _pykernel.SecondOrderDS_mass(self)
[docs] def inverseMass(self) -> "SP::SimpleMatrix":
r"""
get (pointer) inverse or LU-factorization of the mass,
used for LU-forward-backward computation
:rtype: :py:class:`SimpleMatrix`
:return: pointer SP::SimpleMatrix
"""
return _pykernel.SecondOrderDS_inverseMass(self)
[docs] def setMassPtr(self, newPtr: "SP::SimpleMatrix") -> "void":
r"""
set mass to pointer newPtr
:type newPtr: :py:class:`SimpleMatrix`
:param newPtr: a plugged matrix SP
"""
return _pykernel.SecondOrderDS_setMassPtr(self, newPtr)
[docs] def setRhs(self, newValue: "SiconosVector") -> "void":
r"""
set the value of the right-hand side, :math:`\dot x`
:type newValue: :py:class:`SiconosVector`
:param newValue: SiconosVector
"""
return _pykernel.SecondOrderDS_setRhs(self, newValue)
[docs] def setRhsPtr(self, newPtr: "SP::SiconosVector") -> "void":
r"""
set right-hand side, :math:`\dot x` (pointer link)
:type newPtr: :py:class:`SiconosVector`
:param newPtr: SP::SiconosVector
"""
return _pykernel.SecondOrderDS_setRhsPtr(self, newPtr)
[docs] def computeForces(self, time: "double", q: "SP::SiconosVector", velocity: "SP::SiconosVector") -> "void":
r"""
Compute :math:`F(v,q,t,z)`
:type time: float
:param time: the current time
:type q: :py:class:`SiconosVector`
:param q: SP::SiconosVector: pointers on q
:type velocity: :py:class:`SiconosVector`
:param velocity: SP::SiconosVector: pointers on velocity
"""
return _pykernel.SecondOrderDS_computeForces(self, time, q, velocity)
[docs] def computeJacobianqForces(self, time: "double") -> "void":
r"""
Compute :math:`\nabla_qF(v,q,t,z)` for current :math:`q,v`
Default function to compute forces
:type time: float
:param time: the current time
"""
return _pykernel.SecondOrderDS_computeJacobianqForces(self, time)
[docs] def computeJacobianvForces(self, time: "double") -> "void":
r"""
Compute :math:`\nabla_{\dot q}F(v,q,t,z)` for current :math:`q,v`
:type time: float
:param time: the current time
"""
return _pykernel.SecondOrderDS_computeJacobianvForces(self, time)
[docs] def dimension(self) -> "unsigned