11 from sys
import version_info
12 if version_info >= (2,6,0):
13 def swig_import_helper():
14 from os.path
import dirname
18 fp, pathname, description = imp.find_module(
'_IMP_gsl', [dirname(__file__)])
24 _mod = imp.load_module(
'_IMP_gsl', fp, pathname, description)
28 _IMP_gsl = swig_import_helper()
29 del swig_import_helper
34 _swig_property = property
37 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
38 if (name ==
"thisown"):
return self.this.own(value)
40 if type(value).__name__ ==
'SwigPyObject':
41 self.__dict__[name] = value
43 method = class_type.__swig_setmethods__.get(name,
None)
44 if method:
return method(self,value)
46 self.__dict__[name] = value
48 raise AttributeError(
"You cannot add attributes to %s" % self)
50 def _swig_setattr(self,class_type,name,value):
51 return _swig_setattr_nondynamic(self,class_type,name,value,0)
53 def _swig_getattr(self,class_type,name):
54 if (name ==
"thisown"):
return self.this.own()
55 method = class_type.__swig_getmethods__.get(name,
None)
56 if method:
return method(self)
57 raise AttributeError(name)
60 try: strthis =
"proxy of " + self.this.__repr__()
62 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
67 except AttributeError:
72 def _swig_setattr_nondynamic_method(set):
73 def set_attr(self,name,value):
74 if (name ==
"thisown"):
return self.this.own(value)
75 if hasattr(self,name)
or (name ==
"this"):
78 raise AttributeError(
"You cannot add attributes to %s" % self)
84 weakref_proxy = weakref.proxy
86 weakref_proxy =
lambda x: x
89 class IMP_GSL_SwigPyIterator(object):
90 """Proxy of C++ swig::IMP_GSL_SwigPyIterator class"""
91 thisown = _swig_property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
'The membership flag')
92 def __init__(self, *args, **kwargs):
raise AttributeError(
"No constructor defined - class is abstract")
94 __swig_destroy__ = _IMP_gsl.delete_IMP_GSL_SwigPyIterator
95 __del__ =
lambda self :
None;
97 """value(IMP_GSL_SwigPyIterator self) -> PyObject *"""
98 return _IMP_gsl.IMP_GSL_SwigPyIterator_value(self)
102 incr(IMP_GSL_SwigPyIterator self, size_t n=1) -> IMP_GSL_SwigPyIterator
103 incr(IMP_GSL_SwigPyIterator self) -> IMP_GSL_SwigPyIterator
105 return _IMP_gsl.IMP_GSL_SwigPyIterator_incr(self, n)
109 decr(IMP_GSL_SwigPyIterator self, size_t n=1) -> IMP_GSL_SwigPyIterator
110 decr(IMP_GSL_SwigPyIterator self) -> IMP_GSL_SwigPyIterator
112 return _IMP_gsl.IMP_GSL_SwigPyIterator_decr(self, n)
114 def distance(self, *args):
115 """distance(IMP_GSL_SwigPyIterator self, IMP_GSL_SwigPyIterator x) -> ptrdiff_t"""
116 return _IMP_gsl.IMP_GSL_SwigPyIterator_distance(self, *args)
118 def equal(self, *args):
119 """equal(IMP_GSL_SwigPyIterator self, IMP_GSL_SwigPyIterator x) -> bool"""
120 return _IMP_gsl.IMP_GSL_SwigPyIterator_equal(self, *args)
123 """copy(IMP_GSL_SwigPyIterator self) -> IMP_GSL_SwigPyIterator"""
124 return _IMP_gsl.IMP_GSL_SwigPyIterator_copy(self)
127 """next(IMP_GSL_SwigPyIterator self) -> PyObject *"""
128 return _IMP_gsl.IMP_GSL_SwigPyIterator_next(self)
131 """__next__(IMP_GSL_SwigPyIterator self) -> PyObject *"""
132 return _IMP_gsl.IMP_GSL_SwigPyIterator___next__(self)
135 """previous(IMP_GSL_SwigPyIterator self) -> PyObject *"""
136 return _IMP_gsl.IMP_GSL_SwigPyIterator_previous(self)
138 def advance(self, *args):
139 """advance(IMP_GSL_SwigPyIterator self, ptrdiff_t n) -> IMP_GSL_SwigPyIterator"""
140 return _IMP_gsl.IMP_GSL_SwigPyIterator_advance(self, *args)
142 def __eq__(self, *args):
143 """__eq__(IMP_GSL_SwigPyIterator self, IMP_GSL_SwigPyIterator x) -> bool"""
144 return _IMP_gsl.IMP_GSL_SwigPyIterator___eq__(self, *args)
146 def __ne__(self, *args):
147 """__ne__(IMP_GSL_SwigPyIterator self, IMP_GSL_SwigPyIterator x) -> bool"""
148 return _IMP_gsl.IMP_GSL_SwigPyIterator___ne__(self, *args)
150 def __iadd__(self, *args):
151 """__iadd__(IMP_GSL_SwigPyIterator self, ptrdiff_t n) -> IMP_GSL_SwigPyIterator"""
152 return _IMP_gsl.IMP_GSL_SwigPyIterator___iadd__(self, *args)
154 def __isub__(self, *args):
155 """__isub__(IMP_GSL_SwigPyIterator self, ptrdiff_t n) -> IMP_GSL_SwigPyIterator"""
156 return _IMP_gsl.IMP_GSL_SwigPyIterator___isub__(self, *args)
158 def __add__(self, *args):
159 """__add__(IMP_GSL_SwigPyIterator self, ptrdiff_t n) -> IMP_GSL_SwigPyIterator"""
160 return _IMP_gsl.IMP_GSL_SwigPyIterator___add__(self, *args)
162 def __sub__(self, *args):
164 __sub__(IMP_GSL_SwigPyIterator self, ptrdiff_t n) -> IMP_GSL_SwigPyIterator
165 __sub__(IMP_GSL_SwigPyIterator self, IMP_GSL_SwigPyIterator x) -> ptrdiff_t
167 return _IMP_gsl.IMP_GSL_SwigPyIterator___sub__(self, *args)
169 def __iter__(self):
return self
170 IMP_GSL_SwigPyIterator_swigregister = _IMP_gsl.IMP_GSL_SwigPyIterator_swigregister
171 IMP_GSL_SwigPyIterator_swigregister(IMP_GSL_SwigPyIterator)
178 IMP_DEBUG = _IMP_gsl.IMP_DEBUG
179 IMP_RELEASE = _IMP_gsl.IMP_RELEASE
180 IMP_SILENT = _IMP_gsl.IMP_SILENT
181 IMP_PROGRESS = _IMP_gsl.IMP_PROGRESS
182 IMP_TERSE = _IMP_gsl.IMP_TERSE
183 IMP_VERBOSE = _IMP_gsl.IMP_VERBOSE
184 IMP_MEMORY = _IMP_gsl.IMP_MEMORY
185 IMP_NONE = _IMP_gsl.IMP_NONE
186 IMP_USAGE = _IMP_gsl.IMP_USAGE
187 IMP_INTERNAL = _IMP_gsl.IMP_INTERNAL
188 IMP_BASE_HAS_LOG4CXX = _IMP_gsl.IMP_BASE_HAS_LOG4CXX
189 IMP_COMPILER_HAS_AUTO = _IMP_gsl.IMP_COMPILER_HAS_AUTO
190 IMP_COMPILER_HAS_DEBUG_VECTOR = _IMP_gsl.IMP_COMPILER_HAS_DEBUG_VECTOR
191 IMP_BASE_HAS_BOOST_RANDOM = _IMP_gsl.IMP_BASE_HAS_BOOST_RANDOM
192 IMP_BASE_HAS_GPERFTOOLS = _IMP_gsl.IMP_BASE_HAS_GPERFTOOLS
193 IMP_BASE_HAS_TCMALLOC_HEAPCHECKER = _IMP_gsl.IMP_BASE_HAS_TCMALLOC_HEAPCHECKER
194 IMP_BASE_HAS_TCMALLOC_HEAPPROFILER = _IMP_gsl.IMP_BASE_HAS_TCMALLOC_HEAPPROFILER
195 IMPBASE_SHOW_WARNINGS = _IMP_gsl.IMPBASE_SHOW_WARNINGS
197 class _DirectorObjects(object):
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 """Proxy of C++ std::ostream class"""
224 thisown = _swig_property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
'The membership flag')
225 def __init__(self, *args, **kwargs):
raise AttributeError(
"No constructor defined")
226 __repr__ = _swig_repr
227 def write(self, *args):
228 """write(_ostream self, char const * osa_buf)"""
229 return _IMP_gsl._ostream_write(self, *args)
231 _ostream_swigregister = _IMP_gsl._ostream_swigregister
232 _ostream_swigregister(_ostream)
234 IMP_COMPILER_HAS_OVERRIDE = _IMP_gsl.IMP_COMPILER_HAS_OVERRIDE
235 IMP_COMPILER_HAS_FINAL = _IMP_gsl.IMP_COMPILER_HAS_FINAL
236 IMP_HAS_NOEXCEPT = _IMP_gsl.IMP_HAS_NOEXCEPT
238 IMP_CGAL_HAS_BOOST_FILESYSTEM = _IMP_gsl.IMP_CGAL_HAS_BOOST_FILESYSTEM
239 IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS = _IMP_gsl.IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS
240 IMP_CGAL_HAS_BOOST_RANDOM = _IMP_gsl.IMP_CGAL_HAS_BOOST_RANDOM
241 IMP_CGAL_HAS_BOOST_SYSTEM = _IMP_gsl.IMP_CGAL_HAS_BOOST_SYSTEM
242 IMPCGAL_SHOW_WARNINGS = _IMP_gsl.IMPCGAL_SHOW_WARNINGS
244 IMP_ALGEBRA_HAS_IMP_CGAL = _IMP_gsl.IMP_ALGEBRA_HAS_IMP_CGAL
245 IMP_ALGEBRA_HAS_BOOST_FILESYSTEM = _IMP_gsl.IMP_ALGEBRA_HAS_BOOST_FILESYSTEM
246 IMP_ALGEBRA_HAS_BOOST_PROGRAMOPTIONS = _IMP_gsl.IMP_ALGEBRA_HAS_BOOST_PROGRAMOPTIONS
247 IMP_ALGEBRA_HAS_BOOST_RANDOM = _IMP_gsl.IMP_ALGEBRA_HAS_BOOST_RANDOM
248 IMP_ALGEBRA_HAS_BOOST_SYSTEM = _IMP_gsl.IMP_ALGEBRA_HAS_BOOST_SYSTEM
249 IMP_ALGEBRA_HAS_CGAL = _IMP_gsl.IMP_ALGEBRA_HAS_CGAL
250 IMP_ALGEBRA_HAS_ANN = _IMP_gsl.IMP_ALGEBRA_HAS_ANN
251 IMPALGEBRA_SHOW_WARNINGS = _IMP_gsl.IMPALGEBRA_SHOW_WARNINGS
253 IMP_KERNEL_HAS_IMP_CGAL = _IMP_gsl.IMP_KERNEL_HAS_IMP_CGAL
254 IMP_KERNEL_HAS_BOOST_PROGRAMOPTIONS = _IMP_gsl.IMP_KERNEL_HAS_BOOST_PROGRAMOPTIONS
255 IMP_KERNEL_HAS_BOOST_RANDOM = _IMP_gsl.IMP_KERNEL_HAS_BOOST_RANDOM
256 IMP_KERNEL_HAS_BOOST_SYSTEM = _IMP_gsl.IMP_KERNEL_HAS_BOOST_SYSTEM
257 IMP_KERNEL_HAS_CGAL = _IMP_gsl.IMP_KERNEL_HAS_CGAL
258 IMPKERNEL_SHOW_WARNINGS = _IMP_gsl.IMPKERNEL_SHOW_WARNINGS
260 IMP_GSL_HAS_IMP_BASE = _IMP_gsl.IMP_GSL_HAS_IMP_BASE
261 IMP_GSL_HAS_IMP_CGAL = _IMP_gsl.IMP_GSL_HAS_IMP_CGAL
262 IMP_GSL_HAS_BOOST_FILESYSTEM = _IMP_gsl.IMP_GSL_HAS_BOOST_FILESYSTEM
263 IMP_GSL_HAS_BOOST_PROGRAMOPTIONS = _IMP_gsl.IMP_GSL_HAS_BOOST_PROGRAMOPTIONS
264 IMP_GSL_HAS_BOOST_RANDOM = _IMP_gsl.IMP_GSL_HAS_BOOST_RANDOM
265 IMP_GSL_HAS_BOOST_SYSTEM = _IMP_gsl.IMP_GSL_HAS_BOOST_SYSTEM
266 IMP_GSL_HAS_CGAL = _IMP_gsl.IMP_GSL_HAS_CGAL
267 IMPGSL_SHOW_WARNINGS = _IMP_gsl.IMPGSL_SHOW_WARNINGS
268 _object_types.append(
"GSLOptimizer")
271 def _object_cast_to_GSLOptimizer(*args):
272 """_object_cast_to_GSLOptimizer(Object o) -> GSLOptimizer"""
273 return _IMP_gsl._object_cast_to_GSLOptimizer(*args)
274 _object_types.append(
"ConjugateGradients")
277 def _object_cast_to_ConjugateGradients(*args):
278 """_object_cast_to_ConjugateGradients(Object o) -> ConjugateGradients"""
279 return _IMP_gsl._object_cast_to_ConjugateGradients(*args)
280 _object_types.append(
"QuasiNewton")
283 def _object_cast_to_QuasiNewton(*args):
284 """_object_cast_to_QuasiNewton(Object o) -> QuasiNewton"""
285 return _IMP_gsl._object_cast_to_QuasiNewton(*args)
286 _object_types.append(
"Simplex")
289 def _object_cast_to_Simplex(*args):
290 """_object_cast_to_Simplex(Object o) -> Simplex"""
291 return _IMP_gsl._object_cast_to_Simplex(*args)
293 """Proxy of C++ IMP::gsl::GSLOptimizer class"""
294 thisown = _swig_property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
'The membership flag')
295 def __init__(self, *args):
296 """__init__(IMP::gsl::GSLOptimizer self, Model m) -> GSLOptimizer"""
297 if self.__class__ == GSLOptimizer:
301 this = _IMP_gsl.new_GSLOptimizer(_self, *args)
302 try: self.this.append(this)
303 except: self.this = this
304 if self.__class__ != GSLOptimizer:
306 IMP.base._director_objects.register(self)
310 __swig_destroy__ = _IMP_gsl.delete_GSLOptimizer
311 __del__ =
lambda self :
None;
312 def set_stop_score(self, *args):
313 """set_stop_score(GSLOptimizer self, double d)"""
314 return _IMP_gsl.GSLOptimizer_set_stop_score(self, *args)
317 """__str__(GSLOptimizer self) -> std::string"""
318 return _IMP_gsl.GSLOptimizer___str__(self)
321 """__repr__(GSLOptimizer self) -> std::string"""
322 return _IMP_gsl.GSLOptimizer___repr__(self)
325 return _object_cast_to_GSLOptimizer(o)
326 get_from = staticmethod(get_from)
328 def get_type_name(self):
329 return self.__class__.__name__
330 def do_show(self, out):
332 def get_version_info(self):
333 if"IMP::gsl" ==
"IMP":
334 return VersionInfo(
"python",
"0")
336 return IMP.VersionInfo(
"python",
"0")
338 return _object_cast_to_GSLOptimizer(o)
339 get_from = staticmethod(get_from)
341 def __disown__(self):
343 _IMP_gsl.disown_GSLOptimizer(self)
344 return weakref_proxy(self)
345 def do_destroy(self):
346 """do_destroy(GSLOptimizer self)"""
347 return _IMP_gsl.GSLOptimizer_do_destroy(self)
349 def handle_set_has_required_score_states(self, *args):
350 """handle_set_has_required_score_states(GSLOptimizer self, bool arg0)"""
351 return _IMP_gsl.GSLOptimizer_handle_set_has_required_score_states(self, *args)
353 def do_get_inputs(self):
354 """do_get_inputs(GSLOptimizer self) -> IMP::kernel::ModelObjectsTemp"""
355 return _IMP_gsl.GSLOptimizer_do_get_inputs(self)
357 def do_get_outputs(self):
358 """do_get_outputs(GSLOptimizer self) -> IMP::kernel::ModelObjectsTemp"""
359 return _IMP_gsl.GSLOptimizer_do_get_outputs(self)
361 def do_get_interactions(self):
362 """do_get_interactions(GSLOptimizer self) -> IMP::kernel::ModelObjectsTemps"""
363 return _IMP_gsl.GSLOptimizer_do_get_interactions(self)
365 def do_optimize(self, *args):
366 """do_optimize(GSLOptimizer self, unsigned int ns) -> double"""
367 return _IMP_gsl.GSLOptimizer_do_optimize(self, *args)
369 GSLOptimizer_swigregister = _IMP_gsl.GSLOptimizer_swigregister
370 GSLOptimizer_swigregister(GSLOptimizer)
372 class ConjugateGradients(GSLOptimizer):
373 """Proxy of C++ IMP::gsl::ConjugateGradients class"""
374 thisown = _swig_property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
'The membership flag')
375 def __init__(self, *args):
376 """__init__(IMP::gsl::ConjugateGradients self, Model m) -> ConjugateGradients"""
377 this = _IMP_gsl.new_ConjugateGradients(*args)
378 try: self.this.append(this)
379 except: self.this = this
380 def set_threshold(self, *args):
381 """set_threshold(ConjugateGradients self, double mg)"""
382 return _IMP_gsl.ConjugateGradients_set_threshold(self, *args)
384 def do_optimize(self, *args):
385 """do_optimize(ConjugateGradients self, unsigned int max_steps) -> IMP::Float"""
386 return _IMP_gsl.ConjugateGradients_do_optimize(self, *args)
388 def get_version_info(self):
389 """get_version_info(ConjugateGradients self) -> VersionInfo"""
390 return _IMP_gsl.ConjugateGradients_get_version_info(self)
393 """__str__(ConjugateGradients self) -> std::string"""
394 return _IMP_gsl.ConjugateGradients___str__(self)
397 """__repr__(ConjugateGradients self) -> std::string"""
398 return _IMP_gsl.ConjugateGradients___repr__(self)
401 return _object_cast_to_ConjugateGradients(o)
402 get_from = staticmethod(get_from)
404 ConjugateGradients_swigregister = _IMP_gsl.ConjugateGradients_swigregister
405 ConjugateGradients_swigregister(ConjugateGradients)
407 class QuasiNewton(GSLOptimizer):
408 """Proxy of C++ IMP::gsl::QuasiNewton class"""
409 thisown = _swig_property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
'The membership flag')
410 def __init__(self, *args):
411 """__init__(IMP::gsl::QuasiNewton self, Model m) -> QuasiNewton"""
412 this = _IMP_gsl.new_QuasiNewton(*args)
413 try: self.this.append(this)
414 except: self.this = this
415 def set_initial_step(self, *args):
416 """set_initial_step(QuasiNewton self, double length)"""
417 return _IMP_gsl.QuasiNewton_set_initial_step(self, *args)
419 def set_line_step(self, *args):
420 """set_line_step(QuasiNewton self, double d)"""
421 return _IMP_gsl.QuasiNewton_set_line_step(self, *args)
423 def set_minimum_gradient(self, *args):
424 """set_minimum_gradient(QuasiNewton self, double d)"""
425 return _IMP_gsl.QuasiNewton_set_minimum_gradient(self, *args)
427 def do_optimize(self, *args):
428 """do_optimize(QuasiNewton self, unsigned int max_steps) -> IMP::Float"""
429 return _IMP_gsl.QuasiNewton_do_optimize(self, *args)
431 def get_version_info(self):
432 """get_version_info(QuasiNewton self) -> VersionInfo"""
433 return _IMP_gsl.QuasiNewton_get_version_info(self)
436 """__str__(QuasiNewton self) -> std::string"""
437 return _IMP_gsl.QuasiNewton___str__(self)
440 """__repr__(QuasiNewton self) -> std::string"""
441 return _IMP_gsl.QuasiNewton___repr__(self)
444 return _object_cast_to_QuasiNewton(o)
445 get_from = staticmethod(get_from)
447 QuasiNewton_swigregister = _IMP_gsl.QuasiNewton_swigregister
448 QuasiNewton_swigregister(QuasiNewton)
450 class Simplex(GSLOptimizer):
451 """Proxy of C++ IMP::gsl::Simplex class"""
452 thisown = _swig_property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
'The membership flag')
453 def __init__(self, *args):
454 """__init__(IMP::gsl::Simplex self, Model m) -> Simplex"""
455 this = _IMP_gsl.new_Simplex(*args)
456 try: self.this.append(this)
457 except: self.this = this
458 def set_initial_length(self, *args):
459 """set_initial_length(Simplex self, double length)"""
460 return _IMP_gsl.Simplex_set_initial_length(self, *args)
462 def set_minimum_size(self, *args):
463 """set_minimum_size(Simplex self, double d)"""
464 return _IMP_gsl.Simplex_set_minimum_size(self, *args)
466 def do_optimize(self, *args):
467 """do_optimize(Simplex self, unsigned int max_steps) -> IMP::Float"""
468 return _IMP_gsl.Simplex_do_optimize(self, *args)
470 def get_version_info(self):
471 """get_version_info(Simplex self) -> VersionInfo"""
472 return _IMP_gsl.Simplex_get_version_info(self)
475 """__str__(Simplex self) -> std::string"""
476 return _IMP_gsl.Simplex___str__(self)
479 """__repr__(Simplex self) -> std::string"""
480 return _IMP_gsl.Simplex___repr__(self)
483 return _object_cast_to_Simplex(o)
484 get_from = staticmethod(get_from)
486 Simplex_swigregister = _IMP_gsl.Simplex_swigregister
487 Simplex_swigregister(Simplex)
490 def get_module_version():
491 """get_module_version() -> std::string const"""
492 return _IMP_gsl.get_module_version()
495 """get_example_path(std::string fname) -> std::string"""
496 return _IMP_gsl.get_example_path(*args)
499 """get_data_path(std::string fname) -> std::string"""
500 return _IMP_gsl.get_data_path(*args)
501 from .
import _version_check
502 _version_check.check_version(get_module_version())
Make CGAL functionality available to IMP.
Low level functionality (logging, error handling, profiling, command line flags etc) that is used by ...
std::string get_data_path(std::string file_name)
Return the full path to installed data.
Base functionality and abstract base classes for representation, scoring and sampling.
Base class for optimizers that act on individual attributes.
std::string get_example_path(std::string file_name)
Return the path to installed example data for this module.
General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP...