14 from sys
import version_info
as _swig_python_version_info
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,)
30 def _swig_setattr_nondynamic_instance_variable(set):
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
43 def _swig_setattr_nondynamic_class_variable(set):
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)
52 def _swig_add_metaclass(metaclass):
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())
59 class _SwigNonDynamicMeta(type):
60 """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
61 __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
66 class IMP_GSL_SwigPyIterator(object):
67 r"""Proxy of C++ swig::IMP_GSL_SwigPyIterator class."""
69 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
71 def __init__(self, *args, **kwargs):
72 raise AttributeError(
"No constructor defined - class is abstract")
74 __swig_destroy__ = _IMP_gsl.delete_IMP_GSL_SwigPyIterator
77 r"""value(IMP_GSL_SwigPyIterator self) -> PyObject *"""
78 return _IMP_gsl.IMP_GSL_SwigPyIterator_value(self)
81 r"""incr(IMP_GSL_SwigPyIterator self, size_t n=1) -> IMP_GSL_SwigPyIterator"""
82 return _IMP_gsl.IMP_GSL_SwigPyIterator_incr(self, n)
85 r"""decr(IMP_GSL_SwigPyIterator self, size_t n=1) -> IMP_GSL_SwigPyIterator"""
86 return _IMP_gsl.IMP_GSL_SwigPyIterator_decr(self, n)
88 def distance(self, x):
89 r"""distance(IMP_GSL_SwigPyIterator self, IMP_GSL_SwigPyIterator x) -> ptrdiff_t"""
90 return _IMP_gsl.IMP_GSL_SwigPyIterator_distance(self, x)
93 r"""equal(IMP_GSL_SwigPyIterator self, IMP_GSL_SwigPyIterator x) -> bool"""
94 return _IMP_gsl.IMP_GSL_SwigPyIterator_equal(self, x)
97 r"""copy(IMP_GSL_SwigPyIterator self) -> IMP_GSL_SwigPyIterator"""
98 return _IMP_gsl.IMP_GSL_SwigPyIterator_copy(self)
101 r"""next(IMP_GSL_SwigPyIterator self) -> PyObject *"""
102 return _IMP_gsl.IMP_GSL_SwigPyIterator_next(self)
105 r"""__next__(IMP_GSL_SwigPyIterator self) -> PyObject *"""
106 return _IMP_gsl.IMP_GSL_SwigPyIterator___next__(self)
109 r"""previous(IMP_GSL_SwigPyIterator self) -> PyObject *"""
110 return _IMP_gsl.IMP_GSL_SwigPyIterator_previous(self)
112 def advance(self, n):
113 r"""advance(IMP_GSL_SwigPyIterator self, ptrdiff_t n) -> IMP_GSL_SwigPyIterator"""
114 return _IMP_gsl.IMP_GSL_SwigPyIterator_advance(self, n)
117 r"""__eq__(IMP_GSL_SwigPyIterator self, IMP_GSL_SwigPyIterator x) -> bool"""
118 return _IMP_gsl.IMP_GSL_SwigPyIterator___eq__(self, x)
121 r"""__ne__(IMP_GSL_SwigPyIterator self, IMP_GSL_SwigPyIterator x) -> bool"""
122 return _IMP_gsl.IMP_GSL_SwigPyIterator___ne__(self, x)
124 def __iadd__(self, n):
125 r"""__iadd__(IMP_GSL_SwigPyIterator self, ptrdiff_t n) -> IMP_GSL_SwigPyIterator"""
126 return _IMP_gsl.IMP_GSL_SwigPyIterator___iadd__(self, n)
128 def __isub__(self, n):
129 r"""__isub__(IMP_GSL_SwigPyIterator self, ptrdiff_t n) -> IMP_GSL_SwigPyIterator"""
130 return _IMP_gsl.IMP_GSL_SwigPyIterator___isub__(self, n)
132 def __add__(self, n):
133 r"""__add__(IMP_GSL_SwigPyIterator self, ptrdiff_t n) -> IMP_GSL_SwigPyIterator"""
134 return _IMP_gsl.IMP_GSL_SwigPyIterator___add__(self, n)
136 def __sub__(self, *args):
138 __sub__(IMP_GSL_SwigPyIterator self, ptrdiff_t n) -> IMP_GSL_SwigPyIterator
139 __sub__(IMP_GSL_SwigPyIterator self, IMP_GSL_SwigPyIterator x) -> ptrdiff_t
141 return _IMP_gsl.IMP_GSL_SwigPyIterator___sub__(self, *args)
146 _IMP_gsl.IMP_GSL_SwigPyIterator_swigregister(IMP_GSL_SwigPyIterator)
153 IMP_DEBUG = _IMP_gsl.IMP_DEBUG
155 IMP_RELEASE = _IMP_gsl.IMP_RELEASE
157 IMP_SILENT = _IMP_gsl.IMP_SILENT
159 IMP_PROGRESS = _IMP_gsl.IMP_PROGRESS
161 IMP_TERSE = _IMP_gsl.IMP_TERSE
163 IMP_VERBOSE = _IMP_gsl.IMP_VERBOSE
165 IMP_MEMORY = _IMP_gsl.IMP_MEMORY
167 IMP_NONE = _IMP_gsl.IMP_NONE
169 IMP_USAGE = _IMP_gsl.IMP_USAGE
171 IMP_INTERNAL = _IMP_gsl.IMP_INTERNAL
173 IMP_KERNEL_HAS_LOG4CXX = _IMP_gsl.IMP_KERNEL_HAS_LOG4CXX
175 IMP_COMPILER_HAS_CEREAL_RAW_POINTER = _IMP_gsl.IMP_COMPILER_HAS_CEREAL_RAW_POINTER
177 IMP_COMPILER_HAS_DEBUG_VECTOR = _IMP_gsl.IMP_COMPILER_HAS_DEBUG_VECTOR
179 IMP_COMPILER_HAS_RANDOM_SHUFFLE = _IMP_gsl.IMP_COMPILER_HAS_RANDOM_SHUFFLE
181 IMP_COMPILER_HAS_THREE_WAY = _IMP_gsl.IMP_COMPILER_HAS_THREE_WAY
183 IMP_KERNEL_HAS_BOOST_RANDOM = _IMP_gsl.IMP_KERNEL_HAS_BOOST_RANDOM
185 IMP_KERNEL_HAS_NUMPY = _IMP_gsl.IMP_KERNEL_HAS_NUMPY
187 IMP_KERNEL_HAS_GPERFTOOLS = _IMP_gsl.IMP_KERNEL_HAS_GPERFTOOLS
189 IMP_KERNEL_HAS_TCMALLOC_HEAPCHECKER = _IMP_gsl.IMP_KERNEL_HAS_TCMALLOC_HEAPCHECKER
191 IMP_KERNEL_HAS_TCMALLOC_HEAPPROFILER = _IMP_gsl.IMP_KERNEL_HAS_TCMALLOC_HEAPPROFILER
193 IMPKERNEL_SHOW_WARNINGS = _IMP_gsl.IMPKERNEL_SHOW_WARNINGS
197 class _DirectorObjects:
198 """@internal Simple class to keep references to director objects
199 to prevent premature deletion."""
202 def register(self, obj):
203 """Take a reference to a director object; will only work for
204 refcounted C++ classes"""
205 if hasattr(obj,
'get_ref_count'):
206 self._objects.append(obj)
208 """Only drop our reference and allow cleanup by Python if no other
209 Python references exist (we hold 3 references: one in self._objects,
210 one in x, and one in the argument list for getrefcount) *and* no
211 other C++ references exist (the Python object always holds one)"""
212 objs = [x
for x
in self._objects
if sys.getrefcount(x) > 3 \
213 or x.get_ref_count() > 1]
217 def get_object_count(self):
218 """Get number of director objects (useful for testing only)"""
219 return len(self._objects)
220 _director_objects = _DirectorObjects()
222 class _ostream(object):
223 r"""Proxy of C++ std::ostream class."""
225 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
227 def __init__(self, *args, **kwargs):
228 raise AttributeError(
"No constructor defined")
229 __repr__ = _swig_repr
231 def write(self, osa_buf):
232 r"""write(_ostream self, char const * osa_buf)"""
233 return _IMP_gsl._ostream_write(self, osa_buf)
236 _IMP_gsl._ostream_swigregister(_ostream)
237 IMP_C_OPEN_BINARY = _IMP_gsl.IMP_C_OPEN_BINARY
240 IMP_CGAL_HAS_BOOST_FILESYSTEM = _IMP_gsl.IMP_CGAL_HAS_BOOST_FILESYSTEM
242 IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS = _IMP_gsl.IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS
244 IMP_CGAL_HAS_BOOST_RANDOM = _IMP_gsl.IMP_CGAL_HAS_BOOST_RANDOM
246 IMP_CGAL_HAS_BOOST_SYSTEM = _IMP_gsl.IMP_CGAL_HAS_BOOST_SYSTEM
248 IMP_CGAL_HAS_NUMPY = _IMP_gsl.IMP_CGAL_HAS_NUMPY
250 IMPCGAL_SHOW_WARNINGS = _IMP_gsl.IMPCGAL_SHOW_WARNINGS
253 IMP_ALGEBRA_HAS_IMP_CGAL = _IMP_gsl.IMP_ALGEBRA_HAS_IMP_CGAL
255 IMP_ALGEBRA_HAS_BOOST_FILESYSTEM = _IMP_gsl.IMP_ALGEBRA_HAS_BOOST_FILESYSTEM
257 IMP_ALGEBRA_HAS_BOOST_PROGRAMOPTIONS = _IMP_gsl.IMP_ALGEBRA_HAS_BOOST_PROGRAMOPTIONS
259 IMP_ALGEBRA_HAS_BOOST_RANDOM = _IMP_gsl.IMP_ALGEBRA_HAS_BOOST_RANDOM
261 IMP_ALGEBRA_HAS_BOOST_SYSTEM = _IMP_gsl.IMP_ALGEBRA_HAS_BOOST_SYSTEM
263 IMP_ALGEBRA_HAS_CGAL = _IMP_gsl.IMP_ALGEBRA_HAS_CGAL
265 IMP_ALGEBRA_HAS_NUMPY = _IMP_gsl.IMP_ALGEBRA_HAS_NUMPY
267 IMP_ALGEBRA_HAS_ANN = _IMP_gsl.IMP_ALGEBRA_HAS_ANN
269 IMPALGEBRA_SHOW_WARNINGS = _IMP_gsl.IMPALGEBRA_SHOW_WARNINGS
272 IMP_GSL_HAS_IMP_CGAL = _IMP_gsl.IMP_GSL_HAS_IMP_CGAL
274 IMP_GSL_HAS_BOOST_FILESYSTEM = _IMP_gsl.IMP_GSL_HAS_BOOST_FILESYSTEM
276 IMP_GSL_HAS_BOOST_PROGRAMOPTIONS = _IMP_gsl.IMP_GSL_HAS_BOOST_PROGRAMOPTIONS
278 IMP_GSL_HAS_BOOST_RANDOM = _IMP_gsl.IMP_GSL_HAS_BOOST_RANDOM
280 IMP_GSL_HAS_BOOST_SYSTEM = _IMP_gsl.IMP_GSL_HAS_BOOST_SYSTEM
282 IMP_GSL_HAS_CGAL = _IMP_gsl.IMP_GSL_HAS_CGAL
284 IMP_GSL_HAS_NUMPY = _IMP_gsl.IMP_GSL_HAS_NUMPY
286 IMPGSL_SHOW_WARNINGS = _IMP_gsl.IMPGSL_SHOW_WARNINGS
289 _object_types.append(
"GSLOptimizer")
292 def _object_cast_to_GSLOptimizer(o):
293 r"""_object_cast_to_GSLOptimizer(Object o) -> GSLOptimizer"""
294 return _IMP_gsl._object_cast_to_GSLOptimizer(o)
296 _object_types.append(
"ConjugateGradients")
299 def _object_cast_to_ConjugateGradients(o):
300 r"""_object_cast_to_ConjugateGradients(Object o) -> ConjugateGradients"""
301 return _IMP_gsl._object_cast_to_ConjugateGradients(o)
303 _object_types.append(
"QuasiNewton")
306 def _object_cast_to_QuasiNewton(o):
307 r"""_object_cast_to_QuasiNewton(Object o) -> QuasiNewton"""
308 return _IMP_gsl._object_cast_to_QuasiNewton(o)
310 _object_types.append(
"Simplex")
313 def _object_cast_to_Simplex(o):
314 r"""_object_cast_to_Simplex(Object o) -> Simplex"""
315 return _IMP_gsl._object_cast_to_Simplex(o)
317 r"""Proxy of C++ IMP::gsl::GSLOptimizer class."""
319 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
321 def __init__(self, m):
322 r"""__init__(GSLOptimizer self, Model m) -> GSLOptimizer"""
323 if self.__class__ == GSLOptimizer:
327 _IMP_gsl.GSLOptimizer_swiginit(self, _IMP_gsl.new_GSLOptimizer(_self, m))
329 if self.__class__ != GSLOptimizer:
330 _director_objects.register(self)
334 __swig_destroy__ = _IMP_gsl.delete_GSLOptimizer
336 def set_stop_score(self, d):
337 r"""set_stop_score(GSLOptimizer self, double d)"""
338 return _IMP_gsl.GSLOptimizer_set_stop_score(self, d)
341 r"""__str__(GSLOptimizer self) -> std::string"""
342 return _IMP_gsl.GSLOptimizer___str__(self)
345 r"""__repr__(GSLOptimizer self) -> std::string"""
346 return _IMP_gsl.GSLOptimizer___repr__(self)
350 return _object_cast_to_GSLOptimizer(o)
353 def get_type_name(self):
354 return self.__class__.__name__
355 def do_show(self, out):
358 if"IMP::gsl" ==
"IMP":
359 return VersionInfo(self.__module__,
366 return _object_cast_to_GSLOptimizer(o)
368 def __disown__(self):
370 _IMP_gsl.disown_GSLOptimizer(self)
371 return weakref.proxy(self)
374 r"""do_destroy(GSLOptimizer self)"""
375 return _IMP_gsl.GSLOptimizer_do_destroy(self)
377 def handle_set_has_required_score_states(self, arg0):
378 r"""handle_set_has_required_score_states(GSLOptimizer self, bool arg0)"""
379 return _IMP_gsl.GSLOptimizer_handle_set_has_required_score_states(self, arg0)
382 r"""do_get_inputs(GSLOptimizer self) -> IMP::ModelObjectsTemp"""
383 return _IMP_gsl.GSLOptimizer_do_get_inputs(self)
386 r"""do_get_outputs(GSLOptimizer self) -> IMP::ModelObjectsTemp"""
387 return _IMP_gsl.GSLOptimizer_do_get_outputs(self)
389 def do_get_interactions(self):
390 r"""do_get_interactions(GSLOptimizer self) -> IMP::ModelObjectsTemps"""
391 return _IMP_gsl.GSLOptimizer_do_get_interactions(self)
393 def do_optimize(self, ns):
394 r"""do_optimize(GSLOptimizer self, unsigned int ns) -> double"""
395 return _IMP_gsl.GSLOptimizer_do_optimize(self, ns)
398 _IMP_gsl.GSLOptimizer_swigregister(GSLOptimizer)
399 class ConjugateGradients(GSLOptimizer):
400 r"""Proxy of C++ IMP::gsl::ConjugateGradients class."""
402 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
404 def __init__(self, m):
405 r"""__init__(ConjugateGradients self, Model m) -> ConjugateGradients"""
406 _IMP_gsl.ConjugateGradients_swiginit(self, _IMP_gsl.new_ConjugateGradients(m))
408 def set_threshold(self, mg):
409 r"""set_threshold(ConjugateGradients self, double mg)"""
410 return _IMP_gsl.ConjugateGradients_set_threshold(self, mg)
412 def do_optimize(self, max_steps):
413 r"""do_optimize(ConjugateGradients self, unsigned int max_steps) -> IMP::Float"""
414 return _IMP_gsl.ConjugateGradients_do_optimize(self, max_steps)
417 r"""get_version_info(ConjugateGradients self) -> VersionInfo"""
418 return _IMP_gsl.ConjugateGradients_get_version_info(self)
419 __swig_destroy__ = _IMP_gsl.delete_ConjugateGradients
422 r"""__str__(ConjugateGradients self) -> std::string"""
423 return _IMP_gsl.ConjugateGradients___str__(self)
426 r"""__repr__(ConjugateGradients self) -> std::string"""
427 return _IMP_gsl.ConjugateGradients___repr__(self)
431 return _object_cast_to_ConjugateGradients(o)
435 _IMP_gsl.ConjugateGradients_swigregister(ConjugateGradients)
436 class QuasiNewton(GSLOptimizer):
437 r"""Proxy of C++ IMP::gsl::QuasiNewton class."""
439 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
441 def __init__(self, m):
442 r"""__init__(QuasiNewton self, Model m) -> QuasiNewton"""
443 _IMP_gsl.QuasiNewton_swiginit(self, _IMP_gsl.new_QuasiNewton(m))
445 def set_initial_step(self, length):
446 r"""set_initial_step(QuasiNewton self, double length)"""
447 return _IMP_gsl.QuasiNewton_set_initial_step(self, length)
449 def set_line_step(self, d):
450 r"""set_line_step(QuasiNewton self, double d)"""
451 return _IMP_gsl.QuasiNewton_set_line_step(self, d)
453 def set_minimum_gradient(self, d):
454 r"""set_minimum_gradient(QuasiNewton self, double d)"""
455 return _IMP_gsl.QuasiNewton_set_minimum_gradient(self, d)
457 def do_optimize(self, max_steps):
458 r"""do_optimize(QuasiNewton self, unsigned int max_steps) -> IMP::Float"""
459 return _IMP_gsl.QuasiNewton_do_optimize(self, max_steps)
462 r"""get_version_info(QuasiNewton self) -> VersionInfo"""
463 return _IMP_gsl.QuasiNewton_get_version_info(self)
464 __swig_destroy__ = _IMP_gsl.delete_QuasiNewton
467 r"""__str__(QuasiNewton self) -> std::string"""
468 return _IMP_gsl.QuasiNewton___str__(self)
471 r"""__repr__(QuasiNewton self) -> std::string"""
472 return _IMP_gsl.QuasiNewton___repr__(self)
476 return _object_cast_to_QuasiNewton(o)
480 _IMP_gsl.QuasiNewton_swigregister(QuasiNewton)
481 class Simplex(GSLOptimizer):
482 r"""Proxy of C++ IMP::gsl::Simplex class."""
484 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
486 def __init__(self, m):
487 r"""__init__(Simplex self, Model m) -> Simplex"""
488 _IMP_gsl.Simplex_swiginit(self, _IMP_gsl.new_Simplex(m))
490 def set_initial_length(self, length):
491 r"""set_initial_length(Simplex self, double length)"""
492 return _IMP_gsl.Simplex_set_initial_length(self, length)
494 def set_minimum_size(self, d):
495 r"""set_minimum_size(Simplex self, double d)"""
496 return _IMP_gsl.Simplex_set_minimum_size(self, d)
498 def do_optimize(self, max_steps):
499 r"""do_optimize(Simplex self, unsigned int max_steps) -> IMP::Float"""
500 return _IMP_gsl.Simplex_do_optimize(self, max_steps)
503 r"""get_version_info(Simplex self) -> VersionInfo"""
504 return _IMP_gsl.Simplex_get_version_info(self)
505 __swig_destroy__ = _IMP_gsl.delete_Simplex
508 r"""__str__(Simplex self) -> std::string"""
509 return _IMP_gsl.Simplex___str__(self)
512 r"""__repr__(Simplex self) -> std::string"""
513 return _IMP_gsl.Simplex___repr__(self)
517 return _object_cast_to_Simplex(o)
521 _IMP_gsl.Simplex_swigregister(Simplex)
524 r"""get_module_version() -> std::string const"""
525 return _IMP_gsl.get_module_version()
528 r"""get_example_path(std::string fname) -> std::string"""
529 return _IMP_gsl.get_example_path(fname)
532 r"""get_data_path(std::string fname) -> std::string"""
533 return _IMP_gsl.get_data_path(fname)
535 from .
import _version_check
Make CGAL functionality available to IMP.
virtual ModelObjectsTemp do_get_outputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the outputs.
virtual void do_destroy()
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
Version and module information for Objects.
Base class for optimizers that act on individual attributes.
General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP...
std::string get_module_version()
Return the version of this module, as a string.
virtual VersionInfo get_version_info() const
Get information about the module and version of the object.
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.
std::string get_data_path(std::string file_name)
Return the full path to one of this module's data files.