20 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 class _SwigNonDynamicMeta(type):
53 """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
54 __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
59 class IMP_EXAMPLE_SwigPyIterator(object):
60 r"""Proxy of C++ swig::IMP_EXAMPLE_SwigPyIterator class."""
62 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
64 def __init__(self, *args, **kwargs):
65 raise AttributeError(
"No constructor defined - class is abstract")
67 __swig_destroy__ = _IMP_example.delete_IMP_EXAMPLE_SwigPyIterator
70 r"""value(IMP_EXAMPLE_SwigPyIterator self) -> PyObject *"""
71 return _IMP_example.IMP_EXAMPLE_SwigPyIterator_value(self)
74 r"""incr(IMP_EXAMPLE_SwigPyIterator self, size_t n=1) -> IMP_EXAMPLE_SwigPyIterator"""
75 return _IMP_example.IMP_EXAMPLE_SwigPyIterator_incr(self, n)
78 r"""decr(IMP_EXAMPLE_SwigPyIterator self, size_t n=1) -> IMP_EXAMPLE_SwigPyIterator"""
79 return _IMP_example.IMP_EXAMPLE_SwigPyIterator_decr(self, n)
81 def distance(self, x):
82 r"""distance(IMP_EXAMPLE_SwigPyIterator self, IMP_EXAMPLE_SwigPyIterator x) -> ptrdiff_t"""
83 return _IMP_example.IMP_EXAMPLE_SwigPyIterator_distance(self, x)
86 r"""equal(IMP_EXAMPLE_SwigPyIterator self, IMP_EXAMPLE_SwigPyIterator x) -> bool"""
87 return _IMP_example.IMP_EXAMPLE_SwigPyIterator_equal(self, x)
90 r"""copy(IMP_EXAMPLE_SwigPyIterator self) -> IMP_EXAMPLE_SwigPyIterator"""
91 return _IMP_example.IMP_EXAMPLE_SwigPyIterator_copy(self)
94 r"""__next__(IMP_EXAMPLE_SwigPyIterator self) -> PyObject *"""
95 return _IMP_example.IMP_EXAMPLE_SwigPyIterator___next__(self)
98 r"""previous(IMP_EXAMPLE_SwigPyIterator self) -> PyObject *"""
99 return _IMP_example.IMP_EXAMPLE_SwigPyIterator_previous(self)
101 def advance(self, n):
102 r"""advance(IMP_EXAMPLE_SwigPyIterator self, ptrdiff_t n) -> IMP_EXAMPLE_SwigPyIterator"""
103 return _IMP_example.IMP_EXAMPLE_SwigPyIterator_advance(self, n)
106 r"""__eq__(IMP_EXAMPLE_SwigPyIterator self, IMP_EXAMPLE_SwigPyIterator x) -> bool"""
107 return _IMP_example.IMP_EXAMPLE_SwigPyIterator___eq__(self, x)
110 r"""__ne__(IMP_EXAMPLE_SwigPyIterator self, IMP_EXAMPLE_SwigPyIterator x) -> bool"""
111 return _IMP_example.IMP_EXAMPLE_SwigPyIterator___ne__(self, x)
113 def __iadd__(self, n):
114 r"""__iadd__(IMP_EXAMPLE_SwigPyIterator self, ptrdiff_t n) -> IMP_EXAMPLE_SwigPyIterator"""
115 return _IMP_example.IMP_EXAMPLE_SwigPyIterator___iadd__(self, n)
117 def __isub__(self, n):
118 r"""__isub__(IMP_EXAMPLE_SwigPyIterator self, ptrdiff_t n) -> IMP_EXAMPLE_SwigPyIterator"""
119 return _IMP_example.IMP_EXAMPLE_SwigPyIterator___isub__(self, n)
121 def __add__(self, n):
122 r"""__add__(IMP_EXAMPLE_SwigPyIterator self, ptrdiff_t n) -> IMP_EXAMPLE_SwigPyIterator"""
123 return _IMP_example.IMP_EXAMPLE_SwigPyIterator___add__(self, n)
125 def __sub__(self, *args):
127 __sub__(IMP_EXAMPLE_SwigPyIterator self, ptrdiff_t n) -> IMP_EXAMPLE_SwigPyIterator
128 __sub__(IMP_EXAMPLE_SwigPyIterator self, IMP_EXAMPLE_SwigPyIterator x) -> ptrdiff_t
130 return _IMP_example.IMP_EXAMPLE_SwigPyIterator___sub__(self, *args)
135 _IMP_example.IMP_EXAMPLE_SwigPyIterator_swigregister(IMP_EXAMPLE_SwigPyIterator)
142 IMP_DEBUG = _IMP_example.IMP_DEBUG
144 IMP_RELEASE = _IMP_example.IMP_RELEASE
146 IMP_SILENT = _IMP_example.IMP_SILENT
148 IMP_PROGRESS = _IMP_example.IMP_PROGRESS
150 IMP_TERSE = _IMP_example.IMP_TERSE
152 IMP_VERBOSE = _IMP_example.IMP_VERBOSE
154 IMP_MEMORY = _IMP_example.IMP_MEMORY
156 IMP_NONE = _IMP_example.IMP_NONE
158 IMP_USAGE = _IMP_example.IMP_USAGE
160 IMP_INTERNAL = _IMP_example.IMP_INTERNAL
162 IMP_KERNEL_HAS_LOG4CXX = _IMP_example.IMP_KERNEL_HAS_LOG4CXX
164 IMP_COMPILER_HAS_CEREAL_RAW_POINTER = _IMP_example.IMP_COMPILER_HAS_CEREAL_RAW_POINTER
166 IMP_COMPILER_HAS_DEBUG_VECTOR = _IMP_example.IMP_COMPILER_HAS_DEBUG_VECTOR
168 IMP_COMPILER_HAS_RANDOM_SHUFFLE = _IMP_example.IMP_COMPILER_HAS_RANDOM_SHUFFLE
170 IMP_COMPILER_HAS_THREE_WAY = _IMP_example.IMP_COMPILER_HAS_THREE_WAY
172 IMP_KERNEL_HAS_BOOST_RANDOM = _IMP_example.IMP_KERNEL_HAS_BOOST_RANDOM
174 IMP_KERNEL_HAS_NUMPY = _IMP_example.IMP_KERNEL_HAS_NUMPY
176 IMP_KERNEL_HAS_BOOST_SYSTEM = _IMP_example.IMP_KERNEL_HAS_BOOST_SYSTEM
178 IMP_KERNEL_HAS_GPERFTOOLS = _IMP_example.IMP_KERNEL_HAS_GPERFTOOLS
180 IMP_KERNEL_HAS_TCMALLOC_HEAPCHECKER = _IMP_example.IMP_KERNEL_HAS_TCMALLOC_HEAPCHECKER
182 IMP_KERNEL_HAS_TCMALLOC_HEAPPROFILER = _IMP_example.IMP_KERNEL_HAS_TCMALLOC_HEAPPROFILER
184 IMPKERNEL_SHOW_WARNINGS = _IMP_example.IMPKERNEL_SHOW_WARNINGS
188 class _DirectorObjects:
189 """@internal Simple class to keep references to director objects
190 to prevent premature deletion."""
193 def register(self, obj):
194 """Take a reference to a director object; will only work for
195 refcounted C++ classes"""
196 if hasattr(obj,
'get_ref_count'):
197 self._objects.append(obj)
199 """Only drop our reference and allow cleanup by Python if no other
200 Python references exist (we hold 3 references: one in self._objects,
201 one in x, and one in the argument list for getrefcount) *and* no
202 other C++ references exist (the Python object always holds one)"""
203 objs = [x
for x
in self._objects
if sys.getrefcount(x) > 3 \
204 or x.get_ref_count() > 1]
208 def get_object_count(self):
209 """Get number of director objects (useful for testing only)"""
210 return len(self._objects)
211 _director_objects = _DirectorObjects()
213 class _ostream(object):
214 r"""Proxy of C++ std::ostream class."""
216 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
218 def __init__(self, *args, **kwargs):
219 raise AttributeError(
"No constructor defined")
220 __repr__ = _swig_repr
222 def write(self, osa_buf):
223 r"""write(_ostream self, char const * osa_buf)"""
224 return _IMP_example._ostream_write(self, osa_buf)
227 _IMP_example._ostream_swigregister(_ostream)
228 IMP_C_OPEN_BINARY = _IMP_example.IMP_C_OPEN_BINARY
231 IMP_CGAL_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_CGAL_HAS_BOOST_FILESYSTEM
233 IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS
235 IMP_CGAL_HAS_BOOST_RANDOM = _IMP_example.IMP_CGAL_HAS_BOOST_RANDOM
237 IMP_CGAL_HAS_NUMPY = _IMP_example.IMP_CGAL_HAS_NUMPY
239 IMPCGAL_SHOW_WARNINGS = _IMP_example.IMPCGAL_SHOW_WARNINGS
242 IMP_ALGEBRA_HAS_IMP_CGAL = _IMP_example.IMP_ALGEBRA_HAS_IMP_CGAL
244 IMP_ALGEBRA_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_ALGEBRA_HAS_BOOST_FILESYSTEM
246 IMP_ALGEBRA_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_ALGEBRA_HAS_BOOST_PROGRAMOPTIONS
248 IMP_ALGEBRA_HAS_BOOST_RANDOM = _IMP_example.IMP_ALGEBRA_HAS_BOOST_RANDOM
250 IMP_ALGEBRA_HAS_CGAL = _IMP_example.IMP_ALGEBRA_HAS_CGAL
252 IMP_ALGEBRA_HAS_NUMPY = _IMP_example.IMP_ALGEBRA_HAS_NUMPY
254 IMP_ALGEBRA_HAS_ANN = _IMP_example.IMP_ALGEBRA_HAS_ANN
256 IMPALGEBRA_SHOW_WARNINGS = _IMP_example.IMPALGEBRA_SHOW_WARNINGS
259 IMP_DISPLAY_HAS_IMP_CGAL = _IMP_example.IMP_DISPLAY_HAS_IMP_CGAL
261 IMP_DISPLAY_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_DISPLAY_HAS_BOOST_FILESYSTEM
263 IMP_DISPLAY_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_DISPLAY_HAS_BOOST_PROGRAMOPTIONS
265 IMP_DISPLAY_HAS_BOOST_RANDOM = _IMP_example.IMP_DISPLAY_HAS_BOOST_RANDOM
267 IMP_DISPLAY_HAS_CGAL = _IMP_example.IMP_DISPLAY_HAS_CGAL
269 IMP_DISPLAY_HAS_NUMPY = _IMP_example.IMP_DISPLAY_HAS_NUMPY
271 IMPDISPLAY_SHOW_WARNINGS = _IMP_example.IMPDISPLAY_SHOW_WARNINGS
274 IMP_SCORE_FUNCTOR_HAS_IMP_CGAL = _IMP_example.IMP_SCORE_FUNCTOR_HAS_IMP_CGAL
276 IMP_SCORE_FUNCTOR_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_SCORE_FUNCTOR_HAS_BOOST_FILESYSTEM
278 IMP_SCORE_FUNCTOR_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_SCORE_FUNCTOR_HAS_BOOST_PROGRAMOPTIONS
280 IMP_SCORE_FUNCTOR_HAS_BOOST_RANDOM = _IMP_example.IMP_SCORE_FUNCTOR_HAS_BOOST_RANDOM
282 IMP_SCORE_FUNCTOR_HAS_CGAL = _IMP_example.IMP_SCORE_FUNCTOR_HAS_CGAL
284 IMP_SCORE_FUNCTOR_HAS_HDF5 = _IMP_example.IMP_SCORE_FUNCTOR_HAS_HDF5
286 IMP_SCORE_FUNCTOR_HAS_NUMPY = _IMP_example.IMP_SCORE_FUNCTOR_HAS_NUMPY
288 IMPSCOREFUNCTOR_SHOW_WARNINGS = _IMP_example.IMPSCOREFUNCTOR_SHOW_WARNINGS
291 IMP_STATISTICS_HAS_IMP_CGAL = _IMP_example.IMP_STATISTICS_HAS_IMP_CGAL
293 IMP_STATISTICS_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_STATISTICS_HAS_BOOST_FILESYSTEM
295 IMP_STATISTICS_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_STATISTICS_HAS_BOOST_PROGRAMOPTIONS
297 IMP_STATISTICS_HAS_BOOST_RANDOM = _IMP_example.IMP_STATISTICS_HAS_BOOST_RANDOM
299 IMP_STATISTICS_HAS_CGAL = _IMP_example.IMP_STATISTICS_HAS_CGAL
301 IMP_STATISTICS_HAS_NUMPY = _IMP_example.IMP_STATISTICS_HAS_NUMPY
303 IMPSTATISTICS_SHOW_WARNINGS = _IMP_example.IMPSTATISTICS_SHOW_WARNINGS
306 IMP_CORE_HAS_IMP_CGAL = _IMP_example.IMP_CORE_HAS_IMP_CGAL
308 IMP_CORE_HAS_IMP_KERNEL = _IMP_example.IMP_CORE_HAS_IMP_KERNEL
310 IMP_CORE_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_CORE_HAS_BOOST_FILESYSTEM
312 IMP_CORE_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_CORE_HAS_BOOST_PROGRAMOPTIONS
314 IMP_CORE_HAS_BOOST_RANDOM = _IMP_example.IMP_CORE_HAS_BOOST_RANDOM
316 IMP_CORE_HAS_CGAL = _IMP_example.IMP_CORE_HAS_CGAL
318 IMP_CORE_HAS_HDF5 = _IMP_example.IMP_CORE_HAS_HDF5
320 IMP_CORE_HAS_NUMPY = _IMP_example.IMP_CORE_HAS_NUMPY
322 IMPCORE_SHOW_WARNINGS = _IMP_example.IMPCORE_SHOW_WARNINGS
325 IMP_CONTAINER_HAS_IMP_ALGEBRA = _IMP_example.IMP_CONTAINER_HAS_IMP_ALGEBRA
327 IMP_CONTAINER_HAS_IMP_CGAL = _IMP_example.IMP_CONTAINER_HAS_IMP_CGAL
329 IMP_CONTAINER_HAS_IMP_DISPLAY = _IMP_example.IMP_CONTAINER_HAS_IMP_DISPLAY
331 IMP_CONTAINER_HAS_IMP_KERNEL = _IMP_example.IMP_CONTAINER_HAS_IMP_KERNEL
333 IMP_CONTAINER_HAS_IMP_SCORE_FUNCTOR = _IMP_example.IMP_CONTAINER_HAS_IMP_SCORE_FUNCTOR
335 IMP_CONTAINER_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_CONTAINER_HAS_BOOST_FILESYSTEM
337 IMP_CONTAINER_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_CONTAINER_HAS_BOOST_PROGRAMOPTIONS
339 IMP_CONTAINER_HAS_BOOST_RANDOM = _IMP_example.IMP_CONTAINER_HAS_BOOST_RANDOM
341 IMP_CONTAINER_HAS_CGAL = _IMP_example.IMP_CONTAINER_HAS_CGAL
343 IMP_CONTAINER_HAS_HDF5 = _IMP_example.IMP_CONTAINER_HAS_HDF5
345 IMP_CONTAINER_HAS_NUMPY = _IMP_example.IMP_CONTAINER_HAS_NUMPY
347 IMP_CONTAINER_HAS_PYTHON_IHM = _IMP_example.IMP_CONTAINER_HAS_PYTHON_IHM
349 IMP_CONTAINER_HAS_GOOGLE_DENSE_HASH_MAP = _IMP_example.IMP_CONTAINER_HAS_GOOGLE_DENSE_HASH_MAP
351 IMP_CONTAINER_HAS_ROBIN_MAP = _IMP_example.IMP_CONTAINER_HAS_ROBIN_MAP
353 IMPCONTAINER_SHOW_WARNINGS = _IMP_example.IMPCONTAINER_SHOW_WARNINGS
356 IMP_ATOM_HAS_IMP_CGAL = _IMP_example.IMP_ATOM_HAS_IMP_CGAL
358 IMP_ATOM_HAS_IMP_KERNEL = _IMP_example.IMP_ATOM_HAS_IMP_KERNEL
360 IMP_ATOM_HAS_IMP_SCORE_FUNCTOR = _IMP_example.IMP_ATOM_HAS_IMP_SCORE_FUNCTOR
362 IMP_ATOM_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_ATOM_HAS_BOOST_PROGRAMOPTIONS
364 IMP_ATOM_HAS_BOOST_RANDOM = _IMP_example.IMP_ATOM_HAS_BOOST_RANDOM
366 IMP_ATOM_HAS_BOOST_REGEX = _IMP_example.IMP_ATOM_HAS_BOOST_REGEX
368 IMP_ATOM_HAS_CGAL = _IMP_example.IMP_ATOM_HAS_CGAL
370 IMP_ATOM_HAS_HDF5 = _IMP_example.IMP_ATOM_HAS_HDF5
372 IMP_ATOM_HAS_NUMPY = _IMP_example.IMP_ATOM_HAS_NUMPY
374 IMP_ATOM_HAS_PYTHON_IHM = _IMP_example.IMP_ATOM_HAS_PYTHON_IHM
376 IMPATOM_SHOW_WARNINGS = _IMP_example.IMPATOM_SHOW_WARNINGS
378 IMP_ATOM_TYPE_INDEX = _IMP_example.IMP_ATOM_TYPE_INDEX
380 IMP_RESIDUE_TYPE_INDEX = _IMP_example.IMP_RESIDUE_TYPE_INDEX
382 IMP_HIERARCHY_TYPE_INDEX = _IMP_example.IMP_HIERARCHY_TYPE_INDEX
384 IMP_CHAIN_TYPE_INDEX = _IMP_example.IMP_CHAIN_TYPE_INDEX
387 IMP_EM_HAS_IMP_CGAL = _IMP_example.IMP_EM_HAS_IMP_CGAL
389 IMP_EM_HAS_IMP_CONTAINER = _IMP_example.IMP_EM_HAS_IMP_CONTAINER
391 IMP_EM_HAS_IMP_DISPLAY = _IMP_example.IMP_EM_HAS_IMP_DISPLAY
393 IMP_EM_HAS_IMP_SCORE_FUNCTOR = _IMP_example.IMP_EM_HAS_IMP_SCORE_FUNCTOR
395 IMP_EM_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_EM_HAS_BOOST_FILESYSTEM
397 IMP_EM_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_EM_HAS_BOOST_PROGRAMOPTIONS
399 IMP_EM_HAS_BOOST_RANDOM = _IMP_example.IMP_EM_HAS_BOOST_RANDOM
401 IMP_EM_HAS_BOOST_REGEX = _IMP_example.IMP_EM_HAS_BOOST_REGEX
403 IMP_EM_HAS_CGAL = _IMP_example.IMP_EM_HAS_CGAL
405 IMP_EM_HAS_HDF5 = _IMP_example.IMP_EM_HAS_HDF5
407 IMP_EM_HAS_NUMPY = _IMP_example.IMP_EM_HAS_NUMPY
409 IMP_EM_HAS_PYTHON_IHM = _IMP_example.IMP_EM_HAS_PYTHON_IHM
411 IMPEM_SHOW_WARNINGS = _IMP_example.IMPEM_SHOW_WARNINGS
414 IMP_SAXS_HAS_IMP_CGAL = _IMP_example.IMP_SAXS_HAS_IMP_CGAL
416 IMP_SAXS_HAS_IMP_CONTAINER = _IMP_example.IMP_SAXS_HAS_IMP_CONTAINER
418 IMP_SAXS_HAS_IMP_DISPLAY = _IMP_example.IMP_SAXS_HAS_IMP_DISPLAY
420 IMP_SAXS_HAS_IMP_KERNEL = _IMP_example.IMP_SAXS_HAS_IMP_KERNEL
422 IMP_SAXS_HAS_IMP_SCORE_FUNCTOR = _IMP_example.IMP_SAXS_HAS_IMP_SCORE_FUNCTOR
424 IMP_SAXS_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_SAXS_HAS_BOOST_FILESYSTEM
426 IMP_SAXS_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_SAXS_HAS_BOOST_PROGRAMOPTIONS
428 IMP_SAXS_HAS_BOOST_RANDOM = _IMP_example.IMP_SAXS_HAS_BOOST_RANDOM
430 IMP_SAXS_HAS_BOOST_REGEX = _IMP_example.IMP_SAXS_HAS_BOOST_REGEX
432 IMP_SAXS_HAS_CGAL = _IMP_example.IMP_SAXS_HAS_CGAL
434 IMP_SAXS_HAS_HDF5 = _IMP_example.IMP_SAXS_HAS_HDF5
436 IMP_SAXS_HAS_NUMPY = _IMP_example.IMP_SAXS_HAS_NUMPY
438 IMP_SAXS_HAS_PYTHON_IHM = _IMP_example.IMP_SAXS_HAS_PYTHON_IHM
440 IMPSAXS_SHOW_WARNINGS = _IMP_example.IMPSAXS_SHOW_WARNINGS
443 IMP_ISD_HAS_IMP_CGAL = _IMP_example.IMP_ISD_HAS_IMP_CGAL
445 IMP_ISD_HAS_IMP_DISPLAY = _IMP_example.IMP_ISD_HAS_IMP_DISPLAY
447 IMP_ISD_HAS_IMP_SCORE_FUNCTOR = _IMP_example.IMP_ISD_HAS_IMP_SCORE_FUNCTOR
449 IMP_ISD_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_ISD_HAS_BOOST_FILESYSTEM
451 IMP_ISD_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_ISD_HAS_BOOST_PROGRAMOPTIONS
453 IMP_ISD_HAS_BOOST_RANDOM = _IMP_example.IMP_ISD_HAS_BOOST_RANDOM
455 IMP_ISD_HAS_BOOST_REGEX = _IMP_example.IMP_ISD_HAS_BOOST_REGEX
457 IMP_ISD_HAS_CGAL = _IMP_example.IMP_ISD_HAS_CGAL
459 IMP_ISD_HAS_HDF5 = _IMP_example.IMP_ISD_HAS_HDF5
461 IMP_ISD_HAS_NUMPY = _IMP_example.IMP_ISD_HAS_NUMPY
463 IMP_ISD_HAS_PYTHON_IHM = _IMP_example.IMP_ISD_HAS_PYTHON_IHM
465 IMPISD_SHOW_WARNINGS = _IMP_example.IMPISD_SHOW_WARNINGS
468 IMP_RMF_HAS_IMP_CGAL = _IMP_example.IMP_RMF_HAS_IMP_CGAL
470 IMP_RMF_HAS_IMP_EM = _IMP_example.IMP_RMF_HAS_IMP_EM
472 IMP_RMF_HAS_IMP_SAXS = _IMP_example.IMP_RMF_HAS_IMP_SAXS
474 IMP_RMF_HAS_IMP_SCORE_FUNCTOR = _IMP_example.IMP_RMF_HAS_IMP_SCORE_FUNCTOR
476 IMP_RMF_HAS_IMP_STATISTICS = _IMP_example.IMP_RMF_HAS_IMP_STATISTICS
478 IMP_RMF_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_RMF_HAS_BOOST_FILESYSTEM
480 IMP_RMF_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_RMF_HAS_BOOST_PROGRAMOPTIONS
482 IMP_RMF_HAS_BOOST_RANDOM = _IMP_example.IMP_RMF_HAS_BOOST_RANDOM
484 IMP_RMF_HAS_BOOST_REGEX = _IMP_example.IMP_RMF_HAS_BOOST_REGEX
486 IMP_RMF_HAS_CGAL = _IMP_example.IMP_RMF_HAS_CGAL
488 IMP_RMF_HAS_HDF5 = _IMP_example.IMP_RMF_HAS_HDF5
490 IMP_RMF_HAS_NUMPY = _IMP_example.IMP_RMF_HAS_NUMPY
492 IMP_RMF_HAS_PYTHON_IHM = _IMP_example.IMP_RMF_HAS_PYTHON_IHM
494 IMPRMF_SHOW_WARNINGS = _IMP_example.IMPRMF_SHOW_WARNINGS
498 IMP_DOMINO_HAS_IMP_ATOM = _IMP_example.IMP_DOMINO_HAS_IMP_ATOM
500 IMP_DOMINO_HAS_IMP_CGAL = _IMP_example.IMP_DOMINO_HAS_IMP_CGAL
502 IMP_DOMINO_HAS_IMP_EM = _IMP_example.IMP_DOMINO_HAS_IMP_EM
504 IMP_DOMINO_HAS_IMP_ISD = _IMP_example.IMP_DOMINO_HAS_IMP_ISD
506 IMP_DOMINO_HAS_IMP_KERNEL = _IMP_example.IMP_DOMINO_HAS_IMP_KERNEL
508 IMP_DOMINO_HAS_IMP_RMF = _IMP_example.IMP_DOMINO_HAS_IMP_RMF
510 IMP_DOMINO_HAS_IMP_SAXS = _IMP_example.IMP_DOMINO_HAS_IMP_SAXS
512 IMP_DOMINO_HAS_IMP_SCORE_FUNCTOR = _IMP_example.IMP_DOMINO_HAS_IMP_SCORE_FUNCTOR
514 IMP_DOMINO_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_DOMINO_HAS_BOOST_FILESYSTEM
516 IMP_DOMINO_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_DOMINO_HAS_BOOST_PROGRAMOPTIONS
518 IMP_DOMINO_HAS_BOOST_RANDOM = _IMP_example.IMP_DOMINO_HAS_BOOST_RANDOM
520 IMP_DOMINO_HAS_BOOST_REGEX = _IMP_example.IMP_DOMINO_HAS_BOOST_REGEX
522 IMP_DOMINO_HAS_CGAL = _IMP_example.IMP_DOMINO_HAS_CGAL
524 IMP_DOMINO_HAS_HDF5 = _IMP_example.IMP_DOMINO_HAS_HDF5
526 IMP_DOMINO_HAS_NUMPY = _IMP_example.IMP_DOMINO_HAS_NUMPY
528 IMP_DOMINO_HAS_RMF = _IMP_example.IMP_DOMINO_HAS_RMF
530 IMP_DOMINO_HAS_PYTHON_IHM = _IMP_example.IMP_DOMINO_HAS_PYTHON_IHM
532 IMPDOMINO_SHOW_WARNINGS = _IMP_example.IMPDOMINO_SHOW_WARNINGS
536 IMP_EXAMPLE_HAS_IMP_ALGEBRA = _IMP_example.IMP_EXAMPLE_HAS_IMP_ALGEBRA
538 IMP_EXAMPLE_HAS_IMP_CGAL = _IMP_example.IMP_EXAMPLE_HAS_IMP_CGAL
540 IMP_EXAMPLE_HAS_IMP_DISPLAY = _IMP_example.IMP_EXAMPLE_HAS_IMP_DISPLAY
542 IMP_EXAMPLE_HAS_IMP_EM = _IMP_example.IMP_EXAMPLE_HAS_IMP_EM
544 IMP_EXAMPLE_HAS_IMP_ISD = _IMP_example.IMP_EXAMPLE_HAS_IMP_ISD
546 IMP_EXAMPLE_HAS_IMP_KERNEL = _IMP_example.IMP_EXAMPLE_HAS_IMP_KERNEL
548 IMP_EXAMPLE_HAS_IMP_RMF = _IMP_example.IMP_EXAMPLE_HAS_IMP_RMF
550 IMP_EXAMPLE_HAS_IMP_SAXS = _IMP_example.IMP_EXAMPLE_HAS_IMP_SAXS
552 IMP_EXAMPLE_HAS_IMP_SCORE_FUNCTOR = _IMP_example.IMP_EXAMPLE_HAS_IMP_SCORE_FUNCTOR
554 IMP_EXAMPLE_HAS_IMP_STATISTICS = _IMP_example.IMP_EXAMPLE_HAS_IMP_STATISTICS
556 IMP_EXAMPLE_HAS_BOOST_FILESYSTEM = _IMP_example.IMP_EXAMPLE_HAS_BOOST_FILESYSTEM
558 IMP_EXAMPLE_HAS_BOOST_GRAPH = _IMP_example.IMP_EXAMPLE_HAS_BOOST_GRAPH
560 IMP_EXAMPLE_HAS_BOOST_PROGRAMOPTIONS = _IMP_example.IMP_EXAMPLE_HAS_BOOST_PROGRAMOPTIONS
562 IMP_EXAMPLE_HAS_BOOST_RANDOM = _IMP_example.IMP_EXAMPLE_HAS_BOOST_RANDOM
564 IMP_EXAMPLE_HAS_BOOST_REGEX = _IMP_example.IMP_EXAMPLE_HAS_BOOST_REGEX
566 IMP_EXAMPLE_HAS_CGAL = _IMP_example.IMP_EXAMPLE_HAS_CGAL
568 IMP_EXAMPLE_HAS_HDF5 = _IMP_example.IMP_EXAMPLE_HAS_HDF5
570 IMP_EXAMPLE_HAS_NUMPY = _IMP_example.IMP_EXAMPLE_HAS_NUMPY
572 IMP_EXAMPLE_HAS_RMF = _IMP_example.IMP_EXAMPLE_HAS_RMF
574 IMP_EXAMPLE_HAS_PYTHON_IHM = _IMP_example.IMP_EXAMPLE_HAS_PYTHON_IHM
576 IMP_EXAMPLE_HAS_EXAMPLEDEPENDENCY = _IMP_example.IMP_EXAMPLE_HAS_EXAMPLEDEPENDENCY
578 IMPEXAMPLE_SHOW_WARNINGS = _IMP_example.IMPEXAMPLE_SHOW_WARNINGS
581 _object_types.append(
"ExampleRestraint")
584 def _object_cast_to_ExampleRestraint(o):
585 r"""_object_cast_to_ExampleRestraint(Object o) -> ExampleRestraint"""
586 return _IMP_example._object_cast_to_ExampleRestraint(o)
588 def ExampleDecorators(l=[]):
589 return [ExampleDecorator(x)
for x
in l]
590 _plural_types.append(
"ExampleDecorators")
593 _value_types.append(
"ExampleDecorator")
596 _object_types.append(
"ExampleUnaryFunction")
599 def _object_cast_to_ExampleUnaryFunction(o):
600 r"""_object_cast_to_ExampleUnaryFunction(Object o) -> ExampleUnaryFunction"""
601 return _IMP_example._object_cast_to_ExampleUnaryFunction(o)
603 _object_types.append(
"ExampleSingletonModifier")
606 def _object_cast_to_ExampleSingletonModifier(o):
607 r"""_object_cast_to_ExampleSingletonModifier(Object o) -> ExampleSingletonModifier"""
608 return _IMP_example._object_cast_to_ExampleSingletonModifier(o)
610 _object_types.append(
"ExamplePairScore")
613 def _object_cast_to_ExamplePairScore(o):
614 r"""_object_cast_to_ExamplePairScore(Object o) -> ExamplePairScore"""
615 return _IMP_example._object_cast_to_ExamplePairScore(o)
617 _object_types.append(
"ExampleSubsetFilterTable")
620 def _object_cast_to_ExampleSubsetFilterTable(o):
621 r"""_object_cast_to_ExampleSubsetFilterTable(Object o) -> ExampleSubsetFilterTable"""
622 return _IMP_example._object_cast_to_ExampleSubsetFilterTable(o)
624 _object_types.append(
"ExampleConstraint")
627 def _object_cast_to_ExampleConstraint(o):
628 r"""_object_cast_to_ExampleConstraint(Object o) -> ExampleConstraint"""
629 return _IMP_example._object_cast_to_ExampleConstraint(o)
631 _object_types.append(
"ExampleObject")
634 def _object_cast_to_ExampleObject(o):
635 r"""_object_cast_to_ExampleObject(Object o) -> ExampleObject"""
636 return _IMP_example._object_cast_to_ExampleObject(o)
638 ExampleTemplateClass3Ds=list
639 _plural_types.append(
"ExampleTemplateClass3Ds")
640 _value_types.append(
"ExampleTemplateClass3D")
643 def create_model_and_particles():
647 IMP.algebra.Vector3D(10,10,10))
648 for i
in range(0,100):
649 p = m.add_particle(
"p")
653 d.set_coordinates_are_optimized(
True)
659 """An example restraint written in Python.
660 This should be functionally equivalent to the C++ ExampleRestraint.
662 def __init__(self, m, p, k):
663 super().__init__(m,
"PythonExampleRestraint%1%")
664 self.p, self.k = p, k
667 """Pure Python implementation of the restraint"""
669 score = .5 * self.k * d.get_z() * d.get_z()
670 if sa.get_derivative_accumulator():
671 deriv = self.k * d.get_z()
672 d.add_to_derivative(2, deriv, sa.get_derivative_accumulator())
675 def _get_jax(self, space):
676 """Implementation of the restraint using JAX"""
679 def jax_restraint(X, k, pi):
680 xyz = X[
'xyz'][...,pi,:]
681 return 0.5 * k * xyz[...,2] * xyz[...,2]
683 raise NotImplementedError(
684 "PythonExampleRestraint does not support periodic boundaries")
685 f = functools.partial(jax_restraint, k=self.k, pi=self.p)
686 return self._wrap_jax(f)
689 return [self.
get_model().get_particle(self.p)]
695 """An example PairScore written in Python.
696 This should be functionally equivalent to the C++ ExamplePairScore.
698 def __init__(self, x0, k):
700 self.x0, self.k = x0, k
703 """Pure Python implementation of the score"""
706 diff = (d0.get_coordinates()
707 - d1.get_coordinates()).get_magnitude() - self.x0
708 score = .5 * self.k * diff * diff
711 delta = d0.get_coordinates() - d1.get_coordinates()
712 udelta = delta.get_unit_vector()
714 d0.add_to_derivatives(udelta * dv, da)
715 d1.add_to_derivatives(-udelta * dv, da)
725 """An example UnaryFunction written in Python.
726 This should be functionally equivalent to the C++ ExampleUnaryFunction.
728 def __init__(self, center, k):
730 self.center, self.k = center, k
733 return (self.
evaluate(feature), self.k * (feature - self.center))
736 return .5 * self.k * (feature - self.center) * (feature - self.center)
742 """An example Constraint written in Python.
743 This should be functionally equivalent to the C++ ExampleConstraint.
748 def __init__(self, p):
749 super().__init__(p.get_model(),
"ExampleConstraint%1%")
752 PythonExampleConstraint.k =
IMP.IntKey(
"Constraint key")
753 if not p.has_attribute(self.k):
754 p.add_attribute(self.k, 0)
756 def do_update_attributes(self):
757 self.p.set_value(self.k, self.p.get_value(self.k) + 1)
759 def do_update_derivatives(self, da):
772 """An example SingletonModifier written in Python.
773 This should be functionally equivalent to the C++
774 ExampleSingletonModifier.
777 def __init__(self, bb):
778 super().__init__(
"ExampleSingletonModifier%1%")
785 while d.get_coordinate(i) < self.bb.get_corner(0)[i]:
786 d.set_coordinate(i,d.get_coordinate(i) + \
787 (self.bb.get_corner(1)[i] - self.bb.get_corner(0)[i]))
788 while d.get_coordinate(i) > self.bb.get_corner(1)[i]:
789 d.set_coordinate(i,d.get_coordinate(i) - \
790 (self.bb.get_corner(1)[i] - self.bb.get_corner(0)[i]))
800 r"""Proxy of C++ IMP::example::ExampleRestraint class."""
802 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
804 def __init__(self, *args):
806 __init__(ExampleRestraint self, Model m, ParticleIndex p, double k) -> ExampleRestraint
807 __init__(ExampleRestraint self) -> ExampleRestraint
809 _IMP_example.ExampleRestraint_swiginit(self, _IMP_example.new_ExampleRestraint(*args))
811 def get_force_constant(self):
812 r"""get_force_constant(ExampleRestraint self) -> double"""
813 return _IMP_example.ExampleRestraint_get_force_constant(self)
816 r"""get_index(ExampleRestraint self) -> ParticleIndex"""
817 return _IMP_example.ExampleRestraint_get_index(self)
819 def do_add_score_and_derivatives(self, sa):
820 r"""do_add_score_and_derivatives(ExampleRestraint self, ScoreAccumulator sa)"""
821 return _IMP_example.ExampleRestraint_do_add_score_and_derivatives(self, sa)
824 r"""do_get_inputs(ExampleRestraint self) -> IMP::ModelObjectsTemp"""
825 return _IMP_example.ExampleRestraint_do_get_inputs(self)
828 r"""get_version_info(ExampleRestraint self) -> VersionInfo"""
829 return _IMP_example.ExampleRestraint_get_version_info(self)
830 __swig_destroy__ = _IMP_example.delete_ExampleRestraint
833 r"""__str__(ExampleRestraint self) -> std::string"""
834 return _IMP_example.ExampleRestraint___str__(self)
837 r"""__repr__(ExampleRestraint self) -> std::string"""
838 return _IMP_example.ExampleRestraint___repr__(self)
842 return _object_cast_to_ExampleRestraint(o)
845 def _get_as_binary(self):
846 r"""_get_as_binary(ExampleRestraint self) -> PyObject *"""
847 return _IMP_example.ExampleRestraint__get_as_binary(self)
849 def _set_from_binary(self, p):
850 r"""_set_from_binary(ExampleRestraint self, PyObject * p)"""
851 return _IMP_example.ExampleRestraint__set_from_binary(self, p)
853 def __getstate__(self):
854 p = self._get_as_binary()
855 if len(self.__dict__) > 1:
856 d = self.__dict__.copy()
861 def __setstate__(self, p):
862 if not hasattr(self,
'this'):
864 if isinstance(p, tuple):
866 self.__dict__.update(d)
867 return self._set_from_binary(p)
870 def _get_jax(self, space):
871 """Implementation of the restraint using JAX.
872 For a Restraint, we must return a single JAX function which
873 takes a single argument, the JAX Model, and returns its score.
874 The JAX Model (here called `jm`) is a JAX object which contains
875 the same information as the IMP Model, as a simple Python dict.
876 For example, jm['xyz'] is an N x 3 array of XYZ coordinates.
878 All JAX restraints should support periodic boundary conditions
879 (PBC), which are controlled by the `space` object, an instance
880 of the IMP.jax.Space class which provides PBC-aware distance
881 calculation and displacement functions. If the restraint does not
882 support PBC, raise a NotImplementedError instead.
885 def jax_restraint(jm, k, pi):
890 return 0.5 * k * xyz[2] * xyz[2]
893 raise NotImplementedError(
894 "ExampleRestraint does not support periodic boundaries")
898 f = functools.partial(jax_restraint, k=self.get_force_constant(),
903 return self._wrap_jax(f)
907 _IMP_example.ExampleRestraint_swigregister(ExampleRestraint)
909 r"""Proxy of C++ IMP::example::ExampleDecorator class."""
911 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
913 def get_decorator_name(self):
914 r"""get_decorator_name(ExampleDecorator self) -> std::string"""
915 return _IMP_example.ExampleDecorator_get_decorator_name(self)
917 def set_decorator_name(self, nm):
918 r"""set_decorator_name(ExampleDecorator self, std::string nm)"""
919 return _IMP_example.ExampleDecorator_set_decorator_name(self, nm)
921 def __init__(self, *args):
923 __init__(ExampleDecorator self) -> ExampleDecorator
924 __init__(ExampleDecorator self, Model m, ParticleIndex id) -> ExampleDecorator
925 __init__(ExampleDecorator self, _ParticleAdaptor d) -> ExampleDecorator
927 _IMP_example.ExampleDecorator_swiginit(self, _IMP_example.new_ExampleDecorator(*args))
930 def get_is_setup(*args):
932 get_is_setup(Model m, ParticleIndex pi) -> bool
933 get_is_setup(_ParticleAdaptor p) -> bool
935 return _IMP_example.ExampleDecorator_get_is_setup(*args)
937 def show(self, *args):
938 r"""show(ExampleDecorator self, _ostream out=std::cout)"""
939 return _IMP_example.ExampleDecorator_show(self, *args)
942 def setup_particle(*args):
944 setup_particle(Model m, ParticleIndex pi, std::string name) -> ExampleDecorator
945 setup_particle(_ParticleAdaptor pa, std::string name) -> ExampleDecorator
947 return _IMP_example.ExampleDecorator_setup_particle(*args)
949 def add_attribute(self, *args):
951 add_attribute(ExampleDecorator self, FloatKey k, IMP::Float v, bool opt)
952 add_attribute(ExampleDecorator self, FloatKey a0, IMP::Float a1)
953 add_attribute(ExampleDecorator self, IntKey a0, IMP::Int a1)
954 add_attribute(ExampleDecorator self, FloatsKey a0, IMP::Floats a1)
955 add_attribute(ExampleDecorator self, IntsKey a0, IMP::Ints a1)
956 add_attribute(ExampleDecorator self, StringKey a0, IMP::String a1)
957 add_attribute(ExampleDecorator self, ParticleIndexKey a0, Particle a1)
958 add_attribute(ExampleDecorator self, ObjectKey a0, Object a1)
959 add_attribute(ExampleDecorator self, SparseFloatKey a0, IMP::Float a1)
960 add_attribute(ExampleDecorator self, SparseIntKey a0, IMP::Int a1)
961 add_attribute(ExampleDecorator self, SparseStringKey a0, IMP::String a1)
962 add_attribute(ExampleDecorator self, SparseParticleIndexKey a0, ParticleIndex a1)
964 return _IMP_example.ExampleDecorator_add_attribute(self, *args)
966 def get_value(self, *args):
968 get_value(ExampleDecorator self, FloatKey a0) -> IMP::Float
969 get_value(ExampleDecorator self, IntKey a0) -> IMP::Int
970 get_value(ExampleDecorator self, FloatsKey a0) -> IMP::Floats
971 get_value(ExampleDecorator self, IntsKey a0) -> IMP::Ints
972 get_value(ExampleDecorator self, StringKey a0) -> IMP::String
973 get_value(ExampleDecorator self, ParticleIndexKey a0) -> Particle
974 get_value(ExampleDecorator self, ObjectKey a0) -> Object
975 get_value(ExampleDecorator self, SparseFloatKey a0) -> IMP::Float
976 get_value(ExampleDecorator self, SparseIntKey a0) -> IMP::Int
977 get_value(ExampleDecorator self, SparseStringKey a0) -> IMP::String
978 get_value(ExampleDecorator self, SparseParticleIndexKey a0) -> ParticleIndex
980 return _IMP_example.ExampleDecorator_get_value(self, *args)
982 def set_value(self, *args):
984 set_value(ExampleDecorator self, FloatKey a0, IMP::Float a1)
985 set_value(ExampleDecorator self, IntKey a0, IMP::Int a1)
986 set_value(ExampleDecorator self, FloatsKey a0, IMP::Floats a1)
987 set_value(ExampleDecorator self, IntsKey a0, IMP::Ints a1)
988 set_value(ExampleDecorator self, StringKey a0, IMP::String a1)
989 set_value(ExampleDecorator self, ParticleIndexKey a0, Particle a1)
990 set_value(ExampleDecorator self, ObjectKey a0, Object a1)
991 set_value(ExampleDecorator self, SparseFloatKey a0, IMP::Float a1)
992 set_value(ExampleDecorator self, SparseIntKey a0, IMP::Int a1)
993 set_value(ExampleDecorator self, SparseStringKey a0, IMP::String a1)
994 set_value(ExampleDecorator self, SparseParticleIndexKey a0, ParticleIndex a1)
996 return _IMP_example.ExampleDecorator_set_value(self, *args)
998 def remove_attribute(self, *args):
1000 remove_attribute(ExampleDecorator self, FloatKey a0)
1001 remove_attribute(ExampleDecorator self, IntKey a0)
1002 remove_attribute(ExampleDecorator self, FloatsKey a0)
1003 remove_attribute(ExampleDecorator self, IntsKey a0)
1004 remove_attribute(ExampleDecorator self, StringKey a0)
1005 remove_attribute(ExampleDecorator self, ParticleIndexKey a0)
1006 remove_attribute(ExampleDecorator self, ObjectKey a0)
1007 remove_attribute(ExampleDecorator self, SparseFloatKey a0)
1008 remove_attribute(ExampleDecorator self, SparseIntKey a0)
1009 remove_attribute(ExampleDecorator self, SparseStringKey a0)
1010 remove_attribute(ExampleDecorator self, SparseParticleIndexKey a0)
1012 return _IMP_example.ExampleDecorator_remove_attribute(self, *args)
1014 def has_attribute(self, *args):
1016 has_attribute(ExampleDecorator self, FloatKey a0) -> bool
1017 has_attribute(ExampleDecorator self, IntKey a0) -> bool
1018 has_attribute(ExampleDecorator self, FloatsKey a0) -> bool
1019 has_attribute(ExampleDecorator self, IntsKey a0) -> bool
1020 has_attribute(ExampleDecorator self, StringKey a0) -> bool
1021 has_attribute(ExampleDecorator self, ParticleIndexKey a0) -> bool
1022 has_attribute(ExampleDecorator self, ObjectKey a0) -> bool
1023 has_attribute(ExampleDecorator self, SparseFloatKey a0) -> bool
1024 has_attribute(ExampleDecorator self, SparseIntKey a0) -> bool
1025 has_attribute(ExampleDecorator self, SparseStringKey a0) -> bool
1026 has_attribute(ExampleDecorator self, SparseParticleIndexKey a0) -> bool
1028 return _IMP_example.ExampleDecorator_has_attribute(self, *args)
1030 def get_derivative(self, a0):
1031 r"""get_derivative(ExampleDecorator self, FloatKey a0) -> double"""
1032 return _IMP_example.ExampleDecorator_get_derivative(self, a0)
1035 r"""get_name(ExampleDecorator self) -> std::string"""
1036 return _IMP_example.ExampleDecorator_get_name(self)
1039 r"""clear_caches(ExampleDecorator self)"""
1040 return _IMP_example.ExampleDecorator_clear_caches(self)
1042 def set_name(self, a0):
1043 r"""set_name(ExampleDecorator self, std::string a0)"""
1044 return _IMP_example.ExampleDecorator_set_name(self, a0)
1047 r"""set_check_level(ExampleDecorator self, IMP::CheckLevel a0)"""
1048 return _IMP_example.ExampleDecorator_set_check_level(self, a0)
1050 def add_to_derivative(self, a0, a1, a2):
1051 r"""add_to_derivative(ExampleDecorator self, FloatKey a0, double a1, DerivativeAccumulator a2)"""
1052 return _IMP_example.ExampleDecorator_add_to_derivative(self, a0, a1, a2)
1054 def set_is_optimized(self, a0, a1):
1055 r"""set_is_optimized(ExampleDecorator self, FloatKey a0, bool a1)"""
1056 return _IMP_example.ExampleDecorator_set_is_optimized(self, a0, a1)
1058 def get_is_optimized(self, a0):
1059 r"""get_is_optimized(ExampleDecorator self, FloatKey a0) -> bool"""
1060 return _IMP_example.ExampleDecorator_get_is_optimized(self, a0)
1062 def get_check_level(self):
1063 r"""get_check_level(ExampleDecorator self) -> IMP::CheckLevel"""
1064 return _IMP_example.ExampleDecorator_get_check_level(self)
1066 def __eq__(self, *args):
1068 __eq__(ExampleDecorator self, ExampleDecorator o) -> bool
1069 __eq__(ExampleDecorator self, Particle d) -> bool
1071 return _IMP_example.ExampleDecorator___eq__(self, *args)
1073 def __ne__(self, *args):
1075 __ne__(ExampleDecorator self, ExampleDecorator o) -> bool
1076 __ne__(ExampleDecorator self, Particle d) -> bool
1078 return _IMP_example.ExampleDecorator___ne__(self, *args)
1080 def __le__(self, *args):
1082 __le__(ExampleDecorator self, ExampleDecorator o) -> bool
1083 __le__(ExampleDecorator self, Particle d) -> bool
1085 return _IMP_example.ExampleDecorator___le__(self, *args)
1087 def __lt__(self, *args):
1089 __lt__(ExampleDecorator self, ExampleDecorator o) -> bool
1090 __lt__(ExampleDecorator self, Particle d) -> bool
1092 return _IMP_example.ExampleDecorator___lt__(self, *args)
1094 def __ge__(self, *args):
1096 __ge__(ExampleDecorator self, ExampleDecorator o) -> bool
1097 __ge__(ExampleDecorator self, Particle d) -> bool
1099 return _IMP_example.ExampleDecorator___ge__(self, *args)
1101 def __gt__(self, *args):
1103 __gt__(ExampleDecorator self, ExampleDecorator o) -> bool
1104 __gt__(ExampleDecorator self, Particle d) -> bool
1106 return _IMP_example.ExampleDecorator___gt__(self, *args)
1109 r"""__hash__(ExampleDecorator self) -> std::size_t"""
1110 return _IMP_example.ExampleDecorator___hash__(self)
1113 r"""__str__(ExampleDecorator self) -> std::string"""
1114 return _IMP_example.ExampleDecorator___str__(self)
1117 r"""__repr__(ExampleDecorator self) -> std::string"""
1118 return _IMP_example.ExampleDecorator___repr__(self)
1120 def _get_as_binary(self):
1121 r"""_get_as_binary(ExampleDecorator self) -> PyObject *"""
1122 return _IMP_example.ExampleDecorator__get_as_binary(self)
1124 def _set_from_binary(self, p):
1125 r"""_set_from_binary(ExampleDecorator self, PyObject * p)"""
1126 return _IMP_example.ExampleDecorator__set_from_binary(self, p)
1128 def __getstate__(self):
1129 p = self._get_as_binary()
1130 if len(self.__dict__) > 1:
1131 d = self.__dict__.copy()
1136 def __setstate__(self, p):
1137 if not hasattr(self,
'this'):
1139 if isinstance(p, tuple):
1141 self.__dict__.update(d)
1142 return self._set_from_binary(p)
1144 __swig_destroy__ = _IMP_example.delete_ExampleDecorator
1147 _IMP_example.ExampleDecorator_swigregister(ExampleDecorator)
1149 def __lshift__(out, n):
1150 r"""__lshift__(_ostream out, ExampleDecorator n) -> _ostream"""
1151 return _IMP_example.__lshift__(out, n)
1153 r"""Proxy of C++ IMP::example::ExampleUnaryFunction class."""
1155 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
1157 def __init__(self, *args):
1159 __init__(ExampleUnaryFunction self, IMP::Float center, IMP::Float k) -> ExampleUnaryFunction
1160 __init__(ExampleUnaryFunction self) -> ExampleUnaryFunction
1162 _IMP_example.ExampleUnaryFunction_swiginit(self, _IMP_example.new_ExampleUnaryFunction(*args))
1164 def get_center(self):
1165 r"""get_center(ExampleUnaryFunction self) -> IMP::Float"""
1166 return _IMP_example.ExampleUnaryFunction_get_center(self)
1168 def get_force_constant(self):
1169 r"""get_force_constant(ExampleUnaryFunction self) -> IMP::Float"""
1170 return _IMP_example.ExampleUnaryFunction_get_force_constant(self)
1173 r"""get_version_info(ExampleUnaryFunction self) -> VersionInfo"""
1174 return _IMP_example.ExampleUnaryFunction_get_version_info(self)
1175 __swig_destroy__ = _IMP_example.delete_ExampleUnaryFunction
1178 r"""__str__(ExampleUnaryFunction self) -> std::string"""
1179 return _IMP_example.ExampleUnaryFunction___str__(self)
1182 r"""__repr__(ExampleUnaryFunction self) -> std::string"""
1183 return _IMP_example.ExampleUnaryFunction___repr__(self)
1187 return _object_cast_to_ExampleUnaryFunction(o)
1190 def _get_as_binary(self):
1191 r"""_get_as_binary(ExampleUnaryFunction self) -> PyObject *"""
1192 return _IMP_example.ExampleUnaryFunction__get_as_binary(self)
1194 def _set_from_binary(self, p):
1195 r"""_set_from_binary(ExampleUnaryFunction self, PyObject * p)"""
1196 return _IMP_example.ExampleUnaryFunction__set_from_binary(self, p)
1198 def __getstate__(self):
1199 p = self._get_as_binary()
1200 if len(self.__dict__) > 1:
1201 d = self.__dict__.copy()
1206 def __setstate__(self, p):
1207 if not hasattr(self,
'this'):
1209 if isinstance(p, tuple):
1211 self.__dict__.update(d)
1212 return self._set_from_binary(p)
1216 """Implementation of the unary function using JAX.
1217 This takes the feature value to act on, and returns a score.
1218 Unlike an IMP C++ UnaryFunction (which takes a single feature),
1219 the JAX score takes multiple features, as an N-element array,
1220 and should return an N-element array of scores."""
1221 def score(feature, center, k):
1222 return 0.5 * k * (feature - center) ** 2
1223 return functools.partial(score, center=self.get_center(),
1224 k=self.get_force_constant())
1228 _IMP_example.ExampleUnaryFunction_swigregister(ExampleUnaryFunction)
1230 r"""Proxy of C++ IMP::example::ExampleObject class."""
1232 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
1234 def __init__(self, *args):
1236 __init__(ExampleObject self, IMP::Floats const & data) -> ExampleObject
1237 __init__(ExampleObject self) -> ExampleObject
1239 _IMP_example.ExampleObject_swiginit(self, _IMP_example.new_ExampleObject(*args))
1241 def get_data(self, i):
1242 r"""get_data(ExampleObject self, unsigned int i) -> double"""
1243 return _IMP_example.ExampleObject_get_data(self, i)
1246 r"""get_version_info(ExampleObject self) -> VersionInfo"""
1247 return _IMP_example.ExampleObject_get_version_info(self)
1248 __swig_destroy__ = _IMP_example.delete_ExampleObject
1251 r"""__str__(ExampleObject self) -> std::string"""
1252 return _IMP_example.ExampleObject___str__(self)
1255 r"""__repr__(ExampleObject self) -> std::string"""
1256 return _IMP_example.ExampleObject___repr__(self)
1260 return _object_cast_to_ExampleObject(o)
1263 def _get_as_binary(self):
1264 r"""_get_as_binary(ExampleObject self) -> PyObject *"""
1265 return _IMP_example.ExampleObject__get_as_binary(self)
1267 def _set_from_binary(self, p):
1268 r"""_set_from_binary(ExampleObject self, PyObject * p)"""
1269 return _IMP_example.ExampleObject__set_from_binary(self, p)
1271 def __getstate__(self):
1272 p = self._get_as_binary()
1273 if len(self.__dict__) > 1:
1274 d = self.__dict__.copy()
1279 def __setstate__(self, p):
1280 if not hasattr(self,
'this'):
1282 if isinstance(p, tuple):
1284 self.__dict__.update(d)
1285 return self._set_from_binary(p)
1289 _IMP_example.ExampleObject_swigregister(ExampleObject)
1291 r"""Proxy of C++ IMP::example::ExampleSingletonModifier class."""
1293 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
1295 def __init__(self, *args):
1297 __init__(ExampleSingletonModifier self, BoundingBox3D bb) -> ExampleSingletonModifier
1298 __init__(ExampleSingletonModifier self) -> ExampleSingletonModifier
1300 _IMP_example.ExampleSingletonModifier_swiginit(self, _IMP_example.new_ExampleSingletonModifier(*args))
1302 def get_bounding_box(self):
1303 r"""get_bounding_box(ExampleSingletonModifier self) -> BoundingBox3D"""
1304 return _IMP_example.ExampleSingletonModifier_get_bounding_box(self)
1307 r"""do_get_inputs(ExampleSingletonModifier self, Model m, IMP::ParticleIndexes const & pis) -> IMP::ModelObjectsTemp"""
1308 return _IMP_example.ExampleSingletonModifier_do_get_inputs(self, m, pis)
1311 r"""do_get_outputs(ExampleSingletonModifier self, Model m, IMP::ParticleIndexes const & pis) -> IMP::ModelObjectsTemp"""
1312 return _IMP_example.ExampleSingletonModifier_do_get_outputs(self, m, pis)
1315 r"""get_version_info(ExampleSingletonModifier self) -> VersionInfo"""
1316 return _IMP_example.ExampleSingletonModifier_get_version_info(self)
1317 __swig_destroy__ = _IMP_example.delete_ExampleSingletonModifier
1320 r"""__str__(ExampleSingletonModifier self) -> std::string"""
1321 return _IMP_example.ExampleSingletonModifier___str__(self)
1324 r"""__repr__(ExampleSingletonModifier self) -> std::string"""
1325 return _IMP_example.ExampleSingletonModifier___repr__(self)
1329 return _object_cast_to_ExampleSingletonModifier(o)
1332 def _get_as_binary(self):
1333 r"""_get_as_binary(ExampleSingletonModifier self) -> PyObject *"""
1334 return _IMP_example.ExampleSingletonModifier__get_as_binary(self)
1336 def _set_from_binary(self, p):
1337 r"""_set_from_binary(ExampleSingletonModifier self, PyObject * p)"""
1338 return _IMP_example.ExampleSingletonModifier__set_from_binary(self, p)
1340 def __getstate__(self):
1341 p = self._get_as_binary()
1342 if len(self.__dict__) > 1:
1343 d = self.__dict__.copy()
1348 def __setstate__(self, p):
1349 if not hasattr(self,
'this'):
1351 if isinstance(p, tuple):
1353 self.__dict__.update(d)
1354 return self._set_from_binary(p)
1357 def _get_jax(self, m, indexes):
1358 """Implementation of the modifier using JAX"""
1359 import jax.numpy
as jnp
1360 def apply_func(jm, box):
1361 jm[
'xyz'] = jm[
'xyz'].at[indexes].set(
1362 jnp.mod(jm[
'xyz'][indexes] - box[0], box[1] - box[0]) + box[0])
1364 box = jnp.array([self.get_bounding_box().get_corner(x)
1366 return self._wrap_jax(
1367 functools.partial(apply_func, box=box))
1371 _IMP_example.ExampleSingletonModifier_swigregister(ExampleSingletonModifier)
1373 r"""Proxy of C++ IMP::example::ExamplePairScore class."""
1375 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
1377 def __init__(self, *args):
1379 __init__(ExamplePairScore self, double x0, double k) -> ExamplePairScore
1380 __init__(ExamplePairScore self) -> ExamplePairScore
1382 _IMP_example.ExamplePairScore_swiginit(self, _IMP_example.new_ExamplePairScore(*args))
1385 r"""get_mean(ExamplePairScore self) -> double"""
1386 return _IMP_example.ExamplePairScore_get_mean(self)
1388 def get_force_constant(self):
1389 r"""get_force_constant(ExamplePairScore self) -> double"""
1390 return _IMP_example.ExamplePairScore_get_force_constant(self)
1393 r"""do_get_inputs(ExamplePairScore self, Model m, IMP::ParticleIndexes const & pis) -> IMP::ModelObjectsTemp"""
1394 return _IMP_example.ExamplePairScore_do_get_inputs(self, m, pis)
1396 def evaluate_indexes(self, m, p, da, lower_bound, upper_bound, all_indexes_checked=False):
1397 r"""evaluate_indexes(ExamplePairScore self, Model m, IMP::ParticleIndexPairs const & p, DerivativeAccumulator da, unsigned int lower_bound, unsigned int upper_bound, bool all_indexes_checked=False) -> double"""
1398 return _IMP_example.ExamplePairScore_evaluate_indexes(self, m, p, da, lower_bound, upper_bound, all_indexes_checked)
1400 def evaluate_indexes_scores(self, m, p, da, lower_bound, upper_bound, score, all_indexes_checked=False):
1401 r"""evaluate_indexes_scores(ExamplePairScore self, Model m, IMP::ParticleIndexPairs const & p, DerivativeAccumulator da, unsigned int lower_bound, unsigned int upper_bound, DistBase score, bool all_indexes_checked=False) -> double"""
1402 return _IMP_example.ExamplePairScore_evaluate_indexes_scores(self, m, p, da, lower_bound, upper_bound, score, all_indexes_checked)
1404 def evaluate_indexes_delta(self, m, p, da, indexes, score, all_indexes_checked=False):
1405 r"""evaluate_indexes_delta(ExamplePairScore self, Model m, IMP::ParticleIndexPairs const & p, DerivativeAccumulator da, std::vector< unsigned int,std::allocator< unsigned int > > const & indexes, DistBase score, bool all_indexes_checked=False) -> double"""
1406 return _IMP_example.ExamplePairScore_evaluate_indexes_delta(self, m, p, da, indexes, score, all_indexes_checked)
1408 def evaluate_if_good_indexes(self, m, p, da, max, lower_bound, upper_bound, all_indexes_checked=False):
1409 r"""evaluate_if_good_indexes(ExamplePairScore self, Model m, IMP::ParticleIndexPairs const & p, DerivativeAccumulator da, double max, unsigned int lower_bound, unsigned int upper_bound, bool all_indexes_checked=False) -> double"""
1410 return _IMP_example.ExamplePairScore_evaluate_if_good_indexes(self, m, p, da, max, lower_bound, upper_bound, all_indexes_checked)
1413 r"""get_version_info(ExamplePairScore self) -> VersionInfo"""
1414 return _IMP_example.ExamplePairScore_get_version_info(self)
1415 __swig_destroy__ = _IMP_example.delete_ExamplePairScore
1418 r"""__str__(ExamplePairScore self) -> std::string"""
1419 return _IMP_example.ExamplePairScore___str__(self)
1422 r"""__repr__(ExamplePairScore self) -> std::string"""
1423 return _IMP_example.ExamplePairScore___repr__(self)
1427 return _object_cast_to_ExamplePairScore(o)
1430 def _get_as_binary(self):
1431 r"""_get_as_binary(ExamplePairScore self) -> PyObject *"""
1432 return _IMP_example.ExamplePairScore__get_as_binary(self)
1434 def _set_from_binary(self, p):
1435 r"""_set_from_binary(ExamplePairScore self, PyObject * p)"""
1436 return _IMP_example.ExamplePairScore__set_from_binary(self, p)
1438 def __getstate__(self):
1439 p = self._get_as_binary()
1440 if len(self.__dict__) > 1:
1441 d = self.__dict__.copy()
1446 def __setstate__(self, p):
1447 if not hasattr(self,
'this'):
1449 if isinstance(p, tuple):
1451 self.__dict__.update(d)
1452 return self._set_from_binary(p)
1455 def _get_jax(self, m, indexes, space):
1456 """Implementation of the score using JAX.
1457 A PairScore takes as input the JAX Model, and returns the score
1458 for a given set of particle pair indexes. Unlike an IMP C++
1459 PairScore (which takes a single pair of indexes), the JAX score
1460 takes multiple indexes, as an Nx2 array, and should return an
1461 N-element array of scores."""
1462 import jax.numpy
as jnp
1463 def pair_score(jm, x0, k):
1464 xyzs = jm[
'xyz'][indexes]
1465 diff = space.distance(xyzs[:,0] - xyzs[:,1]) - x0
1466 return 0.5 * k * diff * diff
1467 f = functools.partial(pair_score, x0=self.get_mean(),
1468 k=self.get_force_constant())
1469 return self._wrap_jax(m, f)
1473 _IMP_example.ExamplePairScore_swigregister(ExamplePairScore)
1475 r"""Proxy of C++ IMP::example::ExampleSubsetFilterTable class."""
1477 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
1479 def __init__(self, max_diff, pt):
1480 r"""__init__(ExampleSubsetFilterTable self, unsigned int max_diff, IMP::ParticlesTemp const & pt) -> ExampleSubsetFilterTable"""
1481 _IMP_example.ExampleSubsetFilterTable_swiginit(self, _IMP_example.new_ExampleSubsetFilterTable(max_diff, pt))
1484 r"""get_version_info(ExampleSubsetFilterTable self) -> VersionInfo"""
1485 return _IMP_example.ExampleSubsetFilterTable_get_version_info(self)
1486 __swig_destroy__ = _IMP_example.delete_ExampleSubsetFilterTable
1489 r"""__str__(ExampleSubsetFilterTable self) -> std::string"""
1490 return _IMP_example.ExampleSubsetFilterTable___str__(self)
1493 r"""__repr__(ExampleSubsetFilterTable self) -> std::string"""
1494 return _IMP_example.ExampleSubsetFilterTable___repr__(self)
1498 return _object_cast_to_ExampleSubsetFilterTable(o)
1502 _IMP_example.ExampleSubsetFilterTable_swigregister(ExampleSubsetFilterTable)
1504 r"""Proxy of C++ IMP::example::ExampleConstraint class."""
1506 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
1508 def __init__(self, *args):
1510 __init__(ExampleConstraint self, Particle p) -> ExampleConstraint
1511 __init__(ExampleConstraint self) -> ExampleConstraint
1513 _IMP_example.ExampleConstraint_swiginit(self, _IMP_example.new_ExampleConstraint(*args))
1516 r"""get_index(ExampleConstraint self) -> ParticleIndex"""
1517 return _IMP_example.ExampleConstraint_get_index(self)
1520 r"""do_get_inputs(ExampleConstraint self) -> IMP::ModelObjectsTemp"""
1521 return _IMP_example.ExampleConstraint_do_get_inputs(self)
1524 r"""do_get_outputs(ExampleConstraint self) -> IMP::ModelObjectsTemp"""
1525 return _IMP_example.ExampleConstraint_do_get_outputs(self)
1529 r"""get_key() -> IntKey"""
1530 return _IMP_example.ExampleConstraint_get_key()
1533 r"""get_version_info(ExampleConstraint self) -> VersionInfo"""
1534 return _IMP_example.ExampleConstraint_get_version_info(self)
1535 __swig_destroy__ = _IMP_example.delete_ExampleConstraint
1538 r"""__str__(ExampleConstraint self) -> std::string"""
1539 return _IMP_example.ExampleConstraint___str__(self)
1542 r"""__repr__(ExampleConstraint self) -> std::string"""
1543 return _IMP_example.ExampleConstraint___repr__(self)
1547 return _object_cast_to_ExampleConstraint(o)
1550 def _get_as_binary(self):
1551 r"""_get_as_binary(ExampleConstraint self) -> PyObject *"""
1552 return _IMP_example.ExampleConstraint__get_as_binary(self)
1554 def _set_from_binary(self, p):
1555 r"""_set_from_binary(ExampleConstraint self, PyObject * p)"""
1556 return _IMP_example.ExampleConstraint__set_from_binary(self, p)
1558 def __getstate__(self):
1559 p = self._get_as_binary()
1560 if len(self.__dict__) > 1:
1561 d = self.__dict__.copy()
1566 def __setstate__(self, p):
1567 if not hasattr(self,
'this'):
1569 if isinstance(p, tuple):
1571 self.__dict__.update(d)
1572 return self._set_from_binary(p)
1576 """Implementation of the constraint using JAX.
1577 Similar to a Restraint, we must return a single JAX function which
1578 takes as input a JAX Model. However, in this case the function
1579 must return a new JAX Model, with the constraint applied."""
1580 def apply_func(jm, key, index):
1585 jm[key] = jm[key].at[index].add(1)
1587 key = self.get_key()
1588 f = functools.partial(apply_func, key=key.get_string(),
1589 index=self.get_index())
1594 return self._wrap_jax(f, keys=(key,))
1598 _IMP_example.ExampleConstraint_swigregister(ExampleConstraint)
1601 r"""get_number_of_incidences(IMP::ParticlesTemp const & psa, IMP::ParticlesTemp const & psb, double point_distance) -> unsigned int"""
1602 return _IMP_example.get_number_of_incidences(psa, psb, point_distance)
1605 r"""create_chain_restraint(Model m, IMP::ParticleIndexes const & ps, double length_factor, double k, std::string name) -> Restraint"""
1606 return _IMP_example.create_chain_restraint(m, ps, length_factor, k, name)
1609 r"""create_excluded_volume(Model m, IMP::ParticleIndexes const & ps, double k, std::string name) -> Restraint"""
1610 return _IMP_example.create_excluded_volume(m, ps, k, name)
1612 r"""Proxy of C++ IMP::example::ExampleTemplateClassD< 3 > class."""
1614 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
1616 def __init__(self, *args):
1618 __init__(ExampleTemplateClass3D self) -> ExampleTemplateClass3D
1619 __init__(ExampleTemplateClass3D self, Vector3D a, Vector3D b) -> ExampleTemplateClass3D
1621 _IMP_example.ExampleTemplateClass3D_swiginit(self, _IMP_example.new_ExampleTemplateClass3D(*args))
1623 def get_point(self, i):
1624 r"""get_point(ExampleTemplateClass3D self, unsigned int i) -> Vector3D"""
1625 return _IMP_example.ExampleTemplateClass3D_get_point(self, i)
1627 def show(self, *args):
1628 r"""show(ExampleTemplateClass3D self, _ostream out=std::cout)"""
1629 return _IMP_example.ExampleTemplateClass3D_show(self, *args)
1632 r"""__str__(ExampleTemplateClass3D self) -> std::string"""
1633 return _IMP_example.ExampleTemplateClass3D___str__(self)
1636 r"""__repr__(ExampleTemplateClass3D self) -> std::string"""
1637 return _IMP_example.ExampleTemplateClass3D___repr__(self)
1638 __swig_destroy__ = _IMP_example.delete_ExampleTemplateClass3D
1641 _IMP_example.ExampleTemplateClass3D_swigregister(ExampleTemplateClass3D)
1643 def get_module_name():
1644 r"""get_module_name() -> std::string const"""
1645 return _IMP_example.get_module_name()
1648 r"""get_module_version() -> std::string const"""
1649 return _IMP_example.get_module_version()
1652 r"""get_example_path(std::string fname) -> std::string"""
1653 return _IMP_example.get_example_path(fname)
1656 r"""get_data_path(std::string fname) -> std::string"""
1657 return _IMP_example.get_data_path(fname)
1659 from .
import _version_check
unsigned int get_number_of_incidences(const ParticlesTemp &psa, const ParticlesTemp &psb, double point_distance)
A base class for modifiers of ParticlesTemp.
Abstract class for scoring object(s) of type ParticleIndexPair.
double get_mean(const cv::Mat &mat, const cvIntMat &mask)
virtual double evaluate(double feature) const
Calculate score with respect to the given feature.
An example PairScore written in Python.
An example SingletonModifier written in Python.
Various classes to hold sets of particles.
static XYZR setup_particle(Model *m, ParticleIndex pi)
An example UnaryFunction written in Python.
Make CGAL functionality available to IMP.
A line segment templated on the dimension.
ParticlesTemp get_particles(Model *m, const ParticleIndexes &ps)
Get the particles from a list of indexes.
An unbounded space with no periodic boundary conditions.
virtual void clear_caches()
virtual ModelObjectsTemp do_get_outputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the outputs.
Composable functors to implement scores via compile-time composition.
Restraint * create_excluded_volume(Model *m, const ParticleIndexes &ps, double k, std::string name)
Vector3D get_random_vector_in(const Cylinder3D &c)
Generate a random vector in a cylinder with uniform density.
Code to compute statistical measures.
Implement a constraint on the Model.
Class for storing model, its restraints, constraints, and particles.
An example simple object which is reference counted.
A simple decorator which adds a name to a particle.
An example Constraint written in Python.
def evaluate_index
Pure Python implementation of the score.
An example singleton modifier.
Ints get_index(const ParticlesTemp &particles, const Subset &subset, const Subsets &excluded)
Common base class for heavy weight IMP objects.
Store a list of ParticleIndexes.
An example restraint written in Python.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
Restrain a particle to be in the x,y plane.
Basic utilities for handling cryo-electron microscopy 3D density maps.
A decorator for a particle with x,y,z coordinates.
Support for the JAX Python library.
Interface to specialized Particle types (e.g. atoms)
virtual ModelObjectsTemp do_get_outputs() const =0
Basic functionality that is expected to be used by a wide variety of IMP users.
General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP...
virtual void apply_index(Model *m, ParticleIndex v) const =0
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.
virtual DerivativePair evaluate_with_derivative(double feature) const
Calculate score and derivative with respect to the given feature.
def do_add_score_and_derivatives
Pure Python implementation of the restraint.
void set_check_level(CheckLevel l)
Apply a harmonic to the distance between two particles.
Restraint * create_chain_restraint(Model *m, const ParticleIndexes &ps, double length_factor, double k, std::string name)
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.
Model * get_model() const
A trivial constraint that just increments a counter.
Output IMP model data in various file formats.
Functionality for loading, creating, manipulating and scoring atomic structures.
std::string get_data_path(std::string file_name)
Return the full path to one of this module's data files.
Support for the RMF file format for storing hierarchical molecular data and markup.
Abstract single variable functor class for score functions.
virtual ModelObjectsTemp do_get_inputs() const =0
Divide-and-conquer inferential optimization in discrete space.
Support for small angle X-ray scattering (SAXS) data.
Inferential scoring building on methods developed as part of the Inferential Structure Determination ...
A restraint is a term in an IMP ScoringFunction.