10from sys
import version_info
as _swig_python_version_info
12if __package__
or "." in __name__:
13 from .
import libconopt4_python
15 import libconopt4_python
18 import builtins
as __builtin__
24 strthis =
"proxy of " + self.this.__repr__()
25 except __builtin__.Exception:
27 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
31 def set_instance_attr(self, name, value):
33 set(self, name, value)
34 elif name ==
"thisown":
36 elif hasattr(self, name)
and isinstance(getattr(type(self), name), property):
37 set(self, name, value)
39 raise AttributeError(
"You cannot add instance attributes to %s" % self)
40 return set_instance_attr
44 def set_class_attr(cls, name, value):
45 if hasattr(cls, name)
and not isinstance(getattr(cls, name), property):
48 raise AttributeError(
"You cannot add class attributes to %s" % cls)
53 """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
55 return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
60 """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
67 r"""Proxy of C++ swig::SwigPyIterator class."""
69 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
72 raise AttributeError(
"No constructor defined - class is abstract")
74 __swig_destroy__ = libconopt4_python.delete_SwigPyIterator
77 r"""value(SwigPyIterator self) -> PyObject *"""
78 return libconopt4_python.SwigPyIterator_value(self)
82 incr(SwigPyIterator self, size_t n=1) -> SwigPyIterator
89 return libconopt4_python.SwigPyIterator_incr(self, n)
93 decr(SwigPyIterator self, size_t n=1) -> SwigPyIterator
100 return libconopt4_python.SwigPyIterator_decr(self, n)
104 distance(SwigPyIterator self, SwigPyIterator x) -> ptrdiff_t
108 x: swig::SwigPyIterator const &
111 return libconopt4_python.SwigPyIterator_distance(self, x)
115 equal(SwigPyIterator self, SwigPyIterator x) -> bool
119 x: swig::SwigPyIterator const &
122 return libconopt4_python.SwigPyIterator_equal(self, x)
125 r"""copy(SwigPyIterator self) -> SwigPyIterator"""
126 return libconopt4_python.SwigPyIterator_copy(self)
129 r"""next(SwigPyIterator self) -> PyObject *"""
130 return libconopt4_python.SwigPyIterator_next(self)
133 r"""__next__(SwigPyIterator self) -> PyObject *"""
134 return libconopt4_python.SwigPyIterator___next__(self)
137 r"""previous(SwigPyIterator self) -> PyObject *"""
138 return libconopt4_python.SwigPyIterator_previous(self)
140 def advance(self, n):
142 advance(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator
149 return libconopt4_python.SwigPyIterator_advance(self, n)
153 __eq__(SwigPyIterator self, SwigPyIterator x) -> bool
157 x: swig::SwigPyIterator const &
160 return libconopt4_python.SwigPyIterator___eq__(self, x)
164 __ne__(SwigPyIterator self, SwigPyIterator x) -> bool
168 x: swig::SwigPyIterator const &
171 return libconopt4_python.SwigPyIterator___ne__(self, x)
173 def __iadd__(self, n):
175 __iadd__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator
182 return libconopt4_python.SwigPyIterator___iadd__(self, n)
184 def __isub__(self, n):
186 __isub__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator
193 return libconopt4_python.SwigPyIterator___isub__(self, n)
195 def __add__(self, n):
197 __add__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator
204 return libconopt4_python.SwigPyIterator___add__(self, n)
206 def __sub__(self, *args):
208 __sub__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator
214 __sub__(SwigPyIterator self, SwigPyIterator x) -> ptrdiff_t
218 x: swig::SwigPyIterator const &
221 return libconopt4_python.SwigPyIterator___sub__(self, *args)
225# Register SwigPyIterator in libconopt4_python:
226libconopt4_python.SwigPyIterator_swigregister(SwigPyIterator)
227class IntVector(object):
228 r"""Proxy of C++ std::vector< int > class."""
230 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
231 __repr__ = _swig_repr
234 r"""iterator(IntVector self) -> SwigPyIterator"""
235 return libconopt4_python.IntVector_iterator(self)
237 return self.iterator()
239 def __nonzero__(self):
240 r"""__nonzero__(IntVector self) -> bool"""
241 return libconopt4_python.IntVector___nonzero__(self)
244 r"""__bool__(IntVector self) -> bool"""
245 return libconopt4_python.IntVector___bool__(self)
248 r"""__len__(IntVector self) -> std::vector< int >::size_type"""
249 return libconopt4_python.IntVector___len__(self)
251 def __getslice__(self, i, j):
253 __getslice__(IntVector self, std::vector< int >::difference_type i, std::vector< int >::difference_type j) -> IntVector
257 i: std::vector< int >::difference_type
258 j: std::vector< int >::difference_type
261 return libconopt4_python.IntVector___getslice__(self, i, j)
263 def __setslice__(self, *args):
265 __setslice__(IntVector self, std::vector< int >::difference_type i, std::vector< int >::difference_type j)
269 i: std::vector< int >::difference_type
270 j: std::vector< int >::difference_type
272 __setslice__(IntVector self, std::vector< int >::difference_type i, std::vector< int >::difference_type j, IntVector v)
276 i: std::vector< int >::difference_type
277 j: std::vector< int >::difference_type
278 v: std::vector< int,std::allocator< int > > const &
281 return libconopt4_python.IntVector___setslice__(self, *args)
283 def __delslice__(self, i, j):
285 __delslice__(IntVector self, std::vector< int >::difference_type i, std::vector< int >::difference_type j)
289 i: std::vector< int >::difference_type
290 j: std::vector< int >::difference_type
293 return libconopt4_python.IntVector___delslice__(self, i, j)
295 def __delitem__(self, *args):
297 __delitem__(IntVector self, std::vector< int >::difference_type i)
301 i: std::vector< int >::difference_type
303 __delitem__(IntVector self, SWIGPY_SLICEOBJECT * slice)
307 slice: SWIGPY_SLICEOBJECT *
310 return libconopt4_python.IntVector___delitem__(self, *args)
312 def __getitem__(self, *args):
314 __getitem__(IntVector self, SWIGPY_SLICEOBJECT * slice) -> IntVector
318 slice: SWIGPY_SLICEOBJECT *
320 __getitem__(IntVector self, std::vector< int >::difference_type i) -> std::vector< int >::value_type const &
324 i: std::vector< int >::difference_type
327 return libconopt4_python.IntVector___getitem__(self, *args)
329 def __setitem__(self, *args):
331 __setitem__(IntVector self, SWIGPY_SLICEOBJECT * slice, IntVector v)
335 slice: SWIGPY_SLICEOBJECT *
336 v: std::vector< int,std::allocator< int > > const &
338 __setitem__(IntVector self, SWIGPY_SLICEOBJECT * slice)
342 slice: SWIGPY_SLICEOBJECT *
344 __setitem__(IntVector self, std::vector< int >::difference_type i, std::vector< int >::value_type const & x)
348 i: std::vector< int >::difference_type
349 x: std::vector< int >::value_type const &
352 return libconopt4_python.IntVector___setitem__(self, *args)
355 r"""pop(IntVector self) -> std::vector< int >::value_type"""
356 return libconopt4_python.IntVector_pop(self)
360 append(IntVector self, std::vector< int >::value_type const & x)
364 x: std::vector< int >::value_type const &
367 return libconopt4_python.IntVector_append(self, x)
370 r"""empty(IntVector self) -> bool"""
371 return libconopt4_python.IntVector_empty(self)
374 r"""size(IntVector self) -> std::vector< int >::size_type"""
375 return libconopt4_python.IntVector_size(self)
379 swap(IntVector self, IntVector v)
383 v: std::vector< int > &
386 return libconopt4_python.IntVector_swap(self, v)
389 r"""begin(IntVector self) -> std::vector< int >::iterator"""
390 return libconopt4_python.IntVector_begin(self)
393 r"""end(IntVector self) -> std::vector< int >::iterator"""
394 return libconopt4_python.IntVector_end(self)
397 r"""rbegin(IntVector self) -> std::vector< int >::reverse_iterator"""
398 return libconopt4_python.IntVector_rbegin(self)
401 r"""rend(IntVector self) -> std::vector< int >::reverse_iterator"""
402 return libconopt4_python.IntVector_rend(self)
405 r"""clear(IntVector self)"""
406 return libconopt4_python.IntVector_clear(self)
408 def get_allocator(self):
409 r"""get_allocator(IntVector self) -> std::vector< int >::allocator_type"""
410 return libconopt4_python.IntVector_get_allocator(self)
413 r"""pop_back(IntVector self)"""
414 return libconopt4_python.IntVector_pop_back(self)
416 def erase(self, *args):
418 erase(IntVector self, std::vector< int >::iterator pos) -> std::vector< int >::iterator
422 pos: std::vector< int >::iterator
424 erase(IntVector self, std::vector< int >::iterator first, std::vector< int >::iterator last) -> std::vector< int >::iterator
428 first: std::vector< int >::iterator
429 last: std::vector< int >::iterator
432 return libconopt4_python.IntVector_erase(self, *args)
434 def __init__(self, *args):
436 __init__(IntVector self) -> IntVector
437 __init__(IntVector self, IntVector other) -> IntVector
441 other: std::vector< int > const &
443 __init__(IntVector self, std::vector< int >::size_type size) -> IntVector
447 size: std::vector< int >::size_type
449 __init__(IntVector self, std::vector< int >::size_type size, std::vector< int >::value_type const & value) -> IntVector
453 size: std::vector< int >::size_type
454 value: std::vector< int >::value_type const &
457 libconopt4_python.IntVector_swiginit(self, libconopt4_python.new_IntVector(*args))
459 def push_back(self, x):
461 push_back(IntVector self, std::vector< int >::value_type const & x)
465 x: std::vector< int >::value_type const &
468 return libconopt4_python.IntVector_push_back(self, x)
471 r"""front(IntVector self) -> std::vector< int >::value_type const &"""
472 return libconopt4_python.IntVector_front(self)
475 r"""back(IntVector self) -> std::vector< int >::value_type const &"""
476 return libconopt4_python.IntVector_back(self)
478 def assign(self, n, x):
480 assign(IntVector self, std::vector< int >::size_type n, std::vector< int >::value_type const & x)
484 n: std::vector< int >::size_type
485 x: std::vector< int >::value_type const &
488 return libconopt4_python.IntVector_assign(self, n, x)
490 def resize(self, *args):
492 resize(IntVector self, std::vector< int >::size_type new_size)
496 new_size: std::vector< int >::size_type
498 resize(IntVector self, std::vector< int >::size_type new_size, std::vector< int >::value_type const & x)
502 new_size: std::vector< int >::size_type
503 x: std::vector< int >::value_type const &
506 return libconopt4_python.IntVector_resize(self, *args)
508 def insert(self, *args):
510 insert(IntVector self, std::vector< int >::iterator pos, std::vector< int >::value_type const & x) -> std::vector< int >::iterator
514 pos: std::vector< int >::iterator
515 x: std::vector< int >::value_type const &
517 insert(IntVector self, std::vector< int >::iterator pos, std::vector< int >::size_type n, std::vector< int >::value_type const & x)
521 pos: std::vector< int >::iterator
522 n: std::vector< int >::size_type
523 x: std::vector< int >::value_type const &
526 return libconopt4_python.IntVector_insert(self, *args)
528 def reserve(self, n):
530 reserve(IntVector self, std::vector< int >::size_type n)
534 n: std::vector< int >::size_type
537 return libconopt4_python.IntVector_reserve(self, n)
540 r"""capacity(IntVector self) -> std::vector< int >::size_type"""
541 return libconopt4_python.IntVector_capacity(self)
542 __swig_destroy__ = libconopt4_python.delete_IntVector
544# Register IntVector in libconopt4_python:
545libconopt4_python.IntVector_swigregister(IntVector)
546class DoubleVector(object):
547 r"""Proxy of C++ std::vector< double > class."""
549 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
550 __repr__ = _swig_repr
553 r"""iterator(DoubleVector self) -> SwigPyIterator"""
554 return libconopt4_python.DoubleVector_iterator(self)
556 return self.iterator()
558 def __nonzero__(self):
559 r"""__nonzero__(DoubleVector self) -> bool"""
560 return libconopt4_python.DoubleVector___nonzero__(self)
563 r"""__bool__(DoubleVector self) -> bool"""
564 return libconopt4_python.DoubleVector___bool__(self)
567 r"""__len__(DoubleVector self) -> std::vector< double >::size_type"""
568 return libconopt4_python.DoubleVector___len__(self)
570 def __getslice__(self, i, j):
572 __getslice__(DoubleVector self, std::vector< double >::difference_type i, std::vector< double >::difference_type j) -> DoubleVector
576 i: std::vector< double >::difference_type
577 j: std::vector< double >::difference_type
580 return libconopt4_python.DoubleVector___getslice__(self, i, j)
582 def __setslice__(self, *args):
584 __setslice__(DoubleVector self, std::vector< double >::difference_type i, std::vector< double >::difference_type j)
588 i: std::vector< double >::difference_type
589 j: std::vector< double >::difference_type
591 __setslice__(DoubleVector self, std::vector< double >::difference_type i, std::vector< double >::difference_type j, DoubleVector v)
595 i: std::vector< double >::difference_type
596 j: std::vector< double >::difference_type
597 v: std::vector< double,std::allocator< double > > const &
600 return libconopt4_python.DoubleVector___setslice__(self, *args)
602 def __delslice__(self, i, j):
604 __delslice__(DoubleVector self, std::vector< double >::difference_type i, std::vector< double >::difference_type j)
608 i: std::vector< double >::difference_type
609 j: std::vector< double >::difference_type
612 return libconopt4_python.DoubleVector___delslice__(self, i, j)
614 def __delitem__(self, *args):
616 __delitem__(DoubleVector self, std::vector< double >::difference_type i)
620 i: std::vector< double >::difference_type
622 __delitem__(DoubleVector self, SWIGPY_SLICEOBJECT * slice)
626 slice: SWIGPY_SLICEOBJECT *
629 return libconopt4_python.DoubleVector___delitem__(self, *args)
631 def __getitem__(self, *args):
633 __getitem__(DoubleVector self, SWIGPY_SLICEOBJECT * slice) -> DoubleVector
637 slice: SWIGPY_SLICEOBJECT *
639 __getitem__(DoubleVector self, std::vector< double >::difference_type i) -> std::vector< double >::value_type const &
643 i: std::vector< double >::difference_type
646 return libconopt4_python.DoubleVector___getitem__(self, *args)
648 def __setitem__(self, *args):
650 __setitem__(DoubleVector self, SWIGPY_SLICEOBJECT * slice, DoubleVector v)
654 slice: SWIGPY_SLICEOBJECT *
655 v: std::vector< double,std::allocator< double > > const &
657 __setitem__(DoubleVector self, SWIGPY_SLICEOBJECT * slice)
661 slice: SWIGPY_SLICEOBJECT *
663 __setitem__(DoubleVector self, std::vector< double >::difference_type i, std::vector< double >::value_type const & x)
667 i: std::vector< double >::difference_type
668 x: std::vector< double >::value_type const &
671 return libconopt4_python.DoubleVector___setitem__(self, *args)
674 r"""pop(DoubleVector self) -> std::vector< double >::value_type"""
675 return libconopt4_python.DoubleVector_pop(self)
679 append(DoubleVector self, std::vector< double >::value_type const & x)
683 x: std::vector< double >::value_type const &
686 return libconopt4_python.DoubleVector_append(self, x)
689 r"""empty(DoubleVector self) -> bool"""
690 return libconopt4_python.DoubleVector_empty(self)
693 r"""size(DoubleVector self) -> std::vector< double >::size_type"""
694 return libconopt4_python.DoubleVector_size(self)
698 swap(DoubleVector self, DoubleVector v)
702 v: std::vector< double > &
705 return libconopt4_python.DoubleVector_swap(self, v)
708 r"""begin(DoubleVector self) -> std::vector< double >::iterator"""
709 return libconopt4_python.DoubleVector_begin(self)
712 r"""end(DoubleVector self) -> std::vector< double >::iterator"""
713 return libconopt4_python.DoubleVector_end(self)
716 r"""rbegin(DoubleVector self) -> std::vector< double >::reverse_iterator"""
717 return libconopt4_python.DoubleVector_rbegin(self)
720 r"""rend(DoubleVector self) -> std::vector< double >::reverse_iterator"""
721 return libconopt4_python.DoubleVector_rend(self)
724 r"""clear(DoubleVector self)"""
725 return libconopt4_python.DoubleVector_clear(self)
727 def get_allocator(self):
728 r"""get_allocator(DoubleVector self) -> std::vector< double >::allocator_type"""
729 return libconopt4_python.DoubleVector_get_allocator(self)
732 r"""pop_back(DoubleVector self)"""
733 return libconopt4_python.DoubleVector_pop_back(self)
735 def erase(self, *args):
737 erase(DoubleVector self, std::vector< double >::iterator pos) -> std::vector< double >::iterator
741 pos: std::vector< double >::iterator
743 erase(DoubleVector self, std::vector< double >::iterator first, std::vector< double >::iterator last) -> std::vector< double >::iterator
747 first: std::vector< double >::iterator
748 last: std::vector< double >::iterator
751 return libconopt4_python.DoubleVector_erase(self, *args)
753 def __init__(self, *args):
755 __init__(DoubleVector self) -> DoubleVector
756 __init__(DoubleVector self, DoubleVector other) -> DoubleVector
760 other: std::vector< double > const &
762 __init__(DoubleVector self, std::vector< double >::size_type size) -> DoubleVector
766 size: std::vector< double >::size_type
768 __init__(DoubleVector self, std::vector< double >::size_type size, std::vector< double >::value_type const & value) -> DoubleVector
772 size: std::vector< double >::size_type
773 value: std::vector< double >::value_type const &
776 libconopt4_python.DoubleVector_swiginit(self, libconopt4_python.new_DoubleVector(*args))
778 def push_back(self, x):
780 push_back(DoubleVector self, std::vector< double >::value_type const & x)
784 x: std::vector< double >::value_type const &
787 return libconopt4_python.DoubleVector_push_back(self, x)
790 r"""front(DoubleVector self) -> std::vector< double >::value_type const &"""
791 return libconopt4_python.DoubleVector_front(self)
794 r"""back(DoubleVector self) -> std::vector< double >::value_type const &"""
795 return libconopt4_python.DoubleVector_back(self)
797 def assign(self, n, x):
799 assign(DoubleVector self, std::vector< double >::size_type n, std::vector< double >::value_type const & x)
803 n: std::vector< double >::size_type
804 x: std::vector< double >::value_type const &
807 return libconopt4_python.DoubleVector_assign(self, n, x)
809 def resize(self, *args):
811 resize(DoubleVector self, std::vector< double >::size_type new_size)
815 new_size: std::vector< double >::size_type
817 resize(DoubleVector self, std::vector< double >::size_type new_size, std::vector< double >::value_type const & x)
821 new_size: std::vector< double >::size_type
822 x: std::vector< double >::value_type const &
825 return libconopt4_python.DoubleVector_resize(self, *args)
827 def insert(self, *args):
829 insert(DoubleVector self, std::vector< double >::iterator pos, std::vector< double >::value_type const & x) -> std::vector< double >::iterator
833 pos: std::vector< double >::iterator
834 x: std::vector< double >::value_type const &
836 insert(DoubleVector self, std::vector< double >::iterator pos, std::vector< double >::size_type n, std::vector< double >::value_type const & x)
840 pos: std::vector< double >::iterator
841 n: std::vector< double >::size_type
842 x: std::vector< double >::value_type const &
845 return libconopt4_python.DoubleVector_insert(self, *args)
847 def reserve(self, n):
849 reserve(DoubleVector self, std::vector< double >::size_type n)
853 n: std::vector< double >::size_type
856 return libconopt4_python.DoubleVector_reserve(self, n)
859 r"""capacity(DoubleVector self) -> std::vector< double >::size_type"""
860 return libconopt4_python.DoubleVector_capacity(self)
861 __swig_destroy__ = libconopt4_python.delete_DoubleVector
863# Register DoubleVector in libconopt4_python:
864libconopt4_python.DoubleVector_swigregister(DoubleVector)
865class StringVector(object):
866 r"""Proxy of C++ std::vector< std::string > class."""
868 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
869 __repr__ = _swig_repr
872 r"""iterator(StringVector self) -> SwigPyIterator"""
873 return libconopt4_python.StringVector_iterator(self)
875 return self.iterator()
877 def __nonzero__(self):
878 r"""__nonzero__(StringVector self) -> bool"""
879 return libconopt4_python.StringVector___nonzero__(self)
882 r"""__bool__(StringVector self) -> bool"""
883 return libconopt4_python.StringVector___bool__(self)
886 r"""__len__(StringVector self) -> std::vector< std::string >::size_type"""
887 return libconopt4_python.StringVector___len__(self)
889 def __getslice__(self, i, j):
891 __getslice__(StringVector self, std::vector< std::string >::difference_type i, std::vector< std::string >::difference_type j) -> StringVector
895 i: std::vector< std::string >::difference_type
896 j: std::vector< std::string >::difference_type
899 return libconopt4_python.StringVector___getslice__(self, i, j)
901 def __setslice__(self, *args):
903 __setslice__(StringVector self, std::vector< std::string >::difference_type i, std::vector< std::string >::difference_type j)
907 i: std::vector< std::string >::difference_type
908 j: std::vector< std::string >::difference_type
910 __setslice__(StringVector self, std::vector< std::string >::difference_type i, std::vector< std::string >::difference_type j, StringVector v)
914 i: std::vector< std::string >::difference_type
915 j: std::vector< std::string >::difference_type
916 v: std::vector< std::string,std::allocator< std::string > > const &
919 return libconopt4_python.StringVector___setslice__(self, *args)
921 def __delslice__(self, i, j):
923 __delslice__(StringVector self, std::vector< std::string >::difference_type i, std::vector< std::string >::difference_type j)
927 i: std::vector< std::string >::difference_type
928 j: std::vector< std::string >::difference_type
931 return libconopt4_python.StringVector___delslice__(self, i, j)
933 def __delitem__(self, *args):
935 __delitem__(StringVector self, std::vector< std::string >::difference_type i)
939 i: std::vector< std::string >::difference_type
941 __delitem__(StringVector self, SWIGPY_SLICEOBJECT * slice)
945 slice: SWIGPY_SLICEOBJECT *
948 return libconopt4_python.StringVector___delitem__(self, *args)
950 def __getitem__(self, *args):
952 __getitem__(StringVector self, SWIGPY_SLICEOBJECT * slice) -> StringVector
956 slice: SWIGPY_SLICEOBJECT *
958 __getitem__(StringVector self, std::vector< std::string >::difference_type i) -> std::vector< std::string >::value_type const &
962 i: std::vector< std::string >::difference_type
965 return libconopt4_python.StringVector___getitem__(self, *args)
967 def __setitem__(self, *args):
969 __setitem__(StringVector self, SWIGPY_SLICEOBJECT * slice, StringVector v)
973 slice: SWIGPY_SLICEOBJECT *
974 v: std::vector< std::string,std::allocator< std::string > > const &
976 __setitem__(StringVector self, SWIGPY_SLICEOBJECT * slice)
980 slice: SWIGPY_SLICEOBJECT *
982 __setitem__(StringVector self, std::vector< std::string >::difference_type i, std::vector< std::string >::value_type const & x)
986 i: std::vector< std::string >::difference_type
987 x: std::vector< std::string >::value_type const &
990 return libconopt4_python.StringVector___setitem__(self, *args)
993 r"""pop(StringVector self) -> std::vector< std::string >::value_type"""
994 return libconopt4_python.StringVector_pop(self)
998 append(StringVector self, std::vector< std::string >::value_type const & x)
1002 x: std::vector< std::string >::value_type const &
1005 return libconopt4_python.StringVector_append(self, x)
1008 r"""empty(StringVector self) -> bool"""
1009 return libconopt4_python.StringVector_empty(self)
1012 r"""size(StringVector self) -> std::vector< std::string >::size_type"""
1013 return libconopt4_python.StringVector_size(self)
1017 swap(StringVector self, StringVector v)
1021 v: std::vector< std::string > &
1024 return libconopt4_python.StringVector_swap(self, v)
1027 r"""begin(StringVector self) -> std::vector< std::string >::iterator"""
1028 return libconopt4_python.StringVector_begin(self)
1031 r"""end(StringVector self) -> std::vector< std::string >::iterator"""
1032 return libconopt4_python.StringVector_end(self)
1035 r"""rbegin(StringVector self) -> std::vector< std::string >::reverse_iterator"""
1036 return libconopt4_python.StringVector_rbegin(self)
1039 r"""rend(StringVector self) -> std::vector< std::string >::reverse_iterator"""
1040 return libconopt4_python.StringVector_rend(self)
1043 r"""clear(StringVector self)"""
1044 return libconopt4_python.StringVector_clear(self)
1046 def get_allocator(self):
1047 r"""get_allocator(StringVector self) -> std::vector< std::string >::allocator_type"""
1048 return libconopt4_python.StringVector_get_allocator(self)
1051 r"""pop_back(StringVector self)"""
1052 return libconopt4_python.StringVector_pop_back(self)
1054 def erase(self, *args):
1056 erase(StringVector self, std::vector< std::string >::iterator pos) -> std::vector< std::string >::iterator
1060 pos: std::vector< std::string >::iterator
1062 erase(StringVector self, std::vector< std::string >::iterator first, std::vector< std::string >::iterator last) -> std::vector< std::string >::iterator
1066 first: std::vector< std::string >::iterator
1067 last: std::vector< std::string >::iterator
1070 return libconopt4_python.StringVector_erase(self, *args)
1072 def __init__(self, *args):
1074 __init__(StringVector self) -> StringVector
1075 __init__(StringVector self, StringVector other) -> StringVector
1079 other: std::vector< std::string > const &
1081 __init__(StringVector self, std::vector< std::string >::size_type size) -> StringVector
1085 size: std::vector< std::string >::size_type
1087 __init__(StringVector self, std::vector< std::string >::size_type size, std::vector< std::string >::value_type const & value) -> StringVector
1091 size: std::vector< std::string >::size_type
1092 value: std::vector< std::string >::value_type const &
1095 libconopt4_python.StringVector_swiginit(self, libconopt4_python.new_StringVector(*args))
1097 def push_back(self, x):
1099 push_back(StringVector self, std::vector< std::string >::value_type const & x)
1103 x: std::vector< std::string >::value_type const &
1106 return libconopt4_python.StringVector_push_back(self, x)
1109 r"""front(StringVector self) -> std::vector< std::string >::value_type const &"""
1110 return libconopt4_python.StringVector_front(self)
1113 r"""back(StringVector self) -> std::vector< std::string >::value_type const &"""
1114 return libconopt4_python.StringVector_back(self)
1116 def assign(self, n, x):
1118 assign(StringVector self, std::vector< std::string >::size_type n, std::vector< std::string >::value_type const & x)
1122 n: std::vector< std::string >::size_type
1123 x: std::vector< std::string >::value_type const &
1126 return libconopt4_python.StringVector_assign(self, n, x)
1128 def resize(self, *args):
1130 resize(StringVector self, std::vector< std::string >::size_type new_size)
1134 new_size: std::vector< std::string >::size_type
1136 resize(StringVector self, std::vector< std::string >::size_type new_size, std::vector< std::string >::value_type const & x)
1140 new_size: std::vector< std::string >::size_type
1141 x: std::vector< std::string >::value_type const &
1144 return libconopt4_python.StringVector_resize(self, *args)
1146 def insert(self, *args):
1148 insert(StringVector self, std::vector< std::string >::iterator pos, std::vector< std::string >::value_type const & x) -> std::vector< std::string >::iterator
1152 pos: std::vector< std::string >::iterator
1153 x: std::vector< std::string >::value_type const &
1155 insert(StringVector self, std::vector< std::string >::iterator pos, std::vector< std::string >::size_type n, std::vector< std::string >::value_type const & x)
1159 pos: std::vector< std::string >::iterator
1160 n: std::vector< std::string >::size_type
1161 x: std::vector< std::string >::value_type const &
1164 return libconopt4_python.StringVector_insert(self, *args)
1166 def reserve(self, n):
1168 reserve(StringVector self, std::vector< std::string >::size_type n)
1172 n: std::vector< std::string >::size_type
1175 return libconopt4_python.StringVector_reserve(self, n)
1178 r"""capacity(StringVector self) -> std::vector< std::string >::size_type"""
1179 return libconopt4_python.StringVector_capacity(self)
1180 __swig_destroy__ = libconopt4_python.delete_StringVector
1182# Register StringVector in libconopt4_python:
1183libconopt4_python.StringVector_swigregister(StringVector)
1184class IntArray3(object):
1185 r"""Proxy of C++ std::array< int,3 > class."""
1187 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1188 __repr__ = _swig_repr
1191 r"""iterator(IntArray3 self) -> SwigPyIterator"""
1192 return libconopt4_python.IntArray3_iterator(self)
1194 return self.iterator()
1196 def __nonzero__(self):
1197 r"""__nonzero__(IntArray3 self) -> bool"""
1198 return libconopt4_python.IntArray3___nonzero__(self)
1201 r"""__bool__(IntArray3 self) -> bool"""
1202 return libconopt4_python.IntArray3___bool__(self)
1205 r"""__len__(IntArray3 self) -> std::array< int,3 >::size_type"""
1206 return libconopt4_python.IntArray3___len__(self)
1208 def __getslice__(self, i, j):
1210 __getslice__(IntArray3 self, std::array< int,3 >::difference_type i, std::array< int,3 >::difference_type j) -> IntArray3
1214 i: std::array< int,3 >::difference_type
1215 j: std::array< int,3 >::difference_type
1218 return libconopt4_python.IntArray3___getslice__(self, i, j)
1220 def __setslice__(self, *args):
1222 __setslice__(IntArray3 self, std::array< int,3 >::difference_type i, std::array< int,3 >::difference_type j)
1226 i: std::array< int,3 >::difference_type
1227 j: std::array< int,3 >::difference_type
1229 __setslice__(IntArray3 self, std::array< int,3 >::difference_type i, std::array< int,3 >::difference_type j, IntArray3 v)
1233 i: std::array< int,3 >::difference_type
1234 j: std::array< int,3 >::difference_type
1235 v: std::array< int,3 > const &
1238 return libconopt4_python.IntArray3___setslice__(self, *args)
1240 def __delslice__(self, i, j):
1242 __delslice__(IntArray3 self, std::array< int,3 >::difference_type i, std::array< int,3 >::difference_type j)
1246 i: std::array< int,3 >::difference_type
1247 j: std::array< int,3 >::difference_type
1250 return libconopt4_python.IntArray3___delslice__(self, i, j)
1252 def __delitem__(self, *args):
1254 __delitem__(IntArray3 self, std::array< int,3 >::difference_type i)
1258 i: std::array< int,3 >::difference_type
1260 __delitem__(IntArray3 self, SWIGPY_SLICEOBJECT * slice)
1264 slice: SWIGPY_SLICEOBJECT *
1267 return libconopt4_python.IntArray3___delitem__(self, *args)
1269 def __getitem__(self, *args):
1271 __getitem__(IntArray3 self, SWIGPY_SLICEOBJECT * slice) -> IntArray3
1275 slice: SWIGPY_SLICEOBJECT *
1277 __getitem__(IntArray3 self, std::array< int,3 >::difference_type i) -> std::array< int,3 >::value_type const &
1281 i: std::array< int,3 >::difference_type
1284 return libconopt4_python.IntArray3___getitem__(self, *args)
1286 def __setitem__(self, *args):
1288 __setitem__(IntArray3 self, SWIGPY_SLICEOBJECT * slice, IntArray3 v)
1292 slice: SWIGPY_SLICEOBJECT *
1293 v: std::array< int,3 > const &
1295 __setitem__(IntArray3 self, SWIGPY_SLICEOBJECT * slice)
1299 slice: SWIGPY_SLICEOBJECT *
1301 __setitem__(IntArray3 self, std::array< int,3 >::difference_type i, std::array< int,3 >::value_type const & x)
1305 i: std::array< int,3 >::difference_type
1306 x: std::array< int,3 >::value_type const &
1309 return libconopt4_python.IntArray3___setitem__(self, *args)
1311 def __init__(self, *args):
1313 __init__(IntArray3 self) -> IntArray3
1314 __init__(IntArray3 self, IntArray3 other) -> IntArray3
1318 other: std::array< int,3 > const &
1321 libconopt4_python.IntArray3_swiginit(self, libconopt4_python.new_IntArray3(*args))
1324 r"""empty(IntArray3 self) -> bool"""
1325 return libconopt4_python.IntArray3_empty(self)
1328 r"""size(IntArray3 self) -> std::array< int,3 >::size_type"""
1329 return libconopt4_python.IntArray3_size(self)
1333 swap(IntArray3 self, IntArray3 v)
1337 v: std::array< int,3 > &
1340 return libconopt4_python.IntArray3_swap(self, v)
1343 r"""begin(IntArray3 self) -> std::array< int,3 >::iterator"""
1344 return libconopt4_python.IntArray3_begin(self)
1347 r"""end(IntArray3 self) -> std::array< int,3 >::iterator"""
1348 return libconopt4_python.IntArray3_end(self)
1351 r"""rbegin(IntArray3 self) -> std::array< int,3 >::reverse_iterator"""
1352 return libconopt4_python.IntArray3_rbegin(self)
1355 r"""rend(IntArray3 self) -> std::array< int,3 >::reverse_iterator"""
1356 return libconopt4_python.IntArray3_rend(self)
1359 r"""front(IntArray3 self) -> std::array< int,3 >::value_type const &"""
1360 return libconopt4_python.IntArray3_front(self)
1363 r"""back(IntArray3 self) -> std::array< int,3 >::value_type const &"""
1364 return libconopt4_python.IntArray3_back(self)
1368 fill(IntArray3 self, std::array< int,3 >::value_type const & u)
1372 u: std::array< int,3 >::value_type const &
1375 return libconopt4_python.IntArray3_fill(self, u)
1376 __swig_destroy__ = libconopt4_python.delete_IntArray3
1378# Register IntArray3 in libconopt4_python:
1379libconopt4_python.IntArray3_swigregister(IntArray3)
1380CONOPT_INF = libconopt4_python.CONOPT_INF
1382ConstraintType_Eq = libconopt4_python.ConstraintType_Eq
1383r"""equality constraint"""
1384ConstraintType_GtEq = libconopt4_python.ConstraintType_GtEq
1385r"""greater than or equal to constraint"""
1386ConstraintType_LtEq = libconopt4_python.ConstraintType_LtEq
1387r"""greater than or equal to constraint"""
1388ConstraintType_Free = libconopt4_python.ConstraintType_Free
1389r"""an unrestricted constraint. This is used when specifying the objective function."""
1390ObjectiveElement_Variable = libconopt4_python.ObjectiveElement_Variable
1391r"""the objective is given by a single variable"""
1392ObjectiveElement_Constraint = libconopt4_python.ObjectiveElement_Constraint
1393r"""the objective is given by the value of an equation"""
1394Sense_Minimize = libconopt4_python.Sense_Minimize
1395r"""a minimisation problem (default)"""
1396Sense_Maximize = libconopt4_python.Sense_Maximize
1397r"""a maximisation problem"""
1398VerbosityLevel_VerbLevelMin = libconopt4_python.VerbosityLevel_VerbLevelMin
1400VerbosityLevel__None = libconopt4_python.VerbosityLevel__None
1401r"""turn off all output"""
1402VerbosityLevel_Normal = libconopt4_python.VerbosityLevel_Normal
1403r"""normal output, iteration log to stdout and error to stderr"""
1404VerbosityLevel_Error = libconopt4_python.VerbosityLevel_Error
1405r"""more detailed iteration log to stdout, error to stdout and stderr"""
1406VerbosityLevel_Debug = libconopt4_python.VerbosityLevel_Debug
1407r"""extensive iteration log, error to stdout and stderr"""
1408VerbosityLevel_VerbLevelMax = libconopt4_python.VerbosityLevel_VerbLevelMax
1410SDEvaluationType__None = libconopt4_python.SDEvaluationType__None
1412SDEvaluationType_Constraint = libconopt4_python.SDEvaluationType_Constraint
1414SDEvaluationType_Lagrangian = libconopt4_python.SDEvaluationType_Lagrangian
1416class Conopt(object):
1420 @ingroup CONOPT_PYTHON
1423 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1424 __repr__ = _swig_repr
1426 def __init__(self, *args):
1430 @param modelName: the name for the model.
1433 libconopt4_python.Conopt_swiginit(self, libconopt4_python.new_Conopt(*args))
1434 __swig_destroy__ = libconopt4_python.delete_Conopt
1438 @copydoc DEF_COI_SOLVE
1441 @ingroup UTILITY_ROUTINES_PYTHON
1443 return libconopt4_python.Conopt_solve(self)
1445 def checkModelAndParameters(self):
1446 r"""checks the model data and parameters to ensure it is setup correctly"""
1447 return libconopt4_python.Conopt_checkModelAndParameters(self)
1449 def controlVector(self):
1451 returns the control vector pointer.
1453 This is for use in the C-interface methods
1456 @ingroup UTILITY_ROUTINES_PYTHON
1458 return libconopt4_python.Conopt_controlVector(self)
1460 def printStatus(self):
1462 prints the status of the optimisation
1465 @ingroup UTILITY_ROUTINES_PYTHON
1467 return libconopt4_python.Conopt_printStatus(self)
1471 returns the model name
1474 @ingroup UTILITY_ROUTINES_PYTHON
1476 return libconopt4_python.Conopt_getName(self)
1478 def loadModel(self, modeldata):
1480 loads the model and stores the pointer in the interface
1482 The user creates an instantiation of the ConoptModelData that includes all details of the model, including
1483 function evaluation callbacks. This method loads the model data into Conopt before solving the problem.
1485 @param modeldata: a user defined ConoptModelData object
1488 @ingroup CONOPTPYTHON_MODELDATA
1490 return libconopt4_python.Conopt_loadModel(self, modeldata)
1492 def modelStatus(self):
1494 returns the model status
1497 return libconopt4_python.Conopt_modelStatus(self)
1499 def solutionStatus(self):
1501 return the solution status
1504 @ingroup SOLUTION_STATUS_METHODS_PYTHON
1506 return libconopt4_python.Conopt_solutionStatus(self)
1508 def iterations(self):
1510 returns the number of iterations
1513 @ingroup SOLUTION_STATUS_METHODS_PYTHON
1515 return libconopt4_python.Conopt_iterations(self)
1517 def objectiveValue(self):
1519 returns the objective value
1522 @ingroup SOLUTION_STATUS_METHODS_PYTHON
1524 return libconopt4_python.Conopt_objectiveValue(self)
1526 def getVariableValues(self):
1528 returns the variable values
1531 @ingroup SOLUTION_STATUS_METHODS_PYTHON
1533 return libconopt4_python.Conopt_getVariableValues(self)
1535 def getVariableMarginals(self):
1537 returns the variable marginals
1540 @ingroup SOLUTION_STATUS_METHODS_PYTHON
1542 return libconopt4_python.Conopt_getVariableMarginals(self)
1544 def getVariableBasisStatus(self):
1546 returns the variable basis status
1549 @ingroup SOLUTION_STATUS_METHODS_PYTHON
1551 return libconopt4_python.Conopt_getVariableBasisStatus(self)
1553 def getVariableStatus(self):
1555 returns the variable status
1558 @ingroup SOLUTION_STATUS_METHODS_PYTHON
1560 return libconopt4_python.Conopt_getVariableStatus(self)
1562 def getConstraintValues(self):
1564 returns the constraint values
1567 @ingroup SOLUTION_STATUS_METHODS_PYTHON
1569 return libconopt4_python.Conopt_getConstraintValues(self)
1571 def getConstraintMarginals(self):
1573 returns the constraint marginals
1576 @ingroup SOLUTION_STATUS_METHODS_PYTHON
1578 return libconopt4_python.Conopt_getConstraintMarginals(self)
1580 def getConstraintBasisStatus(self):
1582 returns the constraint basis status
1585 @ingroup SOLUTION_STATUS_METHODS_PYTHON
1587 return libconopt4_python.Conopt_getConstraintBasisStatus(self)
1589 def getConstraintStatus(self):
1591 returns the constraint status
1594 @ingroup SOLUTION_STATUS_METHODS_PYTHON
1596 return libconopt4_python.Conopt_getConstraintStatus(self)
1598 def setMessageHandler(self, msghandler):
1600 sets the message handler to the user supplied handler.
1602 The pointer to the supplied message handler is stored in the interface object. The user is responsible for the
1603 creation and destruction of the message handler object.
1605 @param msghandler: a user defined ConoptMessageHandler object
1608 @ingroup CONOPTPYTHON_MESSAGEHANDLER
1610 return libconopt4_python.Conopt_setMessageHandler(self, msghandler)
1612 def sendMessage(self, msg):
1614 sends a message to the message handler
1616 @param msg: A string for the message that will be processed in the message handler
1619 @ingroup CONOPTPYTHON_MESSAGEHANDLER
1621 return libconopt4_python.Conopt_sendMessage(self, msg)
1623 def setVerbosityLevel(self, verblevel):
1625 sets the verbosity level for messaging
1627 The verbosity level is:
1628 - None -- turn off all output
1629 - Normal -- normal output, iteration log to stdout and error to stderr
1630 - Error -- more detailed iteration log to stdout, error to stdout and stderr
1631 - Debug -- extensive iteration log, error to stdout and stderr
1633 @param verblevel: the verbosity level for the message handler
1636 @ingroup CONOPTPYTHON_MESSAGEHANDLER
1638 return libconopt4_python.Conopt_setVerbosityLevel(self, verblevel)
1643 returns the version number.
1645 It can be used to ensure that the modeler is linked to the correct version of the CONOPT DLL.
1648 @ingroup UTILITY_ROUTINES_PYTHON
1650 return libconopt4_python.Conopt_version()
1652 def debugFV(self, debugfv):
1654 @copydoc DEF_COI_DEBUGFV
1657 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1659 return libconopt4_python.Conopt_debugFV(self, debugfv)
1661 def squareModel(self, square):
1663 @copydoc DEF_COI_SQUARE
1666 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1668 return libconopt4_python.Conopt_squareModel(self, square)
1670 def setLicense(self, licint1, licint2, licint3, licstring):
1672 @copydoc DEF_COI_LICENSE
1675 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1677 return libconopt4_python.Conopt_setLicense(self, licint1, licint2, licint3, licstring)
1679 def setItLim(self, itlim):
1681 @copydoc DEF_COI_ITLIM
1684 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1686 return libconopt4_python.Conopt_setItLim(self, itlim)
1688 def setErrLim(self, errlim):
1690 @copydoc DEF_COI_ERRLIM
1693 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1695 return libconopt4_python.Conopt_setErrLim(self, errlim)
1697 def fVincLin(self, fvinclin):
1699 @copydoc DEF_COI_FVINCLIN
1702 @ingroup REGISTRATION_OF_SIZES_PYTHON
1704 return libconopt4_python.Conopt_fVincLin(self, fvinclin)
1706 def fVforAll(self, fvforall):
1708 @copydoc DEF_COI_FVFORALL
1711 @ingroup REGISTRATION_OF_SIZES_PYTHON
1713 return libconopt4_python.Conopt_fVforAll(self, fvforall)
1715 def setMaxSup(self, maxsup):
1717 @copydoc DEF_COI_MAXSUP
1720 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1722 return libconopt4_python.Conopt_setMaxSup(self, maxsup)
1724 def allowEmptyRow(self, emptyrow):
1726 @copydoc DEF_COI_EMPTYROW
1729 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1731 return libconopt4_python.Conopt_allowEmptyRow(self, emptyrow)
1733 def allowEmptyCol(self, emptycol):
1735 @copydoc DEF_COI_EMPTYCOL
1738 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1740 return libconopt4_python.Conopt_allowEmptyCol(self, emptycol)
1742 def debug2D(self, debug2d):
1744 @copydoc DEF_COI_DEBUG2D
1747 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1749 return libconopt4_python.Conopt_debug2D(self, debug2d)
1751 def disCont(self, discont):
1753 @copydoc DEF_COI_DISCONT
1756 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1758 return libconopt4_python.Conopt_disCont(self, discont)
1760 def clearM(self, clearm):
1762 @copydoc DEF_COI_CLEARM
1765 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1767 return libconopt4_python.Conopt_clearM(self, clearm)
1769 def setResLim(self, reslim):
1771 @copydoc DEF_COI_RESLIM
1774 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1776 return libconopt4_python.Conopt_setResLim(self, reslim)
1778 def setMaxHeap(self, maxheap):
1780 @copydoc DEF_COI_MAXHEAP
1783 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1785 return libconopt4_python.Conopt_setMaxHeap(self, maxheap)
1787 def setThreadS(self, threads):
1789 @copydoc DEF_COI_THREADS
1792 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1794 return libconopt4_python.Conopt_setThreadS(self, threads)
1796 def setThreadF(self, threadf):
1798 @copydoc DEF_COI_THREADF
1801 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1803 return libconopt4_python.Conopt_setThreadF(self, threadf)
1805 def setThread2D(self, thread2d):
1807 @copydoc DEF_COI_THREAD2D
1810 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1812 return libconopt4_python.Conopt_setThread2D(self, thread2d)
1814 def setThreadC(self, threadc):
1816 @copydoc DEF_COI_THREADC
1819 @ingroup REGISTRATION_OF_OPTIONS_PYTHON
1821 return libconopt4_python.Conopt_setThreadC(self, threadc)
1823 def getMaxThreads(self):
1825 returns the maximum number of threads that can be used by CONOPT.
1827 If you are using multiple threads it may be necessary to know in advance how many threads CONOPT can use. If
1828 called inside a parallel loop, this method will return one---indicating that CONOPT cannot use multiple
1829 threads when CONOPT itself is called in parallel. Therefore, this method should be called in some sequential
1830 initialization code and not inside a function evaluation routine, that could be called in parallel.
1833 @ingroup UTILITY_ROUTINES_PYTHON
1835 return libconopt4_python.Conopt_getMaxThreads(self)
1837 def getMaxHeapUsed(self):
1839 After a model has been solved this method will return the amount of heap memory used.
1842 @ingroup UTILITY_ROUTINES_PYTHON
1844 return libconopt4_python.Conopt_getMaxHeapUsed(self)
1846 def getRangeErrors(self):
1848 returns the range errors that were encountered.
1851 @ingroup UTILITY_ROUTINES_PYTHON
1853 return libconopt4_python.Conopt_getRangeErrors(self)
1855# Register Conopt in libconopt4_python:
1856libconopt4_python.Conopt_swigregister(Conopt)
1857class Variable(object):
1861 This struct is used internally for supplying the variable data to CONOPT. The user is able to query this data from
1862 the ConoptModelData object. However, the user is not able to change the data after the variable has been added to
1866 @ingroup QUERY_MODEL_PYTHON
1869 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1870 __repr__ = _swig_repr
1872 def __init__(self, idx, low, up, cur=0, varstat=-1):
1874 __init__(Variable self, int idx, double low, double up, double cur=0, int varstat=-1) -> Variable
1885 libconopt4_python.Variable_swiginit(self, libconopt4_python.new_Variable(idx, low, up, cur, varstat))
1887 def addNonzero(self, conindex, value, nlflag):
1889 adds a non-zero to the variable data
1891 Notes: this is used internally.
1893 return libconopt4_python.Variable_addNonzero(self, conindex, value, nlflag)
1895 def sortNonzeros(self):
1897 sorts the non-zeros by constraint index.
1899 Notes: this is used internally.
1901 return libconopt4_python.Variable_sortNonzeros(self)
1902 index = property(libconopt4_python.Variable_index_get, libconopt4_python.Variable_index_set, doc=
r"""the index of the variable in the problem""")
1903 lower = property(libconopt4_python.Variable_lower_get, libconopt4_python.Variable_lower_set, doc=
r"""the lower bound of the variables""")
1904 upper = property(libconopt4_python.Variable_upper_get, libconopt4_python.Variable_upper_set, doc=
r"""the upper bounds of the variables""")
1905 curr = property(libconopt4_python.Variable_curr_get, libconopt4_python.Variable_curr_set, doc=
r"""the initial values of the variables. This is 0 by default.""")
1906 varstatus = property(libconopt4_python.Variable_varstatus_get, libconopt4_python.Variable_varstatus_set, doc=
r"""the initial status of the variables. The depends on the COIDEF_IniStat setting.""")
1907 consindex_ = property(libconopt4_python.Variable_consindex__get, libconopt4_python.Variable_consindex__set, doc=
r"""the index of the constraints""")
1908 value_ = property(libconopt4_python.Variable_value__get, libconopt4_python.Variable_value__set, doc=
r"""the non-zero for linear terms, for non-linear terms this is ignored""")
1909 nlflag_ = property(libconopt4_python.Variable_nlflag__get, libconopt4_python.Variable_nlflag__set, doc=
r"""indicator whether the non-zero is part of a non-linear term""")
1910 sortorder_ = property(libconopt4_python.Variable_sortorder__get, libconopt4_python.Variable_sortorder__set, doc=
r"""a vector to support the sorting of the non-zeros""")
1911 __swig_destroy__ = libconopt4_python.delete_Variable
1913# Register Variable in libconopt4_python:
1914libconopt4_python.Variable_swigregister(Variable)
1915class Constraint(object):
1919 This struct is used internally for supplying the variable data to CONOPT. The user is able to query this data from
1920 the ConoptModelData object. However, the user is not able to change the data after the variable has been added to
1924 @ingroup QUERY_MODEL_PYTHON
1927 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1928 __repr__ = _swig_repr
1930 def __init__(self, idx, type, bound, slackstat):
1932 __init__(Constraint self, int idx, ConoptConstraintType type, double bound, int slackstat) -> Constraint
1937 type: enum ConoptConstraintType
1942 libconopt4_python.Constraint_swiginit(self, libconopt4_python.new_Constraint(idx, type, bound, slackstat))
1943 index = property(libconopt4_python.Constraint_index_get, libconopt4_python.Constraint_index_set, doc=
r"""the index of the constraint in the problem""")
1944 constype = property(libconopt4_python.Constraint_constype_get, libconopt4_python.Constraint_constype_set, doc=
r"""0: equality, 1: greater than or equal, 2: less than or equal, 3: free row""")
1945 rhs = property(libconopt4_python.Constraint_rhs_get, libconopt4_python.Constraint_rhs_set, doc=
r"""the right hand side of the constraint""")
1946 slackstatus = property(libconopt4_python.Constraint_slackstatus_get, libconopt4_python.Constraint_slackstatus_set, doc=
r"""the initial status of the slacks. This depends on the COIDEF_IniStat setting.""")
1947 __swig_destroy__ = libconopt4_python.delete_Constraint
1949# Register Constraint in libconopt4_python:
1950libconopt4_python.Constraint_swigregister(Constraint)
1951class ConoptModelData(object):
1952 r"""The Model Data class"""
1954 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1955 __repr__ = _swig_repr
1959 if self.__class__ == ConoptModelData:
1963 libconopt4_python.ConoptModelData_swiginit(self, libconopt4_python.new_ConoptModelData(_self, ))
1964 __swig_destroy__ = libconopt4_python.delete_ConoptModelData
1966 def readMatrix(self, lower, curr, upper, vsta, type, rhs, esta, colsta, rowno, value, nlflag, numvar, numcon, numnz):
1968 loads the structure of the model into CONOPT.
1970 Using the C++ interface, there are two ways to load the model into CONOPT.
1971 The first method follows the process used for the Fortran and C interfaces. This involves:
1972 1. setting the problem dimension by calling setProblemDimension().
1973 2. set the objective element (constraint or variable) by calling setObjectiveElement().
1974 3. set the optimisation sense by calling setOptimizationSense().
1975 4. implementing a readMatrix() method that loads the model using a column-oriented sparse matrix format. For
1976 more details regarding the parameters of the readMatrix() method, please see 'API_DEFINING_THE_MODEL_F90'
1978 The second method makes use of the convenience functions included in the C++ interface. Within the
1979 ConoptModelData the methods addConstraint() and addVariable() are provided. As such, to load the model into
1981 1. write a member function for building the model.
1982 2. in the build model function, call addVariable() for each variable to be added to the problem.
1983 3. in the build model function, call addConstraint() for each constraint to be added to the problem. When adding
1984 a constraint, you should specify the variables (by index), coefficients and non-linear flags (for all
1986 4. set the objective element (constraint or variable) by calling setObjectiveElement().
1987 5. set the optimisation sense by calling setOptimizationSense().
1988 When the solve method is called, the default readMatrix() method will be called, which will load the model into
1989 CONOPT as specified by the calls to addVariable() and addConstraint().
1993 return libconopt4_python.ConoptModelData_readMatrix(self, lower, curr, upper, vsta, type, rhs, esta, colsta, rowno, value, nlflag, numvar, numcon, numnz)
1995 def setProblemDimension(self, numvar, numcons, numnz, numnlnz):
1997 sets the problem dimension. This is called if the user wants to implement a custom readMatrix() method.
1999 NOTE: it is not possible to call setProblemDimension() and addConstraint() or addVariable(). The latter
2000 functions can only be used if the problem dimension is not set and the default readMatrix() method is used.
2004 @param numvar: the number of variables in the problem
2005 @param numcons: the number of constraints in the problem
2006 @param numnz: the number of non-zeros in the constraint matrix
2007 @param numnlnz: the number of nonlinear non-zeros in the constraint matrix
2009 return libconopt4_python.ConoptModelData_setProblemDimension(self, numvar, numcons, numnz, numnlnz)
2011 def addConstraint(self, *args):
2014 adds a constraint to the problem. The non-zero coefficients are added later
2018 @param constype: the type of constraint, 0: ==, 1: >=, 2: <=, 3: free
2019 @param rhs: the right hand side
2020 @param slackstatus: initial status of the slack variables, see IniStat
2025 adds a constraint to the problem. The matrix non-zeros are added based on the supplied variables
2029 @param constype: the type of constraint, 0: ==, 1: >=, 2: <=, 3: free
2030 @param rhs: the right hand side
2031 @param varindex: the variables this constraint has non-zero coefficients
2032 @param value: the non-zero of the variable
2033 @param nlflag: flag to set whether the variable belongs to a non-linear term
2034 @param slackstatus: initial status of the slack variables, see IniStat
2039 adds a constraint to the problem. The matrix non-zeros are added based on the supplied variables
2043 @param constype: the type of constraint, 0: ==, 1: >=, 2: <=, 3: free
2044 @param rhs: the right hand side
2045 @param varindex: the variables this constraint has non-zero coefficients
2046 @param value: the non-zero of the variable
2047 @param nlflag: flag to set whether the variable belongs to a non-linear term
2048 @param slackstatus: initial status of the slack variables, see IniStat
2050 return libconopt4_python.ConoptModelData_addConstraint(self, *args)
2052 def addVariable(self, *args):
2055 adds a variable to the model. The non-zero coefficients are added later.
2059 @param lower: lower bound for the variable
2060 @param upper: upper bound for the variable
2061 @param curr: initial value of the variable, can be set to 0
2062 @param varstatus: initial status of the variable, see IniStat
2067 adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.
2071 @param lower: lower bound for the variable
2072 @param upper: upper bound for the variable
2073 @param consindex: the constraints this variable has non-zero coefficients
2074 @param value: the non-zero of the variable
2075 @param nlflag: flag to set whether the variable belongs to a non-linear term
2076 @param curr: initial value of the variable, can be set to 0
2077 @param varstatus: initial status of the variable, see IniStat
2082 adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.
2086 @param lower: lower bound for the variable
2087 @param upper: upper bound for the variable
2088 @param consindex: the constraints this variable has non-zero coefficients
2089 @param value: the non-zero of the variable
2090 @param nlflag: flag to set whether the variable belongs to a non-linear term
2091 @param curr: initial value of the variable, can be set to 0
2092 @param varstatus: initial status of the variable, see IniStat
2097 adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.
2101 @param lower: lower bound for the variable
2102 @param upper: upper bound for the variable
2103 @param consindex: the constraints this variable has non-zero coefficients
2104 @param value: the non-zero of the variable
2105 @param nlflag: flag to set whether the variable belongs to a non-linear term
2106 @param curr: initial value of the variable, can be set to 0
2107 @param varstatus: initial status of the variable, see IniStat
2109 return libconopt4_python.ConoptModelData_addVariable(self, *args)
2111 def setObjectiveElement(self, elem, elemindex):
2113 sets the index for the objective variable or constraint
2117 return libconopt4_python.ConoptModelData_setObjectiveElement(self, elem, elemindex)
2119 def setOptimizationSense(self, sense):
2121 sets the optimisation direction.
2125 return libconopt4_python.ConoptModelData_setOptimizationSense(self, sense)
2127 def setInitialStatusOption(self, inistat):
2129 the setting to indicate how the initial status of the variables and slack variables will be handled.
2131 The initial status is set in the addVariable() and addConstraint() methods, or in the readMatrix() method if the
2132 classical model input approach is used. By default, the value of inistat is 0, which means that the variable and
2133 slack status is ignored.
2136 The variable status has the following behaviour:
2137 - 0: The variable is initialized non-basic (if curr = lower or curr = upper) or super-basic, and
2138 - 1: The variable is initialized basic
2139 The slack status has the following behaviour:
2140 - 0: The slack is initialized non-basic (if the constraint is binding in the initial point) or super-basic,
2141 - 1: The slack is initialized basic
2144 The variable status has the following behaviour:
2145 - 0: The variable is initialized at lower bound
2146 - 1: The variable is initialized at upper bound
2147 - 2: The variable is initialized basic, and
2148 - 3: The variable is initialized superbasic.
2149 The slack status has the following behaviour:
2150 - 0: The slack is initialized at lower bound.
2151 - 1: The slack is initialized at upper bound.
2152 - 2: The slack is initialized basic, and
2153 - 3: The slack is initialized superbasic.
2157 return libconopt4_python.ConoptModelData_setInitialStatusOption(self, inistat)
2161 returns the number of variables in the model
2165 return libconopt4_python.ConoptModelData_numVar(self)
2169 returns the number of constraints in the model
2173 return libconopt4_python.ConoptModelData_numCons(self)
2175 def numHessianNonzeros(self):
2177 returns the number of non-zeros in the Hessian
2181 return libconopt4_python.ConoptModelData_numHessianNonzeros(self)
2183 def getVariable(self, index):
2185 returns a reference to the variable object
2189 return libconopt4_python.ConoptModelData_getVariable(self, index)
2191 def getConstraint(self, index):
2193 returns a reference to the constraint object
2197 return libconopt4_python.ConoptModelData_getConstraint(self, index)
2199 def setSDEvaluationType(self, sdevaltype):
2201 informs CONOPT of the method for evaluating the second derivative
2205 return libconopt4_python.ConoptModelData_setSDEvaluationType(self, sdevaltype)
2207 def setSDLagrangianStructure(self, rownum, colnum):
2209 sets the structure of the second derivatives of the Lagrangian
2213 @param rownum: Vector of row numbers of the lower triangular part of the Hessian.
2214 @param colnum: Vector of column numbers of the lower triangular part of the Hessian.
2216 return libconopt4_python.ConoptModelData_setSDLagrangianStructure(self, rownum, colnum)
2218 def getSDLagrangianRowNumbers(self):
2219 r"""returns the row numbers in the second derivative of the lagrangian structure"""
2220 return libconopt4_python.ConoptModelData_getSDLagrangianRowNumbers(self)
2222 def getSDLagrangianColumnNumbers(self):
2223 r"""returns the column numbers in the second derivative of the lagrangian structure"""
2224 return libconopt4_python.ConoptModelData_getSDLagrangianColumnNumbers(self)
2225 def __disown__(self):
2227 libconopt4_python.disown_ConoptModelData(self)
2228 return weakref.proxy(self)
2230# Register ConoptModelData in libconopt4_python:
2231libconopt4_python.ConoptModelData_swigregister(ConoptModelData)
2232class ConoptAlgProgress(object):
2233 r"""Proxy of C++ ConoptAlgProgress class."""
2235 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2236 __repr__ = _swig_repr
2237 iteration = property(libconopt4_python.ConoptAlgProgress_iteration_get, libconopt4_python.ConoptAlgProgress_iteration_set, doc=
r"""Number of the iteration.""")
2238 phase = property(libconopt4_python.ConoptAlgProgress_phase_get, libconopt4_python.ConoptAlgProgress_phase_set, doc=
r"""The phase of the optimization.""")
2239 numinfeas = property(libconopt4_python.ConoptAlgProgress_numinfeas_get, libconopt4_python.ConoptAlgProgress_numinfeas_set, doc=
r"""
2240 Number of infeasible constraints. In phase 0, this number will only
2241 count the number of "difficult" constraints.
2243 numnopt = property(libconopt4_python.ConoptAlgProgress_numnopt_get, libconopt4_python.ConoptAlgProgress_numnopt_set, doc=
r"""
2244 Number of non-optimal variables. Will be 0 meaning undefined
2247 numsuper = property(libconopt4_python.ConoptAlgProgress_numsuper_get, libconopt4_python.ConoptAlgProgress_numsuper_set, doc=
r"""Number of super-basic variables. Will be zero during phase 0 .""")
2248 suminfeas = property(libconopt4_python.ConoptAlgProgress_suminfeas_get, libconopt4_python.ConoptAlgProgress_suminfeas_set, doc=
r"""
2249 Sum of the infeasibilities. In phase 0 it will include the
2250 infeasibilities in both easy and difficult constraint. During phase
2251 3 and 4 SUMINF will be 0.
2253 objvalue = property(libconopt4_python.ConoptAlgProgress_objvalue_get, libconopt4_python.ConoptAlgProgress_objvalue_set, doc=
r"""
2254 The value of the true objective function. OBJVAL is zero meaning
2255 undefined during phase 0, 1 and 2
2257 rgmax = property(libconopt4_python.ConoptAlgProgress_rgmax_get, libconopt4_python.ConoptAlgProgress_rgmax_set, doc=
r"""
2258 The numerically largest reduced gradient. RGMAX will be zero during
2261 step = property(libconopt4_python.ConoptAlgProgress_step_get, libconopt4_python.ConoptAlgProgress_step_set, doc=
r"""The optimal steplength.""")
2262 numvar = property(libconopt4_python.ConoptAlgProgress_numvar_get, libconopt4_python.ConoptAlgProgress_numvar_set, doc=
r"""The number of variables""")
2265 r"""__init__(ConoptAlgProgress self) -> ConoptAlgProgress"""
2266 libconopt4_python.ConoptAlgProgress_swiginit(self, libconopt4_python.new_ConoptAlgProgress())
2267 __swig_destroy__ = libconopt4_python.delete_ConoptAlgProgress
2269# Register ConoptAlgProgress in libconopt4_python:
2270libconopt4_python.ConoptAlgProgress_swigregister(ConoptAlgProgress)
2271class MessageHandler(object):
2273 The message handler class
2275 @ingroup MESSAGEHANDLER_PYTHON
2278 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2279 __repr__ = _swig_repr
2283 if self.__class__ == MessageHandler:
2287 libconopt4_python.MessageHandler_swiginit(self, libconopt4_python.new_MessageHandler(_self, ))
2288 __swig_destroy__ = libconopt4_python.delete_MessageHandler
2290 def message(self, smsg, dmsg, nmsg, msgv):
2292 virtual method for handling the messages.
2294 This can be redefined by the user for alternative message handling
2296 @include{doc} message_cb_intro.dox
2299 @ingroup MESSAGEHANDLER_PYTHON
2301 @param smsg: The number of lines in the message that should go to the Screen file. Between 0 and 30.
2302 @param dmsg: The number of lines in the message that should go to the Status file. Between 0 and 30.
2303 @param nmsg: The number of lines in the message that should go to the Documentation file. Between 0 and 30.
2304 @param msgv: Vector with the actual message lines.
2306 return libconopt4_python.MessageHandler_message(self, smsg, dmsg, nmsg, msgv)
2308 def errorMessage(self, rowno, colno, posno, msg):
2310 virtual method for handling error messages.
2312 This can be redefined by the user for alternative message handling
2314 Messages about particular parts of a model are all one line long. The messages
2315 can be related to an error or it can be a general informative message related to
2316 a row or column or Jacobian element. The modeler is responsible for combining
2317 the row and column identification and the message text and for displaying the
2320 There are some special cases for the three first arguments and the message
2321 should be interpreted accordingly. The special cases are:
2323 - **COLNO = -1:** The message is about a row and `ROWNO` will be between 0
2326 - **ROWNO = -1:** The message is about a column and `COLNO` will be between 0
2329 - **ROWNO and COLNO both non-negative:** The message is about a position in
2330 the Jacobian if `POSNO` is non-negative and about a (row,column)-pair if `POSNO`
2333 Examples of message texts are "Inconsistent lower and upper bounds." and "The
2334 variable has reached 'infinity.'" for a column, "The slack has reached
2335 'infinity.'" for a row and "Initial Jacobian element was not defined." for a
2339 @ingroup MESSAGEHANDLER_PYTHON
2341 @param rowno: The number of a row in the matrix.
2342 @param colno: The number of a column in the matrix.
2343 @param posno: The number of a Jacobian element in the matrix.
2344 @param msg: The actual message.
2346 return libconopt4_python.MessageHandler_errorMessage(self, rowno, colno, posno, msg)
2348 def progress(self, progressdata):
2350 progress(MessageHandler self, ConoptAlgProgress progressdata) -> int
2354 progressdata: ConoptAlgProgress const &
2357 return libconopt4_python.MessageHandler_progress(self, progressdata)
2359 def sendMessage(self, msg):
2361 sends a message to the message handler
2364 @ingroup MESSAGEHANDLER_PYTHON
2366 return libconopt4_python.MessageHandler_sendMessage(self, msg)
2368 def setVerbosityLevel(self, verblevel):
2370 sets the verbosity level for messaging.
2372 The effect of this will depend on how the user implements the custom message handler
2375 @ingroup MESSAGEHANDLER_PYTHON
2377 return libconopt4_python.MessageHandler_setVerbosityLevel(self, verblevel)
2378 def __disown__(self):
2380 libconopt4_python.disown_MessageHandler(self)
2381 return weakref.proxy(self)
2383# Register MessageHandler in libconopt4_python:
2384libconopt4_python.MessageHandler_swigregister(MessageHandler)
2385EvaluationMode_TermsOnly = libconopt4_python.EvaluationMode_TermsOnly
2386r"""only the nonlinear terms will be evaluated."""
2387EvaluationMode_JacobianOnly = libconopt4_python.EvaluationMode_JacobianOnly
2388r"""only the Jacobian of the nonlinear terms will be evaluated."""
2389EvaluationMode_Both = libconopt4_python.EvaluationMode_Both
2390r"""both the nonlinear terms and Jacobian will be evaluated."""
2391class ModelData(ConoptModelData):
2393 A class that can be extended to build and solve a model using Conopt.
2395 This class is the base class that is used for the extended interfaces for Conopt, namely Python and Java. The
2396 virtual methods included in this class can be redefined in the native languages.
2398 @ingroup MODELDATA_PYTHON
2401 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2402 __repr__ = _swig_repr
2406 __init__(ModelData self) -> ModelData
2413 if self.__class__ == ModelData:
2417 libconopt4_python.ModelData_swiginit(self, libconopt4_python.new_ModelData(_self, ))
2418 __swig_destroy__ = libconopt4_python.delete_ModelData
2420 def evaluateNonlinearTerm(self, x, rowno, ignerr, thread):
2422 callback method for evaluating the nonlinear terms in a given row
2424 @param x: the solution vector that needs to be evaluated.
2425 @param rowno: the number for the row in which the nonlinear term exists.
2426 @param ignerr: a boolean to indicate whether the current point is safe or unsafe.
2427 @param thread: the index of the thread from which this method is being called from.
2429 @return the value of the nonlinear terms.
2431 Notes: an error in the evaluation is reported by calling errorInEvaluation()
2433 @ingroup EVAL_NONLINEAR_FUNCTION_PYTHON
2435 return libconopt4_python.ModelData_evaluateNonlinearTerm(self, x, rowno, ignerr, thread)
2437 def evaluateNonlinearJacobian(self, x, rowno, jacnum, ignerr, thread):
2439 callback method for evaluating the jacobian for the nonlinear terms in a given row
2441 @param x: the solution vector that needs to be evaluated.
2442 @param rowno: the number for the row in which the nonlinear term exists.
2443 @param jacnum: vector with a list of column numbers for the nonlinear nonzero Jacobian elements in the row.
2444 @param ignerr: a boolean to indicate whether the current point is safe or unsafe.
2445 @param thread: the index of the thread from which this method is being called from.
2447 @return a vector the length of jacnum that contains the jacobian values for the referenced elements.
2449 Notes: an error in the evaluation is reported by calling errorInEvaluation()
2451 @ingroup EVAL_NONLINEAR_FUNCTION_PYTHON
2453 return libconopt4_python.ModelData_evaluateNonlinearJacobian(self, x, rowno, jacnum, ignerr, thread)
2455 def initFDEvaluation(self, x, rowlist, mode, numthread, ignerr):
2457 callback method for initialising the first derivative evaluation.
2459 If defined, this method will be called each time the point of interest
2460 has changed, and it will define the coming point and tell which constraints
2461 CONOPT will need during the following calls to `evaluateNonlinearTerm` and `evaluateNonlinearJacobian`.
2463 @param x: the solution vector that needs to be evaluated.
2464 @param rowlist: the list of rows that will be evaluated for the given point.
2465 @param mode: the evaluation mode for the current iteration. This is either TermsOnly, JacobianOnly or Both. See
2466 EvaluationMode for more details.
2467 @param numthread: the number of threads that will be used for the following FDEval calls.
2468 @param ignerr: a boolean to indicate whether the current point is safe or unsafe.
2470 Notes: an error in the evaluation is reported by calling errorInEvaluation()
2476 def endFDEvaluation(self, ignerr):
2478 Optional function, if defined, it will be called at the end of the function evaluation stage.
2479 This can be used to clean up any user data generated, such as in `FDEvalIni`, that was used to improve
2480 the efficiency of the function and derivative evaluation.
2482 @param ignerr: a boolean to indicate whether the current point is safe or unsafe.
2484 Notes: an error in the evaluation is reported by calling errorInEvaluation()
2486 @ingroup EVAL_NONLINEAR_FUNCTION_PYTHON
2488 return libconopt4_python.ModelData_endFDEvaluation(self, ignerr)
2490 def evaluateSDLagrangian(self, x, u, hessianrow, hessiancol):
2492 Computes and returns the numerical values of the Lagrangian of the Hessian
2494 @param x: the solution vector that needs to be evaluated.
2495 @param u: the vector of weights on the individual constraints.
2496 @param hessianrow: vector of row numbers of the lower triangular part of the hessian.
2497 @param hessiancol: vector of column numbers of the lower triangular part of the hessian.
2499 returns a vector for the values of the Lagrangian of the Hessian. The length of the vector is of size numHessianNonzeros().
2501 Notes: an error in the evaluation is reported by calling errorInEvaluation()
2503 @ingroup DEFINE_SECOND_DERIVATIVE_PYTHON
2505 return libconopt4_python.ModelData_evaluateSDLagrangian(self, x, u, hessianrow, hessiancol)
2507 def evaluateSDDirLagrangian(self, x, dx, u, newpoint):
2509 computes the directional second derivative for the Lagrangian
2511 @param x: the solution vector that needs to be evaluated.
2512 @param dx: vector with the direction in which the directional second derivatives should be computed.
2513 @param u: the vector of weights on the individual constraints.
2514 @param newpoint: a boolean to indicate whether x has changed. If newpoint is false, the values of dx may have
2517 returns a vector for the directional second derivative. The length of the vector is the number of variables.
2519 Notes: an error in the evaluation is reported by calling errorInEvaluation()
2521 @ingroup DEFINE_SECOND_DERIVATIVE_PYTHON
2523 return libconopt4_python.ModelData_evaluateSDDirLagrangian(self, x, dx, u, newpoint)
2525 def evaluateDirectionalSD(self, x, dx, rowno, jacnum, thread):
2527 computes the directional second derivative for a single constraint
2529 @param x: the solution vector that needs to be evaluated.
2530 @param dx: vector with the direction in which the directional second derivatives should be computed.
2531 @param rowno: the number for the row in which the nonlinear term exists.
2532 @param jacnum: vector with a list of column numbers for the nonlinear nonzero Jacobian elements in the row.
2533 @param thread: the index of the thread from which this method is being called from.
2535 returns a vector for the directional second derivative. The length of the vector is the number of variables.
2537 Notes: an error in the evaluation is reported by calling errorInEvaluation()
2539 @ingroup DEFINE_SECOND_DERIVATIVE_PYTHON
2541 return libconopt4_python.ModelData_evaluateDirectionalSD(self, x, dx, rowno, jacnum, thread)
2543 def initDirectionalSDEval(self, x, dx, rowlist, numthread, newpoint):
2545 a callback for the initialisation of the second derivative evaluation.
2547 This method is called before a sequence of calls to evaluateDirectionalSD(). The user can utilise this method
2548 for evaluating common terms and storing important information.
2550 @param x: the solution vector that needs to be evaluated.
2551 @param dx: vector with the direction in which the directional second derivatives should be computed.
2552 @param rowlist: the list of rows that will be evaluated for the given point.
2553 @param mode: the evaluation mode for the current iteration. This is either TermsOnly, JacobianOnly or Both. See
2554 EvaluationMode for more details.
2555 @param numthread: the number of threads that will be used for the following FDEval calls.
2556 @param newpoint: a boolean to indicate whether x has changed. If newpoint is false, the values of dx may have
2559 Notes: an error in the evaluation is reported by calling errorInEvaluation()
2565 def endDirectionalSDEval(self):
2567 called by CONOPT after a sequence of evaluateDirectionalSD() calls each time either the point or the direction
2570 It can be used to perform cleanup tasks, including to report if anything went wrong.
2572 Notes: an error in the evaluation is reported by calling errorInEvaluation()
2574 @ingroup DEFINE_SECOND_DERIVATIVE_PYTHON
2576 return libconopt4_python.ModelData_endDirectionalSDEval(self)
2578 def errorInEvaluation(self):
2580 reports that an error occurred in the evaluation.
2582 When executing evaluateNonlinearTerm() or evaluateNonlinearJacobian() the number of errors are counted and then
2583 if an error limit is exceeded, CONOPT will terminate.
2585 When evaluating second derivative information, any errors reported will inform CONOPT that it is unable to use
2586 second order methods for the current point.
2588 return libconopt4_python.ModelData_errorInEvaluation(self)
2590 def setProblemDimension(self, numvar, numcons, numnz, numnlnz):
2592 sets the problem dimension. This is called if the user wants to implement a custom readMatrix() method.
2594 NOTE: it is not possible to call setProblemDimension() and addConstraint() or addVariable(). The latter
2595 functions can only be used if the problem dimension is not set and the default readMatrix() method is used.
2598 @ingroup DEFINE_MODEL_PYTHON
2600 @param numvar: the number of variables in the problem
2601 @param numcons: the number of constraints in the problem
2602 @param numnz: the number of non-zeros in the constraint matrix
2603 @param numnlnz: the number of nonlinear non-zeros in the constraint matrix
2605 return libconopt4_python.ModelData_setProblemDimension(self, numvar, numcons, numnz, numnlnz)
2607 def addConstraint(self, *args):
2610 adds a constraint to the problem. The non-zero coefficients are added later
2613 @ingroup DEFINE_MODEL_PYTHON
2615 @param constype: the type of constraint, 0: ==, 1: >=, 2: <=, 3: free
2616 @param rhs: the right hand side
2617 @param slackstatus: initial status of the slack variables, see IniStat
2622 adds a constraint to the problem. The non-zero coefficients are added later
2625 @ingroup DEFINE_MODEL_PYTHON
2627 @param constype: the type of constraint, 0: ==, 1: >=, 2: <=, 3: free
2628 @param rhs: the right hand side
2629 @param slackstatus: initial status of the slack variables, see IniStat
2634 adds a constraint to the problem. The matrix non-zeros are added based on the supplied variables
2637 @ingroup DEFINE_MODEL_PYTHON
2639 @param constype: the type of constraint, 0: ==, 1: >=, 2: <=, 3: free
2640 @param rhs: the right hand side
2641 @param varindex: the variables this constraint has non-zero coefficients
2642 @param value: the non-zero of the variable
2643 @param nlflag: flag to set whether the variable belongs to a non-linear term
2644 @param slackstatus: initial status of the slack variables, see IniStat
2649 adds a constraint to the problem. The matrix non-zeros are added based on the supplied variables
2652 @ingroup DEFINE_MODEL_PYTHON
2654 @param constype: the type of constraint, 0: ==, 1: >=, 2: <=, 3: free
2655 @param rhs: the right hand side
2656 @param varindex: the variables this constraint has non-zero coefficients
2657 @param value: the non-zero of the variable
2658 @param nlflag: flag to set whether the variable belongs to a non-linear term
2659 @param slackstatus: initial status of the slack variables, see IniStat
2661 return libconopt4_python.ModelData_addConstraint(self, *args)
2663 def addVariable(self, *args):
2666 adds a variable to the model. The non-zero coefficients are added later.
2669 @ingroup DEFINE_MODEL_PYTHON
2671 @param lower: lower bound for the variable
2672 @param upper: upper bound for the variable
2673 @param curr: initial value of the variable, can be set to 0
2674 @param varstatus: initial status of the variable, see IniStat
2679 adds a variable to the model. The non-zero coefficients are added later.
2682 @ingroup DEFINE_MODEL_PYTHON
2684 @param lower: lower bound for the variable
2685 @param upper: upper bound for the variable
2686 @param curr: initial value of the variable, can be set to 0
2687 @param varstatus: initial status of the variable, see IniStat
2692 adds a variable to the model. The non-zero coefficients are added later.
2695 @ingroup DEFINE_MODEL_PYTHON
2697 @param lower: lower bound for the variable
2698 @param upper: upper bound for the variable
2699 @param curr: initial value of the variable, can be set to 0
2700 @param varstatus: initial status of the variable, see IniStat
2705 adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.
2708 @ingroup DEFINE_MODEL_PYTHON
2710 @param lower: lower bound for the variable
2711 @param upper: upper bound for the variable
2712 @param consindex: the constraints this variable has non-zero coefficients
2713 @param value: the non-zero of the variable
2714 @param nlflag: flag to set whether the variable belongs to a non-linear term
2715 @param curr: initial value of the variable, can be set to 0
2716 @param varstatus: initial status of the variable, see IniStat
2721 adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.
2724 @ingroup DEFINE_MODEL_PYTHON
2726 @param lower: lower bound for the variable
2727 @param upper: upper bound for the variable
2728 @param consindex: the constraints this variable has non-zero coefficients
2729 @param value: the non-zero of the variable
2730 @param nlflag: flag to set whether the variable belongs to a non-linear term
2731 @param curr: initial value of the variable, can be set to 0
2732 @param varstatus: initial status of the variable, see IniStat
2737 adds a variable to the problem. The matrix non-zeros are added based on the supplied constraints.
2740 @ingroup DEFINE_MODEL_PYTHON
2742 @param lower: lower bound for the variable
2743 @param upper: upper bound for the variable
2744 @param consindex: the constraints this variable has non-zero coefficients
2745 @param value: the non-zero of the variable
2746 @param nlflag: flag to set whether the variable belongs to a non-linear term
2747 @param curr: initial value of the variable, can be set to 0
2748 @param varstatus: initial status of the variable, see IniStat
2750 return libconopt4_python.ModelData_addVariable(self, *args)
2752 def setObjectiveElement(self, elem, elemindex):
2754 sets the index for the objective variable or constraint
2757 @ingroup DEFINE_MODEL_PYTHON
2759 return libconopt4_python.ModelData_setObjectiveElement(self, elem, elemindex)
2761 def setOptimizationSense(self, sense):
2763 sets the optimisation direction.
2766 @ingroup DEFINE_MODEL_PYTHON
2768 return libconopt4_python.ModelData_setOptimizationSense(self, sense)
2770 def setInitialStatusOption(self, inistat):
2772 the setting to indicate how the initial status of the variables and slack variables will be handled.
2774 The initial status is set in the addVariable() and addConstraint() methods, or in the readMatrix() method if the
2775 classical model input approach is used. By default, the value of inistat is 0, which means that the variable and
2776 slack status is ignored.
2779 The variable status has the following behaviour:
2780 - 0: The variable is initialized non-basic (if curr = lower or curr = upper) or super-basic, and
2781 - 1: The variable is initialized basic
2782 The slack status has the following behaviour:
2783 - 0: The slack is initialized non-basic (if the constraint is binding in the initial point) or super-basic,
2784 - 1: The slack is initialized basic
2787 The variable status has the following behaviour:
2788 - 0: The variable is initialized at lower bound
2789 - 1: The variable is initialized at upper bound
2790 - 2: The variable is initialized basic, and
2791 - 3: The variable is initialized superbasic.
2792 The slack status has the following behaviour:
2793 - 0: The slack is initialized at lower bound.
2794 - 1: The slack is initialized at upper bound.
2795 - 2: The slack is initialized basic, and
2796 - 3: The slack is initialized superbasic.
2799 @ingroup DEFINE_MODEL_PYTHON
2801 return libconopt4_python.ModelData_setInitialStatusOption(self, inistat)
2805 returns the number of variables in the model
2808 @ingroup QUERY_MODEL_PYTHON
2810 return libconopt4_python.ModelData_numVar(self)
2814 returns the number of constraints in the model
2817 @ingroup QUERY_MODEL_PYTHON
2819 return libconopt4_python.ModelData_numCons(self)
2821 def numHessianNonzeros(self):
2823 returns the number of non-zeros in the Hessian
2826 @ingroup QUERY_MODEL_PYTHON
2828 return libconopt4_python.ModelData_numHessianNonzeros(self)
2830 def getVariable(self, index):
2832 returns a reference to the variable object
2835 @ingroup QUERY_MODEL_PYTHON
2837 return libconopt4_python.ModelData_getVariable(self, index)
2839 def getConstraint(self, index):
2841 returns a reference to the constraint object
2844 @ingroup QUERY_MODEL_PYTHON
2846 return libconopt4_python.ModelData_getConstraint(self, index)
2848 def setSDEvaluationType(self, sdevaltype):
2850 informs CONOPT of the method for evaluating the second derivative
2853 @ingroup DEFINE_SECOND_DERIVATIVE_PYTHON
2855 return libconopt4_python.ModelData_setSDEvaluationType(self, sdevaltype)
2857 def setSDLagrangianStructure(self, rownum, colnum):
2859 sets the structure of the second derivatives of the Lagrangian
2862 @ingroup DEFINE_SECOND_DERIVATIVE_PYTHON
2864 @param rownum: Vector of row numbers of the lower triangular part of the Hessian.
2865 @param colnum: Vector of column numbers of the lower triangular part of the Hessian.
2867 return libconopt4_python.ModelData_setSDLagrangianStructure(self, rownum, colnum)
2868 def __disown__(self):
2870 libconopt4_python.disown_ModelData(self)
2871 return weakref.proxy(self)
2873# Register ModelData in libconopt4_python:
2874libconopt4_python.ModelData_swigregister(ModelData)
Proxy of C++ swig::SwigPyIterator class.
__init__(self, *args, **kwargs)
copy(self)
copy(SwigPyIterator self) -> SwigPyIterator
value(self)
value(SwigPyIterator self) -> PyObject *
distance(self, x)
distance(SwigPyIterator self, SwigPyIterator x) -> ptrdiff_t
incr(self, n=1)
incr(SwigPyIterator self, size_t n=1) -> SwigPyIterator
decr(self, n=1)
decr(SwigPyIterator self, size_t n=1) -> SwigPyIterator
equal(self, x)
equal(SwigPyIterator self, SwigPyIterator x) -> bool
_swig_setattr_nondynamic_class_variable(set)
_swig_setattr_nondynamic_instance_variable(set)
_swig_add_metaclass(metaclass)
Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six....