IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
isd/__init__.py
1# This file was automatically generated by SWIG (https://www.swig.org).
2# Version 4.5.1
3#
4# Do not make changes to this file unless you know what you are doing - modify
5# the SWIG interface file instead.
6
7
8# This wrapper is part of IMP,
9# Copyright 2007-2026 IMP Inventors. All rights reserved.
10
11
12
13import functools
14
15
16
17import typing
18import _IMP_isd
19
20import builtins as __builtin__
21
22def _swig_repr(self):
23 try:
24 strthis = "proxy of " + self.this.__repr__()
25 except __builtin__.Exception:
26 strthis = ""
27 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
28
29
30def _swig_setattr_nondynamic_instance_variable(set):
31 def set_instance_attr(self, name, value):
32 if name == "this":
33 set(self, name, value)
34 elif name == "thisown":
35 self.this.own(value)
36 elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
37 set(self, name, value)
38 else:
39 raise AttributeError("You cannot add instance attributes to %s" % self)
40 return set_instance_attr
41
42
43def _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):
46 set(cls, name, value)
47 else:
48 raise AttributeError("You cannot add class attributes to %s" % cls)
49 return set_class_attr
50
51
52class _SwigNonDynamicMeta(type):
53 """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
54 __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
55
56
57import weakref
58
59class IMP_ISD_SwigPyIterator(object):
60 r"""Proxy of C++ swig::IMP_ISD_SwigPyIterator class."""
61
62 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
63
64 def __init__(self, *args, **kwargs):
65 raise AttributeError("No constructor defined - class is abstract")
66 __repr__ = _swig_repr
67 __swig_destroy__ = _IMP_isd.delete_IMP_ISD_SwigPyIterator
68
69 def value(self):
70 r"""value(IMP_ISD_SwigPyIterator self) -> PyObject *"""
71 return _IMP_isd.IMP_ISD_SwigPyIterator_value(self)
72
73 def incr(self, n=1):
74 r"""incr(IMP_ISD_SwigPyIterator self, size_t n=1) -> IMP_ISD_SwigPyIterator"""
75 return _IMP_isd.IMP_ISD_SwigPyIterator_incr(self, n)
76
77 def decr(self, n=1):
78 r"""decr(IMP_ISD_SwigPyIterator self, size_t n=1) -> IMP_ISD_SwigPyIterator"""
79 return _IMP_isd.IMP_ISD_SwigPyIterator_decr(self, n)
80
81 def distance(self, x):
82 r"""distance(IMP_ISD_SwigPyIterator self, IMP_ISD_SwigPyIterator x) -> ptrdiff_t"""
83 return _IMP_isd.IMP_ISD_SwigPyIterator_distance(self, x)
84
85 def equal(self, x):
86 r"""equal(IMP_ISD_SwigPyIterator self, IMP_ISD_SwigPyIterator x) -> bool"""
87 return _IMP_isd.IMP_ISD_SwigPyIterator_equal(self, x)
88
89 def copy(self):
90 r"""copy(IMP_ISD_SwigPyIterator self) -> IMP_ISD_SwigPyIterator"""
91 return _IMP_isd.IMP_ISD_SwigPyIterator_copy(self)
92
93 def __next__(self):
94 r"""__next__(IMP_ISD_SwigPyIterator self) -> PyObject *"""
95 return _IMP_isd.IMP_ISD_SwigPyIterator___next__(self)
96
97 def previous(self):
98 r"""previous(IMP_ISD_SwigPyIterator self) -> PyObject *"""
99 return _IMP_isd.IMP_ISD_SwigPyIterator_previous(self)
100
101 def advance(self, n):
102 r"""advance(IMP_ISD_SwigPyIterator self, ptrdiff_t n) -> IMP_ISD_SwigPyIterator"""
103 return _IMP_isd.IMP_ISD_SwigPyIterator_advance(self, n)
104
105 def __eq__(self, x):
106 r"""__eq__(IMP_ISD_SwigPyIterator self, IMP_ISD_SwigPyIterator x) -> bool"""
107 return _IMP_isd.IMP_ISD_SwigPyIterator___eq__(self, x)
108
109 def __ne__(self, x):
110 r"""__ne__(IMP_ISD_SwigPyIterator self, IMP_ISD_SwigPyIterator x) -> bool"""
111 return _IMP_isd.IMP_ISD_SwigPyIterator___ne__(self, x)
112
113 def __iadd__(self, n):
114 r"""__iadd__(IMP_ISD_SwigPyIterator self, ptrdiff_t n) -> IMP_ISD_SwigPyIterator"""
115 return _IMP_isd.IMP_ISD_SwigPyIterator___iadd__(self, n)
116
117 def __isub__(self, n):
118 r"""__isub__(IMP_ISD_SwigPyIterator self, ptrdiff_t n) -> IMP_ISD_SwigPyIterator"""
119 return _IMP_isd.IMP_ISD_SwigPyIterator___isub__(self, n)
120
121 def __add__(self, n):
122 r"""__add__(IMP_ISD_SwigPyIterator self, ptrdiff_t n) -> IMP_ISD_SwigPyIterator"""
123 return _IMP_isd.IMP_ISD_SwigPyIterator___add__(self, n)
124
125 def __sub__(self, *args):
126 r"""
127 __sub__(IMP_ISD_SwigPyIterator self, ptrdiff_t n) -> IMP_ISD_SwigPyIterator
128 __sub__(IMP_ISD_SwigPyIterator self, IMP_ISD_SwigPyIterator x) -> ptrdiff_t
129 """
130 return _IMP_isd.IMP_ISD_SwigPyIterator___sub__(self, *args)
131 def __iter__(self):
132 return self
133
134# Register IMP_ISD_SwigPyIterator in _IMP_isd:
135_IMP_isd.IMP_ISD_SwigPyIterator_swigregister(IMP_ISD_SwigPyIterator)
136
137_value_types=[]
138_object_types=[]
139_raii_types=[]
140_plural_types=[]
141
142IMP_DEBUG = _IMP_isd.IMP_DEBUG
143
144IMP_RELEASE = _IMP_isd.IMP_RELEASE
145
146IMP_SILENT = _IMP_isd.IMP_SILENT
147
148IMP_PROGRESS = _IMP_isd.IMP_PROGRESS
149
150IMP_TERSE = _IMP_isd.IMP_TERSE
151
152IMP_VERBOSE = _IMP_isd.IMP_VERBOSE
153
154IMP_MEMORY = _IMP_isd.IMP_MEMORY
155
156IMP_NONE = _IMP_isd.IMP_NONE
157
158IMP_USAGE = _IMP_isd.IMP_USAGE
159
160IMP_INTERNAL = _IMP_isd.IMP_INTERNAL
161
162IMP_KERNEL_HAS_LOG4CXX = _IMP_isd.IMP_KERNEL_HAS_LOG4CXX
163
164IMP_COMPILER_HAS_CEREAL_RAW_POINTER = _IMP_isd.IMP_COMPILER_HAS_CEREAL_RAW_POINTER
165
166IMP_COMPILER_HAS_DEBUG_VECTOR = _IMP_isd.IMP_COMPILER_HAS_DEBUG_VECTOR
167
168IMP_COMPILER_HAS_RANDOM_SHUFFLE = _IMP_isd.IMP_COMPILER_HAS_RANDOM_SHUFFLE
169
170IMP_COMPILER_HAS_THREE_WAY = _IMP_isd.IMP_COMPILER_HAS_THREE_WAY
171
172IMP_KERNEL_HAS_BOOST_RANDOM = _IMP_isd.IMP_KERNEL_HAS_BOOST_RANDOM
173
174IMP_KERNEL_HAS_BOOST_SYSTEM = _IMP_isd.IMP_KERNEL_HAS_BOOST_SYSTEM
175
176IMP_KERNEL_HAS_GPERFTOOLS = _IMP_isd.IMP_KERNEL_HAS_GPERFTOOLS
177
178IMP_KERNEL_HAS_NUMPY = _IMP_isd.IMP_KERNEL_HAS_NUMPY
179
180IMP_KERNEL_HAS_TCMALLOC_HEAPCHECKER = _IMP_isd.IMP_KERNEL_HAS_TCMALLOC_HEAPCHECKER
181
182IMP_KERNEL_HAS_TCMALLOC_HEAPPROFILER = _IMP_isd.IMP_KERNEL_HAS_TCMALLOC_HEAPPROFILER
183
184IMPKERNEL_SHOW_WARNINGS = _IMP_isd.IMPKERNEL_SHOW_WARNINGS
185
186
187import sys
188class _DirectorObjects:
189 """@internal Simple class to keep references to director objects
190 to prevent premature deletion."""
191 def __init__(self):
192 self._objects = []
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)
198 def cleanup(self):
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]
205# Do in two steps so the references are kept until the end of the
206# function (deleting references may trigger a fresh call to this method)
207 self._objects = objs
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()
212
213class _ostream(object):
214 r"""Proxy of C++ std::ostream class."""
215
216 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
217
218 def __init__(self, *args, **kwargs):
219 raise AttributeError("No constructor defined")
220 __repr__ = _swig_repr
221
222 def write(self, osa_buf):
223 r"""write(_ostream self, char const * osa_buf)"""
224 return _IMP_isd._ostream_write(self, osa_buf)
225
226# Register _ostream in _IMP_isd:
227_IMP_isd._ostream_swigregister(_ostream)
228IMP_C_OPEN_BINARY = _IMP_isd.IMP_C_OPEN_BINARY
229
230import IMP
231IMP_CGAL_HAS_BOOST_FILESYSTEM = _IMP_isd.IMP_CGAL_HAS_BOOST_FILESYSTEM
232
233IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS = _IMP_isd.IMP_CGAL_HAS_BOOST_PROGRAMOPTIONS
234
235IMP_CGAL_HAS_BOOST_RANDOM = _IMP_isd.IMP_CGAL_HAS_BOOST_RANDOM
236
237IMP_CGAL_HAS_BOOST_SYSTEM = _IMP_isd.IMP_CGAL_HAS_BOOST_SYSTEM
238
239IMP_CGAL_HAS_GPERFTOOLS = _IMP_isd.IMP_CGAL_HAS_GPERFTOOLS
240
241IMP_CGAL_HAS_NUMPY = _IMP_isd.IMP_CGAL_HAS_NUMPY
242
243IMPCGAL_SHOW_WARNINGS = _IMP_isd.IMPCGAL_SHOW_WARNINGS
244
245import IMP.cgal
246IMP_ALGEBRA_HAS_IMP_CGAL = _IMP_isd.IMP_ALGEBRA_HAS_IMP_CGAL
247
248IMP_ALGEBRA_HAS_ANN = _IMP_isd.IMP_ALGEBRA_HAS_ANN
249
250IMP_ALGEBRA_HAS_BOOST_FILESYSTEM = _IMP_isd.IMP_ALGEBRA_HAS_BOOST_FILESYSTEM
251
252IMP_ALGEBRA_HAS_BOOST_PROGRAMOPTIONS = _IMP_isd.IMP_ALGEBRA_HAS_BOOST_PROGRAMOPTIONS
253
254IMP_ALGEBRA_HAS_BOOST_RANDOM = _IMP_isd.IMP_ALGEBRA_HAS_BOOST_RANDOM
255
256IMP_ALGEBRA_HAS_BOOST_SYSTEM = _IMP_isd.IMP_ALGEBRA_HAS_BOOST_SYSTEM
257
258IMP_ALGEBRA_HAS_CGAL = _IMP_isd.IMP_ALGEBRA_HAS_CGAL
259
260IMP_ALGEBRA_HAS_GPERFTOOLS = _IMP_isd.IMP_ALGEBRA_HAS_GPERFTOOLS
261
262IMP_ALGEBRA_HAS_NUMPY = _IMP_isd.IMP_ALGEBRA_HAS_NUMPY
263
264IMPALGEBRA_SHOW_WARNINGS = _IMP_isd.IMPALGEBRA_SHOW_WARNINGS
265
266import IMP.algebra
267IMP_DISPLAY_HAS_IMP_CGAL = _IMP_isd.IMP_DISPLAY_HAS_IMP_CGAL
268
269IMP_DISPLAY_HAS_ANN = _IMP_isd.IMP_DISPLAY_HAS_ANN
270
271IMP_DISPLAY_HAS_BOOST_FILESYSTEM = _IMP_isd.IMP_DISPLAY_HAS_BOOST_FILESYSTEM
272
273IMP_DISPLAY_HAS_BOOST_PROGRAMOPTIONS = _IMP_isd.IMP_DISPLAY_HAS_BOOST_PROGRAMOPTIONS
274
275IMP_DISPLAY_HAS_BOOST_RANDOM = _IMP_isd.IMP_DISPLAY_HAS_BOOST_RANDOM
276
277IMP_DISPLAY_HAS_BOOST_SYSTEM = _IMP_isd.IMP_DISPLAY_HAS_BOOST_SYSTEM
278
279IMP_DISPLAY_HAS_CGAL = _IMP_isd.IMP_DISPLAY_HAS_CGAL
280
281IMP_DISPLAY_HAS_GPERFTOOLS = _IMP_isd.IMP_DISPLAY_HAS_GPERFTOOLS
282
283IMP_DISPLAY_HAS_NUMPY = _IMP_isd.IMP_DISPLAY_HAS_NUMPY
284
285IMPDISPLAY_SHOW_WARNINGS = _IMP_isd.IMPDISPLAY_SHOW_WARNINGS
286
287import IMP.display
288IMP_SCORE_FUNCTOR_HAS_IMP_CGAL = _IMP_isd.IMP_SCORE_FUNCTOR_HAS_IMP_CGAL
289
290IMP_SCORE_FUNCTOR_HAS_ANN = _IMP_isd.IMP_SCORE_FUNCTOR_HAS_ANN
291
292IMP_SCORE_FUNCTOR_HAS_BOOST_FILESYSTEM = _IMP_isd.IMP_SCORE_FUNCTOR_HAS_BOOST_FILESYSTEM
293
294IMP_SCORE_FUNCTOR_HAS_BOOST_PROGRAMOPTIONS = _IMP_isd.IMP_SCORE_FUNCTOR_HAS_BOOST_PROGRAMOPTIONS
295
296IMP_SCORE_FUNCTOR_HAS_BOOST_RANDOM = _IMP_isd.IMP_SCORE_FUNCTOR_HAS_BOOST_RANDOM
297
298IMP_SCORE_FUNCTOR_HAS_BOOST_SYSTEM = _IMP_isd.IMP_SCORE_FUNCTOR_HAS_BOOST_SYSTEM
299
300IMP_SCORE_FUNCTOR_HAS_CGAL = _IMP_isd.IMP_SCORE_FUNCTOR_HAS_CGAL
301
302IMP_SCORE_FUNCTOR_HAS_GPERFTOOLS = _IMP_isd.IMP_SCORE_FUNCTOR_HAS_GPERFTOOLS
303
304IMP_SCORE_FUNCTOR_HAS_HDF5 = _IMP_isd.IMP_SCORE_FUNCTOR_HAS_HDF5
305
306IMP_SCORE_FUNCTOR_HAS_NUMPY = _IMP_isd.IMP_SCORE_FUNCTOR_HAS_NUMPY
307
308IMPSCOREFUNCTOR_SHOW_WARNINGS = _IMP_isd.IMPSCOREFUNCTOR_SHOW_WARNINGS
309
310import IMP.score_functor
311IMP_STATISTICS_HAS_IMP_CGAL = _IMP_isd.IMP_STATISTICS_HAS_IMP_CGAL
312
313IMP_STATISTICS_HAS_ANN = _IMP_isd.IMP_STATISTICS_HAS_ANN
314
315IMP_STATISTICS_HAS_BOOST_FILESYSTEM = _IMP_isd.IMP_STATISTICS_HAS_BOOST_FILESYSTEM
316
317IMP_STATISTICS_HAS_BOOST_PROGRAMOPTIONS = _IMP_isd.IMP_STATISTICS_HAS_BOOST_PROGRAMOPTIONS
318
319IMP_STATISTICS_HAS_BOOST_RANDOM = _IMP_isd.IMP_STATISTICS_HAS_BOOST_RANDOM
320
321IMP_STATISTICS_HAS_BOOST_SYSTEM = _IMP_isd.IMP_STATISTICS_HAS_BOOST_SYSTEM
322
323IMP_STATISTICS_HAS_CGAL = _IMP_isd.IMP_STATISTICS_HAS_CGAL
324
325IMP_STATISTICS_HAS_GPERFTOOLS = _IMP_isd.IMP_STATISTICS_HAS_GPERFTOOLS
326
327IMP_STATISTICS_HAS_NUMPY = _IMP_isd.IMP_STATISTICS_HAS_NUMPY
328
329IMPSTATISTICS_SHOW_WARNINGS = _IMP_isd.IMPSTATISTICS_SHOW_WARNINGS
330
331import IMP.statistics
332IMP_CORE_HAS_IMP_CGAL = _IMP_isd.IMP_CORE_HAS_IMP_CGAL
333
334IMP_CORE_HAS_IMP_KERNEL = _IMP_isd.IMP_CORE_HAS_IMP_KERNEL
335
336IMP_CORE_HAS_ANN = _IMP_isd.IMP_CORE_HAS_ANN
337
338IMP_CORE_HAS_BOOST_FILESYSTEM = _IMP_isd.IMP_CORE_HAS_BOOST_FILESYSTEM
339
340IMP_CORE_HAS_BOOST_PROGRAMOPTIONS = _IMP_isd.IMP_CORE_HAS_BOOST_PROGRAMOPTIONS
341
342IMP_CORE_HAS_BOOST_RANDOM = _IMP_isd.IMP_CORE_HAS_BOOST_RANDOM
343
344IMP_CORE_HAS_BOOST_SYSTEM = _IMP_isd.IMP_CORE_HAS_BOOST_SYSTEM
345
346IMP_CORE_HAS_CGAL = _IMP_isd.IMP_CORE_HAS_CGAL
347
348IMP_CORE_HAS_GPERFTOOLS = _IMP_isd.IMP_CORE_HAS_GPERFTOOLS
349
350IMP_CORE_HAS_HDF5 = _IMP_isd.IMP_CORE_HAS_HDF5
351
352IMP_CORE_HAS_NUMPY = _IMP_isd.IMP_CORE_HAS_NUMPY
353
354IMPCORE_SHOW_WARNINGS = _IMP_isd.IMPCORE_SHOW_WARNINGS
355
356import IMP.core
357IMP_CONTAINER_HAS_IMP_ALGEBRA = _IMP_isd.IMP_CONTAINER_HAS_IMP_ALGEBRA
358
359IMP_CONTAINER_HAS_IMP_CGAL = _IMP_isd.IMP_CONTAINER_HAS_IMP_CGAL
360
361IMP_CONTAINER_HAS_IMP_DISPLAY = _IMP_isd.IMP_CONTAINER_HAS_IMP_DISPLAY
362
363IMP_CONTAINER_HAS_IMP_KERNEL = _IMP_isd.IMP_CONTAINER_HAS_IMP_KERNEL
364
365IMP_CONTAINER_HAS_IMP_SCORE_FUNCTOR = _IMP_isd.IMP_CONTAINER_HAS_IMP_SCORE_FUNCTOR
366
367IMP_CONTAINER_HAS_ANN = _IMP_isd.IMP_CONTAINER_HAS_ANN
368
369IMP_CONTAINER_HAS_BOOST_FILESYSTEM = _IMP_isd.IMP_CONTAINER_HAS_BOOST_FILESYSTEM
370
371IMP_CONTAINER_HAS_BOOST_PROGRAMOPTIONS = _IMP_isd.IMP_CONTAINER_HAS_BOOST_PROGRAMOPTIONS
372
373IMP_CONTAINER_HAS_BOOST_RANDOM = _IMP_isd.IMP_CONTAINER_HAS_BOOST_RANDOM
374
375IMP_CONTAINER_HAS_BOOST_SYSTEM = _IMP_isd.IMP_CONTAINER_HAS_BOOST_SYSTEM
376
377IMP_CONTAINER_HAS_CGAL = _IMP_isd.IMP_CONTAINER_HAS_CGAL
378
379IMP_CONTAINER_HAS_GPERFTOOLS = _IMP_isd.IMP_CONTAINER_HAS_GPERFTOOLS
380
381IMP_CONTAINER_HAS_HDF5 = _IMP_isd.IMP_CONTAINER_HAS_HDF5
382
383IMP_CONTAINER_HAS_NUMPY = _IMP_isd.IMP_CONTAINER_HAS_NUMPY
384
385IMP_CONTAINER_HAS_GOOGLE_DENSE_HASH_MAP = _IMP_isd.IMP_CONTAINER_HAS_GOOGLE_DENSE_HASH_MAP
386
387IMP_CONTAINER_HAS_PYTHON_IHM = _IMP_isd.IMP_CONTAINER_HAS_PYTHON_IHM
388
389IMP_CONTAINER_HAS_ROBIN_MAP = _IMP_isd.IMP_CONTAINER_HAS_ROBIN_MAP
390
391IMPCONTAINER_SHOW_WARNINGS = _IMP_isd.IMPCONTAINER_SHOW_WARNINGS
392
393import IMP.container
394IMP_ATOM_HAS_IMP_CGAL = _IMP_isd.IMP_ATOM_HAS_IMP_CGAL
395
396IMP_ATOM_HAS_IMP_KERNEL = _IMP_isd.IMP_ATOM_HAS_IMP_KERNEL
397
398IMP_ATOM_HAS_IMP_SCORE_FUNCTOR = _IMP_isd.IMP_ATOM_HAS_IMP_SCORE_FUNCTOR
399
400IMP_ATOM_HAS_ANN = _IMP_isd.IMP_ATOM_HAS_ANN
401
402IMP_ATOM_HAS_BOOST_PROGRAMOPTIONS = _IMP_isd.IMP_ATOM_HAS_BOOST_PROGRAMOPTIONS
403
404IMP_ATOM_HAS_BOOST_RANDOM = _IMP_isd.IMP_ATOM_HAS_BOOST_RANDOM
405
406IMP_ATOM_HAS_BOOST_REGEX = _IMP_isd.IMP_ATOM_HAS_BOOST_REGEX
407
408IMP_ATOM_HAS_BOOST_SYSTEM = _IMP_isd.IMP_ATOM_HAS_BOOST_SYSTEM
409
410IMP_ATOM_HAS_CGAL = _IMP_isd.IMP_ATOM_HAS_CGAL
411
412IMP_ATOM_HAS_GPERFTOOLS = _IMP_isd.IMP_ATOM_HAS_GPERFTOOLS
413
414IMP_ATOM_HAS_HDF5 = _IMP_isd.IMP_ATOM_HAS_HDF5
415
416IMP_ATOM_HAS_NUMPY = _IMP_isd.IMP_ATOM_HAS_NUMPY
417
418IMP_ATOM_HAS_GOOGLE_DENSE_HASH_MAP = _IMP_isd.IMP_ATOM_HAS_GOOGLE_DENSE_HASH_MAP
419
420IMP_ATOM_HAS_PYTHON_IHM = _IMP_isd.IMP_ATOM_HAS_PYTHON_IHM
421
422IMP_ATOM_HAS_ROBIN_MAP = _IMP_isd.IMP_ATOM_HAS_ROBIN_MAP
423
424IMPATOM_SHOW_WARNINGS = _IMP_isd.IMPATOM_SHOW_WARNINGS
425
426IMP_ATOM_TYPE_INDEX = _IMP_isd.IMP_ATOM_TYPE_INDEX
427
428IMP_RESIDUE_TYPE_INDEX = _IMP_isd.IMP_RESIDUE_TYPE_INDEX
429
430IMP_HIERARCHY_TYPE_INDEX = _IMP_isd.IMP_HIERARCHY_TYPE_INDEX
431
432IMP_CHAIN_TYPE_INDEX = _IMP_isd.IMP_CHAIN_TYPE_INDEX
433
434import IMP.atom
435IMP_EM_HAS_IMP_CGAL = _IMP_isd.IMP_EM_HAS_IMP_CGAL
436
437IMP_EM_HAS_IMP_CONTAINER = _IMP_isd.IMP_EM_HAS_IMP_CONTAINER
438
439IMP_EM_HAS_IMP_DISPLAY = _IMP_isd.IMP_EM_HAS_IMP_DISPLAY
440
441IMP_EM_HAS_IMP_SCORE_FUNCTOR = _IMP_isd.IMP_EM_HAS_IMP_SCORE_FUNCTOR
442
443IMP_EM_HAS_ANN = _IMP_isd.IMP_EM_HAS_ANN
444
445IMP_EM_HAS_BOOST_FILESYSTEM = _IMP_isd.IMP_EM_HAS_BOOST_FILESYSTEM
446
447IMP_EM_HAS_BOOST_PROGRAMOPTIONS = _IMP_isd.IMP_EM_HAS_BOOST_PROGRAMOPTIONS
448
449IMP_EM_HAS_BOOST_RANDOM = _IMP_isd.IMP_EM_HAS_BOOST_RANDOM
450
451IMP_EM_HAS_BOOST_REGEX = _IMP_isd.IMP_EM_HAS_BOOST_REGEX
452
453IMP_EM_HAS_BOOST_SYSTEM = _IMP_isd.IMP_EM_HAS_BOOST_SYSTEM
454
455IMP_EM_HAS_CGAL = _IMP_isd.IMP_EM_HAS_CGAL
456
457IMP_EM_HAS_GPERFTOOLS = _IMP_isd.IMP_EM_HAS_GPERFTOOLS
458
459IMP_EM_HAS_HDF5 = _IMP_isd.IMP_EM_HAS_HDF5
460
461IMP_EM_HAS_NUMPY = _IMP_isd.IMP_EM_HAS_NUMPY
462
463IMP_EM_HAS_GOOGLE_DENSE_HASH_MAP = _IMP_isd.IMP_EM_HAS_GOOGLE_DENSE_HASH_MAP
464
465IMP_EM_HAS_PYTHON_IHM = _IMP_isd.IMP_EM_HAS_PYTHON_IHM
466
467IMP_EM_HAS_ROBIN_MAP = _IMP_isd.IMP_EM_HAS_ROBIN_MAP
468
469IMPEM_SHOW_WARNINGS = _IMP_isd.IMPEM_SHOW_WARNINGS
470
471import IMP.em
472IMP_SAXS_HAS_IMP_CGAL = _IMP_isd.IMP_SAXS_HAS_IMP_CGAL
473
474IMP_SAXS_HAS_IMP_CONTAINER = _IMP_isd.IMP_SAXS_HAS_IMP_CONTAINER
475
476IMP_SAXS_HAS_IMP_DISPLAY = _IMP_isd.IMP_SAXS_HAS_IMP_DISPLAY
477
478IMP_SAXS_HAS_IMP_KERNEL = _IMP_isd.IMP_SAXS_HAS_IMP_KERNEL
479
480IMP_SAXS_HAS_IMP_SCORE_FUNCTOR = _IMP_isd.IMP_SAXS_HAS_IMP_SCORE_FUNCTOR
481
482IMP_SAXS_HAS_ANN = _IMP_isd.IMP_SAXS_HAS_ANN
483
484IMP_SAXS_HAS_BOOST_FILESYSTEM = _IMP_isd.IMP_SAXS_HAS_BOOST_FILESYSTEM
485
486IMP_SAXS_HAS_BOOST_PROGRAMOPTIONS = _IMP_isd.IMP_SAXS_HAS_BOOST_PROGRAMOPTIONS
487
488IMP_SAXS_HAS_BOOST_RANDOM = _IMP_isd.IMP_SAXS_HAS_BOOST_RANDOM
489
490IMP_SAXS_HAS_BOOST_REGEX = _IMP_isd.IMP_SAXS_HAS_BOOST_REGEX
491
492IMP_SAXS_HAS_BOOST_SYSTEM = _IMP_isd.IMP_SAXS_HAS_BOOST_SYSTEM
493
494IMP_SAXS_HAS_CGAL = _IMP_isd.IMP_SAXS_HAS_CGAL
495
496IMP_SAXS_HAS_GPERFTOOLS = _IMP_isd.IMP_SAXS_HAS_GPERFTOOLS
497
498IMP_SAXS_HAS_HDF5 = _IMP_isd.IMP_SAXS_HAS_HDF5
499
500IMP_SAXS_HAS_NUMPY = _IMP_isd.IMP_SAXS_HAS_NUMPY
501
502IMP_SAXS_HAS_GOOGLE_DENSE_HASH_MAP = _IMP_isd.IMP_SAXS_HAS_GOOGLE_DENSE_HASH_MAP
503
504IMP_SAXS_HAS_PYTHON_IHM = _IMP_isd.IMP_SAXS_HAS_PYTHON_IHM
505
506IMP_SAXS_HAS_ROBIN_MAP = _IMP_isd.IMP_SAXS_HAS_ROBIN_MAP
507
508IMPSAXS_SHOW_WARNINGS = _IMP_isd.IMPSAXS_SHOW_WARNINGS
509
510import IMP.saxs
511IMP_ISD_HAS_IMP_CGAL = _IMP_isd.IMP_ISD_HAS_IMP_CGAL
512
513IMP_ISD_HAS_IMP_DISPLAY = _IMP_isd.IMP_ISD_HAS_IMP_DISPLAY
514
515IMP_ISD_HAS_IMP_SCORE_FUNCTOR = _IMP_isd.IMP_ISD_HAS_IMP_SCORE_FUNCTOR
516
517IMP_ISD_HAS_ANN = _IMP_isd.IMP_ISD_HAS_ANN
518
519IMP_ISD_HAS_BOOST_FILESYSTEM = _IMP_isd.IMP_ISD_HAS_BOOST_FILESYSTEM
520
521IMP_ISD_HAS_BOOST_PROGRAMOPTIONS = _IMP_isd.IMP_ISD_HAS_BOOST_PROGRAMOPTIONS
522
523IMP_ISD_HAS_BOOST_RANDOM = _IMP_isd.IMP_ISD_HAS_BOOST_RANDOM
524
525IMP_ISD_HAS_BOOST_REGEX = _IMP_isd.IMP_ISD_HAS_BOOST_REGEX
526
527IMP_ISD_HAS_BOOST_SYSTEM = _IMP_isd.IMP_ISD_HAS_BOOST_SYSTEM
528
529IMP_ISD_HAS_CGAL = _IMP_isd.IMP_ISD_HAS_CGAL
530
531IMP_ISD_HAS_GPERFTOOLS = _IMP_isd.IMP_ISD_HAS_GPERFTOOLS
532
533IMP_ISD_HAS_HDF5 = _IMP_isd.IMP_ISD_HAS_HDF5
534
535IMP_ISD_HAS_NUMPY = _IMP_isd.IMP_ISD_HAS_NUMPY
536
537IMP_ISD_HAS_GOOGLE_DENSE_HASH_MAP = _IMP_isd.IMP_ISD_HAS_GOOGLE_DENSE_HASH_MAP
538
539IMP_ISD_HAS_PYTHON_IHM = _IMP_isd.IMP_ISD_HAS_PYTHON_IHM
540
541IMP_ISD_HAS_ROBIN_MAP = _IMP_isd.IMP_ISD_HAS_ROBIN_MAP
542
543IMPISD_SHOW_WARNINGS = _IMP_isd.IMPISD_SHOW_WARNINGS
544
545
546_object_types.append("ISDRestraint")
547
548
549def _object_cast_to_ISDRestraint(o):
550 r"""_object_cast_to_ISDRestraint(Object o) -> ISDRestraint"""
551 return _IMP_isd._object_cast_to_ISDRestraint(o)
552
553_object_types.append("CrossLinkMSRestraint")
554
555
556def _object_cast_to_CrossLinkMSRestraint(o):
557 r"""_object_cast_to_CrossLinkMSRestraint(Object o) -> CrossLinkMSRestraint"""
558 return _IMP_isd._object_cast_to_CrossLinkMSRestraint(o)
559
560_object_types.append("ExactCrossLinkMSRestraint")
561
562
563def _object_cast_to_ExactCrossLinkMSRestraint(o):
564 r"""_object_cast_to_ExactCrossLinkMSRestraint(Object o) -> ExactCrossLinkMSRestraint"""
565 return _IMP_isd._object_cast_to_ExactCrossLinkMSRestraint(o)
566
567_object_types.append("LogWrapper")
568
569
570def _object_cast_to_LogWrapper(o):
571 r"""_object_cast_to_LogWrapper(Object o) -> LogWrapper"""
572 return _IMP_isd._object_cast_to_LogWrapper(o)
573
574_object_types.append("UniformPrior")
575
576
577def _object_cast_to_UniformPrior(o):
578 r"""_object_cast_to_UniformPrior(Object o) -> UniformPrior"""
579 return _IMP_isd._object_cast_to_UniformPrior(o)
580
581_object_types.append("JeffreysRestraint")
582
583
584def _object_cast_to_JeffreysRestraint(o):
585 r"""_object_cast_to_JeffreysRestraint(Object o) -> JeffreysRestraint"""
586 return _IMP_isd._object_cast_to_JeffreysRestraint(o)
587
588_object_types.append("NuisanceScoreState")
589
590
591def _object_cast_to_NuisanceScoreState(o):
592 r"""_object_cast_to_NuisanceScoreState(Object o) -> NuisanceScoreState"""
593 return _IMP_isd._object_cast_to_NuisanceScoreState(o)
594
595_object_types.append("NormalSigmaPCRestraint")
596
597
598def _object_cast_to_NormalSigmaPCRestraint(o):
599 r"""_object_cast_to_NormalSigmaPCRestraint(Object o) -> NormalSigmaPCRestraint"""
600 return _IMP_isd._object_cast_to_NormalSigmaPCRestraint(o)
601
602_object_types.append("vonMisesKappaJeffreysRestraint")
603
604
605def _object_cast_to_vonMisesKappaJeffreysRestraint(o):
606 r"""_object_cast_to_vonMisesKappaJeffreysRestraint(Object o) -> vonMisesKappaJeffreysRestraint"""
607 return _IMP_isd._object_cast_to_vonMisesKappaJeffreysRestraint(o)
608
609_object_types.append("vonMisesKappaConjugateRestraint")
610
611
612def _object_cast_to_vonMisesKappaConjugateRestraint(o):
613 r"""_object_cast_to_vonMisesKappaConjugateRestraint(Object o) -> vonMisesKappaConjugateRestraint"""
614 return _IMP_isd._object_cast_to_vonMisesKappaConjugateRestraint(o)
615
616_object_types.append("Distribution")
617
618
619def _object_cast_to_Distribution(o):
620 r"""_object_cast_to_Distribution(Object o) -> Distribution"""
621 return _IMP_isd._object_cast_to_Distribution(o)
622
623_object_types.append("OneDimensionalDistribution")
624
625
626def _object_cast_to_OneDimensionalDistribution(o):
627 r"""_object_cast_to_OneDimensionalDistribution(Object o) -> OneDimensionalDistribution"""
628 return _IMP_isd._object_cast_to_OneDimensionalDistribution(o)
629
630_object_types.append("OneDimensionalSufficientDistribution")
631
632
633def _object_cast_to_OneDimensionalSufficientDistribution(o):
634 r"""_object_cast_to_OneDimensionalSufficientDistribution(Object o) -> OneDimensionalSufficientDistribution"""
635 return _IMP_isd._object_cast_to_OneDimensionalSufficientDistribution(o)
636
637_object_types.append("FNormal")
638
639
640def _object_cast_to_FNormal(o):
641 r"""_object_cast_to_FNormal(Object o) -> FNormal"""
642 return _IMP_isd._object_cast_to_FNormal(o)
643
644_object_types.append("FStudentT")
645
646
647def _object_cast_to_FStudentT(o):
648 r"""_object_cast_to_FStudentT(Object o) -> FStudentT"""
649 return _IMP_isd._object_cast_to_FStudentT(o)
650
651_object_types.append("vonMises")
652
653
654def _object_cast_to_vonMises(o):
655 r"""_object_cast_to_vonMises(Object o) -> vonMises"""
656 return _IMP_isd._object_cast_to_vonMises(o)
657
658_object_types.append("vonMisesSufficient")
659
660
661def _object_cast_to_vonMisesSufficient(o):
662 r"""_object_cast_to_vonMisesSufficient(Object o) -> vonMisesSufficient"""
663 return _IMP_isd._object_cast_to_vonMisesSufficient(o)
664
665_object_types.append("PenalizedComplexityPrior")
666
667
668def _object_cast_to_PenalizedComplexityPrior(o):
669 r"""_object_cast_to_PenalizedComplexityPrior(Object o) -> PenalizedComplexityPrior"""
670 return _IMP_isd._object_cast_to_PenalizedComplexityPrior(o)
671
672def Nuisances(l=[]):
673 return [Nuisance(x) for x in l]
674_plural_types.append("Nuisances")
675
676
677_value_types.append("Nuisance")
678
679
680def Scales(l=[]):
681 return [Scale(x) for x in l]
682_plural_types.append("Scales")
683
684
685_value_types.append("Scale")
686
687
688def Switchings(l=[]):
689 return [Switching(x) for x in l]
690_plural_types.append("Switchings")
691
692
693_value_types.append("Switching")
694
695
696_object_types.append("NOERestraint")
697
698
699def _object_cast_to_NOERestraint(o):
700 r"""_object_cast_to_NOERestraint(Object o) -> NOERestraint"""
701 return _IMP_isd._object_cast_to_NOERestraint(o)
702
703def Weights(l=[]):
704 return [Weight(x) for x in l]
705_plural_types.append("Weights")
706
707
708_value_types.append("Weight")
709
710
711_object_types.append("GaussianRestraint")
712
713
714def _object_cast_to_GaussianRestraint(o):
715 r"""_object_cast_to_GaussianRestraint(Object o) -> GaussianRestraint"""
716 return _IMP_isd._object_cast_to_GaussianRestraint(o)
717
718_object_types.append("StudentTRestraint")
719
720
721def _object_cast_to_StudentTRestraint(o):
722 r"""_object_cast_to_StudentTRestraint(Object o) -> StudentTRestraint"""
723 return _IMP_isd._object_cast_to_StudentTRestraint(o)
724
725_object_types.append("LognormalRestraint")
726
727
728def _object_cast_to_LognormalRestraint(o):
729 r"""_object_cast_to_LognormalRestraint(Object o) -> LognormalRestraint"""
730 return _IMP_isd._object_cast_to_LognormalRestraint(o)
731
732_object_types.append("LognormalAmbiguousRestraint")
733
734
735def _object_cast_to_LognormalAmbiguousRestraint(o):
736 r"""_object_cast_to_LognormalAmbiguousRestraint(Object o) -> LognormalAmbiguousRestraint"""
737 return _IMP_isd._object_cast_to_LognormalAmbiguousRestraint(o)
738
739_object_types.append("AmbiguousNOERestraint")
740
741
742def _object_cast_to_AmbiguousNOERestraint(o):
743 r"""_object_cast_to_AmbiguousNOERestraint(Object o) -> AmbiguousNOERestraint"""
744 return _IMP_isd._object_cast_to_AmbiguousNOERestraint(o)
745
746_object_types.append("MarginalNOERestraint")
747
748
749def _object_cast_to_MarginalNOERestraint(o):
750 r"""_object_cast_to_MarginalNOERestraint(Object o) -> MarginalNOERestraint"""
751 return _IMP_isd._object_cast_to_MarginalNOERestraint(o)
752
753_object_types.append("MarginalHBondRestraint")
754
755
756def _object_cast_to_MarginalHBondRestraint(o):
757 r"""_object_cast_to_MarginalHBondRestraint(Object o) -> MarginalHBondRestraint"""
758 return _IMP_isd._object_cast_to_MarginalHBondRestraint(o)
759
760_object_types.append("TALOSRestraint")
761
762
763def _object_cast_to_TALOSRestraint(o):
764 r"""_object_cast_to_TALOSRestraint(Object o) -> TALOSRestraint"""
765 return _IMP_isd._object_cast_to_TALOSRestraint(o)
766
767_object_types.append("RepulsiveDistancePairScore")
768
769
770def _object_cast_to_RepulsiveDistancePairScore(o):
771 r"""_object_cast_to_RepulsiveDistancePairScore(Object o) -> RepulsiveDistancePairScore"""
772 return _IMP_isd._object_cast_to_RepulsiveDistancePairScore(o)
773
774_object_types.append("AmbiguousRestraint")
775
776
777def _object_cast_to_AmbiguousRestraint(o):
778 r"""_object_cast_to_AmbiguousRestraint(Object o) -> AmbiguousRestraint"""
779 return _IMP_isd._object_cast_to_AmbiguousRestraint(o)
780
781_object_types.append("UnivariateFunction")
782
783
784def _object_cast_to_UnivariateFunction(o):
785 r"""_object_cast_to_UnivariateFunction(Object o) -> UnivariateFunction"""
786 return _IMP_isd._object_cast_to_UnivariateFunction(o)
787
788_object_types.append("Linear1DFunction")
789
790
791def _object_cast_to_Linear1DFunction(o):
792 r"""_object_cast_to_Linear1DFunction(Object o) -> Linear1DFunction"""
793 return _IMP_isd._object_cast_to_Linear1DFunction(o)
794
795_object_types.append("GeneralizedGuinierPorodFunction")
796
797
798def _object_cast_to_GeneralizedGuinierPorodFunction(o):
799 r"""_object_cast_to_GeneralizedGuinierPorodFunction(Object o) -> GeneralizedGuinierPorodFunction"""
800 return _IMP_isd._object_cast_to_GeneralizedGuinierPorodFunction(o)
801
802_object_types.append("BivariateFunction")
803
804
805def _object_cast_to_BivariateFunction(o):
806 r"""_object_cast_to_BivariateFunction(Object o) -> BivariateFunction"""
807 return _IMP_isd._object_cast_to_BivariateFunction(o)
808
809_object_types.append("Covariance1DFunction")
810
811
812def _object_cast_to_Covariance1DFunction(o):
813 r"""_object_cast_to_Covariance1DFunction(Object o) -> Covariance1DFunction"""
814 return _IMP_isd._object_cast_to_Covariance1DFunction(o)
815
816_object_types.append("GaussianProcessInterpolation")
817
818
819def _object_cast_to_GaussianProcessInterpolation(o):
820 r"""_object_cast_to_GaussianProcessInterpolation(Object o) -> GaussianProcessInterpolation"""
821 return _IMP_isd._object_cast_to_GaussianProcessInterpolation(o)
822
823_object_types.append("GaussianProcessInterpolationRestraint")
824
825
826def _object_cast_to_GaussianProcessInterpolationRestraint(o):
827 r"""_object_cast_to_GaussianProcessInterpolationRestraint(Object o) -> GaussianProcessInterpolationRestraint"""
828 return _IMP_isd._object_cast_to_GaussianProcessInterpolationRestraint(o)
829
830_object_types.append("MolecularDynamics")
831
832
833_object_types.append("MolecularDynamicsMover")
834
835
836def _object_cast_to_MolecularDynamicsMover(o):
837 r"""_object_cast_to_MolecularDynamicsMover(Object o) -> MolecularDynamicsMover"""
838 return _IMP_isd._object_cast_to_MolecularDynamicsMover(o)
839
840_object_types.append("HybridMonteCarlo")
841
842
843def _object_cast_to_HybridMonteCarlo(o):
844 r"""_object_cast_to_HybridMonteCarlo(Object o) -> HybridMonteCarlo"""
845 return _IMP_isd._object_cast_to_HybridMonteCarlo(o)
846
847_object_types.append("FretData")
848
849
850def _object_cast_to_FretData(o):
851 r"""_object_cast_to_FretData(Object o) -> FretData"""
852 return _IMP_isd._object_cast_to_FretData(o)
853
854_object_types.append("FretRestraint")
855
856
857def _object_cast_to_FretRestraint(o):
858 r"""_object_cast_to_FretRestraint(Object o) -> FretRestraint"""
859 return _IMP_isd._object_cast_to_FretRestraint(o)
860
861_object_types.append("CrossLinkData")
862
863
864def _object_cast_to_CrossLinkData(o):
865 r"""_object_cast_to_CrossLinkData(Object o) -> CrossLinkData"""
866 return _IMP_isd._object_cast_to_CrossLinkData(o)
867
868_object_types.append("CysteineCrossLinkData")
869
870
871def _object_cast_to_CysteineCrossLinkData(o):
872 r"""_object_cast_to_CysteineCrossLinkData(Object o) -> CysteineCrossLinkData"""
873 return _IMP_isd._object_cast_to_CysteineCrossLinkData(o)
874
875_object_types.append("CysteineCrossLinkRestraint")
876
877
878def _object_cast_to_CysteineCrossLinkRestraint(o):
879 r"""_object_cast_to_CysteineCrossLinkRestraint(Object o) -> CysteineCrossLinkRestraint"""
880 return _IMP_isd._object_cast_to_CysteineCrossLinkRestraint(o)
881
882_object_types.append("WeightMover")
883
884
885def _object_cast_to_WeightMover(o):
886 r"""_object_cast_to_WeightMover(Object o) -> WeightMover"""
887 return _IMP_isd._object_cast_to_WeightMover(o)
888
889_object_types.append("WeightRestraint")
890
891
892def _object_cast_to_WeightRestraint(o):
893 r"""_object_cast_to_WeightRestraint(Object o) -> WeightRestraint"""
894 return _IMP_isd._object_cast_to_WeightRestraint(o)
895
896_object_types.append("AtomicCrossLinkMSRestraint")
897
898
899def _object_cast_to_AtomicCrossLinkMSRestraint(o):
900 r"""_object_cast_to_AtomicCrossLinkMSRestraint(Object o) -> AtomicCrossLinkMSRestraint"""
901 return _IMP_isd._object_cast_to_AtomicCrossLinkMSRestraint(o)
902
903_object_types.append("GaussianEMRestraint")
904
905
906def _object_cast_to_GaussianEMRestraint(o):
907 r"""_object_cast_to_GaussianEMRestraint(Object o) -> GaussianEMRestraint"""
908 return _IMP_isd._object_cast_to_GaussianEMRestraint(o)
909
910_object_types.append("GaussianAnchorEMRestraint")
911
912
913def _object_cast_to_GaussianAnchorEMRestraint(o):
914 r"""_object_cast_to_GaussianAnchorEMRestraint(Object o) -> GaussianAnchorEMRestraint"""
915 return _IMP_isd._object_cast_to_GaussianAnchorEMRestraint(o)
916
917_object_types.append("GammaPrior")
918
919
920def _object_cast_to_GammaPrior(o):
921 r"""_object_cast_to_GammaPrior(Object o) -> GammaPrior"""
922 return _IMP_isd._object_cast_to_GammaPrior(o)
923
924_object_types.append("ResidueProteinProximityRestraint")
925
926
927def _object_cast_to_ResidueProteinProximityRestraint(o):
928 r"""_object_cast_to_ResidueProteinProximityRestraint(Object o) -> ResidueProteinProximityRestraint"""
929 return _IMP_isd._object_cast_to_ResidueProteinProximityRestraint(o)
930
931def create_model_and_particles():
932 m= IMP.Model()
933 sc= IMP.container.ListSingletonContainer(m)
934 b= IMP.algebra.BoundingBox3D(IMP.algebra.Vector3D(0,0,0),
935 IMP.algebra.Vector3D(10,10,10))
936 for i in range(0,100):
937 p= IMP.Particle(m)
938 sc.add_particle(p)
939 d=IMP.core.XYZR.setup_particle(p, IMP.algebra.Sphere3D(IMP.algebra.get_random_vector_in(b), 1))
940 d.set_coordinates_are_optimized(True)
941 return (m, sc)
942
943class ISDRestraint(IMP.Restraint):
944 r"""Proxy of C++ IMP::isd::ISDRestraint class."""
945
946 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
947
948 def __init__(self, m, name):
949 r"""__init__(ISDRestraint self, Model m, std::string name) -> ISDRestraint"""
950 if self.__class__ == ISDRestraint:
951 _self = None
952 else:
953 _self = self
954 _IMP_isd.ISDRestraint_swiginit(self, _IMP_isd.new_ISDRestraint(_self, m, name))
955
956 if self.__class__ != ISDRestraint:
957 _director_objects.register(self)
958
959
960
961
962 def get_probability(self):
963 r"""get_probability(ISDRestraint self) -> double"""
964 return _IMP_isd.ISDRestraint_get_probability(self)
965
966 def unprotected_evaluate(self, accum):
967 r"""unprotected_evaluate(ISDRestraint self, DerivativeAccumulator accum) -> double"""
968 return _IMP_isd.ISDRestraint_unprotected_evaluate(self, accum)
969
970 def do_get_inputs(self):
971 r"""do_get_inputs(ISDRestraint self) -> IMP::ModelObjectsTemp"""
972 return _IMP_isd.ISDRestraint_do_get_inputs(self)
973
974 def get_type_name(self):
975 r"""get_type_name(ISDRestraint self) -> std::string"""
976 return _IMP_isd.ISDRestraint_get_type_name(self)
977
978 def get_version_info(self):
979 r"""get_version_info(ISDRestraint self) -> VersionInfo"""
980 return _IMP_isd.ISDRestraint_get_version_info(self)
981 __swig_destroy__ = _IMP_isd.delete_ISDRestraint
982
983 def __str__(self):
984 r"""__str__(ISDRestraint self) -> std::string"""
985 return _IMP_isd.ISDRestraint___str__(self)
986
987 def __repr__(self):
988 r"""__repr__(ISDRestraint self) -> std::string"""
989 return _IMP_isd.ISDRestraint___repr__(self)
990
991 @staticmethod
992 def get_from(o):
993 return _object_cast_to_ISDRestraint(o)
994
995
996 def do_show(self, out):
997 pass
998
999 @staticmethod
1000 def get_from(o):
1001 return _object_cast_to_ISDRestraint(o)
1002
1003 def __disown__(self):
1004 self.this.disown()
1005 _IMP_isd.disown_ISDRestraint(self)
1006 return weakref.proxy(self)
1007
1008 def do_destroy(self):
1009 r"""do_destroy(ISDRestraint self)"""
1010 return _IMP_isd.ISDRestraint_do_destroy(self)
1011
1012 def handle_set_has_required_score_states(self, arg0):
1013 r"""handle_set_has_required_score_states(ISDRestraint self, bool arg0)"""
1014 return _IMP_isd.ISDRestraint_handle_set_has_required_score_states(self, arg0)
1015
1016 def do_get_outputs(self):
1017 r"""do_get_outputs(ISDRestraint self) -> IMP::ModelObjectsTemp"""
1018 return _IMP_isd.ISDRestraint_do_get_outputs(self)
1019
1020 def do_get_interactions(self):
1021 r"""do_get_interactions(ISDRestraint self) -> IMP::ModelObjectsTemps"""
1022 return _IMP_isd.ISDRestraint_do_get_interactions(self)
1023
1024 def do_create_decomposition(self):
1025 r"""do_create_decomposition(ISDRestraint self) -> IMP::Restraints"""
1026 return _IMP_isd.ISDRestraint_do_create_decomposition(self)
1027
1028 def do_create_current_decomposition(self):
1029 r"""do_create_current_decomposition(ISDRestraint self) -> IMP::Restraints"""
1030 return _IMP_isd.ISDRestraint_do_create_current_decomposition(self)
1031
1032 def do_add_score_and_derivatives(self, sa):
1033 r"""do_add_score_and_derivatives(ISDRestraint self, ScoreAccumulator sa)"""
1034 return _IMP_isd.ISDRestraint_do_add_score_and_derivatives(self, sa)
1035
1036 def do_add_score_and_derivatives_moved(self, sa, moved_pis, reset_pis):
1037 r"""do_add_score_and_derivatives_moved(ISDRestraint self, ScoreAccumulator sa, IMP::ParticleIndexes const & moved_pis, IMP::ParticleIndexes const & reset_pis)"""
1038 return _IMP_isd.ISDRestraint_do_add_score_and_derivatives_moved(self, sa, moved_pis, reset_pis)
1039
1040# Register ISDRestraint in _IMP_isd:
1041_IMP_isd.ISDRestraint_swigregister(ISDRestraint)
1042class CrossLinkMSRestraint(IMP.Restraint):
1043 r"""Proxy of C++ IMP::isd::CrossLinkMSRestraint class."""
1044
1045 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1046
1047 def __init__(self, *args):
1048 r"""
1049 __init__(CrossLinkMSRestraint self, Model m, double length, bool get_log_prob=False, std::string name="CrossLinkMSRestraint%1%") -> CrossLinkMSRestraint
1050 __init__(CrossLinkMSRestraint self, Model m, _ParticleIndexAdaptor lengthi, bool get_log_prob=False, std::string name="CrossLinkMSRestraint%1%") -> CrossLinkMSRestraint
1051 __init__(CrossLinkMSRestraint self, Model m, double length, double slope, bool get_log_prob=False, std::string name="CrossLinkMSRestraint%1%") -> CrossLinkMSRestraint
1052 __init__(CrossLinkMSRestraint self) -> CrossLinkMSRestraint
1053 """
1054 _IMP_isd.CrossLinkMSRestraint_swiginit(self, _IMP_isd.new_CrossLinkMSRestraint(*args))
1055
1056 def set_source_protein1(self, protein1):
1057 r"""set_source_protein1(CrossLinkMSRestraint self, std::string protein1)"""
1058 return _IMP_isd.CrossLinkMSRestraint_set_source_protein1(self, protein1)
1059
1060 def get_source_protein1(self):
1061 r"""get_source_protein1(CrossLinkMSRestraint self) -> std::string"""
1062 return _IMP_isd.CrossLinkMSRestraint_get_source_protein1(self)
1063
1064 def set_source_protein2(self, protein2):
1065 r"""set_source_protein2(CrossLinkMSRestraint self, std::string protein2)"""
1066 return _IMP_isd.CrossLinkMSRestraint_set_source_protein2(self, protein2)
1067
1068 def get_source_protein2(self):
1069 r"""get_source_protein2(CrossLinkMSRestraint self) -> std::string"""
1070 return _IMP_isd.CrossLinkMSRestraint_get_source_protein2(self)
1071
1072 def set_source_residue1(self, residue1):
1073 r"""set_source_residue1(CrossLinkMSRestraint self, int residue1)"""
1074 return _IMP_isd.CrossLinkMSRestraint_set_source_residue1(self, residue1)
1075
1076 def get_source_residue1(self):
1077 r"""get_source_residue1(CrossLinkMSRestraint self) -> int"""
1078 return _IMP_isd.CrossLinkMSRestraint_get_source_residue1(self)
1079
1080 def set_source_residue2(self, residue2):
1081 r"""set_source_residue2(CrossLinkMSRestraint self, int residue2)"""
1082 return _IMP_isd.CrossLinkMSRestraint_set_source_residue2(self, residue2)
1083
1084 def get_source_residue2(self):
1085 r"""get_source_residue2(CrossLinkMSRestraint self) -> int"""
1086 return _IMP_isd.CrossLinkMSRestraint_get_source_residue2(self)
1087
1088 def add_contribution(self, pps, sigmas, psi):
1089 r"""add_contribution(CrossLinkMSRestraint self, IMP::ParticleIndexPair const & pps, IMP::ParticleIndexPair const & sigmas, ParticleIndex psi)"""
1090 return _IMP_isd.CrossLinkMSRestraint_add_contribution(self, pps, sigmas, psi)
1091
1092 def get_probability(self):
1093 r"""get_probability(CrossLinkMSRestraint self) -> double"""
1094 return _IMP_isd.CrossLinkMSRestraint_get_probability(self)
1095
1096 def get_length(self):
1097 r"""get_length(CrossLinkMSRestraint self) -> double"""
1098 return _IMP_isd.CrossLinkMSRestraint_get_length(self)
1099
1100 def get_is_length_variable(self):
1101 r"""get_is_length_variable(CrossLinkMSRestraint self) -> bool"""
1102 return _IMP_isd.CrossLinkMSRestraint_get_is_length_variable(self)
1103
1104 def get_has_slope(self):
1105 r"""get_has_slope(CrossLinkMSRestraint self) -> bool"""
1106 return _IMP_isd.CrossLinkMSRestraint_get_has_slope(self)
1107
1108 def get_slope(self):
1109 r"""get_slope(CrossLinkMSRestraint self) -> double"""
1110 return _IMP_isd.CrossLinkMSRestraint_get_slope(self)
1111
1112 def get_log_prob(self):
1113 r"""get_log_prob(CrossLinkMSRestraint self) -> bool"""
1114 return _IMP_isd.CrossLinkMSRestraint_get_log_prob(self)
1115
1116 def get_contribution_sigma_indexes(self, i):
1117 r"""get_contribution_sigma_indexes(CrossLinkMSRestraint self, int i) -> IMP::ParticleIndexPair"""
1118 return _IMP_isd.CrossLinkMSRestraint_get_contribution_sigma_indexes(self, i)
1119
1120 def get_contribution_psi_index(self, i):
1121 r"""get_contribution_psi_index(CrossLinkMSRestraint self, int i) -> ParticleIndex"""
1122 return _IMP_isd.CrossLinkMSRestraint_get_contribution_psi_index(self, i)
1123
1124 def get_contribution_particle_indexes(self, i):
1125 r"""get_contribution_particle_indexes(CrossLinkMSRestraint self, int i) -> IMP::ParticleIndexPair"""
1126 return _IMP_isd.CrossLinkMSRestraint_get_contribution_particle_indexes(self, i)
1127
1128 def get_number_of_contributions(self):
1129 r"""get_number_of_contributions(CrossLinkMSRestraint self) -> unsigned int"""
1130 return _IMP_isd.CrossLinkMSRestraint_get_number_of_contributions(self)
1131
1132 def do_get_inputs(self):
1133 r"""do_get_inputs(CrossLinkMSRestraint self) -> IMP::ModelObjectsTemp"""
1134 return _IMP_isd.CrossLinkMSRestraint_do_get_inputs(self)
1135
1136 def get_version_info(self):
1137 r"""get_version_info(CrossLinkMSRestraint self) -> VersionInfo"""
1138 return _IMP_isd.CrossLinkMSRestraint_get_version_info(self)
1139 __swig_destroy__ = _IMP_isd.delete_CrossLinkMSRestraint
1140
1141 def __str__(self):
1142 r"""__str__(CrossLinkMSRestraint self) -> std::string"""
1143 return _IMP_isd.CrossLinkMSRestraint___str__(self)
1144
1145 def __repr__(self):
1146 r"""__repr__(CrossLinkMSRestraint self) -> std::string"""
1147 return _IMP_isd.CrossLinkMSRestraint___repr__(self)
1148
1149 @staticmethod
1150 def get_from(o):
1151 return _object_cast_to_CrossLinkMSRestraint(o)
1152
1153
1154 def _get_as_binary(self):
1155 r"""_get_as_binary(CrossLinkMSRestraint self) -> PyObject *"""
1156 return _IMP_isd.CrossLinkMSRestraint__get_as_binary(self)
1157
1158 def _set_from_binary(self, p):
1159 r"""_set_from_binary(CrossLinkMSRestraint self, PyObject * p)"""
1160 return _IMP_isd.CrossLinkMSRestraint__set_from_binary(self, p)
1161
1162 def __getstate__(self):
1163 p = self._get_as_binary()
1164 if len(self.__dict__) > 1:
1165 d = self.__dict__.copy()
1166 del d['this']
1167 p = (d, p)
1168 return p
1169
1170 def __setstate__(self, p):
1171 if not hasattr(self, 'this'):
1172 self.__init__()
1173 if isinstance(p, tuple):
1174 d, p = p
1175 self.__dict__.update(d)
1176 return self._set_from_binary(p)
1177
1178
1179 @staticmethod
1180 def _get_contributions_sigma_numpy(rs):
1181 """Get the particle indexes for all sigma nuisances for all
1182 contributions to the given list of restraints."""
1183 import numpy
1184 import itertools
1185 nconts = [r.get_number_of_contributions() for r in rs]
1186 ret = numpy.empty((sum(nconts), 2), int)
1187 i = itertools.count(0)
1188 for (ncont, r) in zip(nconts, rs):
1189 for c in range(ncont):
1190 ret[next(i)] = r.get_contribution_sigma_indexes(c)
1191 return ret
1192
1193 @staticmethod
1194 def _get_contributions_psi_numpy(rs):
1195 """Get the particle indexes for psi sigma nuisances for all
1196 contributions to the given list of restraints."""
1197 import numpy
1198 import itertools
1199 nconts = [r.get_number_of_contributions() for r in rs]
1200 ret = numpy.empty(sum(nconts), int)
1201 i = itertools.count(0)
1202 for (ncont, r) in zip(nconts, rs):
1203 for c in range(ncont):
1204 ret[next(i)] = r.get_contribution_psi_index(c)
1205 return ret
1206
1207 @staticmethod
1208 def _get_contributions_particles_numpy(rs):
1209 """Get the particle indexes for crosslink endpoints for all
1210 contributions to the given list of restraints."""
1211 import numpy
1212 import itertools
1213 nconts = [r.get_number_of_contributions() for r in rs]
1214 ret = numpy.empty((sum(nconts), 2), int)
1215 i = itertools.count(0)
1216 for (ncont, r) in zip(nconts, rs):
1217 for c in range(ncont):
1218 ret[next(i)] = r.get_contribution_particle_indexes(c)
1219 return ret
1220
1221 @staticmethod
1222 def _get_contributions_segments(rs):
1223 """Map each contribution to the corresponding restraint index,
1224 suitable for use by IMP.isd._jax_util.get_segment_prod()."""
1225 import numpy
1226 import itertools
1227 nconts = [r.get_number_of_contributions() for r in rs]
1228 # If every restraint has only a single contribution, skip
1229 # and return None; segment ids aren't needed
1230 if any(n > 1 for n in nconts):
1231 segs = []
1232 segment = itertools.count(0)
1233 for ncont in nconts:
1234 segs.extend([next(segment)] * ncont)
1235 return numpy.array(segs)
1236
1237 @classmethod
1238 def _get_jax_for_restraints(cls, rs, space):
1239 """Get a JAX function that scores the given list of crosslink
1240 restraints. They must all have the same length, slope and
1241 get_log_prob flag."""
1242 import jax.numpy as jnp
1243 import math
1244
1245 def sphere_cap(r1, r2, d):
1246 short_range = jnp.minimum(4.0 / 3.0 * math.pi * r1 * r1 * r1,
1247 4.0 / 3.0 * math.pi * r2 * r2 * r2)
1248 is_short = d <= jnp.absolute(r1 - r2)
1249 is_long = d >= r1 + r2
1250 # Only evaluate the mid-range expression (which divides by d)
1251 # where it is actually used; otherwise d==0 in the short-range
1252 # branch yields NaN gradients even though the value is unused
1253 safe_d = jnp.where(is_short | is_long, 1., d)
1254 mid_range = ((math.pi / 12 / safe_d * (r1 + r2 - safe_d)
1255 * (r1 + r2 - safe_d)) *
1256 (safe_d * safe_d + 2 * safe_d * r1 - 3 * r1 * r1
1257 + 2 * safe_d * r2 + 6 * r1 * r2 - 3 * r2 * r2))
1258 return jnp.where(is_short, short_range,
1259 jnp.where(is_long, 0., mid_range))
1260
1261 def forward_model(dist, sigmai, sigmaj, length):
1262 voli = 4.0 / 3.0 * math.pi * sigmai * sigmai * sigmai
1263 volj = 4.0 / 3.0 * math.pi * sigmaj * sigmaj * sigmaj
1264 xlvol = (4.0 / 3.0 * math.pi * (length / 2.)
1265 * (length / 2.) * (length / 2.))
1266
1267 close = dist < sigmai + sigmaj
1268 fi = jnp.where(
1269 close, jnp.minimum(voli, xlvol),
1270 sphere_cap(sigmai, length / 2.,
1271 jnp.abs(dist - sigmaj - length / 2.)))
1272 fj = jnp.where(
1273 close, jnp.minimum(volj, xlvol),
1274 sphere_cap(sigmaj, length / 2.,
1275 jnp.abs(dist - sigmai - length / 2.)))
1276
1277 return fi * fj / voli / volj
1278
1279 return _get_crosslink_jax_for_restraints(rs, space, forward_model)
1280
1281 def _get_jax(self, space):
1282 return self._get_jax_for_restraints([self], space)
1283
1284 @classmethod
1285 def _get_jax_multiple(cls, restraints, space):
1286 return _get_crosslink_jax_multiple(cls, restraints, space)
1287
1288
1289# Register CrossLinkMSRestraint in _IMP_isd:
1290_IMP_isd.CrossLinkMSRestraint_swigregister(CrossLinkMSRestraint)
1291class ExactCrossLinkMSRestraint(IMP.Restraint):
1292 r"""Proxy of C++ IMP::isd::ExactCrossLinkMSRestraint class."""
1293
1294 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1295
1296 def __init__(self, *args):
1297 r"""
1298 __init__(ExactCrossLinkMSRestraint self, Model m, double length, bool get_log_prob=False, std::string name="ExactCrossLinkMSRestraint%1%") -> ExactCrossLinkMSRestraint
1299 __init__(ExactCrossLinkMSRestraint self, Model m, _ParticleIndexAdaptor lengthi, bool get_log_prob=False, std::string name="ExactCrossLinkMSRestraint%1%") -> ExactCrossLinkMSRestraint
1300 __init__(ExactCrossLinkMSRestraint self, Model m, double length, double slope, bool get_log_prob=False, std::string name="ExactCrossLinkMSRestraint%1%") -> ExactCrossLinkMSRestraint
1301 __init__(ExactCrossLinkMSRestraint self) -> ExactCrossLinkMSRestraint
1302 """
1303 _IMP_isd.ExactCrossLinkMSRestraint_swiginit(self, _IMP_isd.new_ExactCrossLinkMSRestraint(*args))
1304
1305 def set_source_protein1(self, protein1):
1306 r"""set_source_protein1(ExactCrossLinkMSRestraint self, std::string protein1)"""
1307 return _IMP_isd.ExactCrossLinkMSRestraint_set_source_protein1(self, protein1)
1308
1309 def get_source_protein1(self):
1310 r"""get_source_protein1(ExactCrossLinkMSRestraint self) -> std::string"""
1311 return _IMP_isd.ExactCrossLinkMSRestraint_get_source_protein1(self)
1312
1313 def set_source_protein2(self, protein2):
1314 r"""set_source_protein2(ExactCrossLinkMSRestraint self, std::string protein2)"""
1315 return _IMP_isd.ExactCrossLinkMSRestraint_set_source_protein2(self, protein2)
1316
1317 def get_source_protein2(self):
1318 r"""get_source_protein2(ExactCrossLinkMSRestraint self) -> std::string"""
1319 return _IMP_isd.ExactCrossLinkMSRestraint_get_source_protein2(self)
1320
1321 def set_source_residue1(self, residue1):
1322 r"""set_source_residue1(ExactCrossLinkMSRestraint self, int residue1)"""
1323 return _IMP_isd.ExactCrossLinkMSRestraint_set_source_residue1(self, residue1)
1324
1325 def get_source_residue1(self):
1326 r"""get_source_residue1(ExactCrossLinkMSRestraint self) -> int"""
1327 return _IMP_isd.ExactCrossLinkMSRestraint_get_source_residue1(self)
1328
1329 def set_source_residue2(self, residue2):
1330 r"""set_source_residue2(ExactCrossLinkMSRestraint self, int residue2)"""
1331 return _IMP_isd.ExactCrossLinkMSRestraint_set_source_residue2(self, residue2)
1332
1333 def get_source_residue2(self):
1334 r"""get_source_residue2(ExactCrossLinkMSRestraint self) -> int"""
1335 return _IMP_isd.ExactCrossLinkMSRestraint_get_source_residue2(self)
1336
1337 def add_contribution(self, pps, sigmas, psi):
1338 r"""add_contribution(ExactCrossLinkMSRestraint self, IMP::ParticleIndexPair const & pps, IMP::ParticleIndexPair const & sigmas, ParticleIndex psi)"""
1339 return _IMP_isd.ExactCrossLinkMSRestraint_add_contribution(self, pps, sigmas, psi)
1340
1341 def get_probability(self):
1342 r"""get_probability(ExactCrossLinkMSRestraint self) -> double"""
1343 return _IMP_isd.ExactCrossLinkMSRestraint_get_probability(self)
1344
1345 def get_length(self):
1346 r"""get_length(ExactCrossLinkMSRestraint self) -> double"""
1347 return _IMP_isd.ExactCrossLinkMSRestraint_get_length(self)
1348
1349 def get_is_length_variable(self):
1350 r"""get_is_length_variable(ExactCrossLinkMSRestraint self) -> bool"""
1351 return _IMP_isd.ExactCrossLinkMSRestraint_get_is_length_variable(self)
1352
1353 def get_has_slope(self):
1354 r"""get_has_slope(ExactCrossLinkMSRestraint self) -> bool"""
1355 return _IMP_isd.ExactCrossLinkMSRestraint_get_has_slope(self)
1356
1357 def get_slope(self):
1358 r"""get_slope(ExactCrossLinkMSRestraint self) -> double"""
1359 return _IMP_isd.ExactCrossLinkMSRestraint_get_slope(self)
1360
1361 def get_log_prob(self):
1362 r"""get_log_prob(ExactCrossLinkMSRestraint self) -> bool"""
1363 return _IMP_isd.ExactCrossLinkMSRestraint_get_log_prob(self)
1364
1365 def get_contribution_sigma_indexes(self, i):
1366 r"""get_contribution_sigma_indexes(ExactCrossLinkMSRestraint self, int i) -> IMP::ParticleIndexPair"""
1367 return _IMP_isd.ExactCrossLinkMSRestraint_get_contribution_sigma_indexes(self, i)
1368
1369 def get_contribution_psi_index(self, i):
1370 r"""get_contribution_psi_index(ExactCrossLinkMSRestraint self, int i) -> ParticleIndex"""
1371 return _IMP_isd.ExactCrossLinkMSRestraint_get_contribution_psi_index(self, i)
1372
1373 def get_contribution_particle_indexes(self, i):
1374 r"""get_contribution_particle_indexes(ExactCrossLinkMSRestraint self, int i) -> IMP::ParticleIndexPair"""
1375 return _IMP_isd.ExactCrossLinkMSRestraint_get_contribution_particle_indexes(self, i)
1376
1377 def get_number_of_contributions(self):
1378 r"""get_number_of_contributions(ExactCrossLinkMSRestraint self) -> unsigned int"""
1379 return _IMP_isd.ExactCrossLinkMSRestraint_get_number_of_contributions(self)
1380
1381 def do_get_inputs(self):
1382 r"""do_get_inputs(ExactCrossLinkMSRestraint self) -> IMP::ModelObjectsTemp"""
1383 return _IMP_isd.ExactCrossLinkMSRestraint_do_get_inputs(self)
1384
1385 def get_version_info(self):
1386 r"""get_version_info(ExactCrossLinkMSRestraint self) -> VersionInfo"""
1387 return _IMP_isd.ExactCrossLinkMSRestraint_get_version_info(self)
1388 __swig_destroy__ = _IMP_isd.delete_ExactCrossLinkMSRestraint
1389
1390 def __str__(self):
1391 r"""__str__(ExactCrossLinkMSRestraint self) -> std::string"""
1392 return _IMP_isd.ExactCrossLinkMSRestraint___str__(self)
1393
1394 def __repr__(self):
1395 r"""__repr__(ExactCrossLinkMSRestraint self) -> std::string"""
1396 return _IMP_isd.ExactCrossLinkMSRestraint___repr__(self)
1397
1398 @staticmethod
1399 def get_from(o):
1400 return _object_cast_to_ExactCrossLinkMSRestraint(o)
1401
1402
1403 def _get_as_binary(self):
1404 r"""_get_as_binary(ExactCrossLinkMSRestraint self) -> PyObject *"""
1405 return _IMP_isd.ExactCrossLinkMSRestraint__get_as_binary(self)
1406
1407 def _set_from_binary(self, p):
1408 r"""_set_from_binary(ExactCrossLinkMSRestraint self, PyObject * p)"""
1409 return _IMP_isd.ExactCrossLinkMSRestraint__set_from_binary(self, p)
1410
1411 def __getstate__(self):
1412 p = self._get_as_binary()
1413 if len(self.__dict__) > 1:
1414 d = self.__dict__.copy()
1415 del d['this']
1416 p = (d, p)
1417 return p
1418
1419 def __setstate__(self, p):
1420 if not hasattr(self, 'this'):
1421 self.__init__()
1422 if isinstance(p, tuple):
1423 d, p = p
1424 self.__dict__.update(d)
1425 return self._set_from_binary(p)
1426
1427
1428 @classmethod
1429 def _get_jax_for_restraints(cls, rs, space):
1430 """Get a JAX function that scores the given list of crosslink
1431 restraints. They must all have the same length, slope and
1432 get_log_prob flag."""
1433 import jax.numpy as jnp
1434 import math
1435
1436 # 4-point Gauss-Legendre nodes and weights on [-1, 1], as in
1437 # get_forward_model_probability() in ExactCrossLinkMSRestraint.cpp:
1438 # t = +-sqrt(3/7 + (2/7) sqrt(6/5)), w = (18 - sqrt(30)) / 36 and
1439 # t = +-sqrt(3/7 - (2/7) sqrt(6/5)), w = (18 + sqrt(30)) / 36
1440 # (Abramowitz & Stegun 1964, Table 25.4, p. 916).
1441 gl_x = jnp.array([-0.8611363115940526, -0.3399810435848563,
1442 0.3399810435848563, 0.8611363115940526])
1443 gl_w = jnp.array([0.3478548451374538, 0.6521451548625461,
1444 0.6521451548625461, 0.3478548451374538])
1445
1446 def lens_volume(a, b, r):
1447 # Volume of the intersection of two balls of radii a and b
1448 # whose centers are r apart. Only divide by r where the
1449 # mid-range expression is used, so that gradients are finite.
1450 is_long = r >= a + b
1451 is_short = r <= jnp.abs(a - b)
1452 r_safe = jnp.where(is_long | is_short, a + b, r)
1453 rmin = jnp.minimum(a, b)
1454 mid_range = (math.pi * (a + b - r_safe) * (a + b - r_safe)
1455 * (r_safe * r_safe + 2. * r_safe * (a + b)
1456 - 3. * (a - b) * (a - b))
1457 / (12. * r_safe))
1458 return jnp.where(
1459 is_long, 0.,
1460 jnp.where(is_short, 4. / 3. * math.pi * rmin * rmin * rmin,
1461 mid_range))
1462
1463 def sphere_area_within(r, dist, length):
1464 # Area of the part of a sphere of radius r, centered at the
1465 # origin, within length of a point at distance dist
1466 mid_range = (math.pi * r * (length * length - (r - dist) ** 2)
1467 / dist)
1468 outside = (r <= dist - length) | (r >= dist + length)
1469 return jnp.where(r + dist <= length, 4. * math.pi * r * r,
1470 jnp.where(outside, 0., mid_range))
1471
1472 def forward_model(dist, sigmai, sigmaj, length):
1473 # See get_forward_model_probability() in
1474 # ExactCrossLinkMSRestraint.cpp. The integrand is continuous
1475 # in r and zero at the upper limit, so differentiating this
1476 # piecewise quadrature (with its moving breakpoints) gives the
1477 # exact derivatives.
1478 rmax = sigmai + sigmaj
1479 points = jnp.stack([jnp.zeros_like(rmax), rmax,
1480 jnp.abs(sigmai - sigmaj),
1481 jnp.abs(dist - length), dist + length],
1482 axis=-1)
1483 points = jnp.sort(jnp.clip(points, 0., rmax[..., None]),
1484 axis=-1)
1485 half = 0.5 * (points[..., 1:] - points[..., :-1])
1486 mid = 0.5 * (points[..., 1:] + points[..., :-1])
1487 r = mid[..., None] + half[..., None] * gl_x
1488 integrand = (lens_volume(sigmai[..., None, None],
1489 sigmaj[..., None, None], r)
1490 * sphere_area_within(r, dist[..., None, None],
1491 length))
1492 integral = jnp.sum(half[..., None] * gl_w * integrand,
1493 axis=(-2, -1))
1494 voli = 4.0 / 3.0 * math.pi * sigmai * sigmai * sigmai
1495 volj = 4.0 / 3.0 * math.pi * sigmaj * sigmaj * sigmaj
1496 return jnp.clip(integral / voli / volj, 0., 1.)
1497
1498 return _get_crosslink_jax_for_restraints(rs, space, forward_model)
1499
1500 def _get_jax(self, space):
1501 return self._get_jax_for_restraints([self], space)
1502
1503 @classmethod
1504 def _get_jax_multiple(cls, restraints, space):
1505 return _get_crosslink_jax_multiple(cls, restraints, space)
1506
1507
1508# Register ExactCrossLinkMSRestraint in _IMP_isd:
1509_IMP_isd.ExactCrossLinkMSRestraint_swigregister(ExactCrossLinkMSRestraint)
1510class LogWrapper(IMP.RestraintSet):
1511 r"""Proxy of C++ IMP::isd::LogWrapper class."""
1512
1513 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1514
1515 def __init__(self, *args):
1516 r"""
1517 __init__(LogWrapper self, Model m, double weight, std::string const & name="LogWrapper %1%") -> LogWrapper
1518 __init__(LogWrapper self, Model m, std::string const & name="LogWrapper %1%") -> LogWrapper
1519 __init__(LogWrapper self, IMP::RestraintsTemp const & rs, double weight, std::string const & name="LogWrapper %1%") -> LogWrapper
1520 __init__(LogWrapper self) -> LogWrapper
1521 """
1522 _IMP_isd.LogWrapper_swiginit(self, _IMP_isd.new_LogWrapper(*args))
1523
1524 def do_add_score_and_derivatives(self, sa):
1525 r"""do_add_score_and_derivatives(LogWrapper self, ScoreAccumulator sa)"""
1526 return _IMP_isd.LogWrapper_do_add_score_and_derivatives(self, sa)
1527
1528 def do_add_score_and_derivatives_moved(self, sa, moved_pis, reset_pis):
1529 r"""do_add_score_and_derivatives_moved(LogWrapper self, ScoreAccumulator sa, IMP::ParticleIndexes const & moved_pis, IMP::ParticleIndexes const & reset_pis)"""
1530 return _IMP_isd.LogWrapper_do_add_score_and_derivatives_moved(self, sa, moved_pis, reset_pis)
1531 __swig_destroy__ = _IMP_isd.delete_LogWrapper
1532
1533 def __str__(self):
1534 r"""__str__(LogWrapper self) -> std::string"""
1535 return _IMP_isd.LogWrapper___str__(self)
1536
1537 def __repr__(self):
1538 r"""__repr__(LogWrapper self) -> std::string"""
1539 return _IMP_isd.LogWrapper___repr__(self)
1540
1541 @staticmethod
1542 def get_from(o):
1543 return _object_cast_to_LogWrapper(o)
1544
1545
1546 def _get_as_binary(self):
1547 r"""_get_as_binary(LogWrapper self) -> PyObject *"""
1548 return _IMP_isd.LogWrapper__get_as_binary(self)
1549
1550 def _set_from_binary(self, p):
1551 r"""_set_from_binary(LogWrapper self, PyObject * p)"""
1552 return _IMP_isd.LogWrapper__set_from_binary(self, p)
1553
1554 def __getstate__(self):
1555 p = self._get_as_binary()
1556 if len(self.__dict__) > 1:
1557 d = self.__dict__.copy()
1558 del d['this']
1559 p = (d, p)
1560 return p
1561
1562 def __setstate__(self, p):
1563 if not hasattr(self, 'this'):
1564 self.__init__()
1565 if isinstance(p, tuple):
1566 d, p = p
1567 self.__dict__.update(d)
1568 return self._set_from_binary(p)
1569
1570
1571 def _get_jax(self, space):
1572 import jax.numpy as jnp
1573 import IMP._jax_util
1574 restraints = [r.get_derived_object() for r in self.restraints]
1575 multi_funcs, funcs, keys = IMP._jax_util.get_restraints_jax_funcs_keys(
1576 restraints, space)
1577 def jax_sf(jm):
1578 rets = [f(jm) for f in multi_funcs]
1579 if funcs:
1580 rets.append(jnp.stack([f(jm) for f in funcs], axis=-1))
1581 scores = jnp.concatenate(rets, axis=-1)
1582 return -jnp.sum(jnp.log(scores), axis=-1)
1583 return self._wrap_jax(jax_sf, keys=keys)
1584
1585
1586# Register LogWrapper in _IMP_isd:
1587_IMP_isd.LogWrapper_swigregister(LogWrapper)
1588class UniformPrior(IMP.Restraint):
1589 r"""Proxy of C++ IMP::isd::UniformPrior class."""
1590
1591 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1592
1593 def __init__(self, *args):
1594 r"""
1595 __init__(UniformPrior self, Model m, Particle p, double k, double upperb, double lowerb, std::string name="UniformPrior%1%") -> UniformPrior
1596 __init__(UniformPrior self) -> UniformPrior
1597 """
1598 _IMP_isd.UniformPrior_swiginit(self, _IMP_isd.new_UniformPrior(*args))
1599
1600 def do_get_inputs(self):
1601 r"""do_get_inputs(UniformPrior self) -> IMP::ModelObjectsTemp"""
1602 return _IMP_isd.UniformPrior_do_get_inputs(self)
1603
1604 def get_version_info(self):
1605 r"""get_version_info(UniformPrior self) -> VersionInfo"""
1606 return _IMP_isd.UniformPrior_get_version_info(self)
1607 __swig_destroy__ = _IMP_isd.delete_UniformPrior
1608
1609 def get_probability(self):
1610 r"""get_probability(UniformPrior self) -> double"""
1611 return _IMP_isd.UniformPrior_get_probability(self)
1612
1613 def get_range(self):
1614 r"""get_range(UniformPrior self) -> IMP::FloatRange"""
1615 return _IMP_isd.UniformPrior_get_range(self)
1616
1617 def get_k(self):
1618 r"""get_k(UniformPrior self) -> double"""
1619 return _IMP_isd.UniformPrior_get_k(self)
1620
1621 def get_index(self):
1622 r"""get_index(UniformPrior self) -> ParticleIndex"""
1623 return _IMP_isd.UniformPrior_get_index(self)
1624
1625 def __str__(self):
1626 r"""__str__(UniformPrior self) -> std::string"""
1627 return _IMP_isd.UniformPrior___str__(self)
1628
1629 def __repr__(self):
1630 r"""__repr__(UniformPrior self) -> std::string"""
1631 return _IMP_isd.UniformPrior___repr__(self)
1632
1633 @staticmethod
1634 def get_from(o):
1635 return _object_cast_to_UniformPrior(o)
1636
1637
1638 def _get_as_binary(self):
1639 r"""_get_as_binary(UniformPrior self) -> PyObject *"""
1640 return _IMP_isd.UniformPrior__get_as_binary(self)
1641
1642 def _set_from_binary(self, p):
1643 r"""_set_from_binary(UniformPrior self, PyObject * p)"""
1644 return _IMP_isd.UniformPrior__set_from_binary(self, p)
1645
1646 def __getstate__(self):
1647 p = self._get_as_binary()
1648 if len(self.__dict__) > 1:
1649 d = self.__dict__.copy()
1650 del d['this']
1651 p = (d, p)
1652 return p
1653
1654 def __setstate__(self, p):
1655 if not hasattr(self, 'this'):
1656 self.__init__()
1657 if isinstance(p, tuple):
1658 d, p = p
1659 self.__dict__.update(d)
1660 return self._set_from_binary(p)
1661
1662
1663 def _get_jax(self, space):
1664 import jax.numpy as jnp
1665 def score(jm, lb, ub, k, index):
1666 nuisance = jm['nuisance'][index]
1667 return 0.5 * k * (nuisance - jnp.clip(nuisance, lb, ub)) ** 2
1668 rng = self.get_range()
1669 f = functools.partial(score, lb=rng[0], ub=rng[1], k=self.get_k(),
1670 index=self.get_index())
1671 return self._wrap_jax(f, keys=[Scale.get_scale_key()])
1672
1673
1674# Register UniformPrior in _IMP_isd:
1675_IMP_isd.UniformPrior_swigregister(UniformPrior)
1676class Nuisance(IMP.Decorator):
1677 r"""Proxy of C++ IMP::isd::Nuisance class."""
1678
1679 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1680
1681 def __init__(self, *args):
1682 r"""
1683 __init__(Nuisance self) -> Nuisance
1684 __init__(Nuisance self, Model m, ParticleIndex id) -> Nuisance
1685 __init__(Nuisance self, _ParticleAdaptor d) -> Nuisance
1686 """
1687 _IMP_isd.Nuisance_swiginit(self, _IMP_isd.new_Nuisance(*args))
1688
1689 def show(self, *args):
1690 r"""show(Nuisance self, _ostream out=std::cout)"""
1691 return _IMP_isd.Nuisance_show(self, *args)
1692
1693 @staticmethod
1694 def setup_particle(*args):
1695 r"""
1696 setup_particle(Model m, ParticleIndex pi) -> Nuisance
1697 setup_particle(_ParticleAdaptor pa) -> Nuisance
1698 setup_particle(Model m, ParticleIndex pi, double nuisance) -> Nuisance
1699 setup_particle(_ParticleAdaptor pa, double nuisance) -> Nuisance
1700 """
1701 return _IMP_isd.Nuisance_setup_particle(*args)
1702
1703 @staticmethod
1704 def get_is_setup(*args):
1705 r"""
1706 get_is_setup(_ParticleAdaptor p) -> bool
1707 get_is_setup(Model m, ParticleIndex pi) -> bool
1708 """
1709 return _IMP_isd.Nuisance_get_is_setup(*args)
1710
1711 @staticmethod
1712 def get_nuisance_key():
1713 r"""get_nuisance_key() -> FloatKey"""
1714 return _IMP_isd.Nuisance_get_nuisance_key()
1715
1716 def get_nuisance(self):
1717 r"""get_nuisance(Nuisance self) -> IMP::Float"""
1718 return _IMP_isd.Nuisance_get_nuisance(self)
1719
1720 def set_nuisance(self, d):
1721 r"""set_nuisance(Nuisance self, IMP::Float d)"""
1722 return _IMP_isd.Nuisance_set_nuisance(self, d)
1723
1724 def get_has_lower(self):
1725 r"""get_has_lower(Nuisance self) -> bool"""
1726 return _IMP_isd.Nuisance_get_has_lower(self)
1727
1728 def get_has_lower_float(self):
1729 r"""get_has_lower_float(Nuisance self) -> bool"""
1730 return _IMP_isd.Nuisance_get_has_lower_float(self)
1731
1732 def get_has_lower_particle(self):
1733 r"""get_has_lower_particle(Nuisance self) -> bool"""
1734 return _IMP_isd.Nuisance_get_has_lower_particle(self)
1735
1736 def get_lower(self):
1737 r"""get_lower(Nuisance self) -> IMP::Float"""
1738 return _IMP_isd.Nuisance_get_lower(self)
1739
1740 @staticmethod
1741 def get_lower_key():
1742 r"""get_lower_key() -> FloatKey"""
1743 return _IMP_isd.Nuisance_get_lower_key()
1744
1745 @staticmethod
1746 def get_lower_particle_key():
1747 r"""get_lower_particle_key() -> ParticleIndexKey"""
1748 return _IMP_isd.Nuisance_get_lower_particle_key()
1749
1750 def set_lower(self, *args):
1751 r"""
1752 set_lower(Nuisance self, IMP::Float d)
1753 set_lower(Nuisance self, Particle d)
1754 """
1755 return _IMP_isd.Nuisance_set_lower(self, *args)
1756
1757 def remove_lower(self):
1758 r"""remove_lower(Nuisance self)"""
1759 return _IMP_isd.Nuisance_remove_lower(self)
1760
1761 def get_has_upper(self):
1762 r"""get_has_upper(Nuisance self) -> bool"""
1763 return _IMP_isd.Nuisance_get_has_upper(self)
1764
1765 def get_has_upper_float(self):
1766 r"""get_has_upper_float(Nuisance self) -> bool"""
1767 return _IMP_isd.Nuisance_get_has_upper_float(self)
1768
1769 def get_has_upper_particle(self):
1770 r"""get_has_upper_particle(Nuisance self) -> bool"""
1771 return _IMP_isd.Nuisance_get_has_upper_particle(self)
1772
1773 def get_upper(self):
1774 r"""get_upper(Nuisance self) -> IMP::Float"""
1775 return _IMP_isd.Nuisance_get_upper(self)
1776
1777 @staticmethod
1778 def get_upper_key():
1779 r"""get_upper_key() -> FloatKey"""
1780 return _IMP_isd.Nuisance_get_upper_key()
1781
1782 @staticmethod
1783 def get_upper_particle_key():
1784 r"""get_upper_particle_key() -> ParticleIndexKey"""
1785 return _IMP_isd.Nuisance_get_upper_particle_key()
1786
1787 def set_upper(self, *args):
1788 r"""
1789 set_upper(Nuisance self, IMP::Float d)
1790 set_upper(Nuisance self, Particle d)
1791 """
1792 return _IMP_isd.Nuisance_set_upper(self, *args)
1793
1794 def remove_upper(self):
1795 r"""remove_upper(Nuisance self)"""
1796 return _IMP_isd.Nuisance_remove_upper(self)
1797
1798 def get_nuisance_derivative(self):
1799 r"""get_nuisance_derivative(Nuisance self) -> IMP::Float"""
1800 return _IMP_isd.Nuisance_get_nuisance_derivative(self)
1801
1802 def add_to_nuisance_derivative(self, d, accum):
1803 r"""add_to_nuisance_derivative(Nuisance self, IMP::Float d, DerivativeAccumulator accum)"""
1804 return _IMP_isd.Nuisance_add_to_nuisance_derivative(self, d, accum)
1805
1806 def get_nuisance_is_optimized(self):
1807 r"""get_nuisance_is_optimized(Nuisance self) -> bool"""
1808 return _IMP_isd.Nuisance_get_nuisance_is_optimized(self)
1809
1810 def set_nuisance_is_optimized(self, val):
1811 r"""set_nuisance_is_optimized(Nuisance self, bool val)"""
1812 return _IMP_isd.Nuisance_set_nuisance_is_optimized(self, val)
1813
1814 def add_attribute(self, *args):
1815 r"""
1816 add_attribute(Nuisance self, FloatKey k, IMP::Float v, bool opt)
1817 add_attribute(Nuisance self, FloatKey a0, IMP::Float a1)
1818 add_attribute(Nuisance self, IntKey a0, IMP::Int a1)
1819 add_attribute(Nuisance self, FloatsKey a0, IMP::Floats a1)
1820 add_attribute(Nuisance self, IntsKey a0, IMP::Ints a1)
1821 add_attribute(Nuisance self, StringKey a0, IMP::String a1)
1822 add_attribute(Nuisance self, ParticleIndexKey a0, Particle a1)
1823 add_attribute(Nuisance self, ObjectKey a0, Object a1)
1824 add_attribute(Nuisance self, SparseFloatKey a0, IMP::Float a1)
1825 add_attribute(Nuisance self, SparseIntKey a0, IMP::Int a1)
1826 add_attribute(Nuisance self, SparseStringKey a0, IMP::String a1)
1827 add_attribute(Nuisance self, SparseParticleIndexKey a0, ParticleIndex a1)
1828 """
1829 return _IMP_isd.Nuisance_add_attribute(self, *args)
1830
1831 def get_value(self, *args):
1832 r"""
1833 get_value(Nuisance self, FloatKey a0) -> IMP::Float
1834 get_value(Nuisance self, IntKey a0) -> IMP::Int
1835 get_value(Nuisance self, FloatsKey a0) -> IMP::Floats
1836 get_value(Nuisance self, IntsKey a0) -> IMP::Ints
1837 get_value(Nuisance self, StringKey a0) -> IMP::String
1838 get_value(Nuisance self, ParticleIndexKey a0) -> Particle
1839 get_value(Nuisance self, ObjectKey a0) -> Object
1840 get_value(Nuisance self, SparseFloatKey a0) -> IMP::Float
1841 get_value(Nuisance self, SparseIntKey a0) -> IMP::Int
1842 get_value(Nuisance self, SparseStringKey a0) -> IMP::String
1843 get_value(Nuisance self, SparseParticleIndexKey a0) -> ParticleIndex
1844 """
1845 return _IMP_isd.Nuisance_get_value(self, *args)
1846
1847 def set_value(self, *args):
1848 r"""
1849 set_value(Nuisance self, FloatKey a0, IMP::Float a1)
1850 set_value(Nuisance self, IntKey a0, IMP::Int a1)
1851 set_value(Nuisance self, FloatsKey a0, IMP::Floats a1)
1852 set_value(Nuisance self, IntsKey a0, IMP::Ints a1)
1853 set_value(Nuisance self, StringKey a0, IMP::String a1)
1854 set_value(Nuisance self, ParticleIndexKey a0, Particle a1)
1855 set_value(Nuisance self, ObjectKey a0, Object a1)
1856 set_value(Nuisance self, SparseFloatKey a0, IMP::Float a1)
1857 set_value(Nuisance self, SparseIntKey a0, IMP::Int a1)
1858 set_value(Nuisance self, SparseStringKey a0, IMP::String a1)
1859 set_value(Nuisance self, SparseParticleIndexKey a0, ParticleIndex a1)
1860 """
1861 return _IMP_isd.Nuisance_set_value(self, *args)
1862
1863 def remove_attribute(self, *args):
1864 r"""
1865 remove_attribute(Nuisance self, FloatKey a0)
1866 remove_attribute(Nuisance self, IntKey a0)
1867 remove_attribute(Nuisance self, FloatsKey a0)
1868 remove_attribute(Nuisance self, IntsKey a0)
1869 remove_attribute(Nuisance self, StringKey a0)
1870 remove_attribute(Nuisance self, ParticleIndexKey a0)
1871 remove_attribute(Nuisance self, ObjectKey a0)
1872 remove_attribute(Nuisance self, SparseFloatKey a0)
1873 remove_attribute(Nuisance self, SparseIntKey a0)
1874 remove_attribute(Nuisance self, SparseStringKey a0)
1875 remove_attribute(Nuisance self, SparseParticleIndexKey a0)
1876 """
1877 return _IMP_isd.Nuisance_remove_attribute(self, *args)
1878
1879 def has_attribute(self, *args):
1880 r"""
1881 has_attribute(Nuisance self, FloatKey a0) -> bool
1882 has_attribute(Nuisance self, IntKey a0) -> bool
1883 has_attribute(Nuisance self, FloatsKey a0) -> bool
1884 has_attribute(Nuisance self, IntsKey a0) -> bool
1885 has_attribute(Nuisance self, StringKey a0) -> bool
1886 has_attribute(Nuisance self, ParticleIndexKey a0) -> bool
1887 has_attribute(Nuisance self, ObjectKey a0) -> bool
1888 has_attribute(Nuisance self, SparseFloatKey a0) -> bool
1889 has_attribute(Nuisance self, SparseIntKey a0) -> bool
1890 has_attribute(Nuisance self, SparseStringKey a0) -> bool
1891 has_attribute(Nuisance self, SparseParticleIndexKey a0) -> bool
1892 """
1893 return _IMP_isd.Nuisance_has_attribute(self, *args)
1894
1895 def get_derivative(self, a0):
1896 r"""get_derivative(Nuisance self, FloatKey a0) -> double"""
1897 return _IMP_isd.Nuisance_get_derivative(self, a0)
1898
1899 def get_name(self):
1900 r"""get_name(Nuisance self) -> std::string"""
1901 return _IMP_isd.Nuisance_get_name(self)
1902
1903 def clear_caches(self):
1904 r"""clear_caches(Nuisance self)"""
1905 return _IMP_isd.Nuisance_clear_caches(self)
1906
1907 def set_name(self, a0):
1908 r"""set_name(Nuisance self, std::string a0)"""
1909 return _IMP_isd.Nuisance_set_name(self, a0)
1910
1911 def set_check_level(self, a0):
1912 r"""set_check_level(Nuisance self, IMP::CheckLevel a0)"""
1913 return _IMP_isd.Nuisance_set_check_level(self, a0)
1914
1915 def add_to_derivative(self, a0, a1, a2):
1916 r"""add_to_derivative(Nuisance self, FloatKey a0, double a1, DerivativeAccumulator a2)"""
1917 return _IMP_isd.Nuisance_add_to_derivative(self, a0, a1, a2)
1918
1919 def set_is_optimized(self, a0, a1):
1920 r"""set_is_optimized(Nuisance self, FloatKey a0, bool a1)"""
1921 return _IMP_isd.Nuisance_set_is_optimized(self, a0, a1)
1922
1923 def get_is_optimized(self, a0):
1924 r"""get_is_optimized(Nuisance self, FloatKey a0) -> bool"""
1925 return _IMP_isd.Nuisance_get_is_optimized(self, a0)
1926
1927 def get_check_level(self):
1928 r"""get_check_level(Nuisance self) -> IMP::CheckLevel"""
1929 return _IMP_isd.Nuisance_get_check_level(self)
1930
1931 def __eq__(self, *args):
1932 r"""
1933 __eq__(Nuisance self, Nuisance o) -> bool
1934 __eq__(Nuisance self, Particle d) -> bool
1935 """
1936 return _IMP_isd.Nuisance___eq__(self, *args)
1937
1938 def __ne__(self, *args):
1939 r"""
1940 __ne__(Nuisance self, Nuisance o) -> bool
1941 __ne__(Nuisance self, Particle d) -> bool
1942 """
1943 return _IMP_isd.Nuisance___ne__(self, *args)
1944
1945 def __le__(self, *args):
1946 r"""
1947 __le__(Nuisance self, Nuisance o) -> bool
1948 __le__(Nuisance self, Particle d) -> bool
1949 """
1950 return _IMP_isd.Nuisance___le__(self, *args)
1951
1952 def __lt__(self, *args):
1953 r"""
1954 __lt__(Nuisance self, Nuisance o) -> bool
1955 __lt__(Nuisance self, Particle d) -> bool
1956 """
1957 return _IMP_isd.Nuisance___lt__(self, *args)
1958
1959 def __ge__(self, *args):
1960 r"""
1961 __ge__(Nuisance self, Nuisance o) -> bool
1962 __ge__(Nuisance self, Particle d) -> bool
1963 """
1964 return _IMP_isd.Nuisance___ge__(self, *args)
1965
1966 def __gt__(self, *args):
1967 r"""
1968 __gt__(Nuisance self, Nuisance o) -> bool
1969 __gt__(Nuisance self, Particle d) -> bool
1970 """
1971 return _IMP_isd.Nuisance___gt__(self, *args)
1972
1973 def __hash__(self):
1974 r"""__hash__(Nuisance self) -> std::size_t"""
1975 return _IMP_isd.Nuisance___hash__(self)
1976
1977 def __str__(self):
1978 r"""__str__(Nuisance self) -> std::string"""
1979 return _IMP_isd.Nuisance___str__(self)
1980
1981 def __repr__(self):
1982 r"""__repr__(Nuisance self) -> std::string"""
1983 return _IMP_isd.Nuisance___repr__(self)
1984
1985 def _get_as_binary(self):
1986 r"""_get_as_binary(Nuisance self) -> PyObject *"""
1987 return _IMP_isd.Nuisance__get_as_binary(self)
1988
1989 def _set_from_binary(self, p):
1990 r"""_set_from_binary(Nuisance self, PyObject * p)"""
1991 return _IMP_isd.Nuisance__set_from_binary(self, p)
1992
1993 def __getstate__(self):
1994 p = self._get_as_binary()
1995 if len(self.__dict__) > 1:
1996 d = self.__dict__.copy()
1997 del d['this']
1998 p = (d, p)
1999 return p
2000
2001 def __setstate__(self, p):
2002 if not hasattr(self, 'this'):
2003 self.__init__()
2004 if isinstance(p, tuple):
2005 d, p = p
2006 self.__dict__.update(d)
2007 return self._set_from_binary(p)
2008
2009 __swig_destroy__ = _IMP_isd.delete_Nuisance
2010
2011# Register Nuisance in _IMP_isd:
2012_IMP_isd.Nuisance_swigregister(Nuisance)
2013class NuisanceScoreState(IMP.ScoreState):
2014 r"""Proxy of C++ IMP::isd::NuisanceScoreState class."""
2015
2016 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2017
2018 def __init__(self, *args):
2019 r"""
2020 __init__(NuisanceScoreState self, Particle p) -> NuisanceScoreState
2021 __init__(NuisanceScoreState self) -> NuisanceScoreState
2022 """
2023 _IMP_isd.NuisanceScoreState_swiginit(self, _IMP_isd.new_NuisanceScoreState(*args))
2024
2025 def get_index(self):
2026 r"""get_index(NuisanceScoreState self) -> ParticleIndex"""
2027 return _IMP_isd.NuisanceScoreState_get_index(self)
2028
2029 def do_before_evaluate(self):
2030 r"""do_before_evaluate(NuisanceScoreState self)"""
2031 return _IMP_isd.NuisanceScoreState_do_before_evaluate(self)
2032
2033 def do_after_evaluate(self, da):
2034 r"""do_after_evaluate(NuisanceScoreState self, DerivativeAccumulator da)"""
2035 return _IMP_isd.NuisanceScoreState_do_after_evaluate(self, da)
2036
2037 def do_get_inputs(self):
2038 r"""do_get_inputs(NuisanceScoreState self) -> IMP::ModelObjectsTemp"""
2039 return _IMP_isd.NuisanceScoreState_do_get_inputs(self)
2040
2041 def do_get_outputs(self):
2042 r"""do_get_outputs(NuisanceScoreState self) -> IMP::ModelObjectsTemp"""
2043 return _IMP_isd.NuisanceScoreState_do_get_outputs(self)
2044
2045 def get_version_info(self):
2046 r"""get_version_info(NuisanceScoreState self) -> VersionInfo"""
2047 return _IMP_isd.NuisanceScoreState_get_version_info(self)
2048 __swig_destroy__ = _IMP_isd.delete_NuisanceScoreState
2049
2050 def __str__(self):
2051 r"""__str__(NuisanceScoreState self) -> std::string"""
2052 return _IMP_isd.NuisanceScoreState___str__(self)
2053
2054 def __repr__(self):
2055 r"""__repr__(NuisanceScoreState self) -> std::string"""
2056 return _IMP_isd.NuisanceScoreState___repr__(self)
2057
2058 @staticmethod
2059 def get_from(o):
2060 return _object_cast_to_NuisanceScoreState(o)
2061
2062
2063 def _get_as_binary(self):
2064 r"""_get_as_binary(NuisanceScoreState self) -> PyObject *"""
2065 return _IMP_isd.NuisanceScoreState__get_as_binary(self)
2066
2067 def _set_from_binary(self, p):
2068 r"""_set_from_binary(NuisanceScoreState self, PyObject * p)"""
2069 return _IMP_isd.NuisanceScoreState__set_from_binary(self, p)
2070
2071 def __getstate__(self):
2072 p = self._get_as_binary()
2073 if len(self.__dict__) > 1:
2074 d = self.__dict__.copy()
2075 del d['this']
2076 p = (d, p)
2077 return p
2078
2079 def __setstate__(self, p):
2080 if not hasattr(self, 'this'):
2081 self.__init__()
2082 if isinstance(p, tuple):
2083 d, p = p
2084 self.__dict__.update(d)
2085 return self._set_from_binary(p)
2086
2087
2088 def _get_jax(self):
2089 import jax.lax
2090 import math
2091 import jax.numpy as jnp
2092 import IMP._jax_util
2093 def apply_func(jm, index, upper_f, upper_p, lower_f, lower_p):
2094 nuisances = jm['nuisance']
2095 up = jm['upper'][index] if upper_f else math.inf
2096 if upper_p:
2097 up = jax.lax.min(up, nuisances[jm['p_upper'][index]])
2098 low = jm['lower'][index] if lower_f else -math.inf
2099 if lower_p:
2100 low = jax.lax.max(low, nuisances[jm['p_lower'][index]])
2101 jm['nuisance'] = jm['nuisance'].at[index].set(
2102 jnp.clip(nuisances[index], low, up))
2103 return jm
2104 p = self.get_index()
2105 m = self.get_model()
2106 n = Nuisance(m, p)
2107 upper_f, upper_p = n.get_has_upper_float(), n.get_has_upper_particle()
2108 lower_f, lower_p = n.get_has_lower_float(), n.get_has_lower_particle()
2109 if upper_p or lower_p:
2110 # These particle indexes can change during a simulation, so
2111 # we can't use the default CompactArray for nuisances (which
2112 # statically maps indexes beforehand)
2113 keys = [IMP._jax_util._DenseKey(n.get_nuisance_key())]
2114 else:
2115 keys = [n.get_nuisance_key()]
2116 if upper_f:
2117 keys.append(n.get_upper_key())
2118 if upper_p:
2119 keys.append(n.get_upper_particle_key())
2120 if lower_f:
2121 keys.append(n.get_lower_key())
2122 if lower_p:
2123 keys.append(n.get_lower_particle_key())
2124 f = functools.partial(apply_func, index=p, upper_f=upper_f,
2125 upper_p=upper_p, lower_f=lower_f,
2126 lower_p=lower_p)
2127 return self._wrap_jax(f, keys)
2128
2129
2130# Register NuisanceScoreState in _IMP_isd:
2131_IMP_isd.NuisanceScoreState_swigregister(NuisanceScoreState)
2132class Scale(Nuisance):
2133 r"""Proxy of C++ IMP::isd::Scale class."""
2134
2135 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2136
2137 def __init__(self, *args):
2138 r"""
2139 __init__(Scale self) -> Scale
2140 __init__(Scale self, Model m, ParticleIndex id) -> Scale
2141 __init__(Scale self, _ParticleAdaptor d) -> Scale
2142 """
2143 _IMP_isd.Scale_swiginit(self, _IMP_isd.new_Scale(*args))
2144
2145 def show(self, *args):
2146 r"""show(Scale self, _ostream out=std::cout)"""
2147 return _IMP_isd.Scale_show(self, *args)
2148
2149 @staticmethod
2150 def setup_particle(*args):
2151 r"""
2152 setup_particle(Model m, ParticleIndex pi) -> Scale
2153 setup_particle(_ParticleAdaptor pa) -> Scale
2154 setup_particle(Model m, ParticleIndex pi, double scale) -> Scale
2155 setup_particle(_ParticleAdaptor pa, double scale) -> Scale
2156 """
2157 return _IMP_isd.Scale_setup_particle(*args)
2158
2159 @staticmethod
2160 def get_is_setup(*args):
2161 r"""
2162 get_is_setup(_ParticleAdaptor p) -> bool
2163 get_is_setup(Model m, ParticleIndex pi) -> bool
2164 """
2165 return _IMP_isd.Scale_get_is_setup(*args)
2166
2167 def get_scale(self):
2168 r"""get_scale(Scale self) -> IMP::Float"""
2169 return _IMP_isd.Scale_get_scale(self)
2170
2171 def set_scale(self, d):
2172 r"""set_scale(Scale self, IMP::Float d)"""
2173 return _IMP_isd.Scale_set_scale(self, d)
2174
2175 def add_to_scale_derivative(self, d, accum):
2176 r"""add_to_scale_derivative(Scale self, IMP::Float d, DerivativeAccumulator accum)"""
2177 return _IMP_isd.Scale_add_to_scale_derivative(self, d, accum)
2178
2179 def get_scale_derivative(self):
2180 r"""get_scale_derivative(Scale self) -> IMP::Float"""
2181 return _IMP_isd.Scale_get_scale_derivative(self)
2182
2183 @staticmethod
2184 def get_scale_key():
2185 r"""get_scale_key() -> FloatKey"""
2186 return _IMP_isd.Scale_get_scale_key()
2187
2188 def get_scale_is_optimized(self):
2189 r"""get_scale_is_optimized(Scale self) -> bool"""
2190 return _IMP_isd.Scale_get_scale_is_optimized(self)
2191
2192 def set_scale_is_optimized(self, val):
2193 r"""set_scale_is_optimized(Scale self, bool val)"""
2194 return _IMP_isd.Scale_set_scale_is_optimized(self, val)
2195
2196 def add_attribute(self, *args):
2197 r"""
2198 add_attribute(Scale self, FloatKey k, IMP::Float v, bool opt)
2199 add_attribute(Scale self, FloatKey a0, IMP::Float a1)
2200 add_attribute(Scale self, IntKey a0, IMP::Int a1)
2201 add_attribute(Scale self, FloatsKey a0, IMP::Floats a1)
2202 add_attribute(Scale self, IntsKey a0, IMP::Ints a1)
2203 add_attribute(Scale self, StringKey a0, IMP::String a1)
2204 add_attribute(Scale self, ParticleIndexKey a0, Particle a1)
2205 add_attribute(Scale self, ObjectKey a0, Object a1)
2206 add_attribute(Scale self, SparseFloatKey a0, IMP::Float a1)
2207 add_attribute(Scale self, SparseIntKey a0, IMP::Int a1)
2208 add_attribute(Scale self, SparseStringKey a0, IMP::String a1)
2209 add_attribute(Scale self, SparseParticleIndexKey a0, ParticleIndex a1)
2210 """
2211 return _IMP_isd.Scale_add_attribute(self, *args)
2212
2213 def get_value(self, *args):
2214 r"""
2215 get_value(Scale self, FloatKey a0) -> IMP::Float
2216 get_value(Scale self, IntKey a0) -> IMP::Int
2217 get_value(Scale self, FloatsKey a0) -> IMP::Floats
2218 get_value(Scale self, IntsKey a0) -> IMP::Ints
2219 get_value(Scale self, StringKey a0) -> IMP::String
2220 get_value(Scale self, ParticleIndexKey a0) -> Particle
2221 get_value(Scale self, ObjectKey a0) -> Object
2222 get_value(Scale self, SparseFloatKey a0) -> IMP::Float
2223 get_value(Scale self, SparseIntKey a0) -> IMP::Int
2224 get_value(Scale self, SparseStringKey a0) -> IMP::String
2225 get_value(Scale self, SparseParticleIndexKey a0) -> ParticleIndex
2226 """
2227 return _IMP_isd.Scale_get_value(self, *args)
2228
2229 def set_value(self, *args):
2230 r"""
2231 set_value(Scale self, FloatKey a0, IMP::Float a1)
2232 set_value(Scale self, IntKey a0, IMP::Int a1)
2233 set_value(Scale self, FloatsKey a0, IMP::Floats a1)
2234 set_value(Scale self, IntsKey a0, IMP::Ints a1)
2235 set_value(Scale self, StringKey a0, IMP::String a1)
2236 set_value(Scale self, ParticleIndexKey a0, Particle a1)
2237 set_value(Scale self, ObjectKey a0, Object a1)
2238 set_value(Scale self, SparseFloatKey a0, IMP::Float a1)
2239 set_value(Scale self, SparseIntKey a0, IMP::Int a1)
2240 set_value(Scale self, SparseStringKey a0, IMP::String a1)
2241 set_value(Scale self, SparseParticleIndexKey a0, ParticleIndex a1)
2242 """
2243 return _IMP_isd.Scale_set_value(self, *args)
2244
2245 def remove_attribute(self, *args):
2246 r"""
2247 remove_attribute(Scale self, FloatKey a0)
2248 remove_attribute(Scale self, IntKey a0)
2249 remove_attribute(Scale self, FloatsKey a0)
2250 remove_attribute(Scale self, IntsKey a0)
2251 remove_attribute(Scale self, StringKey a0)
2252 remove_attribute(Scale self, ParticleIndexKey a0)
2253 remove_attribute(Scale self, ObjectKey a0)
2254 remove_attribute(Scale self, SparseFloatKey a0)
2255 remove_attribute(Scale self, SparseIntKey a0)
2256 remove_attribute(Scale self, SparseStringKey a0)
2257 remove_attribute(Scale self, SparseParticleIndexKey a0)
2258 """
2259 return _IMP_isd.Scale_remove_attribute(self, *args)
2260
2261 def has_attribute(self, *args):
2262 r"""
2263 has_attribute(Scale self, FloatKey a0) -> bool
2264 has_attribute(Scale self, IntKey a0) -> bool
2265 has_attribute(Scale self, FloatsKey a0) -> bool
2266 has_attribute(Scale self, IntsKey a0) -> bool
2267 has_attribute(Scale self, StringKey a0) -> bool
2268 has_attribute(Scale self, ParticleIndexKey a0) -> bool
2269 has_attribute(Scale self, ObjectKey a0) -> bool
2270 has_attribute(Scale self, SparseFloatKey a0) -> bool
2271 has_attribute(Scale self, SparseIntKey a0) -> bool
2272 has_attribute(Scale self, SparseStringKey a0) -> bool
2273 has_attribute(Scale self, SparseParticleIndexKey a0) -> bool
2274 """
2275 return _IMP_isd.Scale_has_attribute(self, *args)
2276
2277 def get_derivative(self, a0):
2278 r"""get_derivative(Scale self, FloatKey a0) -> double"""
2279 return _IMP_isd.Scale_get_derivative(self, a0)
2280
2281 def get_name(self):
2282 r"""get_name(Scale self) -> std::string"""
2283 return _IMP_isd.Scale_get_name(self)
2284
2285 def clear_caches(self):
2286 r"""clear_caches(Scale self)"""
2287 return _IMP_isd.Scale_clear_caches(self)
2288
2289 def set_name(self, a0):
2290 r"""set_name(Scale self, std::string a0)"""
2291 return _IMP_isd.Scale_set_name(self, a0)
2292
2293 def set_check_level(self, a0):
2294 r"""set_check_level(Scale self, IMP::CheckLevel a0)"""
2295 return _IMP_isd.Scale_set_check_level(self, a0)
2296
2297 def add_to_derivative(self, a0, a1, a2):
2298 r"""add_to_derivative(Scale self, FloatKey a0, double a1, DerivativeAccumulator a2)"""
2299 return _IMP_isd.Scale_add_to_derivative(self, a0, a1, a2)
2300
2301 def set_is_optimized(self, a0, a1):
2302 r"""set_is_optimized(Scale self, FloatKey a0, bool a1)"""
2303 return _IMP_isd.Scale_set_is_optimized(self, a0, a1)
2304
2305 def get_is_optimized(self, a0):
2306 r"""get_is_optimized(Scale self, FloatKey a0) -> bool"""
2307 return _IMP_isd.Scale_get_is_optimized(self, a0)
2308
2309 def get_check_level(self):
2310 r"""get_check_level(Scale self) -> IMP::CheckLevel"""
2311 return _IMP_isd.Scale_get_check_level(self)
2312
2313 def __eq__(self, *args):
2314 r"""
2315 __eq__(Scale self, Scale o) -> bool
2316 __eq__(Scale self, Particle d) -> bool
2317 """
2318 return _IMP_isd.Scale___eq__(self, *args)
2319
2320 def __ne__(self, *args):
2321 r"""
2322 __ne__(Scale self, Scale o) -> bool
2323 __ne__(Scale self, Particle d) -> bool
2324 """
2325 return _IMP_isd.Scale___ne__(self, *args)
2326
2327 def __le__(self, *args):
2328 r"""
2329 __le__(Scale self, Scale o) -> bool
2330 __le__(Scale self, Particle d) -> bool
2331 """
2332 return _IMP_isd.Scale___le__(self, *args)
2333
2334 def __lt__(self, *args):
2335 r"""
2336 __lt__(Scale self, Scale o) -> bool
2337 __lt__(Scale self, Particle d) -> bool
2338 """
2339 return _IMP_isd.Scale___lt__(self, *args)
2340
2341 def __ge__(self, *args):
2342 r"""
2343 __ge__(Scale self, Scale o) -> bool
2344 __ge__(Scale self, Particle d) -> bool
2345 """
2346 return _IMP_isd.Scale___ge__(self, *args)
2347
2348 def __gt__(self, *args):
2349 r"""
2350 __gt__(Scale self, Scale o) -> bool
2351 __gt__(Scale self, Particle d) -> bool
2352 """
2353 return _IMP_isd.Scale___gt__(self, *args)
2354
2355 def __hash__(self):
2356 r"""__hash__(Scale self) -> std::size_t"""
2357 return _IMP_isd.Scale___hash__(self)
2358
2359 def __str__(self):
2360 r"""__str__(Scale self) -> std::string"""
2361 return _IMP_isd.Scale___str__(self)
2362
2363 def __repr__(self):
2364 r"""__repr__(Scale self) -> std::string"""
2365 return _IMP_isd.Scale___repr__(self)
2366
2367 def _get_as_binary(self):
2368 r"""_get_as_binary(Scale self) -> PyObject *"""
2369 return _IMP_isd.Scale__get_as_binary(self)
2370
2371 def _set_from_binary(self, p):
2372 r"""_set_from_binary(Scale self, PyObject * p)"""
2373 return _IMP_isd.Scale__set_from_binary(self, p)
2374
2375 def __getstate__(self):
2376 p = self._get_as_binary()
2377 if len(self.__dict__) > 1:
2378 d = self.__dict__.copy()
2379 del d['this']
2380 p = (d, p)
2381 return p
2382
2383 def __setstate__(self, p):
2384 if not hasattr(self, 'this'):
2385 self.__init__()
2386 if isinstance(p, tuple):
2387 d, p = p
2388 self.__dict__.update(d)
2389 return self._set_from_binary(p)
2390
2391 __swig_destroy__ = _IMP_isd.delete_Scale
2392
2393# Register Scale in _IMP_isd:
2394_IMP_isd.Scale_swigregister(Scale)
2395class Switching(Nuisance):
2396 r"""Proxy of C++ IMP::isd::Switching class."""
2397
2398 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2399
2400 def __init__(self, *args):
2401 r"""
2402 __init__(Switching self) -> Switching
2403 __init__(Switching self, Model m, ParticleIndex id) -> Switching
2404 __init__(Switching self, _ParticleAdaptor d) -> Switching
2405 """
2406 _IMP_isd.Switching_swiginit(self, _IMP_isd.new_Switching(*args))
2407
2408 def show(self, *args):
2409 r"""show(Switching self, _ostream out=std::cout)"""
2410 return _IMP_isd.Switching_show(self, *args)
2411
2412 @staticmethod
2413 def setup_particle(*args):
2414 r"""
2415 setup_particle(Model m, ParticleIndex pi) -> Switching
2416 setup_particle(_ParticleAdaptor pa) -> Switching
2417 setup_particle(Model m, ParticleIndex pi, double switching) -> Switching
2418 setup_particle(_ParticleAdaptor pa, double switching) -> Switching
2419 """
2420 return _IMP_isd.Switching_setup_particle(*args)
2421
2422 @staticmethod
2423 def get_is_setup(*args):
2424 r"""
2425 get_is_setup(_ParticleAdaptor p) -> bool
2426 get_is_setup(Model m, ParticleIndex pi) -> bool
2427 """
2428 return _IMP_isd.Switching_get_is_setup(*args)
2429
2430 def get_switching(self):
2431 r"""get_switching(Switching self) -> IMP::Float"""
2432 return _IMP_isd.Switching_get_switching(self)
2433
2434 def set_switching(self, d):
2435 r"""set_switching(Switching self, IMP::Float d)"""
2436 return _IMP_isd.Switching_set_switching(self, d)
2437
2438 def add_to_switching_derivative(self, d, accum):
2439 r"""add_to_switching_derivative(Switching self, IMP::Float d, DerivativeAccumulator accum)"""
2440 return _IMP_isd.Switching_add_to_switching_derivative(self, d, accum)
2441
2442 def get_switching_derivative(self):
2443 r"""get_switching_derivative(Switching self) -> IMP::Float"""
2444 return _IMP_isd.Switching_get_switching_derivative(self)
2445
2446 @staticmethod
2447 def get_switching_key():
2448 r"""get_switching_key() -> FloatKey"""
2449 return _IMP_isd.Switching_get_switching_key()
2450
2451 def get_switching_is_optimized(self):
2452 r"""get_switching_is_optimized(Switching self) -> bool"""
2453 return _IMP_isd.Switching_get_switching_is_optimized(self)
2454
2455 def set_switching_is_optimized(self, val):
2456 r"""set_switching_is_optimized(Switching self, bool val)"""
2457 return _IMP_isd.Switching_set_switching_is_optimized(self, val)
2458
2459 def add_attribute(self, *args):
2460 r"""
2461 add_attribute(Switching self, FloatKey k, IMP::Float v, bool opt)
2462 add_attribute(Switching self, FloatKey a0, IMP::Float a1)
2463 add_attribute(Switching self, IntKey a0, IMP::Int a1)
2464 add_attribute(Switching self, FloatsKey a0, IMP::Floats a1)
2465 add_attribute(Switching self, IntsKey a0, IMP::Ints a1)
2466 add_attribute(Switching self, StringKey a0, IMP::String a1)
2467 add_attribute(Switching self, ParticleIndexKey a0, Particle a1)
2468 add_attribute(Switching self, ObjectKey a0, Object a1)
2469 add_attribute(Switching self, SparseFloatKey a0, IMP::Float a1)
2470 add_attribute(Switching self, SparseIntKey a0, IMP::Int a1)
2471 add_attribute(Switching self, SparseStringKey a0, IMP::String a1)
2472 add_attribute(Switching self, SparseParticleIndexKey a0, ParticleIndex a1)
2473 """
2474 return _IMP_isd.Switching_add_attribute(self, *args)
2475
2476 def get_value(self, *args):
2477 r"""
2478 get_value(Switching self, FloatKey a0) -> IMP::Float
2479 get_value(Switching self, IntKey a0) -> IMP::Int
2480 get_value(Switching self, FloatsKey a0) -> IMP::Floats
2481 get_value(Switching self, IntsKey a0) -> IMP::Ints
2482 get_value(Switching self, StringKey a0) -> IMP::String
2483 get_value(Switching self, ParticleIndexKey a0) -> Particle
2484 get_value(Switching self, ObjectKey a0) -> Object
2485 get_value(Switching self, SparseFloatKey a0) -> IMP::Float
2486 get_value(Switching self, SparseIntKey a0) -> IMP::Int
2487 get_value(Switching self, SparseStringKey a0) -> IMP::String
2488 get_value(Switching self, SparseParticleIndexKey a0) -> ParticleIndex
2489 """
2490 return _IMP_isd.Switching_get_value(self, *args)
2491
2492 def set_value(self, *args):
2493 r"""
2494 set_value(Switching self, FloatKey a0, IMP::Float a1)
2495 set_value(Switching self, IntKey a0, IMP::Int a1)
2496 set_value(Switching self, FloatsKey a0, IMP::Floats a1)
2497 set_value(Switching self, IntsKey a0, IMP::Ints a1)
2498 set_value(Switching self, StringKey a0, IMP::String a1)
2499 set_value(Switching self, ParticleIndexKey a0, Particle a1)
2500 set_value(Switching self, ObjectKey a0, Object a1)
2501 set_value(Switching self, SparseFloatKey a0, IMP::Float a1)
2502 set_value(Switching self, SparseIntKey a0, IMP::Int a1)
2503 set_value(Switching self, SparseStringKey a0, IMP::String a1)
2504 set_value(Switching self, SparseParticleIndexKey a0, ParticleIndex a1)
2505 """
2506 return _IMP_isd.Switching_set_value(self, *args)
2507
2508 def remove_attribute(self, *args):
2509 r"""
2510 remove_attribute(Switching self, FloatKey a0)
2511 remove_attribute(Switching self, IntKey a0)
2512 remove_attribute(Switching self, FloatsKey a0)
2513 remove_attribute(Switching self, IntsKey a0)
2514 remove_attribute(Switching self, StringKey a0)
2515 remove_attribute(Switching self, ParticleIndexKey a0)
2516 remove_attribute(Switching self, ObjectKey a0)
2517 remove_attribute(Switching self, SparseFloatKey a0)
2518 remove_attribute(Switching self, SparseIntKey a0)
2519 remove_attribute(Switching self, SparseStringKey a0)
2520 remove_attribute(Switching self, SparseParticleIndexKey a0)
2521 """
2522 return _IMP_isd.Switching_remove_attribute(self, *args)
2523
2524 def has_attribute(self, *args):
2525 r"""
2526 has_attribute(Switching self, FloatKey a0) -> bool
2527 has_attribute(Switching self, IntKey a0) -> bool
2528 has_attribute(Switching self, FloatsKey a0) -> bool
2529 has_attribute(Switching self, IntsKey a0) -> bool
2530 has_attribute(Switching self, StringKey a0) -> bool
2531 has_attribute(Switching self, ParticleIndexKey a0) -> bool
2532 has_attribute(Switching self, ObjectKey a0) -> bool
2533 has_attribute(Switching self, SparseFloatKey a0) -> bool
2534 has_attribute(Switching self, SparseIntKey a0) -> bool
2535 has_attribute(Switching self, SparseStringKey a0) -> bool
2536 has_attribute(Switching self, SparseParticleIndexKey a0) -> bool
2537 """
2538 return _IMP_isd.Switching_has_attribute(self, *args)
2539
2540 def get_derivative(self, a0):
2541 r"""get_derivative(Switching self, FloatKey a0) -> double"""
2542 return _IMP_isd.Switching_get_derivative(self, a0)
2543
2544 def get_name(self):
2545 r"""get_name(Switching self) -> std::string"""
2546 return _IMP_isd.Switching_get_name(self)
2547
2548 def clear_caches(self):
2549 r"""clear_caches(Switching self)"""
2550 return _IMP_isd.Switching_clear_caches(self)
2551
2552 def set_name(self, a0):
2553 r"""set_name(Switching self, std::string a0)"""
2554 return _IMP_isd.Switching_set_name(self, a0)
2555
2556 def set_check_level(self, a0):
2557 r"""set_check_level(Switching self, IMP::CheckLevel a0)"""
2558 return _IMP_isd.Switching_set_check_level(self, a0)
2559
2560 def add_to_derivative(self, a0, a1, a2):
2561 r"""add_to_derivative(Switching self, FloatKey a0, double a1, DerivativeAccumulator a2)"""
2562 return _IMP_isd.Switching_add_to_derivative(self, a0, a1, a2)
2563
2564 def set_is_optimized(self, a0, a1):
2565 r"""set_is_optimized(Switching self, FloatKey a0, bool a1)"""
2566 return _IMP_isd.Switching_set_is_optimized(self, a0, a1)
2567
2568 def get_is_optimized(self, a0):
2569 r"""get_is_optimized(Switching self, FloatKey a0) -> bool"""
2570 return _IMP_isd.Switching_get_is_optimized(self, a0)
2571
2572 def get_check_level(self):
2573 r"""get_check_level(Switching self) -> IMP::CheckLevel"""
2574 return _IMP_isd.Switching_get_check_level(self)
2575
2576 def __eq__(self, *args):
2577 r"""
2578 __eq__(Switching self, Switching o) -> bool
2579 __eq__(Switching self, Particle d) -> bool
2580 """
2581 return _IMP_isd.Switching___eq__(self, *args)
2582
2583 def __ne__(self, *args):
2584 r"""
2585 __ne__(Switching self, Switching o) -> bool
2586 __ne__(Switching self, Particle d) -> bool
2587 """
2588 return _IMP_isd.Switching___ne__(self, *args)
2589
2590 def __le__(self, *args):
2591 r"""
2592 __le__(Switching self, Switching o) -> bool
2593 __le__(Switching self, Particle d) -> bool
2594 """
2595 return _IMP_isd.Switching___le__(self, *args)
2596
2597 def __lt__(self, *args):
2598 r"""
2599 __lt__(Switching self, Switching o) -> bool
2600 __lt__(Switching self, Particle d) -> bool
2601 """
2602 return _IMP_isd.Switching___lt__(self, *args)
2603
2604 def __ge__(self, *args):
2605 r"""
2606 __ge__(Switching self, Switching o) -> bool
2607 __ge__(Switching self, Particle d) -> bool
2608 """
2609 return _IMP_isd.Switching___ge__(self, *args)
2610
2611 def __gt__(self, *args):
2612 r"""
2613 __gt__(Switching self, Switching o) -> bool
2614 __gt__(Switching self, Particle d) -> bool
2615 """
2616 return _IMP_isd.Switching___gt__(self, *args)
2617
2618 def __hash__(self):
2619 r"""__hash__(Switching self) -> std::size_t"""
2620 return _IMP_isd.Switching___hash__(self)
2621
2622 def __str__(self):
2623 r"""__str__(Switching self) -> std::string"""
2624 return _IMP_isd.Switching___str__(self)
2625
2626 def __repr__(self):
2627 r"""__repr__(Switching self) -> std::string"""
2628 return _IMP_isd.Switching___repr__(self)
2629
2630 def _get_as_binary(self):
2631 r"""_get_as_binary(Switching self) -> PyObject *"""
2632 return _IMP_isd.Switching__get_as_binary(self)
2633
2634 def _set_from_binary(self, p):
2635 r"""_set_from_binary(Switching self, PyObject * p)"""
2636 return _IMP_isd.Switching__set_from_binary(self, p)
2637
2638 def __getstate__(self):
2639 p = self._get_as_binary()
2640 if len(self.__dict__) > 1:
2641 d = self.__dict__.copy()
2642 del d['this']
2643 p = (d, p)
2644 return p
2645
2646 def __setstate__(self, p):
2647 if not hasattr(self, 'this'):
2648 self.__init__()
2649 if isinstance(p, tuple):
2650 d, p = p
2651 self.__dict__.update(d)
2652 return self._set_from_binary(p)
2653
2654 __swig_destroy__ = _IMP_isd.delete_Switching
2655
2656# Register Switching in _IMP_isd:
2657_IMP_isd.Switching_swigregister(Switching)
2658class Weight(IMP.Decorator):
2659 r"""Proxy of C++ IMP::isd::Weight class."""
2660
2661 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2662
2663 def __init__(self, *args):
2664 r"""
2665 __init__(Weight self) -> Weight
2666 __init__(Weight self, Model m, ParticleIndex id) -> Weight
2667 __init__(Weight self, _ParticleAdaptor d) -> Weight
2668 """
2669 _IMP_isd.Weight_swiginit(self, _IMP_isd.new_Weight(*args))
2670
2671 def show(self, *args):
2672 r"""show(Weight self, _ostream out=std::cout)"""
2673 return _IMP_isd.Weight_show(self, *args)
2674
2675 @staticmethod
2676 def setup_particle(*args):
2677 r"""
2678 setup_particle(Model m, ParticleIndex pi) -> Weight
2679 setup_particle(_ParticleAdaptor pa) -> Weight
2680 setup_particle(Model m, ParticleIndex pi, IMP::Int nweights) -> Weight
2681 setup_particle(_ParticleAdaptor pa, IMP::Int nweights) -> Weight
2682 setup_particle(Model m, ParticleIndex pi, VectorKD w) -> Weight
2683 setup_particle(_ParticleAdaptor pa, VectorKD w) -> Weight
2684 """
2685 return _IMP_isd.Weight_setup_particle(*args)
2686
2687 @staticmethod
2688 def get_number_of_weights_key():
2689 r"""get_number_of_weights_key() -> IntKey"""
2690 return _IMP_isd.Weight_get_number_of_weights_key()
2691
2692 @staticmethod
2693 def get_weight_key(i):
2694 r"""get_weight_key(int i) -> FloatKey"""
2695 return _IMP_isd.Weight_get_weight_key(i)
2696
2697 def get_weight_keys(self):
2698 r"""get_weight_keys(Weight self) -> IMP::FloatKeys"""
2699 return _IMP_isd.Weight_get_weight_keys(self)
2700
2701 def get_weight(self, i):
2702 r"""get_weight(Weight self, int i) -> IMP::Float"""
2703 return _IMP_isd.Weight_get_weight(self, i)
2704
2705 def get_weights(self):
2706 r"""get_weights(Weight self) -> VectorKD"""
2707 return _IMP_isd.Weight_get_weights(self)
2708
2709 def set_weight_lazy(self, i, wi):
2710 r"""set_weight_lazy(Weight self, int i, IMP::Float wi)"""
2711 return _IMP_isd.Weight_set_weight_lazy(self, i, wi)
2712
2713 def set_weights_lazy(self, w):
2714 r"""set_weights_lazy(Weight self, VectorKD w)"""
2715 return _IMP_isd.Weight_set_weights_lazy(self, w)
2716
2717 def set_weights(self, w):
2718 r"""set_weights(Weight self, VectorKD w)"""
2719 return _IMP_isd.Weight_set_weights(self, w)
2720
2721 def get_weights_are_optimized(self):
2722 r"""get_weights_are_optimized(Weight self) -> bool"""
2723 return _IMP_isd.Weight_get_weights_are_optimized(self)
2724
2725 def set_weights_are_optimized(self, tf):
2726 r"""set_weights_are_optimized(Weight self, bool tf)"""
2727 return _IMP_isd.Weight_set_weights_are_optimized(self, tf)
2728
2729 def get_weight_derivative(self, i):
2730 r"""get_weight_derivative(Weight self, int i) -> IMP::Float"""
2731 return _IMP_isd.Weight_get_weight_derivative(self, i)
2732
2733 def get_weights_derivatives(self):
2734 r"""get_weights_derivatives(Weight self) -> VectorKD"""
2735 return _IMP_isd.Weight_get_weights_derivatives(self)
2736
2737 def add_to_weight_derivative(self, i, dwi, da):
2738 r"""add_to_weight_derivative(Weight self, int i, IMP::Float dwi, DerivativeAccumulator da)"""
2739 return _IMP_isd.Weight_add_to_weight_derivative(self, i, dwi, da)
2740
2741 def add_to_weights_derivatives(self, dw, da):
2742 r"""add_to_weights_derivatives(Weight self, VectorKD dw, DerivativeAccumulator da)"""
2743 return _IMP_isd.Weight_add_to_weights_derivatives(self, dw, da)
2744
2745 def add_weight_lazy(self, wi=0):
2746 r"""add_weight_lazy(Weight self, IMP::Float wi=0)"""
2747 return _IMP_isd.Weight_add_weight_lazy(self, wi)
2748
2749 def add_weight(self, wi=0):
2750 r"""add_weight(Weight self, IMP::Float wi=0)"""
2751 return _IMP_isd.Weight_add_weight(self, wi)
2752
2753 def get_number_of_weights(self):
2754 r"""get_number_of_weights(Weight self) -> IMP::Int"""
2755 return _IMP_isd.Weight_get_number_of_weights(self)
2756
2757 def get_unit_simplex(self):
2758 r"""get_unit_simplex(Weight self) -> UnitSimplexKD"""
2759 return _IMP_isd.Weight_get_unit_simplex(self)
2760
2761 def set_number_of_weights_lazy(self, nweights):
2762 r"""set_number_of_weights_lazy(Weight self, IMP::Int nweights)"""
2763 return _IMP_isd.Weight_set_number_of_weights_lazy(self, nweights)
2764
2765 def set_number_of_weights(self, nweights):
2766 r"""set_number_of_weights(Weight self, IMP::Int nweights)"""
2767 return _IMP_isd.Weight_set_number_of_weights(self, nweights)
2768
2769 @staticmethod
2770 def get_is_setup(*args):
2771 r"""
2772 get_is_setup(_ParticleAdaptor p) -> bool
2773 get_is_setup(Model m, ParticleIndex pi) -> bool
2774 """
2775 return _IMP_isd.Weight_get_is_setup(*args)
2776
2777 def add_attribute(self, *args):
2778 r"""
2779 add_attribute(Weight self, FloatKey k, IMP::Float v, bool opt)
2780 add_attribute(Weight self, FloatKey a0, IMP::Float a1)
2781 add_attribute(Weight self, IntKey a0, IMP::Int a1)
2782 add_attribute(Weight self, FloatsKey a0, IMP::Floats a1)
2783 add_attribute(Weight self, IntsKey a0, IMP::Ints a1)
2784 add_attribute(Weight self, StringKey a0, IMP::String a1)
2785 add_attribute(Weight self, ParticleIndexKey a0, Particle a1)
2786 add_attribute(Weight self, ObjectKey a0, Object a1)
2787 add_attribute(Weight self, SparseFloatKey a0, IMP::Float a1)
2788 add_attribute(Weight self, SparseIntKey a0, IMP::Int a1)
2789 add_attribute(Weight self, SparseStringKey a0, IMP::String a1)
2790 add_attribute(Weight self, SparseParticleIndexKey a0, ParticleIndex a1)
2791 """
2792 return _IMP_isd.Weight_add_attribute(self, *args)
2793
2794 def get_value(self, *args):
2795 r"""
2796 get_value(Weight self, FloatKey a0) -> IMP::Float
2797 get_value(Weight self, IntKey a0) -> IMP::Int
2798 get_value(Weight self, FloatsKey a0) -> IMP::Floats
2799 get_value(Weight self, IntsKey a0) -> IMP::Ints
2800 get_value(Weight self, StringKey a0) -> IMP::String
2801 get_value(Weight self, ParticleIndexKey a0) -> Particle
2802 get_value(Weight self, ObjectKey a0) -> Object
2803 get_value(Weight self, SparseFloatKey a0) -> IMP::Float
2804 get_value(Weight self, SparseIntKey a0) -> IMP::Int
2805 get_value(Weight self, SparseStringKey a0) -> IMP::String
2806 get_value(Weight self, SparseParticleIndexKey a0) -> ParticleIndex
2807 """
2808 return _IMP_isd.Weight_get_value(self, *args)
2809
2810 def set_value(self, *args):
2811 r"""
2812 set_value(Weight self, FloatKey a0, IMP::Float a1)
2813 set_value(Weight self, IntKey a0, IMP::Int a1)
2814 set_value(Weight self, FloatsKey a0, IMP::Floats a1)
2815 set_value(Weight self, IntsKey a0, IMP::Ints a1)
2816 set_value(Weight self, StringKey a0, IMP::String a1)
2817 set_value(Weight self, ParticleIndexKey a0, Particle a1)
2818 set_value(Weight self, ObjectKey a0, Object a1)
2819 set_value(Weight self, SparseFloatKey a0, IMP::Float a1)
2820 set_value(Weight self, SparseIntKey a0, IMP::Int a1)
2821 set_value(Weight self, SparseStringKey a0, IMP::String a1)
2822 set_value(Weight self, SparseParticleIndexKey a0, ParticleIndex a1)
2823 """
2824 return _IMP_isd.Weight_set_value(self, *args)
2825
2826 def remove_attribute(self, *args):
2827 r"""
2828 remove_attribute(Weight self, FloatKey a0)
2829 remove_attribute(Weight self, IntKey a0)
2830 remove_attribute(Weight self, FloatsKey a0)
2831 remove_attribute(Weight self, IntsKey a0)
2832 remove_attribute(Weight self, StringKey a0)
2833 remove_attribute(Weight self, ParticleIndexKey a0)
2834 remove_attribute(Weight self, ObjectKey a0)
2835 remove_attribute(Weight self, SparseFloatKey a0)
2836 remove_attribute(Weight self, SparseIntKey a0)
2837 remove_attribute(Weight self, SparseStringKey a0)
2838 remove_attribute(Weight self, SparseParticleIndexKey a0)
2839 """
2840 return _IMP_isd.Weight_remove_attribute(self, *args)
2841
2842 def has_attribute(self, *args):
2843 r"""
2844 has_attribute(Weight self, FloatKey a0) -> bool
2845 has_attribute(Weight self, IntKey a0) -> bool
2846 has_attribute(Weight self, FloatsKey a0) -> bool
2847 has_attribute(Weight self, IntsKey a0) -> bool
2848 has_attribute(Weight self, StringKey a0) -> bool
2849 has_attribute(Weight self, ParticleIndexKey a0) -> bool
2850 has_attribute(Weight self, ObjectKey a0) -> bool
2851 has_attribute(Weight self, SparseFloatKey a0) -> bool
2852 has_attribute(Weight self, SparseIntKey a0) -> bool
2853 has_attribute(Weight self, SparseStringKey a0) -> bool
2854 has_attribute(Weight self, SparseParticleIndexKey a0) -> bool
2855 """
2856 return _IMP_isd.Weight_has_attribute(self, *args)
2857
2858 def get_derivative(self, a0):
2859 r"""get_derivative(Weight self, FloatKey a0) -> double"""
2860 return _IMP_isd.Weight_get_derivative(self, a0)
2861
2862 def get_name(self):
2863 r"""get_name(Weight self) -> std::string"""
2864 return _IMP_isd.Weight_get_name(self)
2865
2866 def clear_caches(self):
2867 r"""clear_caches(Weight self)"""
2868 return _IMP_isd.Weight_clear_caches(self)
2869
2870 def set_name(self, a0):
2871 r"""set_name(Weight self, std::string a0)"""
2872 return _IMP_isd.Weight_set_name(self, a0)
2873
2874 def set_check_level(self, a0):
2875 r"""set_check_level(Weight self, IMP::CheckLevel a0)"""
2876 return _IMP_isd.Weight_set_check_level(self, a0)
2877
2878 def add_to_derivative(self, a0, a1, a2):
2879 r"""add_to_derivative(Weight self, FloatKey a0, double a1, DerivativeAccumulator a2)"""
2880 return _IMP_isd.Weight_add_to_derivative(self, a0, a1, a2)
2881
2882 def set_is_optimized(self, a0, a1):
2883 r"""set_is_optimized(Weight self, FloatKey a0, bool a1)"""
2884 return _IMP_isd.Weight_set_is_optimized(self, a0, a1)
2885
2886 def get_is_optimized(self, a0):
2887 r"""get_is_optimized(Weight self, FloatKey a0) -> bool"""
2888 return _IMP_isd.Weight_get_is_optimized(self, a0)
2889
2890 def get_check_level(self):
2891 r"""get_check_level(Weight self) -> IMP::CheckLevel"""
2892 return _IMP_isd.Weight_get_check_level(self)
2893
2894 def __eq__(self, *args):
2895 r"""
2896 __eq__(Weight self, Weight o) -> bool
2897 __eq__(Weight self, Particle d) -> bool
2898 """
2899 return _IMP_isd.Weight___eq__(self, *args)
2900
2901 def __ne__(self, *args):
2902 r"""
2903 __ne__(Weight self, Weight o) -> bool
2904 __ne__(Weight self, Particle d) -> bool
2905 """
2906 return _IMP_isd.Weight___ne__(self, *args)
2907
2908 def __le__(self, *args):
2909 r"""
2910 __le__(Weight self, Weight o) -> bool
2911 __le__(Weight self, Particle d) -> bool
2912 """
2913 return _IMP_isd.Weight___le__(self, *args)
2914
2915 def __lt__(self, *args):
2916 r"""
2917 __lt__(Weight self, Weight o) -> bool
2918 __lt__(Weight self, Particle d) -> bool
2919 """
2920 return _IMP_isd.Weight___lt__(self, *args)
2921
2922 def __ge__(self, *args):
2923 r"""
2924 __ge__(Weight self, Weight o) -> bool
2925 __ge__(Weight self, Particle d) -> bool
2926 """
2927 return _IMP_isd.Weight___ge__(self, *args)
2928
2929 def __gt__(self, *args):
2930 r"""
2931 __gt__(Weight self, Weight o) -> bool
2932 __gt__(Weight self, Particle d) -> bool
2933 """
2934 return _IMP_isd.Weight___gt__(self, *args)
2935
2936 def __hash__(self):
2937 r"""__hash__(Weight self) -> std::size_t"""
2938 return _IMP_isd.Weight___hash__(self)
2939
2940 def __str__(self):
2941 r"""__str__(Weight self) -> std::string"""
2942 return _IMP_isd.Weight___str__(self)
2943
2944 def __repr__(self):
2945 r"""__repr__(Weight self) -> std::string"""
2946 return _IMP_isd.Weight___repr__(self)
2947
2948 def _get_as_binary(self):
2949 r"""_get_as_binary(Weight self) -> PyObject *"""
2950 return _IMP_isd.Weight__get_as_binary(self)
2951
2952 def _set_from_binary(self, p):
2953 r"""_set_from_binary(Weight self, PyObject * p)"""
2954 return _IMP_isd.Weight__set_from_binary(self, p)
2955
2956 def __getstate__(self):
2957 p = self._get_as_binary()
2958 if len(self.__dict__) > 1:
2959 d = self.__dict__.copy()
2960 del d['this']
2961 p = (d, p)
2962 return p
2963
2964 def __setstate__(self, p):
2965 if not hasattr(self, 'this'):
2966 self.__init__()
2967 if isinstance(p, tuple):
2968 d, p = p
2969 self.__dict__.update(d)
2970 return self._set_from_binary(p)
2971
2972 __swig_destroy__ = _IMP_isd.delete_Weight
2973
2974# Register Weight in _IMP_isd:
2975_IMP_isd.Weight_swigregister(Weight)
2976cvar = _IMP_isd.cvar
2977IMPISD_MAX_WEIGHTS = cvar.IMPISD_MAX_WEIGHTS
2978
2979
2980def __lshift__(*args):
2981 r"""
2982 __lshift__(_ostream out, Nuisance n) -> _ostream
2983 __lshift__(_ostream out, Scale n) -> _ostream
2984 __lshift__(_ostream out, Switching n) -> _ostream
2985 __lshift__(_ostream out, Weight n) -> _ostream
2986 """
2987 return _IMP_isd.__lshift__(*args)
2988class JeffreysRestraint(IMP.Restraint):
2989 r"""Proxy of C++ IMP::isd::JeffreysRestraint class."""
2990
2991 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2992
2993 def __init__(self, *args):
2994 r"""
2995 __init__(JeffreysRestraint self, Model m, Particle p) -> JeffreysRestraint
2996 __init__(JeffreysRestraint self) -> JeffreysRestraint
2997 """
2998 _IMP_isd.JeffreysRestraint_swiginit(self, _IMP_isd.new_JeffreysRestraint(*args))
2999
3000 def do_get_inputs(self):
3001 r"""do_get_inputs(JeffreysRestraint self) -> IMP::ModelObjectsTemp"""
3002 return _IMP_isd.JeffreysRestraint_do_get_inputs(self)
3003
3004 def get_version_info(self):
3005 r"""get_version_info(JeffreysRestraint self) -> VersionInfo"""
3006 return _IMP_isd.JeffreysRestraint_get_version_info(self)
3007 __swig_destroy__ = _IMP_isd.delete_JeffreysRestraint
3008
3009 def get_index(self):
3010 r"""get_index(JeffreysRestraint self) -> ParticleIndex"""
3011 return _IMP_isd.JeffreysRestraint_get_index(self)
3012
3013 def get_probability(self):
3014 r"""get_probability(JeffreysRestraint self) -> double"""
3015 return _IMP_isd.JeffreysRestraint_get_probability(self)
3016
3017 def __str__(self):
3018 r"""__str__(JeffreysRestraint self) -> std::string"""
3019 return _IMP_isd.JeffreysRestraint___str__(self)
3020
3021 def __repr__(self):
3022 r"""__repr__(JeffreysRestraint self) -> std::string"""
3023 return _IMP_isd.JeffreysRestraint___repr__(self)
3024
3025 @staticmethod
3026 def get_from(o):
3027 return _object_cast_to_JeffreysRestraint(o)
3028
3029
3030 def _get_as_binary(self):
3031 r"""_get_as_binary(JeffreysRestraint self) -> PyObject *"""
3032 return _IMP_isd.JeffreysRestraint__get_as_binary(self)
3033
3034 def _set_from_binary(self, p):
3035 r"""_set_from_binary(JeffreysRestraint self, PyObject * p)"""
3036 return _IMP_isd.JeffreysRestraint__set_from_binary(self, p)
3037
3038 def __getstate__(self):
3039 p = self._get_as_binary()
3040 if len(self.__dict__) > 1:
3041 d = self.__dict__.copy()
3042 del d['this']
3043 p = (d, p)
3044 return p
3045
3046 def __setstate__(self, p):
3047 if not hasattr(self, 'this'):
3048 self.__init__()
3049 if isinstance(p, tuple):
3050 d, p = p
3051 self.__dict__.update(d)
3052 return self._set_from_binary(p)
3053
3054
3055 def _get_jax(self, space):
3056 import jax.numpy as jnp
3057 indexes = jnp.array([self.get_index()])
3058 def score(jm):
3059 nuisance = jm['nuisance'][indexes]
3060 return jnp.sum(jnp.log(nuisance))
3061 return self._wrap_jax(score, keys=[Scale.get_scale_key()])
3062
3063
3064# Register JeffreysRestraint in _IMP_isd:
3065_IMP_isd.JeffreysRestraint_swigregister(JeffreysRestraint)
3066class NormalSigmaPCRestraint(IMP.Restraint):
3067 r"""Proxy of C++ IMP::isd::NormalSigmaPCRestraint class."""
3068
3069 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3070
3071 def __init__(self, *args):
3072 r"""
3073 __init__(NormalSigmaPCRestraint self, Model m, ParticleIndex spi, double su, double alpha, std::string name="NormalSigmaPCRestraint%1%") -> NormalSigmaPCRestraint
3074 __init__(NormalSigmaPCRestraint self, Scale s, double su, double alpha, std::string name="NormalSigmaPCRestraint%1%") -> NormalSigmaPCRestraint
3075 """
3076 _IMP_isd.NormalSigmaPCRestraint_swiginit(self, _IMP_isd.new_NormalSigmaPCRestraint(*args))
3077
3078 def get_sigma(self):
3079 r"""get_sigma(NormalSigmaPCRestraint self) -> Scale"""
3080 return _IMP_isd.NormalSigmaPCRestraint_get_sigma(self)
3081
3082 def get_alpha(self):
3083 r"""get_alpha(NormalSigmaPCRestraint self) -> double"""
3084 return _IMP_isd.NormalSigmaPCRestraint_get_alpha(self)
3085
3086 def get_sigma_upper(self):
3087 r"""get_sigma_upper(NormalSigmaPCRestraint self) -> double"""
3088 return _IMP_isd.NormalSigmaPCRestraint_get_sigma_upper(self)
3089
3090 def get_probability(self):
3091 r"""get_probability(NormalSigmaPCRestraint self) -> double"""
3092 return _IMP_isd.NormalSigmaPCRestraint_get_probability(self)
3093
3094 def do_get_inputs(self):
3095 r"""do_get_inputs(NormalSigmaPCRestraint self) -> IMP::ModelObjectsTemp"""
3096 return _IMP_isd.NormalSigmaPCRestraint_do_get_inputs(self)
3097
3098 def get_version_info(self):
3099 r"""get_version_info(NormalSigmaPCRestraint self) -> VersionInfo"""
3100 return _IMP_isd.NormalSigmaPCRestraint_get_version_info(self)
3101 __swig_destroy__ = _IMP_isd.delete_NormalSigmaPCRestraint
3102
3103 def __str__(self):
3104 r"""__str__(NormalSigmaPCRestraint self) -> std::string"""
3105 return _IMP_isd.NormalSigmaPCRestraint___str__(self)
3106
3107 def __repr__(self):
3108 r"""__repr__(NormalSigmaPCRestraint self) -> std::string"""
3109 return _IMP_isd.NormalSigmaPCRestraint___repr__(self)
3110
3111 @staticmethod
3112 def get_from(o):
3113 return _object_cast_to_NormalSigmaPCRestraint(o)
3114
3115
3116# Register NormalSigmaPCRestraint in _IMP_isd:
3117_IMP_isd.NormalSigmaPCRestraint_swigregister(NormalSigmaPCRestraint)
3118class Distribution(IMP.Object):
3119 r"""Proxy of C++ IMP::isd::Distribution class."""
3120
3121 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3122
3123 def __init__(self, *args):
3124 r"""__init__(Distribution self, std::string name="Distribution %1%") -> Distribution"""
3125 if self.__class__ == Distribution:
3126 _self = None
3127 else:
3128 _self = self
3129 _IMP_isd.Distribution_swiginit(self, _IMP_isd.new_Distribution(_self, *args))
3130
3131 if self.__class__ != Distribution:
3132 _director_objects.register(self)
3133
3134
3135
3136
3137 def get_type_name(self):
3138 r"""get_type_name(Distribution self) -> std::string"""
3139 return _IMP_isd.Distribution_get_type_name(self)
3140
3141 def get_version_info(self):
3142 r"""get_version_info(Distribution self) -> VersionInfo"""
3143 return _IMP_isd.Distribution_get_version_info(self)
3144 __swig_destroy__ = _IMP_isd.delete_Distribution
3145
3146 def __str__(self):
3147 r"""__str__(Distribution self) -> std::string"""
3148 return _IMP_isd.Distribution___str__(self)
3149
3150 def __repr__(self):
3151 r"""__repr__(Distribution self) -> std::string"""
3152 return _IMP_isd.Distribution___repr__(self)
3153
3154 @staticmethod
3155 def get_from(o):
3156 return _object_cast_to_Distribution(o)
3157
3158
3159 def do_show(self, out):
3160 pass
3161
3162 @staticmethod
3163 def get_from(o):
3164 return _object_cast_to_Distribution(o)
3165
3166 def __disown__(self):
3167 self.this.disown()
3168 _IMP_isd.disown_Distribution(self)
3169 return weakref.proxy(self)
3170
3171 def do_destroy(self):
3172 r"""do_destroy(Distribution self)"""
3173 return _IMP_isd.Distribution_do_destroy(self)
3174
3175# Register Distribution in _IMP_isd:
3176_IMP_isd.Distribution_swigregister(Distribution)
3177class OneDimensionalDistribution(Distribution):
3178 r"""Proxy of C++ IMP::isd::OneDimensionalDistribution class."""
3179
3180 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3181
3182 def do_evaluate(self, *args):
3183 r"""
3184 do_evaluate(OneDimensionalDistribution self, double v) -> double
3185 do_evaluate(OneDimensionalDistribution self, IMP::Floats const & vs) -> IMP::Floats
3186 """
3187 return _IMP_isd.OneDimensionalDistribution_do_evaluate(self, *args)
3188
3189 def do_get_density(self, *args):
3190 r"""
3191 do_get_density(OneDimensionalDistribution self, double v) -> double
3192 do_get_density(OneDimensionalDistribution self, IMP::Floats const & vs) -> IMP::Floats
3193 """
3194 return _IMP_isd.OneDimensionalDistribution_do_get_density(self, *args)
3195
3196 def __init__(self, *args):
3197 r"""__init__(OneDimensionalDistribution self, std::string name="OneDimensionalDistribution %1%") -> OneDimensionalDistribution"""
3198 if self.__class__ == OneDimensionalDistribution:
3199 _self = None
3200 else:
3201 _self = self
3202 _IMP_isd.OneDimensionalDistribution_swiginit(self, _IMP_isd.new_OneDimensionalDistribution(_self, *args))
3203
3204 if self.__class__ != OneDimensionalDistribution:
3205 _director_objects.register(self)
3206
3207
3208
3209
3210 def evaluate(self, *args):
3211 r"""
3212 evaluate(OneDimensionalDistribution self, double v) -> double
3213 evaluate(OneDimensionalDistribution self, IMP::Floats const & vs) -> IMP::Floats
3214 """
3215 return _IMP_isd.OneDimensionalDistribution_evaluate(self, *args)
3216
3217 def get_density(self, *args):
3218 r"""
3219 get_density(OneDimensionalDistribution self, double v) -> double
3220 get_density(OneDimensionalDistribution self, IMP::Floats const & vs) -> IMP::Floats
3221 """
3222 return _IMP_isd.OneDimensionalDistribution_get_density(self, *args)
3223
3224 def get_type_name(self):
3225 r"""get_type_name(OneDimensionalDistribution self) -> std::string"""
3226 return _IMP_isd.OneDimensionalDistribution_get_type_name(self)
3227
3228 def get_version_info(self):
3229 r"""get_version_info(OneDimensionalDistribution self) -> VersionInfo"""
3230 return _IMP_isd.OneDimensionalDistribution_get_version_info(self)
3231 __swig_destroy__ = _IMP_isd.delete_OneDimensionalDistribution
3232
3233 def __str__(self):
3234 r"""__str__(OneDimensionalDistribution self) -> std::string"""
3235 return _IMP_isd.OneDimensionalDistribution___str__(self)
3236
3237 def __repr__(self):
3238 r"""__repr__(OneDimensionalDistribution self) -> std::string"""
3239 return _IMP_isd.OneDimensionalDistribution___repr__(self)
3240
3241 @staticmethod
3242 def get_from(o):
3243 return _object_cast_to_OneDimensionalDistribution(o)
3244
3245
3246 def do_show(self, out):
3247 pass
3248
3249 @staticmethod
3250 def get_from(o):
3251 return _object_cast_to_OneDimensionalDistribution(o)
3252
3253 def __disown__(self):
3254 self.this.disown()
3255 _IMP_isd.disown_OneDimensionalDistribution(self)
3256 return weakref.proxy(self)
3257
3258 def do_destroy(self):
3259 r"""do_destroy(OneDimensionalDistribution self)"""
3260 return _IMP_isd.OneDimensionalDistribution_do_destroy(self)
3261
3262# Register OneDimensionalDistribution in _IMP_isd:
3263_IMP_isd.OneDimensionalDistribution_swigregister(OneDimensionalDistribution)
3264class OneDimensionalSufficientDistribution(Distribution):
3265 r"""Proxy of C++ IMP::isd::OneDimensionalSufficientDistribution class."""
3266
3267 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3268
3269 def do_update_sufficient_statistics(self, vs):
3270 r"""do_update_sufficient_statistics(OneDimensionalSufficientDistribution self, IMP::Floats vs)"""
3271 return _IMP_isd.OneDimensionalSufficientDistribution_do_update_sufficient_statistics(self, vs)
3272
3273 def do_get_sufficient_statistics(self):
3274 r"""do_get_sufficient_statistics(OneDimensionalSufficientDistribution self) -> IMP::Floats"""
3275 return _IMP_isd.OneDimensionalSufficientDistribution_do_get_sufficient_statistics(self)
3276
3277 def do_evaluate(self):
3278 r"""do_evaluate(OneDimensionalSufficientDistribution self) -> double"""
3279 return _IMP_isd.OneDimensionalSufficientDistribution_do_evaluate(self)
3280
3281 def do_get_density(self):
3282 r"""do_get_density(OneDimensionalSufficientDistribution self) -> double"""
3283 return _IMP_isd.OneDimensionalSufficientDistribution_do_get_density(self)
3284
3285 def __init__(self, *args):
3286 r"""__init__(OneDimensionalSufficientDistribution self, std::string name="OneDimensionalSufficientDistribution %1%") -> OneDimensionalSufficientDistribution"""
3287 if self.__class__ == OneDimensionalSufficientDistribution:
3288 _self = None
3289 else:
3290 _self = self
3291 _IMP_isd.OneDimensionalSufficientDistribution_swiginit(self, _IMP_isd.new_OneDimensionalSufficientDistribution(_self, *args))
3292
3293 if self.__class__ != OneDimensionalSufficientDistribution:
3294 _director_objects.register(self)
3295
3296
3297
3298
3299 def update_sufficient_statistics(self, vs):
3300 r"""update_sufficient_statistics(OneDimensionalSufficientDistribution self, IMP::Floats vs)"""
3301 return _IMP_isd.OneDimensionalSufficientDistribution_update_sufficient_statistics(self, vs)
3302
3303 def get_sufficient_statistics(self):
3304 r"""get_sufficient_statistics(OneDimensionalSufficientDistribution self) -> IMP::Floats"""
3305 return _IMP_isd.OneDimensionalSufficientDistribution_get_sufficient_statistics(self)
3306
3307 def evaluate(self):
3308 r"""evaluate(OneDimensionalSufficientDistribution self) -> double"""
3309 return _IMP_isd.OneDimensionalSufficientDistribution_evaluate(self)
3310
3311 def get_density(self):
3312 r"""get_density(OneDimensionalSufficientDistribution self) -> double"""
3313 return _IMP_isd.OneDimensionalSufficientDistribution_get_density(self)
3314
3315 def get_type_name(self):
3316 r"""get_type_name(OneDimensionalSufficientDistribution self) -> std::string"""
3317 return _IMP_isd.OneDimensionalSufficientDistribution_get_type_name(self)
3318
3319 def get_version_info(self):
3320 r"""get_version_info(OneDimensionalSufficientDistribution self) -> VersionInfo"""
3321 return _IMP_isd.OneDimensionalSufficientDistribution_get_version_info(self)
3322 __swig_destroy__ = _IMP_isd.delete_OneDimensionalSufficientDistribution
3323
3324 def __str__(self):
3325 r"""__str__(OneDimensionalSufficientDistribution self) -> std::string"""
3326 return _IMP_isd.OneDimensionalSufficientDistribution___str__(self)
3327
3328 def __repr__(self):
3329 r"""__repr__(OneDimensionalSufficientDistribution self) -> std::string"""
3330 return _IMP_isd.OneDimensionalSufficientDistribution___repr__(self)
3331
3332 @staticmethod
3333 def get_from(o):
3334 return _object_cast_to_OneDimensionalSufficientDistribution(o)
3335
3336
3337 def do_show(self, out):
3338 pass
3339
3340 @staticmethod
3341 def get_from(o):
3342 return _object_cast_to_OneDimensionalSufficientDistribution(o)
3343
3344 def __disown__(self):
3345 self.this.disown()
3346 _IMP_isd.disown_OneDimensionalSufficientDistribution(self)
3347 return weakref.proxy(self)
3348
3349 def do_destroy(self):
3350 r"""do_destroy(OneDimensionalSufficientDistribution self)"""
3351 return _IMP_isd.OneDimensionalSufficientDistribution_do_destroy(self)
3352
3353# Register OneDimensionalSufficientDistribution in _IMP_isd:
3354_IMP_isd.OneDimensionalSufficientDistribution_swigregister(OneDimensionalSufficientDistribution)
3355class FNormal(OneDimensionalSufficientDistribution):
3356 r"""Proxy of C++ IMP::isd::FNormal class."""
3357
3358 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3359
3360 def __init__(self, FA, JA, FM, sigma):
3361 r"""__init__(FNormal self, double FA, double JA, double FM, double sigma) -> FNormal"""
3362 _IMP_isd.FNormal_swiginit(self, _IMP_isd.new_FNormal(FA, JA, FM, sigma))
3363
3364 def update_sufficient_statistics(self, FA):
3365 r"""update_sufficient_statistics(FNormal self, double FA)"""
3366 return _IMP_isd.FNormal_update_sufficient_statistics(self, FA)
3367
3368 def do_update_sufficient_statistics(self, data):
3369 r"""do_update_sufficient_statistics(FNormal self, IMP::Floats data)"""
3370 return _IMP_isd.FNormal_do_update_sufficient_statistics(self, data)
3371
3372 def do_get_sufficient_statistics(self):
3373 r"""do_get_sufficient_statistics(FNormal self) -> IMP::Floats"""
3374 return _IMP_isd.FNormal_do_get_sufficient_statistics(self)
3375
3376 def do_evaluate(self):
3377 r"""do_evaluate(FNormal self) -> double"""
3378 return _IMP_isd.FNormal_do_evaluate(self)
3379
3380 def evaluate_derivative_FA(self):
3381 r"""evaluate_derivative_FA(FNormal self) -> double"""
3382 return _IMP_isd.FNormal_evaluate_derivative_FA(self)
3383
3384 def evaluate_derivative_JA(self):
3385 r"""evaluate_derivative_JA(FNormal self) -> double"""
3386 return _IMP_isd.FNormal_evaluate_derivative_JA(self)
3387
3388 def evaluate_derivative_FM(self):
3389 r"""evaluate_derivative_FM(FNormal self) -> double"""
3390 return _IMP_isd.FNormal_evaluate_derivative_FM(self)
3391
3392 def evaluate_derivative_sigma(self):
3393 r"""evaluate_derivative_sigma(FNormal self) -> double"""
3394 return _IMP_isd.FNormal_evaluate_derivative_sigma(self)
3395
3396 def do_get_density(self):
3397 r"""do_get_density(FNormal self) -> double"""
3398 return _IMP_isd.FNormal_do_get_density(self)
3399
3400 def set_FA(self, f):
3401 r"""set_FA(FNormal self, double f)"""
3402 return _IMP_isd.FNormal_set_FA(self, f)
3403
3404 def set_JA(self, f):
3405 r"""set_JA(FNormal self, double f)"""
3406 return _IMP_isd.FNormal_set_JA(self, f)
3407
3408 def set_FM(self, f):
3409 r"""set_FM(FNormal self, double f)"""
3410 return _IMP_isd.FNormal_set_FM(self, f)
3411
3412 def set_sigma(self, f):
3413 r"""set_sigma(FNormal self, double f)"""
3414 return _IMP_isd.FNormal_set_sigma(self, f)
3415 __swig_destroy__ = _IMP_isd.delete_FNormal
3416
3417 def __str__(self):
3418 r"""__str__(FNormal self) -> std::string"""
3419 return _IMP_isd.FNormal___str__(self)
3420
3421 def __repr__(self):
3422 r"""__repr__(FNormal self) -> std::string"""
3423 return _IMP_isd.FNormal___repr__(self)
3424
3425 @staticmethod
3426 def get_from(o):
3427 return _object_cast_to_FNormal(o)
3428
3429
3430# Register FNormal in _IMP_isd:
3431_IMP_isd.FNormal_swigregister(FNormal)
3432class FStudentT(OneDimensionalSufficientDistribution):
3433 r"""Proxy of C++ IMP::isd::FStudentT class."""
3434
3435 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3436
3437 def __init__(self, *args):
3438 r"""
3439 __init__(FStudentT self, IMP::Floats FXs, IMP::Floats JXs, double FM, double sigma, double nu, std::string name="FStudentT %1%") -> FStudentT
3440 __init__(FStudentT self, double sumFX, double sumFX2, unsigned int N, double LogJX, double FM, double sigma, double nu, std::string name="FStudentT %1%") -> FStudentT
3441 """
3442 _IMP_isd.FStudentT_swiginit(self, _IMP_isd.new_FStudentT(*args))
3443
3444 def update_sufficient_statistics(self, FXs, JXs):
3445 r"""update_sufficient_statistics(FStudentT self, IMP::Floats FXs, IMP::Floats JXs)"""
3446 return _IMP_isd.FStudentT_update_sufficient_statistics(self, FXs, JXs)
3447
3448 def evaluate_derivative_Fx(self, Fx):
3449 r"""evaluate_derivative_Fx(FStudentT self, double Fx) -> double"""
3450 return _IMP_isd.FStudentT_evaluate_derivative_Fx(self, Fx)
3451
3452 def evaluate_derivative_FX(self, FXs):
3453 r"""evaluate_derivative_FX(FStudentT self, IMP::Floats const FXs) -> IMP::Floats"""
3454 return _IMP_isd.FStudentT_evaluate_derivative_FX(self, FXs)
3455
3456 def evaluate_derivative_LogJX(self):
3457 r"""evaluate_derivative_LogJX(FStudentT self) -> double"""
3458 return _IMP_isd.FStudentT_evaluate_derivative_LogJX(self)
3459
3460 def evaluate_derivative_FM(self):
3461 r"""evaluate_derivative_FM(FStudentT self) -> double"""
3462 return _IMP_isd.FStudentT_evaluate_derivative_FM(self)
3463
3464 def evaluate_derivative_sigma(self):
3465 r"""evaluate_derivative_sigma(FStudentT self) -> double"""
3466 return _IMP_isd.FStudentT_evaluate_derivative_sigma(self)
3467
3468 def evaluate_derivative_nu(self):
3469 r"""evaluate_derivative_nu(FStudentT self) -> double"""
3470 return _IMP_isd.FStudentT_evaluate_derivative_nu(self)
3471
3472 def update_cached_values(self):
3473 r"""update_cached_values(FStudentT self)"""
3474 return _IMP_isd.FStudentT_update_cached_values(self)
3475
3476 def set_sumFX(self, v):
3477 r"""set_sumFX(FStudentT self, double v)"""
3478 return _IMP_isd.FStudentT_set_sumFX(self, v)
3479
3480 def set_sumFX2(self, v):
3481 r"""set_sumFX2(FStudentT self, double v)"""
3482 return _IMP_isd.FStudentT_set_sumFX2(self, v)
3483
3484 def set_N(self, v):
3485 r"""set_N(FStudentT self, unsigned int v)"""
3486 return _IMP_isd.FStudentT_set_N(self, v)
3487
3488 def set_LogJX(self, v):
3489 r"""set_LogJX(FStudentT self, double v)"""
3490 return _IMP_isd.FStudentT_set_LogJX(self, v)
3491
3492 def set_FM(self, v):
3493 r"""set_FM(FStudentT self, double v)"""
3494 return _IMP_isd.FStudentT_set_FM(self, v)
3495
3496 def set_sigma(self, v):
3497 r"""set_sigma(FStudentT self, double v)"""
3498 return _IMP_isd.FStudentT_set_sigma(self, v)
3499
3500 def set_nu(self, v):
3501 r"""set_nu(FStudentT self, double v)"""
3502 return _IMP_isd.FStudentT_set_nu(self, v)
3503
3504 def get_sumFX(self):
3505 r"""get_sumFX(FStudentT self) -> double"""
3506 return _IMP_isd.FStudentT_get_sumFX(self)
3507
3508 def get_sumFX2(self):
3509 r"""get_sumFX2(FStudentT self) -> double"""
3510 return _IMP_isd.FStudentT_get_sumFX2(self)
3511
3512 def get_N(self):
3513 r"""get_N(FStudentT self) -> unsigned int"""
3514 return _IMP_isd.FStudentT_get_N(self)
3515
3516 def get_LogJX(self):
3517 r"""get_LogJX(FStudentT self) -> double"""
3518 return _IMP_isd.FStudentT_get_LogJX(self)
3519
3520 def get_FM(self):
3521 r"""get_FM(FStudentT self) -> double"""
3522 return _IMP_isd.FStudentT_get_FM(self)
3523
3524 def get_sigma(self):
3525 r"""get_sigma(FStudentT self) -> double"""
3526 return _IMP_isd.FStudentT_get_sigma(self)
3527
3528 def get_nu(self):
3529 r"""get_nu(FStudentT self) -> double"""
3530 return _IMP_isd.FStudentT_get_nu(self)
3531 __swig_destroy__ = _IMP_isd.delete_FStudentT
3532
3533 def __str__(self):
3534 r"""__str__(FStudentT self) -> std::string"""
3535 return _IMP_isd.FStudentT___str__(self)
3536
3537 def __repr__(self):
3538 r"""__repr__(FStudentT self) -> std::string"""
3539 return _IMP_isd.FStudentT___repr__(self)
3540
3541 @staticmethod
3542 def get_from(o):
3543 return _object_cast_to_FStudentT(o)
3544
3545
3546# Register FStudentT in _IMP_isd:
3547_IMP_isd.FStudentT_swigregister(FStudentT)
3548class vonMises(IMP.Object):
3549 r"""Proxy of C++ IMP::isd::vonMises class."""
3550
3551 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3552
3553 def __init__(self, x, mu, kappa):
3554 r"""__init__(vonMises self, double x, double mu, double kappa) -> vonMises"""
3555 _IMP_isd.vonMises_swiginit(self, _IMP_isd.new_vonMises(x, mu, kappa))
3556
3557 def evaluate(self):
3558 r"""evaluate(vonMises self) -> double"""
3559 return _IMP_isd.vonMises_evaluate(self)
3560
3561 def evaluate_derivative_x(self):
3562 r"""evaluate_derivative_x(vonMises self) -> double"""
3563 return _IMP_isd.vonMises_evaluate_derivative_x(self)
3564
3565 def evaluate_derivative_mu(self):
3566 r"""evaluate_derivative_mu(vonMises self) -> double"""
3567 return _IMP_isd.vonMises_evaluate_derivative_mu(self)
3568
3569 def evaluate_derivative_kappa(self):
3570 r"""evaluate_derivative_kappa(vonMises self) -> double"""
3571 return _IMP_isd.vonMises_evaluate_derivative_kappa(self)
3572
3573 def density(self):
3574 r"""density(vonMises self) -> double"""
3575 return _IMP_isd.vonMises_density(self)
3576
3577 def set_x(self, x):
3578 r"""set_x(vonMises self, double x)"""
3579 return _IMP_isd.vonMises_set_x(self, x)
3580
3581 def set_mu(self, mu):
3582 r"""set_mu(vonMises self, double mu)"""
3583 return _IMP_isd.vonMises_set_mu(self, mu)
3584
3585 def set_kappa(self, kappa):
3586 r"""set_kappa(vonMises self, double kappa)"""
3587 return _IMP_isd.vonMises_set_kappa(self, kappa)
3588
3589 def get_version_info(self):
3590 r"""get_version_info(vonMises self) -> VersionInfo"""
3591 return _IMP_isd.vonMises_get_version_info(self)
3592 __swig_destroy__ = _IMP_isd.delete_vonMises
3593
3594 def __str__(self):
3595 r"""__str__(vonMises self) -> std::string"""
3596 return _IMP_isd.vonMises___str__(self)
3597
3598 def __repr__(self):
3599 r"""__repr__(vonMises self) -> std::string"""
3600 return _IMP_isd.vonMises___repr__(self)
3601
3602 @staticmethod
3603 def get_from(o):
3604 return _object_cast_to_vonMises(o)
3605
3606
3607# Register vonMises in _IMP_isd:
3608_IMP_isd.vonMises_swigregister(vonMises)
3609class vonMisesSufficient(IMP.Object):
3610 r"""Proxy of C++ IMP::isd::vonMisesSufficient class."""
3611
3612 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3613
3614 def __init__(self, *args):
3615 r"""
3616 __init__(vonMisesSufficient self, double chi, unsigned int N, double R0, double chiexp, double kappa) -> vonMisesSufficient
3617 __init__(vonMisesSufficient self, double chi, IMP::Floats obs, double kappa) -> vonMisesSufficient
3618 """
3619 _IMP_isd.vonMisesSufficient_swiginit(self, _IMP_isd.new_vonMisesSufficient(*args))
3620
3621 def evaluate(self):
3622 r"""evaluate(vonMisesSufficient self) -> double"""
3623 return _IMP_isd.vonMisesSufficient_evaluate(self)
3624
3625 def evaluate_derivative_x(self):
3626 r"""evaluate_derivative_x(vonMisesSufficient self) -> double"""
3627 return _IMP_isd.vonMisesSufficient_evaluate_derivative_x(self)
3628
3629 def evaluate_derivative_kappa(self):
3630 r"""evaluate_derivative_kappa(vonMisesSufficient self) -> double"""
3631 return _IMP_isd.vonMisesSufficient_evaluate_derivative_kappa(self)
3632
3633 def density(self):
3634 r"""density(vonMisesSufficient self) -> double"""
3635 return _IMP_isd.vonMisesSufficient_density(self)
3636
3637 def get_x(self):
3638 r"""get_x(vonMisesSufficient self) -> double"""
3639 return _IMP_isd.vonMisesSufficient_get_x(self)
3640
3641 def get_R0(self):
3642 r"""get_R0(vonMisesSufficient self) -> double"""
3643 return _IMP_isd.vonMisesSufficient_get_R0(self)
3644
3645 def get_chiexp(self):
3646 r"""get_chiexp(vonMisesSufficient self) -> double"""
3647 return _IMP_isd.vonMisesSufficient_get_chiexp(self)
3648
3649 def get_N(self):
3650 r"""get_N(vonMisesSufficient self) -> double"""
3651 return _IMP_isd.vonMisesSufficient_get_N(self)
3652
3653 def get_kappa(self):
3654 r"""get_kappa(vonMisesSufficient self) -> double"""
3655 return _IMP_isd.vonMisesSufficient_get_kappa(self)
3656
3657 def set_x(self, x):
3658 r"""set_x(vonMisesSufficient self, double x)"""
3659 return _IMP_isd.vonMisesSufficient_set_x(self, x)
3660
3661 def set_R0(self, R0):
3662 r"""set_R0(vonMisesSufficient self, double R0)"""
3663 return _IMP_isd.vonMisesSufficient_set_R0(self, R0)
3664
3665 def set_chiexp(self, chiexp):
3666 r"""set_chiexp(vonMisesSufficient self, double chiexp)"""
3667 return _IMP_isd.vonMisesSufficient_set_chiexp(self, chiexp)
3668
3669 def set_N(self, N):
3670 r"""set_N(vonMisesSufficient self, unsigned int N)"""
3671 return _IMP_isd.vonMisesSufficient_set_N(self, N)
3672
3673 def set_kappa(self, kappa):
3674 r"""set_kappa(vonMisesSufficient self, double kappa)"""
3675 return _IMP_isd.vonMisesSufficient_set_kappa(self, kappa)
3676
3677 @staticmethod
3678 def get_sufficient_statistics(data):
3679 r"""get_sufficient_statistics(IMP::Floats data) -> IMP::Floats"""
3680 return _IMP_isd.vonMisesSufficient_get_sufficient_statistics(data)
3681
3682 def get_version_info(self):
3683 r"""get_version_info(vonMisesSufficient self) -> VersionInfo"""
3684 return _IMP_isd.vonMisesSufficient_get_version_info(self)
3685 __swig_destroy__ = _IMP_isd.delete_vonMisesSufficient
3686
3687 def __str__(self):
3688 r"""__str__(vonMisesSufficient self) -> std::string"""
3689 return _IMP_isd.vonMisesSufficient___str__(self)
3690
3691 def __repr__(self):
3692 r"""__repr__(vonMisesSufficient self) -> std::string"""
3693 return _IMP_isd.vonMisesSufficient___repr__(self)
3694
3695 @staticmethod
3696 def get_from(o):
3697 return _object_cast_to_vonMisesSufficient(o)
3698
3699
3700# Register vonMisesSufficient in _IMP_isd:
3701_IMP_isd.vonMisesSufficient_swigregister(vonMisesSufficient)
3702class PenalizedComplexityPrior(OneDimensionalSufficientDistribution):
3703 r"""Proxy of C++ IMP::isd::PenalizedComplexityPrior class."""
3704
3705 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3706
3707 def __init__(self, *args):
3708 r"""__init__(PenalizedComplexityPrior self, double Dxi, double Jxi, double alpha, std::string name="PenalizedComplexityPrior %1%") -> PenalizedComplexityPrior"""
3709 _IMP_isd.PenalizedComplexityPrior_swiginit(self, _IMP_isd.new_PenalizedComplexityPrior(*args))
3710
3711 def update_sufficient_statistics(self, Dxis, Jxis):
3712 r"""update_sufficient_statistics(PenalizedComplexityPrior self, IMP::Floats Dxis, IMP::Floats Jxis)"""
3713 return _IMP_isd.PenalizedComplexityPrior_update_sufficient_statistics(self, Dxis, Jxis)
3714
3715 def evaluate_derivative_Dxi(self):
3716 r"""evaluate_derivative_Dxi(PenalizedComplexityPrior self) -> double"""
3717 return _IMP_isd.PenalizedComplexityPrior_evaluate_derivative_Dxi(self)
3718
3719 def evaluate_derivative_Jxi(self):
3720 r"""evaluate_derivative_Jxi(PenalizedComplexityPrior self) -> double"""
3721 return _IMP_isd.PenalizedComplexityPrior_evaluate_derivative_Jxi(self)
3722
3723 def evaluate_derivative_alpha(self):
3724 r"""evaluate_derivative_alpha(PenalizedComplexityPrior self) -> double"""
3725 return _IMP_isd.PenalizedComplexityPrior_evaluate_derivative_alpha(self)
3726
3727 def evaluate_derivative_xi(self, JJxi):
3728 r"""evaluate_derivative_xi(PenalizedComplexityPrior self, double JJxi) -> double"""
3729 return _IMP_isd.PenalizedComplexityPrior_evaluate_derivative_xi(self, JJxi)
3730
3731 def set_Dxi(self, v):
3732 r"""set_Dxi(PenalizedComplexityPrior self, double v)"""
3733 return _IMP_isd.PenalizedComplexityPrior_set_Dxi(self, v)
3734
3735 def set_Jxi(self, v):
3736 r"""set_Jxi(PenalizedComplexityPrior self, double v)"""
3737 return _IMP_isd.PenalizedComplexityPrior_set_Jxi(self, v)
3738
3739 def set_alpha(self, v):
3740 r"""set_alpha(PenalizedComplexityPrior self, double v)"""
3741 return _IMP_isd.PenalizedComplexityPrior_set_alpha(self, v)
3742
3743 def get_Dxi(self):
3744 r"""get_Dxi(PenalizedComplexityPrior self) -> double"""
3745 return _IMP_isd.PenalizedComplexityPrior_get_Dxi(self)
3746
3747 def get_Jxi(self):
3748 r"""get_Jxi(PenalizedComplexityPrior self) -> double"""
3749 return _IMP_isd.PenalizedComplexityPrior_get_Jxi(self)
3750
3751 def get_alpha(self):
3752 r"""get_alpha(PenalizedComplexityPrior self) -> double"""
3753 return _IMP_isd.PenalizedComplexityPrior_get_alpha(self)
3754 __swig_destroy__ = _IMP_isd.delete_PenalizedComplexityPrior
3755
3756 def __str__(self):
3757 r"""__str__(PenalizedComplexityPrior self) -> std::string"""
3758 return _IMP_isd.PenalizedComplexityPrior___str__(self)
3759
3760 def __repr__(self):
3761 r"""__repr__(PenalizedComplexityPrior self) -> std::string"""
3762 return _IMP_isd.PenalizedComplexityPrior___repr__(self)
3763
3764 @staticmethod
3765 def get_from(o):
3766 return _object_cast_to_PenalizedComplexityPrior(o)
3767
3768
3769# Register PenalizedComplexityPrior in _IMP_isd:
3770_IMP_isd.PenalizedComplexityPrior_swigregister(PenalizedComplexityPrior)
3771class vonMisesKappaJeffreysRestraint(IMP.Restraint):
3772 r"""Proxy of C++ IMP::isd::vonMisesKappaJeffreysRestraint class."""
3773
3774 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3775
3776 def __init__(self, m, kappa):
3777 r"""__init__(vonMisesKappaJeffreysRestraint self, Model m, Particle kappa) -> vonMisesKappaJeffreysRestraint"""
3778 _IMP_isd.vonMisesKappaJeffreysRestraint_swiginit(self, _IMP_isd.new_vonMisesKappaJeffreysRestraint(m, kappa))
3779
3780 def do_get_inputs(self):
3781 r"""do_get_inputs(vonMisesKappaJeffreysRestraint self) -> IMP::ModelObjectsTemp"""
3782 return _IMP_isd.vonMisesKappaJeffreysRestraint_do_get_inputs(self)
3783
3784 def get_version_info(self):
3785 r"""get_version_info(vonMisesKappaJeffreysRestraint self) -> VersionInfo"""
3786 return _IMP_isd.vonMisesKappaJeffreysRestraint_get_version_info(self)
3787 __swig_destroy__ = _IMP_isd.delete_vonMisesKappaJeffreysRestraint
3788
3789 def get_probability(self):
3790 r"""get_probability(vonMisesKappaJeffreysRestraint self) -> double"""
3791 return _IMP_isd.vonMisesKappaJeffreysRestraint_get_probability(self)
3792
3793 def __str__(self):
3794 r"""__str__(vonMisesKappaJeffreysRestraint self) -> std::string"""
3795 return _IMP_isd.vonMisesKappaJeffreysRestraint___str__(self)
3796
3797 def __repr__(self):
3798 r"""__repr__(vonMisesKappaJeffreysRestraint self) -> std::string"""
3799 return _IMP_isd.vonMisesKappaJeffreysRestraint___repr__(self)
3800
3801 @staticmethod
3802 def get_from(o):
3803 return _object_cast_to_vonMisesKappaJeffreysRestraint(o)
3804
3805
3806# Register vonMisesKappaJeffreysRestraint in _IMP_isd:
3807_IMP_isd.vonMisesKappaJeffreysRestraint_swigregister(vonMisesKappaJeffreysRestraint)
3808class vonMisesKappaConjugateRestraint(IMP.Restraint):
3809 r"""Proxy of C++ IMP::isd::vonMisesKappaConjugateRestraint class."""
3810
3811 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3812
3813 def __init__(self, m, kappa, c=10.0, R0=0.0):
3814 r"""__init__(vonMisesKappaConjugateRestraint self, Model m, Particle kappa, double c=10.0, double R0=0.0) -> vonMisesKappaConjugateRestraint"""
3815 _IMP_isd.vonMisesKappaConjugateRestraint_swiginit(self, _IMP_isd.new_vonMisesKappaConjugateRestraint(m, kappa, c, R0))
3816
3817 def do_get_inputs(self):
3818 r"""do_get_inputs(vonMisesKappaConjugateRestraint self) -> IMP::ModelObjectsTemp"""
3819 return _IMP_isd.vonMisesKappaConjugateRestraint_do_get_inputs(self)
3820
3821 def get_version_info(self):
3822 r"""get_version_info(vonMisesKappaConjugateRestraint self) -> VersionInfo"""
3823 return _IMP_isd.vonMisesKappaConjugateRestraint_get_version_info(self)
3824 __swig_destroy__ = _IMP_isd.delete_vonMisesKappaConjugateRestraint
3825
3826 def get_probability(self):
3827 r"""get_probability(vonMisesKappaConjugateRestraint self) -> double"""
3828 return _IMP_isd.vonMisesKappaConjugateRestraint_get_probability(self)
3829
3830 def __str__(self):
3831 r"""__str__(vonMisesKappaConjugateRestraint self) -> std::string"""
3832 return _IMP_isd.vonMisesKappaConjugateRestraint___str__(self)
3833
3834 def __repr__(self):
3835 r"""__repr__(vonMisesKappaConjugateRestraint self) -> std::string"""
3836 return _IMP_isd.vonMisesKappaConjugateRestraint___repr__(self)
3837
3838 @staticmethod
3839 def get_from(o):
3840 return _object_cast_to_vonMisesKappaConjugateRestraint(o)
3841
3842
3843# Register vonMisesKappaConjugateRestraint in _IMP_isd:
3844_IMP_isd.vonMisesKappaConjugateRestraint_swigregister(vonMisesKappaConjugateRestraint)
3845class NOERestraint(IMP.Restraint):
3846 r"""Proxy of C++ IMP::isd::NOERestraint class."""
3847
3848 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3849
3850 def __init__(self, m, p0, p1, sigma, gamma, Iexp):
3851 r"""__init__(NOERestraint self, Model m, Particle p0, Particle p1, Particle sigma, Particle gamma, double Iexp) -> NOERestraint"""
3852 _IMP_isd.NOERestraint_swiginit(self, _IMP_isd.new_NOERestraint(m, p0, p1, sigma, gamma, Iexp))
3853
3854 def get_probability(self):
3855 r"""get_probability(NOERestraint self) -> double"""
3856 return _IMP_isd.NOERestraint_get_probability(self)
3857
3858 def get_chi(self):
3859 r"""get_chi(NOERestraint self) -> double"""
3860 return _IMP_isd.NOERestraint_get_chi(self)
3861
3862 def do_get_inputs(self):
3863 r"""do_get_inputs(NOERestraint self) -> IMP::ModelObjectsTemp"""
3864 return _IMP_isd.NOERestraint_do_get_inputs(self)
3865
3866 def get_version_info(self):
3867 r"""get_version_info(NOERestraint self) -> VersionInfo"""
3868 return _IMP_isd.NOERestraint_get_version_info(self)
3869 __swig_destroy__ = _IMP_isd.delete_NOERestraint
3870
3871 def __str__(self):
3872 r"""__str__(NOERestraint self) -> std::string"""
3873 return _IMP_isd.NOERestraint___str__(self)
3874
3875 def __repr__(self):
3876 r"""__repr__(NOERestraint self) -> std::string"""
3877 return _IMP_isd.NOERestraint___repr__(self)
3878
3879 @staticmethod
3880 def get_from(o):
3881 return _object_cast_to_NOERestraint(o)
3882
3883
3884# Register NOERestraint in _IMP_isd:
3885_IMP_isd.NOERestraint_swigregister(NOERestraint)
3886class GaussianRestraint(IMP.Restraint):
3887 r"""Proxy of C++ IMP::isd::GaussianRestraint class."""
3888
3889 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3890
3891 def __init__(self, *args):
3892 r"""
3893 __init__(GaussianRestraint self, Particle x, Particle mu, Particle sigma) -> GaussianRestraint
3894 __init__(GaussianRestraint self, double x, Particle mu, Particle sigma) -> GaussianRestraint
3895 __init__(GaussianRestraint self, Particle x, double mu, Particle sigma) -> GaussianRestraint
3896 __init__(GaussianRestraint self, Particle x, Particle mu, double sigma) -> GaussianRestraint
3897 __init__(GaussianRestraint self, double x, double mu, Particle sigma) -> GaussianRestraint
3898 __init__(GaussianRestraint self, Particle x, double mu, double sigma) -> GaussianRestraint
3899 __init__(GaussianRestraint self, double x, Particle mu, double sigma) -> GaussianRestraint
3900 """
3901 _IMP_isd.GaussianRestraint_swiginit(self, _IMP_isd.new_GaussianRestraint(*args))
3902
3903 def get_probability(self):
3904 r"""get_probability(GaussianRestraint self) -> double"""
3905 return _IMP_isd.GaussianRestraint_get_probability(self)
3906
3907 def get_chi(self):
3908 r"""get_chi(GaussianRestraint self) -> double"""
3909 return _IMP_isd.GaussianRestraint_get_chi(self)
3910
3911 def do_get_inputs(self):
3912 r"""do_get_inputs(GaussianRestraint self) -> IMP::ModelObjectsTemp"""
3913 return _IMP_isd.GaussianRestraint_do_get_inputs(self)
3914
3915 def get_version_info(self):
3916 r"""get_version_info(GaussianRestraint self) -> VersionInfo"""
3917 return _IMP_isd.GaussianRestraint_get_version_info(self)
3918 __swig_destroy__ = _IMP_isd.delete_GaussianRestraint
3919
3920 def __str__(self):
3921 r"""__str__(GaussianRestraint self) -> std::string"""
3922 return _IMP_isd.GaussianRestraint___str__(self)
3923
3924 def __repr__(self):
3925 r"""__repr__(GaussianRestraint self) -> std::string"""
3926 return _IMP_isd.GaussianRestraint___repr__(self)
3927
3928 @staticmethod
3929 def get_from(o):
3930 return _object_cast_to_GaussianRestraint(o)
3931
3932
3933# Register GaussianRestraint in _IMP_isd:
3934_IMP_isd.GaussianRestraint_swigregister(GaussianRestraint)
3935class StudentTRestraint(IMP.Restraint):
3936 r"""Proxy of C++ IMP::isd::StudentTRestraint class."""
3937
3938 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3939
3940 def __init__(self, *args):
3941 r"""
3942 __init__(StudentTRestraint self, Model m, _ParticleIndexAdaptor x, _ParticleIndexAdaptor mu, _ParticleIndexAdaptor sigma, _ParticleIndexAdaptor nu) -> StudentTRestraint
3943 __init__(StudentTRestraint self, Model m, _ParticleIndexAdaptor x, double mu, _ParticleIndexAdaptor sigma, _ParticleIndexAdaptor nu) -> StudentTRestraint
3944 __init__(StudentTRestraint self, Model m, _ParticleIndexAdaptor x, _ParticleIndexAdaptor mu, double sigma, _ParticleIndexAdaptor nu) -> StudentTRestraint
3945 __init__(StudentTRestraint self, Model m, _ParticleIndexAdaptor x, _ParticleIndexAdaptor mu, _ParticleIndexAdaptor sigma, double nu) -> StudentTRestraint
3946 __init__(StudentTRestraint self, Model m, _ParticleIndexAdaptor x, double mu, double sigma, _ParticleIndexAdaptor nu) -> StudentTRestraint
3947 __init__(StudentTRestraint self, Model m, _ParticleIndexAdaptor x, double mu, _ParticleIndexAdaptor sigma, double nu) -> StudentTRestraint
3948 __init__(StudentTRestraint self, Model m, _ParticleIndexAdaptor x, _ParticleIndexAdaptor mu, double sigma, double nu) -> StudentTRestraint
3949 __init__(StudentTRestraint self, Model m, _ParticleIndexAdaptor x, double mu, double sigma, double nu) -> StudentTRestraint
3950 __init__(StudentTRestraint self, Model m, double x, _ParticleIndexAdaptor mu, _ParticleIndexAdaptor sigma, _ParticleIndexAdaptor nu) -> StudentTRestraint
3951 __init__(StudentTRestraint self, Model m, double x, double mu, _ParticleIndexAdaptor sigma, _ParticleIndexAdaptor nu) -> StudentTRestraint
3952 __init__(StudentTRestraint self, Model m, double x, _ParticleIndexAdaptor mu, double sigma, _ParticleIndexAdaptor nu) -> StudentTRestraint
3953 __init__(StudentTRestraint self, Model m, double x, _ParticleIndexAdaptor mu, _ParticleIndexAdaptor sigma, double nu) -> StudentTRestraint
3954 __init__(StudentTRestraint self, Model m, double x, double mu, double sigma, _ParticleIndexAdaptor nu) -> StudentTRestraint
3955 __init__(StudentTRestraint self, Model m, double x, double mu, _ParticleIndexAdaptor sigma, double nu) -> StudentTRestraint
3956 __init__(StudentTRestraint self, Model m, double x, _ParticleIndexAdaptor mu, double sigma, double nu) -> StudentTRestraint
3957 """
3958 _IMP_isd.StudentTRestraint_swiginit(self, _IMP_isd.new_StudentTRestraint(*args))
3959
3960 def get_probability(self):
3961 r"""get_probability(StudentTRestraint self) -> double"""
3962 return _IMP_isd.StudentTRestraint_get_probability(self)
3963
3964 def do_get_inputs(self):
3965 r"""do_get_inputs(StudentTRestraint self) -> IMP::ModelObjectsTemp"""
3966 return _IMP_isd.StudentTRestraint_do_get_inputs(self)
3967
3968 def get_version_info(self):
3969 r"""get_version_info(StudentTRestraint self) -> VersionInfo"""
3970 return _IMP_isd.StudentTRestraint_get_version_info(self)
3971 __swig_destroy__ = _IMP_isd.delete_StudentTRestraint
3972
3973 def __str__(self):
3974 r"""__str__(StudentTRestraint self) -> std::string"""
3975 return _IMP_isd.StudentTRestraint___str__(self)
3976
3977 def __repr__(self):
3978 r"""__repr__(StudentTRestraint self) -> std::string"""
3979 return _IMP_isd.StudentTRestraint___repr__(self)
3980
3981 @staticmethod
3982 def get_from(o):
3983 return _object_cast_to_StudentTRestraint(o)
3984
3985
3986# Register StudentTRestraint in _IMP_isd:
3987_IMP_isd.StudentTRestraint_swigregister(StudentTRestraint)
3988class LognormalRestraint(IMP.Restraint):
3989 r"""Proxy of C++ IMP::isd::LognormalRestraint class."""
3990
3991 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3992
3993 def __init__(self, *args):
3994 r"""
3995 __init__(LognormalRestraint self, Particle x, Particle mu, Particle sigma) -> LognormalRestraint
3996 __init__(LognormalRestraint self, double x, Particle mu, Particle sigma) -> LognormalRestraint
3997 __init__(LognormalRestraint self, Particle x, double mu, Particle sigma) -> LognormalRestraint
3998 __init__(LognormalRestraint self, Particle x, Particle mu, double sigma) -> LognormalRestraint
3999 __init__(LognormalRestraint self, double x, double mu, Particle sigma) -> LognormalRestraint
4000 __init__(LognormalRestraint self, Particle x, double mu, double sigma) -> LognormalRestraint
4001 __init__(LognormalRestraint self, double x, Particle mu, double sigma) -> LognormalRestraint
4002 """
4003 _IMP_isd.LognormalRestraint_swiginit(self, _IMP_isd.new_LognormalRestraint(*args))
4004
4005 def get_probability(self):
4006 r"""get_probability(LognormalRestraint self) -> double"""
4007 return _IMP_isd.LognormalRestraint_get_probability(self)
4008
4009 def get_chi(self):
4010 r"""get_chi(LognormalRestraint self) -> double"""
4011 return _IMP_isd.LognormalRestraint_get_chi(self)
4012
4013 def do_get_inputs(self):
4014 r"""do_get_inputs(LognormalRestraint self) -> IMP::ModelObjectsTemp"""
4015 return _IMP_isd.LognormalRestraint_do_get_inputs(self)
4016
4017 def get_version_info(self):
4018 r"""get_version_info(LognormalRestraint self) -> VersionInfo"""
4019 return _IMP_isd.LognormalRestraint_get_version_info(self)
4020 __swig_destroy__ = _IMP_isd.delete_LognormalRestraint
4021
4022 def __str__(self):
4023 r"""__str__(LognormalRestraint self) -> std::string"""
4024 return _IMP_isd.LognormalRestraint___str__(self)
4025
4026 def __repr__(self):
4027 r"""__repr__(LognormalRestraint self) -> std::string"""
4028 return _IMP_isd.LognormalRestraint___repr__(self)
4029
4030 @staticmethod
4031 def get_from(o):
4032 return _object_cast_to_LognormalRestraint(o)
4033
4034
4035# Register LognormalRestraint in _IMP_isd:
4036_IMP_isd.LognormalRestraint_swigregister(LognormalRestraint)
4037class LognormalAmbiguousRestraint(IMP.Restraint):
4038 r"""Proxy of C++ IMP::isd::LognormalAmbiguousRestraint class."""
4039
4040 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4041
4042 def __init__(self, p1, p2, ki, sigmaG):
4043 r"""__init__(LognormalAmbiguousRestraint self, Particle p1, Particle p2, Particle ki, Particle sigmaG) -> LognormalAmbiguousRestraint"""
4044 _IMP_isd.LognormalAmbiguousRestraint_swiginit(self, _IMP_isd.new_LognormalAmbiguousRestraint(p1, p2, ki, sigmaG))
4045
4046 def add_contribution(self, lexp, omega):
4047 r"""add_contribution(LognormalAmbiguousRestraint self, double lexp, Particle omega)"""
4048 return _IMP_isd.LognormalAmbiguousRestraint_add_contribution(self, lexp, omega)
4049
4050 def get_number_of_contributions(self):
4051 r"""get_number_of_contributions(LognormalAmbiguousRestraint self) -> unsigned int"""
4052 return _IMP_isd.LognormalAmbiguousRestraint_get_number_of_contributions(self)
4053
4054 def draw_k_from_posterior(self, kt):
4055 r"""draw_k_from_posterior(LognormalAmbiguousRestraint self, double kt)"""
4056 return _IMP_isd.LognormalAmbiguousRestraint_draw_k_from_posterior(self, kt)
4057
4058 def get_probability(self):
4059 r"""get_probability(LognormalAmbiguousRestraint self) -> double"""
4060 return _IMP_isd.LognormalAmbiguousRestraint_get_probability(self)
4061
4062 def do_get_inputs(self):
4063 r"""do_get_inputs(LognormalAmbiguousRestraint self) -> IMP::ModelObjectsTemp"""
4064 return _IMP_isd.LognormalAmbiguousRestraint_do_get_inputs(self)
4065
4066 def get_version_info(self):
4067 r"""get_version_info(LognormalAmbiguousRestraint self) -> VersionInfo"""
4068 return _IMP_isd.LognormalAmbiguousRestraint_get_version_info(self)
4069 __swig_destroy__ = _IMP_isd.delete_LognormalAmbiguousRestraint
4070
4071 def __str__(self):
4072 r"""__str__(LognormalAmbiguousRestraint self) -> std::string"""
4073 return _IMP_isd.LognormalAmbiguousRestraint___str__(self)
4074
4075 def __repr__(self):
4076 r"""__repr__(LognormalAmbiguousRestraint self) -> std::string"""
4077 return _IMP_isd.LognormalAmbiguousRestraint___repr__(self)
4078
4079 @staticmethod
4080 def get_from(o):
4081 return _object_cast_to_LognormalAmbiguousRestraint(o)
4082
4083
4084# Register LognormalAmbiguousRestraint in _IMP_isd:
4085_IMP_isd.LognormalAmbiguousRestraint_swigregister(LognormalAmbiguousRestraint)
4086class AmbiguousNOERestraint(IMP.Restraint):
4087 r"""Proxy of C++ IMP::isd::AmbiguousNOERestraint class."""
4088
4089 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4090
4091 def __init__(self, *args):
4092 r"""
4093 __init__(AmbiguousNOERestraint self, Model m, PairContainer pc, _ParticleIndexAdaptor sigma, _ParticleIndexAdaptor gamma, double Iexp) -> AmbiguousNOERestraint
4094 __init__(AmbiguousNOERestraint self) -> AmbiguousNOERestraint
4095 """
4096 _IMP_isd.AmbiguousNOERestraint_swiginit(self, _IMP_isd.new_AmbiguousNOERestraint(*args))
4097
4098 def get_probability(self):
4099 r"""get_probability(AmbiguousNOERestraint self) -> double"""
4100 return _IMP_isd.AmbiguousNOERestraint_get_probability(self)
4101
4102 def get_chi(self):
4103 r"""get_chi(AmbiguousNOERestraint self) -> double"""
4104 return _IMP_isd.AmbiguousNOERestraint_get_chi(self)
4105
4106 def do_get_inputs(self):
4107 r"""do_get_inputs(AmbiguousNOERestraint self) -> IMP::ModelObjectsTemp"""
4108 return _IMP_isd.AmbiguousNOERestraint_do_get_inputs(self)
4109
4110 def get_version_info(self):
4111 r"""get_version_info(AmbiguousNOERestraint self) -> VersionInfo"""
4112 return _IMP_isd.AmbiguousNOERestraint_get_version_info(self)
4113 __swig_destroy__ = _IMP_isd.delete_AmbiguousNOERestraint
4114
4115 def __str__(self):
4116 r"""__str__(AmbiguousNOERestraint self) -> std::string"""
4117 return _IMP_isd.AmbiguousNOERestraint___str__(self)
4118
4119 def __repr__(self):
4120 r"""__repr__(AmbiguousNOERestraint self) -> std::string"""
4121 return _IMP_isd.AmbiguousNOERestraint___repr__(self)
4122
4123 @staticmethod
4124 def get_from(o):
4125 return _object_cast_to_AmbiguousNOERestraint(o)
4126
4127
4128 def _get_as_binary(self):
4129 r"""_get_as_binary(AmbiguousNOERestraint self) -> PyObject *"""
4130 return _IMP_isd.AmbiguousNOERestraint__get_as_binary(self)
4131
4132 def _set_from_binary(self, p):
4133 r"""_set_from_binary(AmbiguousNOERestraint self, PyObject * p)"""
4134 return _IMP_isd.AmbiguousNOERestraint__set_from_binary(self, p)
4135
4136 def __getstate__(self):
4137 p = self._get_as_binary()
4138 if len(self.__dict__) > 1:
4139 d = self.__dict__.copy()
4140 del d['this']
4141 p = (d, p)
4142 return p
4143
4144 def __setstate__(self, p):
4145 if not hasattr(self, 'this'):
4146 self.__init__()
4147 if isinstance(p, tuple):
4148 d, p = p
4149 self.__dict__.update(d)
4150 return self._set_from_binary(p)
4151
4152
4153# Register AmbiguousNOERestraint in _IMP_isd:
4154_IMP_isd.AmbiguousNOERestraint_swigregister(AmbiguousNOERestraint)
4155class MarginalNOERestraint(IMP.Restraint):
4156 r"""Proxy of C++ IMP::isd::MarginalNOERestraint class."""
4157
4158 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4159
4160 def __init__(self, m):
4161 r"""__init__(MarginalNOERestraint self, Model m) -> MarginalNOERestraint"""
4162 _IMP_isd.MarginalNOERestraint_swiginit(self, _IMP_isd.new_MarginalNOERestraint(m))
4163
4164 def add_contribution(self, *args):
4165 r"""
4166 add_contribution(MarginalNOERestraint self, Particle p1, Particle p2, double Iexp)
4167 add_contribution(MarginalNOERestraint self, PairContainer pc, double Iexp)
4168 """
4169 return _IMP_isd.MarginalNOERestraint_add_contribution(self, *args)
4170
4171 def get_log_gammahat(self):
4172 r"""get_log_gammahat(MarginalNOERestraint self) -> double"""
4173 return _IMP_isd.MarginalNOERestraint_get_log_gammahat(self)
4174
4175 def get_SS(self):
4176 r"""get_SS(MarginalNOERestraint self) -> double"""
4177 return _IMP_isd.MarginalNOERestraint_get_SS(self)
4178
4179 def get_number_of_contributions(self):
4180 r"""get_number_of_contributions(MarginalNOERestraint self) -> unsigned int"""
4181 return _IMP_isd.MarginalNOERestraint_get_number_of_contributions(self)
4182
4183 def get_probability(self):
4184 r"""get_probability(MarginalNOERestraint self) -> double"""
4185 return _IMP_isd.MarginalNOERestraint_get_probability(self)
4186
4187 def do_get_inputs(self):
4188 r"""do_get_inputs(MarginalNOERestraint self) -> IMP::ModelObjectsTemp"""
4189 return _IMP_isd.MarginalNOERestraint_do_get_inputs(self)
4190
4191 def get_version_info(self):
4192 r"""get_version_info(MarginalNOERestraint self) -> VersionInfo"""
4193 return _IMP_isd.MarginalNOERestraint_get_version_info(self)
4194 __swig_destroy__ = _IMP_isd.delete_MarginalNOERestraint
4195
4196 def __str__(self):
4197 r"""__str__(MarginalNOERestraint self) -> std::string"""
4198 return _IMP_isd.MarginalNOERestraint___str__(self)
4199
4200 def __repr__(self):
4201 r"""__repr__(MarginalNOERestraint self) -> std::string"""
4202 return _IMP_isd.MarginalNOERestraint___repr__(self)
4203
4204 @staticmethod
4205 def get_from(o):
4206 return _object_cast_to_MarginalNOERestraint(o)
4207
4208
4209# Register MarginalNOERestraint in _IMP_isd:
4210_IMP_isd.MarginalNOERestraint_swigregister(MarginalNOERestraint)
4211class MarginalHBondRestraint(IMP.Restraint):
4212 r"""Proxy of C++ IMP::isd::MarginalHBondRestraint class."""
4213
4214 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4215
4216 def __init__(self, m):
4217 r"""__init__(MarginalHBondRestraint self, Model m) -> MarginalHBondRestraint"""
4218 _IMP_isd.MarginalHBondRestraint_swiginit(self, _IMP_isd.new_MarginalHBondRestraint(m))
4219
4220 def add_contribution(self, *args):
4221 r"""
4222 add_contribution(MarginalHBondRestraint self, Particle p1, Particle p2, double Iexp)
4223 add_contribution(MarginalHBondRestraint self, PairContainer pc, double Iexp)
4224 """
4225 return _IMP_isd.MarginalHBondRestraint_add_contribution(self, *args)
4226
4227 def get_logsquares(self):
4228 r"""get_logsquares(MarginalHBondRestraint self) -> double"""
4229 return _IMP_isd.MarginalHBondRestraint_get_logsquares(self)
4230
4231 def get_number_of_contributions(self):
4232 r"""get_number_of_contributions(MarginalHBondRestraint self) -> unsigned int"""
4233 return _IMP_isd.MarginalHBondRestraint_get_number_of_contributions(self)
4234
4235 def get_probability(self):
4236 r"""get_probability(MarginalHBondRestraint self) -> double"""
4237 return _IMP_isd.MarginalHBondRestraint_get_probability(self)
4238
4239 def do_get_inputs(self):
4240 r"""do_get_inputs(MarginalHBondRestraint self) -> IMP::ModelObjectsTemp"""
4241 return _IMP_isd.MarginalHBondRestraint_do_get_inputs(self)
4242
4243 def get_version_info(self):
4244 r"""get_version_info(MarginalHBondRestraint self) -> VersionInfo"""
4245 return _IMP_isd.MarginalHBondRestraint_get_version_info(self)
4246 __swig_destroy__ = _IMP_isd.delete_MarginalHBondRestraint
4247
4248 def __str__(self):
4249 r"""__str__(MarginalHBondRestraint self) -> std::string"""
4250 return _IMP_isd.MarginalHBondRestraint___str__(self)
4251
4252 def __repr__(self):
4253 r"""__repr__(MarginalHBondRestraint self) -> std::string"""
4254 return _IMP_isd.MarginalHBondRestraint___repr__(self)
4255
4256 @staticmethod
4257 def get_from(o):
4258 return _object_cast_to_MarginalHBondRestraint(o)
4259
4260
4261# Register MarginalHBondRestraint in _IMP_isd:
4262_IMP_isd.MarginalHBondRestraint_swigregister(MarginalHBondRestraint)
4263class TALOSRestraint(IMP.Restraint):
4264 r"""Proxy of C++ IMP::isd::TALOSRestraint class."""
4265
4266 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4267
4268 def __init__(self, *args):
4269 r"""
4270 __init__(TALOSRestraint self, Model m, IMP::Particles p, IMP::Floats data, Particle kappa) -> TALOSRestraint
4271 __init__(TALOSRestraint self, Model m, Particle p1, Particle p2, Particle p3, Particle p4, IMP::Floats data, Particle kappa) -> TALOSRestraint
4272 __init__(TALOSRestraint self, Model m, IMP::Particles p, unsigned int N, double R0, double chiexp, Particle kappa) -> TALOSRestraint
4273 __init__(TALOSRestraint self, Model m, Particle p1, Particle p2, Particle p3, Particle p4, unsigned int N, double R0, double chiexp, Particle kappa) -> TALOSRestraint
4274 """
4275 _IMP_isd.TALOSRestraint_swiginit(self, _IMP_isd.new_TALOSRestraint(*args))
4276
4277 def get_probability(self):
4278 r"""get_probability(TALOSRestraint self) -> double"""
4279 return _IMP_isd.TALOSRestraint_get_probability(self)
4280
4281 def get_R0(self):
4282 r"""get_R0(TALOSRestraint self) -> double"""
4283 return _IMP_isd.TALOSRestraint_get_R0(self)
4284
4285 def get_chiexp(self):
4286 r"""get_chiexp(TALOSRestraint self) -> double"""
4287 return _IMP_isd.TALOSRestraint_get_chiexp(self)
4288
4289 def do_get_inputs(self):
4290 r"""do_get_inputs(TALOSRestraint self) -> IMP::ModelObjectsTemp"""
4291 return _IMP_isd.TALOSRestraint_do_get_inputs(self)
4292
4293 def get_version_info(self):
4294 r"""get_version_info(TALOSRestraint self) -> VersionInfo"""
4295 return _IMP_isd.TALOSRestraint_get_version_info(self)
4296 __swig_destroy__ = _IMP_isd.delete_TALOSRestraint
4297
4298 def __str__(self):
4299 r"""__str__(TALOSRestraint self) -> std::string"""
4300 return _IMP_isd.TALOSRestraint___str__(self)
4301
4302 def __repr__(self):
4303 r"""__repr__(TALOSRestraint self) -> std::string"""
4304 return _IMP_isd.TALOSRestraint___repr__(self)
4305
4306 @staticmethod
4307 def get_from(o):
4308 return _object_cast_to_TALOSRestraint(o)
4309
4310
4311# Register TALOSRestraint in _IMP_isd:
4312_IMP_isd.TALOSRestraint_swigregister(TALOSRestraint)
4313class RepulsiveDistancePairScore(IMP.PairScore):
4314 r"""Proxy of C++ IMP::isd::RepulsiveDistancePairScore class."""
4315
4316 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4317
4318 def __init__(self, d0, k):
4319 r"""__init__(RepulsiveDistancePairScore self, double d0, double k) -> RepulsiveDistancePairScore"""
4320 _IMP_isd.RepulsiveDistancePairScore_swiginit(self, _IMP_isd.new_RepulsiveDistancePairScore(d0, k))
4321
4322 def get_rest_length(self):
4323 r"""get_rest_length(RepulsiveDistancePairScore self) -> double"""
4324 return _IMP_isd.RepulsiveDistancePairScore_get_rest_length(self)
4325
4326 def get_stiffness(self):
4327 r"""get_stiffness(RepulsiveDistancePairScore self) -> double"""
4328 return _IMP_isd.RepulsiveDistancePairScore_get_stiffness(self)
4329
4330 def do_get_inputs(self, m, pis):
4331 r"""do_get_inputs(RepulsiveDistancePairScore self, Model m, IMP::ParticleIndexes const & pis) -> IMP::ModelObjectsTemp"""
4332 return _IMP_isd.RepulsiveDistancePairScore_do_get_inputs(self, m, pis)
4333
4334 def evaluate_indexes(self, m, p, da, lower_bound, upper_bound, all_indexes_checked=False):
4335 r"""evaluate_indexes(RepulsiveDistancePairScore self, Model m, IMP::ParticleIndexPairs const & p, DerivativeAccumulator da, unsigned int lower_bound, unsigned int upper_bound, bool all_indexes_checked=False) -> double"""
4336 return _IMP_isd.RepulsiveDistancePairScore_evaluate_indexes(self, m, p, da, lower_bound, upper_bound, all_indexes_checked)
4337
4338 def evaluate_indexes_scores(self, m, p, da, lower_bound, upper_bound, score, all_indexes_checked=False):
4339 r"""evaluate_indexes_scores(RepulsiveDistancePairScore 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"""
4340 return _IMP_isd.RepulsiveDistancePairScore_evaluate_indexes_scores(self, m, p, da, lower_bound, upper_bound, score, all_indexes_checked)
4341
4342 def evaluate_indexes_delta(self, m, p, da, indexes, score, all_indexes_checked=False):
4343 r"""evaluate_indexes_delta(RepulsiveDistancePairScore 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"""
4344 return _IMP_isd.RepulsiveDistancePairScore_evaluate_indexes_delta(self, m, p, da, indexes, score, all_indexes_checked)
4345
4346 def evaluate_if_good_indexes(self, m, p, da, max, lower_bound, upper_bound, all_indexes_checked=False):
4347 r"""evaluate_if_good_indexes(RepulsiveDistancePairScore 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"""
4348 return _IMP_isd.RepulsiveDistancePairScore_evaluate_if_good_indexes(self, m, p, da, max, lower_bound, upper_bound, all_indexes_checked)
4349
4350 def get_version_info(self):
4351 r"""get_version_info(RepulsiveDistancePairScore self) -> VersionInfo"""
4352 return _IMP_isd.RepulsiveDistancePairScore_get_version_info(self)
4353 __swig_destroy__ = _IMP_isd.delete_RepulsiveDistancePairScore
4354
4355 def __str__(self):
4356 r"""__str__(RepulsiveDistancePairScore self) -> std::string"""
4357 return _IMP_isd.RepulsiveDistancePairScore___str__(self)
4358
4359 def __repr__(self):
4360 r"""__repr__(RepulsiveDistancePairScore self) -> std::string"""
4361 return _IMP_isd.RepulsiveDistancePairScore___repr__(self)
4362
4363 @staticmethod
4364 def get_from(o):
4365 return _object_cast_to_RepulsiveDistancePairScore(o)
4366
4367
4368# Register RepulsiveDistancePairScore in _IMP_isd:
4369_IMP_isd.RepulsiveDistancePairScore_swigregister(RepulsiveDistancePairScore)
4370class AmbiguousRestraint(IMP.Restraint):
4371 r"""Proxy of C++ IMP::isd::AmbiguousRestraint class."""
4372
4373 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4374
4375 def __init__(self, *args):
4376 r"""
4377 __init__(AmbiguousRestraint self, Model m, int d, Restraint r0, Restraint r1) -> AmbiguousRestraint
4378 __init__(AmbiguousRestraint self, Model m, int d, IMP::Restraints rs) -> AmbiguousRestraint
4379 __init__(AmbiguousRestraint self) -> AmbiguousRestraint
4380 """
4381 _IMP_isd.AmbiguousRestraint_swiginit(self, _IMP_isd.new_AmbiguousRestraint(*args))
4382
4383 def get_probability(self):
4384 r"""get_probability(AmbiguousRestraint self) -> double"""
4385 return _IMP_isd.AmbiguousRestraint_get_probability(self)
4386
4387 def do_get_inputs(self):
4388 r"""do_get_inputs(AmbiguousRestraint self) -> IMP::ModelObjectsTemp"""
4389 return _IMP_isd.AmbiguousRestraint_do_get_inputs(self)
4390
4391 def get_version_info(self):
4392 r"""get_version_info(AmbiguousRestraint self) -> VersionInfo"""
4393 return _IMP_isd.AmbiguousRestraint_get_version_info(self)
4394 __swig_destroy__ = _IMP_isd.delete_AmbiguousRestraint
4395
4396 def __str__(self):
4397 r"""__str__(AmbiguousRestraint self) -> std::string"""
4398 return _IMP_isd.AmbiguousRestraint___str__(self)
4399
4400 def __repr__(self):
4401 r"""__repr__(AmbiguousRestraint self) -> std::string"""
4402 return _IMP_isd.AmbiguousRestraint___repr__(self)
4403
4404 @staticmethod
4405 def get_from(o):
4406 return _object_cast_to_AmbiguousRestraint(o)
4407
4408
4409 def _get_as_binary(self):
4410 r"""_get_as_binary(AmbiguousRestraint self) -> PyObject *"""
4411 return _IMP_isd.AmbiguousRestraint__get_as_binary(self)
4412
4413 def _set_from_binary(self, p):
4414 r"""_set_from_binary(AmbiguousRestraint self, PyObject * p)"""
4415 return _IMP_isd.AmbiguousRestraint__set_from_binary(self, p)
4416
4417 def __getstate__(self):
4418 p = self._get_as_binary()
4419 if len(self.__dict__) > 1:
4420 d = self.__dict__.copy()
4421 del d['this']
4422 p = (d, p)
4423 return p
4424
4425 def __setstate__(self, p):
4426 if not hasattr(self, 'this'):
4427 self.__init__()
4428 if isinstance(p, tuple):
4429 d, p = p
4430 self.__dict__.update(d)
4431 return self._set_from_binary(p)
4432
4433
4434# Register AmbiguousRestraint in _IMP_isd:
4435_IMP_isd.AmbiguousRestraint_swigregister(AmbiguousRestraint)
4436IMP_ISD_UNIVARIATE_FUNCTIONS_MINIMUM = _IMP_isd.IMP_ISD_UNIVARIATE_FUNCTIONS_MINIMUM
4437
4438class UnivariateFunction(IMP.Object):
4439 r"""Proxy of C++ IMP::isd::UnivariateFunction class."""
4440
4441 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4442
4443 def __init__(self, *args, **kwargs):
4444 raise AttributeError("No constructor defined - class is abstract")
4445
4446 def __call__(self, *args):
4447 r"""
4448 __call__(UnivariateFunction self, IMP::Floats const & x) -> IMP::Floats
4449 __call__(UnivariateFunction self, IMP::FloatsList const & xlist) -> Eigen::VectorXd
4450 __call__(UnivariateFunction self, IMP::FloatsList const & xlist, bool stupid) -> IMP::FloatsList
4451 """
4452 return _IMP_isd.UnivariateFunction___call__(self, *args)
4453
4454 def has_changed(self):
4455 r"""has_changed(UnivariateFunction self) -> bool"""
4456 return _IMP_isd.UnivariateFunction_has_changed(self)
4457
4458 def update(self):
4459 r"""update(UnivariateFunction self)"""
4460 return _IMP_isd.UnivariateFunction_update(self)
4461
4462 def add_to_derivatives(self, x, accum):
4463 r"""add_to_derivatives(UnivariateFunction self, IMP::Floats const & x, DerivativeAccumulator accum)"""
4464 return _IMP_isd.UnivariateFunction_add_to_derivatives(self, x, accum)
4465
4466 def add_to_particle_derivative(self, particle_no, value, accum):
4467 r"""add_to_particle_derivative(UnivariateFunction self, unsigned int particle_no, double value, DerivativeAccumulator accum)"""
4468 return _IMP_isd.UnivariateFunction_add_to_particle_derivative(self, particle_no, value, accum)
4469
4470 def get_derivative_vector(self, particle_no, xlist):
4471 r"""get_derivative_vector(UnivariateFunction self, unsigned int particle_no, IMP::FloatsList const & xlist) -> Eigen::VectorXd"""
4472 return _IMP_isd.UnivariateFunction_get_derivative_vector(self, particle_no, xlist)
4473
4474 def get_derivative_matrix(self, xlist, stupid):
4475 r"""get_derivative_matrix(UnivariateFunction self, IMP::FloatsList const & xlist, bool stupid) -> IMP::FloatsList"""
4476 return _IMP_isd.UnivariateFunction_get_derivative_matrix(self, xlist, stupid)
4477
4478 def get_second_derivative_vector(self, *args):
4479 r"""
4480 get_second_derivative_vector(UnivariateFunction self, unsigned int particle_a, unsigned int particle_b, IMP::FloatsList const & xlist) -> Eigen::VectorXd
4481 get_second_derivative_vector(UnivariateFunction self, unsigned int particle_a, unsigned int particle_b, IMP::FloatsList const & xlist, bool stupid) -> IMP::FloatsList
4482 """
4483 return _IMP_isd.UnivariateFunction_get_second_derivative_vector(self, *args)
4484
4485 def get_ndims_x(self):
4486 r"""get_ndims_x(UnivariateFunction self) -> unsigned int"""
4487 return _IMP_isd.UnivariateFunction_get_ndims_x(self)
4488
4489 def get_ndims_y(self):
4490 r"""get_ndims_y(UnivariateFunction self) -> unsigned int"""
4491 return _IMP_isd.UnivariateFunction_get_ndims_y(self)
4492
4493 def get_number_of_particles(self):
4494 r"""get_number_of_particles(UnivariateFunction self) -> unsigned int"""
4495 return _IMP_isd.UnivariateFunction_get_number_of_particles(self)
4496
4497 def get_particle_is_optimized(self, particle_no):
4498 r"""get_particle_is_optimized(UnivariateFunction self, unsigned int particle_no) -> bool"""
4499 return _IMP_isd.UnivariateFunction_get_particle_is_optimized(self, particle_no)
4500
4501 def get_number_of_optimized_particles(self):
4502 r"""get_number_of_optimized_particles(UnivariateFunction self) -> unsigned int"""
4503 return _IMP_isd.UnivariateFunction_get_number_of_optimized_particles(self)
4504
4505 def get_inputs(self):
4506 r"""get_inputs(UnivariateFunction self) -> IMP::ModelObjectsTemp"""
4507 return _IMP_isd.UnivariateFunction_get_inputs(self)
4508 __swig_destroy__ = _IMP_isd.delete_UnivariateFunction
4509
4510 def __str__(self):
4511 r"""__str__(UnivariateFunction self) -> std::string"""
4512 return _IMP_isd.UnivariateFunction___str__(self)
4513
4514 def __repr__(self):
4515 r"""__repr__(UnivariateFunction self) -> std::string"""
4516 return _IMP_isd.UnivariateFunction___repr__(self)
4517
4518 @staticmethod
4519 def get_from(o):
4520 return _object_cast_to_UnivariateFunction(o)
4521
4522
4523# Register UnivariateFunction in _IMP_isd:
4524_IMP_isd.UnivariateFunction_swigregister(UnivariateFunction)
4525class Linear1DFunction(UnivariateFunction):
4526 r"""Proxy of C++ IMP::isd::Linear1DFunction class."""
4527
4528 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4529
4530 def __init__(self, a, b):
4531 r"""__init__(Linear1DFunction self, Particle a, Particle b) -> Linear1DFunction"""
4532 _IMP_isd.Linear1DFunction_swiginit(self, _IMP_isd.new_Linear1DFunction(a, b))
4533
4534 def __call__(self, *args):
4535 r"""
4536 __call__(Linear1DFunction self, IMP::Floats const & x) -> IMP::Floats
4537 __call__(Linear1DFunction self, IMP::FloatsList const & xlist) -> Eigen::VectorXd
4538 __call__(Linear1DFunction self, IMP::FloatsList const & xlist, bool arg3) -> IMP::FloatsList
4539 """
4540 return _IMP_isd.Linear1DFunction___call__(self, *args)
4541
4542 def get_second_derivative_vector(self, *args):
4543 r"""
4544 get_second_derivative_vector(Linear1DFunction self, unsigned int arg2, unsigned int arg3, IMP::FloatsList const & xlist) -> Eigen::VectorXd
4545 get_second_derivative_vector(Linear1DFunction self, unsigned int particle_a, unsigned int particle_b, IMP::FloatsList const & xlist, bool arg5) -> IMP::FloatsList
4546 """
4547 return _IMP_isd.Linear1DFunction_get_second_derivative_vector(self, *args)
4548
4549 def get_version_info(self):
4550 r"""get_version_info(Linear1DFunction self) -> VersionInfo"""
4551 return _IMP_isd.Linear1DFunction_get_version_info(self)
4552 __swig_destroy__ = _IMP_isd.delete_Linear1DFunction
4553
4554 def __str__(self):
4555 r"""__str__(Linear1DFunction self) -> std::string"""
4556 return _IMP_isd.Linear1DFunction___str__(self)
4557
4558 def __repr__(self):
4559 r"""__repr__(Linear1DFunction self) -> std::string"""
4560 return _IMP_isd.Linear1DFunction___repr__(self)
4561
4562 @staticmethod
4563 def get_from(o):
4564 return _object_cast_to_Linear1DFunction(o)
4565
4566
4567# Register Linear1DFunction in _IMP_isd:
4568_IMP_isd.Linear1DFunction_swigregister(Linear1DFunction)
4569class GeneralizedGuinierPorodFunction(UnivariateFunction):
4570 r"""Proxy of C++ IMP::isd::GeneralizedGuinierPorodFunction class."""
4571
4572 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4573
4574 def __init__(self, G, Rg, d, s, A):
4575 r"""__init__(GeneralizedGuinierPorodFunction self, Particle G, Particle Rg, Particle d, Particle s, Particle A) -> GeneralizedGuinierPorodFunction"""
4576 _IMP_isd.GeneralizedGuinierPorodFunction_swiginit(self, _IMP_isd.new_GeneralizedGuinierPorodFunction(G, Rg, d, s, A))
4577
4578 def __call__(self, *args):
4579 r"""
4580 __call__(GeneralizedGuinierPorodFunction self, IMP::Floats const & x) -> IMP::Floats
4581 __call__(GeneralizedGuinierPorodFunction self, IMP::FloatsList const & xlist) -> Eigen::VectorXd
4582 __call__(GeneralizedGuinierPorodFunction self, IMP::FloatsList const & xlist, bool arg3) -> IMP::FloatsList
4583 """
4584 return _IMP_isd.GeneralizedGuinierPorodFunction___call__(self, *args)
4585
4586 def get_second_derivative_vector(self, *args):
4587 r"""
4588 get_second_derivative_vector(GeneralizedGuinierPorodFunction self, unsigned int particle_a, unsigned int particle_b, IMP::FloatsList const & xlist) -> Eigen::VectorXd
4589 get_second_derivative_vector(GeneralizedGuinierPorodFunction self, unsigned int particle_a, unsigned int particle_b, IMP::FloatsList const & xlist, bool arg5) -> IMP::FloatsList
4590 """
4591 return _IMP_isd.GeneralizedGuinierPorodFunction_get_second_derivative_vector(self, *args)
4592
4593 def get_version_info(self):
4594 r"""get_version_info(GeneralizedGuinierPorodFunction self) -> VersionInfo"""
4595 return _IMP_isd.GeneralizedGuinierPorodFunction_get_version_info(self)
4596 __swig_destroy__ = _IMP_isd.delete_GeneralizedGuinierPorodFunction
4597
4598 def __str__(self):
4599 r"""__str__(GeneralizedGuinierPorodFunction self) -> std::string"""
4600 return _IMP_isd.GeneralizedGuinierPorodFunction___str__(self)
4601
4602 def __repr__(self):
4603 r"""__repr__(GeneralizedGuinierPorodFunction self) -> std::string"""
4604 return _IMP_isd.GeneralizedGuinierPorodFunction___repr__(self)
4605
4606 @staticmethod
4607 def get_from(o):
4608 return _object_cast_to_GeneralizedGuinierPorodFunction(o)
4609
4610
4611# Register GeneralizedGuinierPorodFunction in _IMP_isd:
4612_IMP_isd.GeneralizedGuinierPorodFunction_swigregister(GeneralizedGuinierPorodFunction)
4613IMP_ISD_BIVARIATE_FUNCTIONS_MINIMUM = _IMP_isd.IMP_ISD_BIVARIATE_FUNCTIONS_MINIMUM
4614
4615class BivariateFunction(IMP.Object):
4616 r"""Proxy of C++ IMP::isd::BivariateFunction class."""
4617
4618 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4619
4620 def __init__(self, *args, **kwargs):
4621 raise AttributeError("No constructor defined - class is abstract")
4622
4623 def __call__(self, *args):
4624 r"""
4625 __call__(BivariateFunction self, IMP::Floats const & x1, IMP::Floats const & x2) -> IMP::Floats
4626 __call__(BivariateFunction self, IMP::FloatsList const & xlist) -> Eigen::MatrixXd
4627 __call__(BivariateFunction self, IMP::FloatsList const & xlist, bool stupid) -> IMP::FloatsList
4628 """
4629 return _IMP_isd.BivariateFunction___call__(self, *args)
4630
4631 def has_changed(self):
4632 r"""has_changed(BivariateFunction self) -> bool"""
4633 return _IMP_isd.BivariateFunction_has_changed(self)
4634
4635 def update(self):
4636 r"""update(BivariateFunction self)"""
4637 return _IMP_isd.BivariateFunction_update(self)
4638
4639 def add_to_derivatives(self, x1, x2, accum):
4640 r"""add_to_derivatives(BivariateFunction self, IMP::Floats const & x1, IMP::Floats const & x2, DerivativeAccumulator accum)"""
4641 return _IMP_isd.BivariateFunction_add_to_derivatives(self, x1, x2, accum)
4642
4643 def add_to_particle_derivative(self, particle_no, value, accum):
4644 r"""add_to_particle_derivative(BivariateFunction self, unsigned int particle_no, double value, DerivativeAccumulator accum)"""
4645 return _IMP_isd.BivariateFunction_add_to_particle_derivative(self, particle_no, value, accum)
4646
4647 def get_derivative_matrix(self, *args):
4648 r"""
4649 get_derivative_matrix(BivariateFunction self, unsigned int particle_no, IMP::FloatsList const & xlist) -> Eigen::MatrixXd
4650 get_derivative_matrix(BivariateFunction self, unsigned int particle_no, IMP::FloatsList const & xlist, bool stupid) -> IMP::FloatsList
4651 """
4652 return _IMP_isd.BivariateFunction_get_derivative_matrix(self, *args)
4653
4654 def get_second_derivative_matrix(self, *args):
4655 r"""
4656 get_second_derivative_matrix(BivariateFunction self, unsigned int particle_a, unsigned int particle_b, IMP::FloatsList const & xlist) -> Eigen::MatrixXd
4657 get_second_derivative_matrix(BivariateFunction self, unsigned int particle_a, unsigned int particle_b, IMP::FloatsList const & xlist, bool stupid) -> IMP::FloatsList
4658 """
4659 return _IMP_isd.BivariateFunction_get_second_derivative_matrix(self, *args)
4660
4661 def get_ndims_x1(self):
4662 r"""get_ndims_x1(BivariateFunction self) -> unsigned int"""
4663 return _IMP_isd.BivariateFunction_get_ndims_x1(self)
4664
4665 def get_ndims_x2(self):
4666 r"""get_ndims_x2(BivariateFunction self) -> unsigned int"""
4667 return _IMP_isd.BivariateFunction_get_ndims_x2(self)
4668
4669 def get_ndims_y(self):
4670 r"""get_ndims_y(BivariateFunction self) -> unsigned int"""
4671 return _IMP_isd.BivariateFunction_get_ndims_y(self)
4672
4673 def get_number_of_particles(self):
4674 r"""get_number_of_particles(BivariateFunction self) -> unsigned int"""
4675 return _IMP_isd.BivariateFunction_get_number_of_particles(self)
4676
4677 def get_particle_is_optimized(self, particle_no):
4678 r"""get_particle_is_optimized(BivariateFunction self, unsigned int particle_no) -> bool"""
4679 return _IMP_isd.BivariateFunction_get_particle_is_optimized(self, particle_no)
4680
4681 def get_number_of_optimized_particles(self):
4682 r"""get_number_of_optimized_particles(BivariateFunction self) -> unsigned int"""
4683 return _IMP_isd.BivariateFunction_get_number_of_optimized_particles(self)
4684
4685 def get_inputs(self):
4686 r"""get_inputs(BivariateFunction self) -> IMP::ModelObjectsTemp"""
4687 return _IMP_isd.BivariateFunction_get_inputs(self)
4688 __swig_destroy__ = _IMP_isd.delete_BivariateFunction
4689
4690 def __str__(self):
4691 r"""__str__(BivariateFunction self) -> std::string"""
4692 return _IMP_isd.BivariateFunction___str__(self)
4693
4694 def __repr__(self):
4695 r"""__repr__(BivariateFunction self) -> std::string"""
4696 return _IMP_isd.BivariateFunction___repr__(self)
4697
4698 @staticmethod
4699 def get_from(o):
4700 return _object_cast_to_BivariateFunction(o)
4701
4702
4703# Register BivariateFunction in _IMP_isd:
4704_IMP_isd.BivariateFunction_swigregister(BivariateFunction)
4705class Covariance1DFunction(BivariateFunction):
4706 r"""Proxy of C++ IMP::isd::Covariance1DFunction class."""
4707
4708 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4709
4710 def __init__(self, tau, ilambda, alpha=2.0, jitter=0.0, cutoff=1e-7):
4711 r"""__init__(Covariance1DFunction self, Particle tau, Particle ilambda, double alpha=2.0, double jitter=0.0, double cutoff=1e-7) -> Covariance1DFunction"""
4712 _IMP_isd.Covariance1DFunction_swiginit(self, _IMP_isd.new_Covariance1DFunction(tau, ilambda, alpha, jitter, cutoff))
4713
4714 def __call__(self, *args):
4715 r"""
4716 __call__(Covariance1DFunction self, IMP::Floats const & x1, IMP::Floats const & x2) -> IMP::Floats
4717 __call__(Covariance1DFunction self, IMP::FloatsList const & xlist) -> Eigen::MatrixXd
4718 __call__(Covariance1DFunction self, IMP::FloatsList const & xlist, bool arg3) -> IMP::FloatsList
4719 """
4720 return _IMP_isd.Covariance1DFunction___call__(self, *args)
4721
4722 def get_derivative_matrix(self, *args):
4723 r"""
4724 get_derivative_matrix(Covariance1DFunction self, unsigned int particle_no, IMP::FloatsList const & xlist) -> Eigen::MatrixXd
4725 get_derivative_matrix(Covariance1DFunction self, unsigned int particle_no, IMP::FloatsList const & xlist, bool arg4) -> IMP::FloatsList
4726 """
4727 return _IMP_isd.Covariance1DFunction_get_derivative_matrix(self, *args)
4728
4729 def get_second_derivative_matrix(self, *args):
4730 r"""
4731 get_second_derivative_matrix(Covariance1DFunction self, unsigned int particle_a, unsigned int particle_b, IMP::FloatsList const & xlist) -> Eigen::MatrixXd
4732 get_second_derivative_matrix(Covariance1DFunction self, unsigned int particle_a, unsigned int particle_b, IMP::FloatsList const & xlist, bool arg5) -> IMP::FloatsList
4733 """
4734 return _IMP_isd.Covariance1DFunction_get_second_derivative_matrix(self, *args)
4735
4736 def get_version_info(self):
4737 r"""get_version_info(Covariance1DFunction self) -> VersionInfo"""
4738 return _IMP_isd.Covariance1DFunction_get_version_info(self)
4739 __swig_destroy__ = _IMP_isd.delete_Covariance1DFunction
4740
4741 def __str__(self):
4742 r"""__str__(Covariance1DFunction self) -> std::string"""
4743 return _IMP_isd.Covariance1DFunction___str__(self)
4744
4745 def __repr__(self):
4746 r"""__repr__(Covariance1DFunction self) -> std::string"""
4747 return _IMP_isd.Covariance1DFunction___repr__(self)
4748
4749 @staticmethod
4750 def get_from(o):
4751 return _object_cast_to_Covariance1DFunction(o)
4752
4753
4754# Register Covariance1DFunction in _IMP_isd:
4755_IMP_isd.Covariance1DFunction_swigregister(Covariance1DFunction)
4756class GaussianProcessInterpolation(IMP.Object):
4757 r"""Proxy of C++ IMP::isd::GaussianProcessInterpolation class."""
4758
4759 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4760
4761 def __init__(self, x, sample_mean, sample_std, n_obs, mean_function, covariance_function, sigma, sparse_cutoff=1e-7):
4762 r"""__init__(GaussianProcessInterpolation self, IMP::FloatsList x, IMP::Floats sample_mean, IMP::Floats sample_std, unsigned int n_obs, UnivariateFunction mean_function, BivariateFunction covariance_function, Particle sigma, double sparse_cutoff=1e-7) -> GaussianProcessInterpolation"""
4763 _IMP_isd.GaussianProcessInterpolation_swiginit(self, _IMP_isd.new_GaussianProcessInterpolation(x, sample_mean, sample_std, n_obs, mean_function, covariance_function, sigma, sparse_cutoff))
4764
4765 def get_posterior_mean(self, x):
4766 r"""get_posterior_mean(GaussianProcessInterpolation self, IMP::Floats x) -> double"""
4767 return _IMP_isd.GaussianProcessInterpolation_get_posterior_mean(self, x)
4768
4769 def get_posterior_covariance(self, x1, x2):
4770 r"""get_posterior_covariance(GaussianProcessInterpolation self, IMP::Floats x1, IMP::Floats x2) -> double"""
4771 return _IMP_isd.GaussianProcessInterpolation_get_posterior_covariance(self, x1, x2)
4772
4773 def get_posterior_covariance_matrix(self, x, arg3):
4774 r"""get_posterior_covariance_matrix(GaussianProcessInterpolation self, IMP::FloatsList x, bool arg3) -> IMP::FloatsList"""
4775 return _IMP_isd.GaussianProcessInterpolation_get_posterior_covariance_matrix(self, x, arg3)
4776
4777 def get_posterior_covariance_derivative(self, x, arg3):
4778 r"""get_posterior_covariance_derivative(GaussianProcessInterpolation self, IMP::Floats x, bool arg3) -> IMP::Floats"""
4779 return _IMP_isd.GaussianProcessInterpolation_get_posterior_covariance_derivative(self, x, arg3)
4780
4781 def get_posterior_covariance_hessian(self, x, arg3):
4782 r"""get_posterior_covariance_hessian(GaussianProcessInterpolation self, IMP::Floats x, bool arg3) -> IMP::FloatsList"""
4783 return _IMP_isd.GaussianProcessInterpolation_get_posterior_covariance_hessian(self, x, arg3)
4784
4785 def get_inputs(self):
4786 r"""get_inputs(GaussianProcessInterpolation self) -> IMP::ModelObjectsTemp"""
4787 return _IMP_isd.GaussianProcessInterpolation_get_inputs(self)
4788
4789 def force_mean_update(self):
4790 r"""force_mean_update(GaussianProcessInterpolation self)"""
4791 return _IMP_isd.GaussianProcessInterpolation_force_mean_update(self)
4792
4793 def force_covariance_update(self):
4794 r"""force_covariance_update(GaussianProcessInterpolation self)"""
4795 return _IMP_isd.GaussianProcessInterpolation_force_covariance_update(self)
4796
4797 def get_number_of_m_particles(self):
4798 r"""get_number_of_m_particles(GaussianProcessInterpolation self) -> unsigned int"""
4799 return _IMP_isd.GaussianProcessInterpolation_get_number_of_m_particles(self)
4800
4801 def get_m_particle_is_optimized(self, i):
4802 r"""get_m_particle_is_optimized(GaussianProcessInterpolation self, unsigned int i) -> bool"""
4803 return _IMP_isd.GaussianProcessInterpolation_get_m_particle_is_optimized(self, i)
4804
4805 def get_number_of_Omega_particles(self):
4806 r"""get_number_of_Omega_particles(GaussianProcessInterpolation self) -> unsigned int"""
4807 return _IMP_isd.GaussianProcessInterpolation_get_number_of_Omega_particles(self)
4808
4809 def get_Omega_particle_is_optimized(self, i):
4810 r"""get_Omega_particle_is_optimized(GaussianProcessInterpolation self, unsigned int i) -> bool"""
4811 return _IMP_isd.GaussianProcessInterpolation_get_Omega_particle_is_optimized(self, i)
4812
4813 def get_data_abscissa(self):
4814 r"""get_data_abscissa(GaussianProcessInterpolation self) -> IMP::FloatsList"""
4815 return _IMP_isd.GaussianProcessInterpolation_get_data_abscissa(self)
4816
4817 def get_data_mean(self):
4818 r"""get_data_mean(GaussianProcessInterpolation self) -> IMP::Floats"""
4819 return _IMP_isd.GaussianProcessInterpolation_get_data_mean(self)
4820
4821 def get_data_variance(self):
4822 r"""get_data_variance(GaussianProcessInterpolation self) -> IMP::FloatsList"""
4823 return _IMP_isd.GaussianProcessInterpolation_get_data_variance(self)
4824
4825 def get_version_info(self):
4826 r"""get_version_info(GaussianProcessInterpolation self) -> VersionInfo"""
4827 return _IMP_isd.GaussianProcessInterpolation_get_version_info(self)
4828 __swig_destroy__ = _IMP_isd.delete_GaussianProcessInterpolation
4829
4830 def __str__(self):
4831 r"""__str__(GaussianProcessInterpolation self) -> std::string"""
4832 return _IMP_isd.GaussianProcessInterpolation___str__(self)
4833
4834 def __repr__(self):
4835 r"""__repr__(GaussianProcessInterpolation self) -> std::string"""
4836 return _IMP_isd.GaussianProcessInterpolation___repr__(self)
4837
4838 @staticmethod
4839 def get_from(o):
4840 return _object_cast_to_GaussianProcessInterpolation(o)
4841
4842
4843# Register GaussianProcessInterpolation in _IMP_isd:
4844_IMP_isd.GaussianProcessInterpolation_swigregister(GaussianProcessInterpolation)
4845class GaussianProcessInterpolationRestraint(IMP.Restraint):
4846 r"""Proxy of C++ IMP::isd::GaussianProcessInterpolationRestraint class."""
4847
4848 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4849
4850 def __init__(self, m, gpi):
4851 r"""__init__(GaussianProcessInterpolationRestraint self, Model m, GaussianProcessInterpolation gpi) -> GaussianProcessInterpolationRestraint"""
4852 _IMP_isd.GaussianProcessInterpolationRestraint_swiginit(self, _IMP_isd.new_GaussianProcessInterpolationRestraint(m, gpi))
4853
4854 def get_probability(self):
4855 r"""get_probability(GaussianProcessInterpolationRestraint self) -> double"""
4856 return _IMP_isd.GaussianProcessInterpolationRestraint_get_probability(self)
4857
4858 def set_use_cg(self, use, tol):
4859 r"""set_use_cg(GaussianProcessInterpolationRestraint self, bool use, double tol)"""
4860 return _IMP_isd.GaussianProcessInterpolationRestraint_set_use_cg(self, use, tol)
4861
4862 def get_minus_log_normalization(self):
4863 r"""get_minus_log_normalization(GaussianProcessInterpolationRestraint self) -> double"""
4864 return _IMP_isd.GaussianProcessInterpolationRestraint_get_minus_log_normalization(self)
4865
4866 def get_minus_exponent(self):
4867 r"""get_minus_exponent(GaussianProcessInterpolationRestraint self) -> double"""
4868 return _IMP_isd.GaussianProcessInterpolationRestraint_get_minus_exponent(self)
4869
4870 def get_logdet_hessian(self):
4871 r"""get_logdet_hessian(GaussianProcessInterpolationRestraint self) -> double"""
4872 return _IMP_isd.GaussianProcessInterpolationRestraint_get_logdet_hessian(self)
4873
4874 def get_hessian(self, *args):
4875 r"""
4876 get_hessian(GaussianProcessInterpolationRestraint self) -> Eigen::MatrixXd
4877 get_hessian(GaussianProcessInterpolationRestraint self, bool unused) -> IMP::FloatsList
4878 """
4879 return _IMP_isd.GaussianProcessInterpolationRestraint_get_hessian(self, *args)
4880
4881 def do_get_inputs(self):
4882 r"""do_get_inputs(GaussianProcessInterpolationRestraint self) -> IMP::ModelObjectsTemp"""
4883 return _IMP_isd.GaussianProcessInterpolationRestraint_do_get_inputs(self)
4884
4885 def get_version_info(self):
4886 r"""get_version_info(GaussianProcessInterpolationRestraint self) -> VersionInfo"""
4887 return _IMP_isd.GaussianProcessInterpolationRestraint_get_version_info(self)
4888 __swig_destroy__ = _IMP_isd.delete_GaussianProcessInterpolationRestraint
4889
4890 def __str__(self):
4891 r"""__str__(GaussianProcessInterpolationRestraint self) -> std::string"""
4892 return _IMP_isd.GaussianProcessInterpolationRestraint___str__(self)
4893
4894 def __repr__(self):
4895 r"""__repr__(GaussianProcessInterpolationRestraint self) -> std::string"""
4896 return _IMP_isd.GaussianProcessInterpolationRestraint___repr__(self)
4897
4898 @staticmethod
4899 def get_from(o):
4900 return _object_cast_to_GaussianProcessInterpolationRestraint(o)
4901
4902
4903# Register GaussianProcessInterpolationRestraint in _IMP_isd:
4904_IMP_isd.GaussianProcessInterpolationRestraint_swigregister(GaussianProcessInterpolationRestraint)
4905class MolecularDynamics(IMP.atom.MolecularDynamics):
4906 r"""Proxy of C++ IMP::isd::MolecularDynamics class."""
4907
4908 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4909
4910 def __init__(self, m=None):
4911 r"""__init__(MolecularDynamics self, Model m=None) -> MolecularDynamics"""
4912 _IMP_isd.MolecularDynamics_swiginit(self, _IMP_isd.new_MolecularDynamics(m))
4913
4914 def __str__(self):
4915 r"""__str__(MolecularDynamics self) -> std::string"""
4916 return _IMP_isd.MolecularDynamics___str__(self)
4917
4918 def __repr__(self):
4919 r"""__repr__(MolecularDynamics self) -> std::string"""
4920 return _IMP_isd.MolecularDynamics___repr__(self)
4921
4922 @staticmethod
4923 def get_from(o):
4924 return _object_cast_to_MolecularDynamics(o)
4925
4926 __swig_destroy__ = _IMP_isd.delete_MolecularDynamics
4927
4928# Register MolecularDynamics in _IMP_isd:
4929_IMP_isd.MolecularDynamics_swigregister(MolecularDynamics)
4930class MolecularDynamicsMover(IMP.core.MonteCarloMover):
4931 r"""Proxy of C++ IMP::isd::MolecularDynamicsMover class."""
4932
4933 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4934
4935 def __init__(self, m, nsteps=100, timestep=1.):
4936 r"""__init__(MolecularDynamicsMover self, Model m, unsigned int nsteps=100, IMP::Float timestep=1.) -> MolecularDynamicsMover"""
4937 _IMP_isd.MolecularDynamicsMover_swiginit(self, _IMP_isd.new_MolecularDynamicsMover(m, nsteps, timestep))
4938
4939 def get_md(self):
4940 r"""get_md(MolecularDynamicsMover self) -> MolecularDynamics"""
4941 return _IMP_isd.MolecularDynamicsMover_get_md(self)
4942
4943 def get_number_of_md_steps(self):
4944 r"""get_number_of_md_steps(MolecularDynamicsMover self) -> unsigned int"""
4945 return _IMP_isd.MolecularDynamicsMover_get_number_of_md_steps(self)
4946
4947 def set_number_of_md_steps(self, nsteps):
4948 r"""set_number_of_md_steps(MolecularDynamicsMover self, unsigned int nsteps)"""
4949 return _IMP_isd.MolecularDynamicsMover_set_number_of_md_steps(self, nsteps)
4950
4951 def get_version_info(self):
4952 r"""get_version_info(MolecularDynamicsMover self) -> VersionInfo"""
4953 return _IMP_isd.MolecularDynamicsMover_get_version_info(self)
4954 __swig_destroy__ = _IMP_isd.delete_MolecularDynamicsMover
4955
4956 def __str__(self):
4957 r"""__str__(MolecularDynamicsMover self) -> std::string"""
4958 return _IMP_isd.MolecularDynamicsMover___str__(self)
4959
4960 def __repr__(self):
4961 r"""__repr__(MolecularDynamicsMover self) -> std::string"""
4962 return _IMP_isd.MolecularDynamicsMover___repr__(self)
4963
4964 @staticmethod
4965 def get_from(o):
4966 return _object_cast_to_MolecularDynamicsMover(o)
4967
4968
4969# Register MolecularDynamicsMover in _IMP_isd:
4970_IMP_isd.MolecularDynamicsMover_swigregister(MolecularDynamicsMover)
4971class HybridMonteCarlo(IMP.core.MonteCarlo):
4972 r"""Proxy of C++ IMP::isd::HybridMonteCarlo class."""
4973
4974 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
4975
4976 def __init__(self, m, kT=1.0, steps=100, timestep=1.0, persistence=1):
4977 r"""__init__(HybridMonteCarlo self, Model m, IMP::Float kT=1.0, unsigned int steps=100, IMP::Float timestep=1.0, unsigned int persistence=1) -> HybridMonteCarlo"""
4978 _IMP_isd.HybridMonteCarlo_swiginit(self, _IMP_isd.new_HybridMonteCarlo(m, kT, steps, timestep, persistence))
4979
4980 def get_kinetic_energy(self):
4981 r"""get_kinetic_energy(HybridMonteCarlo self) -> IMP::Float"""
4982 return _IMP_isd.HybridMonteCarlo_get_kinetic_energy(self)
4983
4984 def get_potential_energy(self):
4985 r"""get_potential_energy(HybridMonteCarlo self) -> IMP::Float"""
4986 return _IMP_isd.HybridMonteCarlo_get_potential_energy(self)
4987
4988 def get_total_energy(self):
4989 r"""get_total_energy(HybridMonteCarlo self) -> IMP::Float"""
4990 return _IMP_isd.HybridMonteCarlo_get_total_energy(self)
4991
4992 def set_timestep(self, ts):
4993 r"""set_timestep(HybridMonteCarlo self, IMP::Float ts)"""
4994 return _IMP_isd.HybridMonteCarlo_set_timestep(self, ts)
4995
4996 def get_timestep(self):
4997 r"""get_timestep(HybridMonteCarlo self) -> double"""
4998 return _IMP_isd.HybridMonteCarlo_get_timestep(self)
4999
5000 def set_number_of_md_steps(self, nsteps):
5001 r"""set_number_of_md_steps(HybridMonteCarlo self, unsigned int nsteps)"""
5002 return _IMP_isd.HybridMonteCarlo_set_number_of_md_steps(self, nsteps)
5003
5004 def get_number_of_md_steps(self):
5005 r"""get_number_of_md_steps(HybridMonteCarlo self) -> unsigned int"""
5006 return _IMP_isd.HybridMonteCarlo_get_number_of_md_steps(self)
5007
5008 def set_persistence(self, persistence=1):
5009 r"""set_persistence(HybridMonteCarlo self, unsigned int persistence=1)"""
5010 return _IMP_isd.HybridMonteCarlo_set_persistence(self, persistence)
5011
5012 def get_persistence(self):
5013 r"""get_persistence(HybridMonteCarlo self) -> unsigned int"""
5014 return _IMP_isd.HybridMonteCarlo_get_persistence(self)
5015
5016 def get_md(self):
5017 r"""get_md(HybridMonteCarlo self) -> MolecularDynamics"""
5018 return _IMP_isd.HybridMonteCarlo_get_md(self)
5019
5020 def do_evaluate(self, arg2, arg3):
5021 r"""do_evaluate(HybridMonteCarlo self, IMP::ParticleIndexes const & arg2, bool arg3) -> double"""
5022 return _IMP_isd.HybridMonteCarlo_do_evaluate(self, arg2, arg3)
5023
5024 def do_step(self):
5025 r"""do_step(HybridMonteCarlo self)"""
5026 return _IMP_isd.HybridMonteCarlo_do_step(self)
5027 __swig_destroy__ = _IMP_isd.delete_HybridMonteCarlo
5028
5029 def __str__(self):
5030 r"""__str__(HybridMonteCarlo self) -> std::string"""
5031 return _IMP_isd.HybridMonteCarlo___str__(self)
5032
5033 def __repr__(self):
5034 r"""__repr__(HybridMonteCarlo self) -> std::string"""
5035 return _IMP_isd.HybridMonteCarlo___repr__(self)
5036
5037 @staticmethod
5038 def get_from(o):
5039 return _object_cast_to_HybridMonteCarlo(o)
5040
5041
5042# Register HybridMonteCarlo in _IMP_isd:
5043_IMP_isd.HybridMonteCarlo_swigregister(HybridMonteCarlo)
5044class FretData(IMP.Object):
5045 r"""Proxy of C++ IMP::isd::FretData class."""
5046
5047 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5048
5049 def __init__(self, *args):
5050 r"""
5051 __init__(FretData self, IMP::Floats d_term, IMP::Floats d_center, IMP::Floats d_int, IMP::Floats s_grid, IMP::Float R0, IMP::Float Rmin, IMP::Float Rmax, bool do_limit=True) -> FretData
5052 __init__(FretData self) -> FretData
5053 """
5054 _IMP_isd.FretData_swiginit(self, _IMP_isd.new_FretData(*args))
5055
5056 def get_closest(self, vec, value):
5057 r"""get_closest(FretData self, DistBase vec, double value) -> int"""
5058 return _IMP_isd.FretData_get_closest(self, vec, value)
5059
5060 def get_probability(self, distn, dist, sigma):
5061 r"""get_probability(FretData self, IMP::Float distn, IMP::Float dist, IMP::Float sigma) -> IMP::Float"""
5062 return _IMP_isd.FretData_get_probability(self, distn, dist, sigma)
5063
5064 def get_kernel(self, dist, R0):
5065 r"""get_kernel(FretData self, IMP::Float dist, IMP::Float R0) -> IMP::Float"""
5066 return _IMP_isd.FretData_get_kernel(self, dist, R0)
5067
5068 def get_marginal_element(self, d_term, d_center, sigma):
5069 r"""get_marginal_element(FretData self, IMP::Float d_term, IMP::Float d_center, IMP::Float sigma) -> IMP::FloatPair"""
5070 return _IMP_isd.FretData_get_marginal_element(self, d_term, d_center, sigma)
5071
5072 def get_version_info(self):
5073 r"""get_version_info(FretData self) -> VersionInfo"""
5074 return _IMP_isd.FretData_get_version_info(self)
5075 __swig_destroy__ = _IMP_isd.delete_FretData
5076
5077 def __str__(self):
5078 r"""__str__(FretData self) -> std::string"""
5079 return _IMP_isd.FretData___str__(self)
5080
5081 def __repr__(self):
5082 r"""__repr__(FretData self) -> std::string"""
5083 return _IMP_isd.FretData___repr__(self)
5084
5085 @staticmethod
5086 def get_from(o):
5087 return _object_cast_to_FretData(o)
5088
5089
5090 def _get_as_binary(self):
5091 r"""_get_as_binary(FretData self) -> PyObject *"""
5092 return _IMP_isd.FretData__get_as_binary(self)
5093
5094 def _set_from_binary(self, p):
5095 r"""_set_from_binary(FretData self, PyObject * p)"""
5096 return _IMP_isd.FretData__set_from_binary(self, p)
5097
5098 def __getstate__(self):
5099 p = self._get_as_binary()
5100 if len(self.__dict__) > 1:
5101 d = self.__dict__.copy()
5102 del d['this']
5103 p = (d, p)
5104 return p
5105
5106 def __setstate__(self, p):
5107 if not hasattr(self, 'this'):
5108 self.__init__()
5109 if isinstance(p, tuple):
5110 d, p = p
5111 self.__dict__.update(d)
5112 return self._set_from_binary(p)
5113
5114
5115# Register FretData in _IMP_isd:
5116_IMP_isd.FretData_swigregister(FretData)
5117class FretRestraint(IMP.Restraint):
5118 r"""Proxy of C++ IMP::isd::FretRestraint class."""
5119
5120 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5121
5122 def __init__(self, *args):
5123 r"""
5124 __init__(FretRestraint self, IMP::ParticlesTemp pd, IMP::ParticlesTemp pa, Particle kda, Particle Ida, Particle R0, Particle sigma0, Particle Pbl, double fexp, double m_d=1.0, double m_a=1.0) -> FretRestraint
5125 __init__(FretRestraint self, Particle kda, Particle Ida, Particle sumFi, Particle sigma0, Particle Pbl, double fexp) -> FretRestraint
5126 __init__(FretRestraint self, Particle prd, Vector3D GMMterd, IMP::algebra::Vector3Ds GMMctrd, IMP::Floats GMMwd, IMP::Floats GMMsigd, Particle pra, Vector3D GMMtera, IMP::algebra::Vector3Ds GMMctra, IMP::Floats GMMwa, IMP::Floats GMMsiga, Particle kda, Particle Ida, Particle sigma0, Particle Pbl, FretData data, double fexp) -> FretRestraint
5127 __init__(FretRestraint self) -> FretRestraint
5128 """
5129 _IMP_isd.FretRestraint_swiginit(self, _IMP_isd.new_FretRestraint(*args))
5130
5131 def get_sumFi(self):
5132 r"""get_sumFi(FretRestraint self) -> double"""
5133 return _IMP_isd.FretRestraint_get_sumFi(self)
5134
5135 def get_average_sigma(self, fmod):
5136 r"""get_average_sigma(FretRestraint self, double fmod) -> double"""
5137 return _IMP_isd.FretRestraint_get_average_sigma(self, fmod)
5138
5139 def get_standard_error(self):
5140 r"""get_standard_error(FretRestraint self) -> double"""
5141 return _IMP_isd.FretRestraint_get_standard_error(self)
5142
5143 def get_model_fretr(self):
5144 r"""get_model_fretr(FretRestraint self) -> double"""
5145 return _IMP_isd.FretRestraint_get_model_fretr(self)
5146
5147 def get_probability(self):
5148 r"""get_probability(FretRestraint self) -> double"""
5149 return _IMP_isd.FretRestraint_get_probability(self)
5150
5151 def get_experimental_value(self):
5152 r"""get_experimental_value(FretRestraint self) -> double"""
5153 return _IMP_isd.FretRestraint_get_experimental_value(self)
5154
5155 def set_experimental_value(self, fexp):
5156 r"""set_experimental_value(FretRestraint self, double fexp)"""
5157 return _IMP_isd.FretRestraint_set_experimental_value(self, fexp)
5158
5159 def do_get_inputs(self):
5160 r"""do_get_inputs(FretRestraint self) -> IMP::ModelObjectsTemp"""
5161 return _IMP_isd.FretRestraint_do_get_inputs(self)
5162
5163 def get_version_info(self):
5164 r"""get_version_info(FretRestraint self) -> VersionInfo"""
5165 return _IMP_isd.FretRestraint_get_version_info(self)
5166 __swig_destroy__ = _IMP_isd.delete_FretRestraint
5167
5168 def __str__(self):
5169 r"""__str__(FretRestraint self) -> std::string"""
5170 return _IMP_isd.FretRestraint___str__(self)
5171
5172 def __repr__(self):
5173 r"""__repr__(FretRestraint self) -> std::string"""
5174 return _IMP_isd.FretRestraint___repr__(self)
5175
5176 @staticmethod
5177 def get_from(o):
5178 return _object_cast_to_FretRestraint(o)
5179
5180
5181 def _get_as_binary(self):
5182 r"""_get_as_binary(FretRestraint self) -> PyObject *"""
5183 return _IMP_isd.FretRestraint__get_as_binary(self)
5184
5185 def _set_from_binary(self, p):
5186 r"""_set_from_binary(FretRestraint self, PyObject * p)"""
5187 return _IMP_isd.FretRestraint__set_from_binary(self, p)
5188
5189 def __getstate__(self):
5190 p = self._get_as_binary()
5191 if len(self.__dict__) > 1:
5192 d = self.__dict__.copy()
5193 del d['this']
5194 p = (d, p)
5195 return p
5196
5197 def __setstate__(self, p):
5198 if not hasattr(self, 'this'):
5199 self.__init__()
5200 if isinstance(p, tuple):
5201 d, p = p
5202 self.__dict__.update(d)
5203 return self._set_from_binary(p)
5204
5205
5206# Register FretRestraint in _IMP_isd:
5207_IMP_isd.FretRestraint_swigregister(FretRestraint)
5208class CysteineCrossLinkData(IMP.Object):
5209 r"""Proxy of C++ IMP::isd::CysteineCrossLinkData class."""
5210
5211 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5212
5213 def __init__(self, *args):
5214 r"""
5215 __init__(CysteineCrossLinkData self, double fexp, IMP::Floats fmod_grid, IMP::Floats omega_grid, IMP::Floats omega0_grid, int prior_type=3) -> CysteineCrossLinkData
5216 __init__(CysteineCrossLinkData self) -> CysteineCrossLinkData
5217 """
5218 _IMP_isd.CysteineCrossLinkData_swiginit(self, _IMP_isd.new_CysteineCrossLinkData(*args))
5219
5220 def get_closest(self, vec, value):
5221 r"""get_closest(CysteineCrossLinkData self, DistBase vec, double value) -> int"""
5222 return _IMP_isd.CysteineCrossLinkData_get_closest(self, vec, value)
5223
5224 def get_omegas(self, fmods, omega0):
5225 r"""get_omegas(CysteineCrossLinkData self, IMP::Floats fmods, double omega0) -> IMP::Floats"""
5226 return _IMP_isd.CysteineCrossLinkData_get_omegas(self, fmods, omega0)
5227
5228 def get_nonmarginal_elements(self, fexp, fmods, omega):
5229 r"""get_nonmarginal_elements(CysteineCrossLinkData self, double fexp, IMP::Floats fmods, double omega) -> IMP::Floats"""
5230 return _IMP_isd.CysteineCrossLinkData_get_nonmarginal_elements(self, fexp, fmods, omega)
5231
5232 def get_marginal_elements(self, fmods, omega0):
5233 r"""get_marginal_elements(CysteineCrossLinkData self, IMP::Floats fmods, double omega0) -> IMP::Floats"""
5234 return _IMP_isd.CysteineCrossLinkData_get_marginal_elements(self, fmods, omega0)
5235
5236 def get_omega(self, fmod, omega0):
5237 r"""get_omega(CysteineCrossLinkData self, double fmod, double omega0) -> double"""
5238 return _IMP_isd.CysteineCrossLinkData_get_omega(self, fmod, omega0)
5239
5240 def get_standard_deviation(self, fmod, omega0):
5241 r"""get_standard_deviation(CysteineCrossLinkData self, double fmod, double omega0) -> double"""
5242 return _IMP_isd.CysteineCrossLinkData_get_standard_deviation(self, fmod, omega0)
5243
5244 def get_nonmarginal_element(self, fexp, fmod, omega):
5245 r"""get_nonmarginal_element(CysteineCrossLinkData self, double fexp, double fmod, double omega) -> double"""
5246 return _IMP_isd.CysteineCrossLinkData_get_nonmarginal_element(self, fexp, fmod, omega)
5247
5248 def get_marginal_element(self, fmod, omega0):
5249 r"""get_marginal_element(CysteineCrossLinkData self, double fmod, double omega0) -> double"""
5250 return _IMP_isd.CysteineCrossLinkData_get_marginal_element(self, fmod, omega0)
5251
5252 def get_version_info(self):
5253 r"""get_version_info(CysteineCrossLinkData self) -> VersionInfo"""
5254 return _IMP_isd.CysteineCrossLinkData_get_version_info(self)
5255 __swig_destroy__ = _IMP_isd.delete_CysteineCrossLinkData
5256
5257 def __str__(self):
5258 r"""__str__(CysteineCrossLinkData self) -> std::string"""
5259 return _IMP_isd.CysteineCrossLinkData___str__(self)
5260
5261 def __repr__(self):
5262 r"""__repr__(CysteineCrossLinkData self) -> std::string"""
5263 return _IMP_isd.CysteineCrossLinkData___repr__(self)
5264
5265 @staticmethod
5266 def get_from(o):
5267 return _object_cast_to_CysteineCrossLinkData(o)
5268
5269
5270 def _get_as_binary(self):
5271 r"""_get_as_binary(CysteineCrossLinkData self) -> PyObject *"""
5272 return _IMP_isd.CysteineCrossLinkData__get_as_binary(self)
5273
5274 def _set_from_binary(self, p):
5275 r"""_set_from_binary(CysteineCrossLinkData self, PyObject * p)"""
5276 return _IMP_isd.CysteineCrossLinkData__set_from_binary(self, p)
5277
5278 def __getstate__(self):
5279 p = self._get_as_binary()
5280 if len(self.__dict__) > 1:
5281 d = self.__dict__.copy()
5282 del d['this']
5283 p = (d, p)
5284 return p
5285
5286 def __setstate__(self, p):
5287 if not hasattr(self, 'this'):
5288 self.__init__()
5289 if isinstance(p, tuple):
5290 d, p = p
5291 self.__dict__.update(d)
5292 return self._set_from_binary(p)
5293
5294
5295# Register CysteineCrossLinkData in _IMP_isd:
5296_IMP_isd.CysteineCrossLinkData_swigregister(CysteineCrossLinkData)
5297class CrossLinkData(IMP.Object):
5298 r"""Proxy of C++ IMP::isd::CrossLinkData class."""
5299
5300 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5301
5302 def __init__(self, *args):
5303 r"""
5304 __init__(CrossLinkData self, IMP::Floats dist_grid, IMP::Floats omega_grid, IMP::Floats sigma_grid, double lexp_, double don=std::numeric_limits< double >::max(), double doff=std::numeric_limits< double >::max(), int prior_type=0) -> CrossLinkData
5305 __init__(CrossLinkData self, IMP::Floats dist_grid, IMP::Floats omega_grid, IMP::Floats sigma_grid, IMP::Floats pot_x_grid, IMP::Floats pot_value_grid, double don=std::numeric_limits< double >::max(), double doff=std::numeric_limits< double >::max(), int prior_type=0) -> CrossLinkData
5306 __init__(CrossLinkData self) -> CrossLinkData
5307 """
5308 _IMP_isd.CrossLinkData_swiginit(self, _IMP_isd.new_CrossLinkData(*args))
5309
5310 def get_closest(self, vec, value):
5311 r"""get_closest(CrossLinkData self, DistBase vec, double value) -> int"""
5312 return _IMP_isd.CrossLinkData_get_closest(self, vec, value)
5313
5314 def get_omegas(self, sigma, dists):
5315 r"""get_omegas(CrossLinkData self, double sigma, IMP::Floats dists) -> IMP::Floats"""
5316 return _IMP_isd.CrossLinkData_get_omegas(self, sigma, dists)
5317
5318 def get_omega_prior(self, omega, omega0):
5319 r"""get_omega_prior(CrossLinkData self, double omega, double omega0) -> double"""
5320 return _IMP_isd.CrossLinkData_get_omega_prior(self, omega, omega0)
5321
5322 def get_nonmarginal_elements(self, sigmai, dists):
5323 r"""get_nonmarginal_elements(CrossLinkData self, double sigmai, IMP::Floats dists) -> IMP::Floats"""
5324 return _IMP_isd.CrossLinkData_get_nonmarginal_elements(self, sigmai, dists)
5325
5326 def get_marginal_elements(self, sigma, dists):
5327 r"""get_marginal_elements(CrossLinkData self, double sigma, IMP::Floats dists) -> IMP::Floats"""
5328 return _IMP_isd.CrossLinkData_get_marginal_elements(self, sigma, dists)
5329
5330 def get_marginal_maximum(self, *args):
5331 r"""
5332 get_marginal_maximum(CrossLinkData self, double sigma) -> double
5333 get_marginal_maximum(CrossLinkData self) -> double
5334 """
5335 return _IMP_isd.CrossLinkData_get_marginal_maximum(self, *args)
5336
5337 def get_version_info(self):
5338 r"""get_version_info(CrossLinkData self) -> VersionInfo"""
5339 return _IMP_isd.CrossLinkData_get_version_info(self)
5340 __swig_destroy__ = _IMP_isd.delete_CrossLinkData
5341
5342 def __str__(self):
5343 r"""__str__(CrossLinkData self) -> std::string"""
5344 return _IMP_isd.CrossLinkData___str__(self)
5345
5346 def __repr__(self):
5347 r"""__repr__(CrossLinkData self) -> std::string"""
5348 return _IMP_isd.CrossLinkData___repr__(self)
5349
5350 @staticmethod
5351 def get_from(o):
5352 return _object_cast_to_CrossLinkData(o)
5353
5354
5355 def _get_as_binary(self):
5356 r"""_get_as_binary(CrossLinkData self) -> PyObject *"""
5357 return _IMP_isd.CrossLinkData__get_as_binary(self)
5358
5359 def _set_from_binary(self, p):
5360 r"""_set_from_binary(CrossLinkData self, PyObject * p)"""
5361 return _IMP_isd.CrossLinkData__set_from_binary(self, p)
5362
5363 def __getstate__(self):
5364 p = self._get_as_binary()
5365 if len(self.__dict__) > 1:
5366 d = self.__dict__.copy()
5367 del d['this']
5368 p = (d, p)
5369 return p
5370
5371 def __setstate__(self, p):
5372 if not hasattr(self, 'this'):
5373 self.__init__()
5374 if isinstance(p, tuple):
5375 d, p = p
5376 self.__dict__.update(d)
5377 return self._set_from_binary(p)
5378
5379
5380# Register CrossLinkData in _IMP_isd:
5381_IMP_isd.CrossLinkData_swigregister(CrossLinkData)
5382class CysteineCrossLinkRestraint(IMP.Restraint):
5383 r"""Proxy of C++ IMP::isd::CysteineCrossLinkRestraint class."""
5384
5385 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5386
5387 def __init__(self, *args):
5388 r"""
5389 __init__(CysteineCrossLinkRestraint self, Model m, _ParticleIndexAdaptor beta, _ParticleIndexAdaptor sigma, _ParticleIndexAdaptor epsilon, _ParticleIndexAdaptor weight, CrossLinkData data, double fexp) -> CysteineCrossLinkRestraint
5390 __init__(CysteineCrossLinkRestraint self, Model m, _ParticleIndexAdaptor beta, _ParticleIndexAdaptor sigma, _ParticleIndexAdaptor epsilon, _ParticleIndexAdaptor weight, CrossLinkData data, CysteineCrossLinkData ccldata) -> CysteineCrossLinkRestraint
5391 __init__(CysteineCrossLinkRestraint self) -> CysteineCrossLinkRestraint
5392 """
5393 _IMP_isd.CysteineCrossLinkRestraint_swiginit(self, _IMP_isd.new_CysteineCrossLinkRestraint(*args))
5394
5395 def get_probability(self):
5396 r"""get_probability(CysteineCrossLinkRestraint self) -> double"""
5397 return _IMP_isd.CysteineCrossLinkRestraint_get_probability(self)
5398
5399 def get_standard_error(self):
5400 r"""get_standard_error(CysteineCrossLinkRestraint self) -> double"""
5401 return _IMP_isd.CysteineCrossLinkRestraint_get_standard_error(self)
5402
5403 def get_frequencies(self):
5404 r"""get_frequencies(CysteineCrossLinkRestraint self) -> IMP::Floats"""
5405 return _IMP_isd.CysteineCrossLinkRestraint_get_frequencies(self)
5406
5407 def get_model_frequency(self):
5408 r"""get_model_frequency(CysteineCrossLinkRestraint self) -> double"""
5409 return _IMP_isd.CysteineCrossLinkRestraint_get_model_frequency(self)
5410
5411 def get_distances(self):
5412 r"""get_distances(CysteineCrossLinkRestraint self) -> IMP::Floats"""
5413 return _IMP_isd.CysteineCrossLinkRestraint_get_distances(self)
5414
5415 def get_truncated_normalization(self, mean, sigma):
5416 r"""get_truncated_normalization(CysteineCrossLinkRestraint self, double mean, double sigma) -> double"""
5417 return _IMP_isd.CysteineCrossLinkRestraint_get_truncated_normalization(self, mean, sigma)
5418
5419 def get_normal_pdf(self, mean, sigma, x):
5420 r"""get_normal_pdf(CysteineCrossLinkRestraint self, double mean, double sigma, double x) -> double"""
5421 return _IMP_isd.CysteineCrossLinkRestraint_get_normal_pdf(self, mean, sigma, x)
5422
5423 def add_contribution(self, *args):
5424 r"""
5425 add_contribution(CysteineCrossLinkRestraint self, _ParticleIndexAdaptor p1, _ParticleIndexAdaptor p2)
5426 add_contribution(CysteineCrossLinkRestraint self, IMP::ParticleIndexes p1, IMP::ParticleIndexes p2)
5427 """
5428 return _IMP_isd.CysteineCrossLinkRestraint_add_contribution(self, *args)
5429
5430 def get_CB_coordinates(self, ps):
5431 r"""get_CB_coordinates(CysteineCrossLinkRestraint self, IMP::ParticleIndexes const & ps) -> Vector3D"""
5432 return _IMP_isd.CysteineCrossLinkRestraint_get_CB_coordinates(self, ps)
5433
5434 def get_number_of_contributions(self):
5435 r"""get_number_of_contributions(CysteineCrossLinkRestraint self) -> unsigned int"""
5436 return _IMP_isd.CysteineCrossLinkRestraint_get_number_of_contributions(self)
5437
5438 def do_get_inputs(self):
5439 r"""do_get_inputs(CysteineCrossLinkRestraint self) -> IMP::ModelObjectsTemp"""
5440 return _IMP_isd.CysteineCrossLinkRestraint_do_get_inputs(self)
5441
5442 def get_version_info(self):
5443 r"""get_version_info(CysteineCrossLinkRestraint self) -> VersionInfo"""
5444 return _IMP_isd.CysteineCrossLinkRestraint_get_version_info(self)
5445 __swig_destroy__ = _IMP_isd.delete_CysteineCrossLinkRestraint
5446
5447 def __str__(self):
5448 r"""__str__(CysteineCrossLinkRestraint self) -> std::string"""
5449 return _IMP_isd.CysteineCrossLinkRestraint___str__(self)
5450
5451 def __repr__(self):
5452 r"""__repr__(CysteineCrossLinkRestraint self) -> std::string"""
5453 return _IMP_isd.CysteineCrossLinkRestraint___repr__(self)
5454
5455 @staticmethod
5456 def get_from(o):
5457 return _object_cast_to_CysteineCrossLinkRestraint(o)
5458
5459
5460 def _get_as_binary(self):
5461 r"""_get_as_binary(CysteineCrossLinkRestraint self) -> PyObject *"""
5462 return _IMP_isd.CysteineCrossLinkRestraint__get_as_binary(self)
5463
5464 def _set_from_binary(self, p):
5465 r"""_set_from_binary(CysteineCrossLinkRestraint self, PyObject * p)"""
5466 return _IMP_isd.CysteineCrossLinkRestraint__set_from_binary(self, p)
5467
5468 def __getstate__(self):
5469 p = self._get_as_binary()
5470 if len(self.__dict__) > 1:
5471 d = self.__dict__.copy()
5472 del d['this']
5473 p = (d, p)
5474 return p
5475
5476 def __setstate__(self, p):
5477 if not hasattr(self, 'this'):
5478 self.__init__()
5479 if isinstance(p, tuple):
5480 d, p = p
5481 self.__dict__.update(d)
5482 return self._set_from_binary(p)
5483
5484
5485# Register CysteineCrossLinkRestraint in _IMP_isd:
5486_IMP_isd.CysteineCrossLinkRestraint_swigregister(CysteineCrossLinkRestraint)
5487class WeightMover(IMP.core.MonteCarloMover):
5488 r"""Proxy of C++ IMP::isd::WeightMover class."""
5489
5490 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5491
5492 def __init__(self, w, radius):
5493 r"""__init__(WeightMover self, Particle w, IMP::Float radius) -> WeightMover"""
5494 _IMP_isd.WeightMover_swiginit(self, _IMP_isd.new_WeightMover(w, radius))
5495
5496 def set_radius(self, radius):
5497 r"""set_radius(WeightMover self, IMP::Float radius)"""
5498 return _IMP_isd.WeightMover_set_radius(self, radius)
5499
5500 def get_radius(self):
5501 r"""get_radius(WeightMover self) -> IMP::Float"""
5502 return _IMP_isd.WeightMover_get_radius(self)
5503
5504 def get_version_info(self):
5505 r"""get_version_info(WeightMover self) -> VersionInfo"""
5506 return _IMP_isd.WeightMover_get_version_info(self)
5507 __swig_destroy__ = _IMP_isd.delete_WeightMover
5508
5509 def __str__(self):
5510 r"""__str__(WeightMover self) -> std::string"""
5511 return _IMP_isd.WeightMover___str__(self)
5512
5513 def __repr__(self):
5514 r"""__repr__(WeightMover self) -> std::string"""
5515 return _IMP_isd.WeightMover___repr__(self)
5516
5517 @staticmethod
5518 def get_from(o):
5519 return _object_cast_to_WeightMover(o)
5520
5521
5522# Register WeightMover in _IMP_isd:
5523_IMP_isd.WeightMover_swigregister(WeightMover)
5524class WeightRestraint(IMP.Restraint):
5525 r"""Proxy of C++ IMP::isd::WeightRestraint class."""
5526
5527 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5528
5529 def __init__(self, w, wmin, wmax, kappa):
5530 r"""__init__(WeightRestraint self, Particle w, IMP::Float wmin, IMP::Float wmax, IMP::Float kappa) -> WeightRestraint"""
5531 _IMP_isd.WeightRestraint_swiginit(self, _IMP_isd.new_WeightRestraint(w, wmin, wmax, kappa))
5532
5533 def do_get_inputs(self):
5534 r"""do_get_inputs(WeightRestraint self) -> IMP::ModelObjectsTemp"""
5535 return _IMP_isd.WeightRestraint_do_get_inputs(self)
5536
5537 def get_version_info(self):
5538 r"""get_version_info(WeightRestraint self) -> VersionInfo"""
5539 return _IMP_isd.WeightRestraint_get_version_info(self)
5540 __swig_destroy__ = _IMP_isd.delete_WeightRestraint
5541
5542 def __str__(self):
5543 r"""__str__(WeightRestraint self) -> std::string"""
5544 return _IMP_isd.WeightRestraint___str__(self)
5545
5546 def __repr__(self):
5547 r"""__repr__(WeightRestraint self) -> std::string"""
5548 return _IMP_isd.WeightRestraint___repr__(self)
5549
5550 @staticmethod
5551 def get_from(o):
5552 return _object_cast_to_WeightRestraint(o)
5553
5554
5555# Register WeightRestraint in _IMP_isd:
5556_IMP_isd.WeightRestraint_swigregister(WeightRestraint)
5557class AtomicCrossLinkMSRestraint(IMP.Restraint):
5558 r"""Proxy of C++ IMP::isd::AtomicCrossLinkMSRestraint class."""
5559
5560 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5561
5562 def __init__(self, *args):
5563 r"""
5564 __init__(AtomicCrossLinkMSRestraint self, Model m, double length, ParticleIndex psi, IMP::Float slope=0.0, bool part_of_log_score=False, std::string name="AtomicCrossLinkMSRestraint%1%") -> AtomicCrossLinkMSRestraint
5565 __init__(AtomicCrossLinkMSRestraint self) -> AtomicCrossLinkMSRestraint
5566 """
5567 _IMP_isd.AtomicCrossLinkMSRestraint_swiginit(self, _IMP_isd.new_AtomicCrossLinkMSRestraint(*args))
5568
5569 def add_contribution(self, ppi, sigmas):
5570 r"""add_contribution(AtomicCrossLinkMSRestraint self, IMP::ParticleIndexPair const & ppi, IMP::ParticleIndexPair const & sigmas)"""
5571 return _IMP_isd.AtomicCrossLinkMSRestraint_add_contribution(self, ppi, sigmas)
5572
5573 def evaluate_for_contributions(self, c, accum):
5574 r"""evaluate_for_contributions(AtomicCrossLinkMSRestraint self, IMP::Ints c, DerivativeAccumulator accum) -> IMP::Float"""
5575 return _IMP_isd.AtomicCrossLinkMSRestraint_evaluate_for_contributions(self, c, accum)
5576
5577 def get_number_of_contributions(self):
5578 r"""get_number_of_contributions(AtomicCrossLinkMSRestraint self) -> unsigned int"""
5579 return _IMP_isd.AtomicCrossLinkMSRestraint_get_number_of_contributions(self)
5580
5581 def get_contribution(self, i):
5582 r"""get_contribution(AtomicCrossLinkMSRestraint self, int i) -> IMP::ParticleIndexPair"""
5583 return _IMP_isd.AtomicCrossLinkMSRestraint_get_contribution(self, i)
5584
5585 def get_contribution_sigmas(self, i):
5586 r"""get_contribution_sigmas(AtomicCrossLinkMSRestraint self, int i) -> IMP::ParticleIndexPair"""
5587 return _IMP_isd.AtomicCrossLinkMSRestraint_get_contribution_sigmas(self, i)
5588
5589 def get_psi(self):
5590 r"""get_psi(AtomicCrossLinkMSRestraint self) -> ParticleIndex"""
5591 return _IMP_isd.AtomicCrossLinkMSRestraint_get_psi(self)
5592
5593 def do_get_inputs(self):
5594 r"""do_get_inputs(AtomicCrossLinkMSRestraint self) -> IMP::ModelObjectsTemp"""
5595 return _IMP_isd.AtomicCrossLinkMSRestraint_do_get_inputs(self)
5596
5597 def show(self, out):
5598 r"""show(AtomicCrossLinkMSRestraint self, _ostream out)"""
5599 return _IMP_isd.AtomicCrossLinkMSRestraint_show(self, out)
5600
5601 def set_slope(self, slope):
5602 r"""set_slope(AtomicCrossLinkMSRestraint self, IMP::Float slope)"""
5603 return _IMP_isd.AtomicCrossLinkMSRestraint_set_slope(self, slope)
5604
5605 def set_part_of_log_score(self, hey):
5606 r"""set_part_of_log_score(AtomicCrossLinkMSRestraint self, bool hey)"""
5607 return _IMP_isd.AtomicCrossLinkMSRestraint_set_part_of_log_score(self, hey)
5608
5609 def get_version_info(self):
5610 r"""get_version_info(AtomicCrossLinkMSRestraint self) -> VersionInfo"""
5611 return _IMP_isd.AtomicCrossLinkMSRestraint_get_version_info(self)
5612 __swig_destroy__ = _IMP_isd.delete_AtomicCrossLinkMSRestraint
5613
5614 def __str__(self):
5615 r"""__str__(AtomicCrossLinkMSRestraint self) -> std::string"""
5616 return _IMP_isd.AtomicCrossLinkMSRestraint___str__(self)
5617
5618 def __repr__(self):
5619 r"""__repr__(AtomicCrossLinkMSRestraint self) -> std::string"""
5620 return _IMP_isd.AtomicCrossLinkMSRestraint___repr__(self)
5621
5622 @staticmethod
5623 def get_from(o):
5624 return _object_cast_to_AtomicCrossLinkMSRestraint(o)
5625
5626
5627 def _get_as_binary(self):
5628 r"""_get_as_binary(AtomicCrossLinkMSRestraint self) -> PyObject *"""
5629 return _IMP_isd.AtomicCrossLinkMSRestraint__get_as_binary(self)
5630
5631 def _set_from_binary(self, p):
5632 r"""_set_from_binary(AtomicCrossLinkMSRestraint self, PyObject * p)"""
5633 return _IMP_isd.AtomicCrossLinkMSRestraint__set_from_binary(self, p)
5634
5635 def __getstate__(self):
5636 p = self._get_as_binary()
5637 if len(self.__dict__) > 1:
5638 d = self.__dict__.copy()
5639 del d['this']
5640 p = (d, p)
5641 return p
5642
5643 def __setstate__(self, p):
5644 if not hasattr(self, 'this'):
5645 self.__init__()
5646 if isinstance(p, tuple):
5647 d, p = p
5648 self.__dict__.update(d)
5649 return self._set_from_binary(p)
5650
5651
5652# Register AtomicCrossLinkMSRestraint in _IMP_isd:
5653_IMP_isd.AtomicCrossLinkMSRestraint_swigregister(AtomicCrossLinkMSRestraint)
5654class GaussianEMRestraint(IMP.Restraint):
5655 r"""Proxy of C++ IMP::isd::GaussianEMRestraint class."""
5656
5657 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5658
5659 def __init__(self, *args):
5660 r"""
5661 __init__(GaussianEMRestraint self, Model mdl, IMP::ParticleIndexes model_ps, IMP::ParticleIndexes density_ps, ParticleIndex global_sigma, IMP::Float model_cutoff_dist, IMP::Float density_cutoff_dist, IMP::Float slope, bool update_model=True, bool backbone_slope=False, bool local=False, std::string name="GaussianEMRestraint%1%") -> GaussianEMRestraint
5662 __init__(GaussianEMRestraint self) -> GaussianEMRestraint
5663 """
5664 _IMP_isd.GaussianEMRestraint_swiginit(self, _IMP_isd.new_GaussianEMRestraint(*args))
5665
5666 def get_probability(self):
5667 r"""get_probability(GaussianEMRestraint self) -> double"""
5668 return _IMP_isd.GaussianEMRestraint_get_probability(self)
5669
5670 def get_cross_correlation_coefficient(self):
5671 r"""get_cross_correlation_coefficient(GaussianEMRestraint self) -> double"""
5672 return _IMP_isd.GaussianEMRestraint_get_cross_correlation_coefficient(self)
5673
5674 def set_density_filename(self, density_fn):
5675 r"""set_density_filename(GaussianEMRestraint self, std::string density_fn)"""
5676 return _IMP_isd.GaussianEMRestraint_set_density_filename(self, density_fn)
5677
5678 def compute_initial_scores(self):
5679 r"""compute_initial_scores(GaussianEMRestraint self)"""
5680 return _IMP_isd.GaussianEMRestraint_compute_initial_scores(self)
5681
5682 def set_slope(self, s):
5683 r"""set_slope(GaussianEMRestraint self, IMP::Float s)"""
5684 return _IMP_isd.GaussianEMRestraint_set_slope(self, s)
5685
5686 def get_slope(self):
5687 r"""get_slope(GaussianEMRestraint self) -> IMP::Float"""
5688 return _IMP_isd.GaussianEMRestraint_get_slope(self)
5689
5690 def get_model_particle_indexes(self):
5691 r"""get_model_particle_indexes(GaussianEMRestraint self) -> IMP::ParticleIndexes"""
5692 return _IMP_isd.GaussianEMRestraint_get_model_particle_indexes(self)
5693
5694 def get_density_particle_indexes(self):
5695 r"""get_density_particle_indexes(GaussianEMRestraint self) -> IMP::ParticleIndexes"""
5696 return _IMP_isd.GaussianEMRestraint_get_density_particle_indexes(self)
5697
5698 def get_slope_particle_indexes(self):
5699 r"""get_slope_particle_indexes(GaussianEMRestraint self) -> IMP::ParticleIndexes"""
5700 return _IMP_isd.GaussianEMRestraint_get_slope_particle_indexes(self)
5701
5702 def get_model_cutoff_distance(self):
5703 r"""get_model_cutoff_distance(GaussianEMRestraint self) -> double"""
5704 return _IMP_isd.GaussianEMRestraint_get_model_cutoff_distance(self)
5705
5706 def get_density_cutoff_distance(self):
5707 r"""get_density_cutoff_distance(GaussianEMRestraint self) -> double"""
5708 return _IMP_isd.GaussianEMRestraint_get_density_cutoff_distance(self)
5709
5710 def get_is_local(self):
5711 r"""get_is_local(GaussianEMRestraint self) -> bool"""
5712 return _IMP_isd.GaussianEMRestraint_get_is_local(self)
5713
5714 def get_density_density_score(self):
5715 r"""get_density_density_score(GaussianEMRestraint self) -> double"""
5716 return _IMP_isd.GaussianEMRestraint_get_density_density_score(self)
5717
5718 def get_model_self_score(self):
5719 r"""get_model_self_score(GaussianEMRestraint self) -> double"""
5720 return _IMP_isd.GaussianEMRestraint_get_model_self_score(self)
5721
5722 def do_get_inputs(self):
5723 r"""do_get_inputs(GaussianEMRestraint self) -> IMP::ModelObjectsTemp"""
5724 return _IMP_isd.GaussianEMRestraint_do_get_inputs(self)
5725
5726 def show(self, out):
5727 r"""show(GaussianEMRestraint self, _ostream out)"""
5728 return _IMP_isd.GaussianEMRestraint_show(self, out)
5729
5730 def get_version_info(self):
5731 r"""get_version_info(GaussianEMRestraint self) -> VersionInfo"""
5732 return _IMP_isd.GaussianEMRestraint_get_version_info(self)
5733 __swig_destroy__ = _IMP_isd.delete_GaussianEMRestraint
5734
5735 def __str__(self):
5736 r"""__str__(GaussianEMRestraint self) -> std::string"""
5737 return _IMP_isd.GaussianEMRestraint___str__(self)
5738
5739 def __repr__(self):
5740 r"""__repr__(GaussianEMRestraint self) -> std::string"""
5741 return _IMP_isd.GaussianEMRestraint___repr__(self)
5742
5743 @staticmethod
5744 def get_from(o):
5745 return _object_cast_to_GaussianEMRestraint(o)
5746
5747
5748 def _get_as_binary(self):
5749 r"""_get_as_binary(GaussianEMRestraint self) -> PyObject *"""
5750 return _IMP_isd.GaussianEMRestraint__get_as_binary(self)
5751
5752 def _set_from_binary(self, p):
5753 r"""_set_from_binary(GaussianEMRestraint self, PyObject * p)"""
5754 return _IMP_isd.GaussianEMRestraint__set_from_binary(self, p)
5755
5756 def __getstate__(self):
5757 p = self._get_as_binary()
5758 if len(self.__dict__) > 1:
5759 d = self.__dict__.copy()
5760 del d['this']
5761 p = (d, p)
5762 return p
5763
5764 def __setstate__(self, p):
5765 if not hasattr(self, 'this'):
5766 self.__init__()
5767 if isinstance(p, tuple):
5768 d, p = p
5769 self.__dict__.update(d)
5770 return self._set_from_binary(p)
5771
5772
5773 def _get_jax(self, space):
5774 """Get a JAX implementation of this restraint.
5775
5776 Unlike the C++ implementation, which uses close pair containers
5777 (which may contain some pairs up to the cutoff plus twice the
5778 slack), every model-model and model-density pair is considered
5779 here, and only those whose sphere distance is less than the
5780 cutoff are scored. Model Gaussian covariances are calculated
5781 from the current orientation of each Gaussian, so the score
5782 can also be differentiated with respect to orientation. Masses,
5783 variances, and density Gaussian covariances are assumed to
5784 be fixed.
5785
5786 Periodic boundary conditions are not supported, since EM
5787 density maps are not periodic."""
5788 import numpy as np
5789 import jax
5790 import jax.numpy as jnp
5791 import IMP.jax
5792 import IMP.core
5793 import IMP.atom
5794 import IMP.core._jax_rigid
5795 from IMP.algebra.jax import _quaternion_to_rotation_matrix
5796 from IMP.isd._jax_util import get_gaussian_overlap
5797
5798 if space is not IMP.jax.FreeSpace:
5799 raise NotImplementedError(
5800 "GaussianEMRestraint does not support periodic boundaries")
5801
5802 m = self.get_model()
5803
5804 def get_indexes(pis):
5805 return np.array([int(p) for p in pis], dtype=int)
5806
5807 model_pis = self.get_model_particle_indexes()
5808 density_pis = self.get_density_particle_indexes()
5809 model_ps = get_indexes(model_pis)
5810 density_ps = get_indexes(density_pis)
5811 slope_ps = get_indexes(self.get_slope_particle_indexes())
5812 model_mass = np.array([IMP.atom.Mass(m, p).get_mass()
5813 for p in model_pis])
5814 density_mass = np.array([IMP.atom.Mass(m, p).get_mass()
5815 for p in density_pis])
5816 model_var = np.array([IMP.core.Gaussian(m, p).get_variances()
5817 for p in model_pis])
5818 density_covar = np.array(
5819 [np.asarray(IMP.core.Gaussian(m, p).get_global_covariance())
5820 for p in density_pis])
5821 # Each Gaussian is also a RigidBody; get the index into the
5822 # array of rigid body quaternions for each model Gaussian
5823 rb_from_particle = {
5824 int(p): i for (i, p) in enumerate(
5825 IMP.core._jax_rigid._get_rigid_body_indexes(m))}
5826 model_rbs = np.array([rb_from_particle[p] for p in model_ps],
5827 dtype=int)
5828 md_mass = model_mass[:, np.newaxis] * density_mass[np.newaxis, :]
5829 # Only score each model-model pair once (the score is doubled
5830 # below). These pairs never change, so use static indexes rather
5831 # than a mask so that only the needed overlaps are calculated.
5832 mm_i, mm_j = np.triu_indices(len(model_ps), k=1)
5833 mm_mass = model_mass[mm_i] * model_mass[mm_j]
5834 model_cutoff = self.get_model_cutoff_distance()
5835 density_cutoff = self.get_density_cutoff_distance()
5836 slope = self.get_slope()
5837 self_mm_score = self.get_model_self_score()
5838 local = self.get_is_local()
5839 if local:
5840 # Precalculate all density-density overlaps; only those for
5841 # density particles near the model are used during scoring
5842 dxyz = np.array([IMP.core.XYZ(m, p).get_coordinates()
5843 for p in density_pis])
5844 dd_matrix = get_gaussian_overlap(
5845 dxyz[np.newaxis, :] - dxyz[:, np.newaxis],
5846 density_covar[:, np.newaxis] + density_covar[np.newaxis, :],
5847 density_mass[:, np.newaxis] * density_mass[np.newaxis, :],
5848 xp=np)
5849 else:
5850 dd_score = self.get_density_density_score()
5851
5852 def get_close_mask(dist, r1, r2, cutoff):
5853 """Get pairs whose sphere distance is less than cutoff"""
5854 return dist - r1[:, jnp.newaxis] - r2[jnp.newaxis, :] < cutoff
5855
5856 def get_model_covariances(jm):
5857 quat = jm['rigid_bodies'].quaternion[model_rbs]
5858 # Note that this "rotation matrix" is the transpose of that
5859 # used in C++ (it is used to transform row vectors), so the
5860 # global covariance R diag(var) R^T is M^T diag(var) M
5861 rot = jax.vmap(_quaternion_to_rotation_matrix)(quat)
5862 return jnp.einsum('nji,nj,njk->nik', rot, model_var, rot)
5863
5864 def jax_score(jm):
5865 xyz = jm['xyz']
5866 radius = jm['r']
5867 xm = xyz[model_ps]
5868 xd = xyz[density_ps]
5869 rm = radius[model_ps]
5870 rd = radius[density_ps]
5871 cm = get_model_covariances(jm)
5872
5873 # Model-density overlap
5874 v_md = space.displacement(
5875 xd[jnp.newaxis, :] - xm[:, jnp.newaxis])
5876 ov_md = get_gaussian_overlap(
5877 v_md, cm[:, jnp.newaxis] + density_covar[jnp.newaxis, :],
5878 md_mass)
5879 md_mask = get_close_mask(space.distance(v_md), rm, rd,
5880 density_cutoff)
5881 md_score = jnp.sum(jnp.where(md_mask, ov_md, 0.))
5882
5883 # Model-model overlap
5884 v_mm = space.displacement(xm[mm_j] - xm[mm_i])
5885 ov_mm = get_gaussian_overlap(v_mm, cm[mm_i] + cm[mm_j], mm_mass)
5886 mm_mask = (space.distance(v_mm) - rm[mm_i] - rm[mm_j]
5887 < model_cutoff)
5888 mm_score = self_mm_score + 2. * jnp.sum(
5889 jnp.where(mm_mask, ov_mm, 0.))
5890
5891 # Density-density overlap
5892 if local:
5893 # Only consider density particles near the model
5894 local_dens = jnp.any(md_mask, axis=0)
5895 dd = jnp.sum(jnp.where(
5896 local_dens[:, jnp.newaxis] & local_dens[jnp.newaxis, :],
5897 dd_matrix, 0.))
5898 else:
5899 dd = dd_score
5900
5901 score = -jnp.log(2. * md_score / (mm_score + dd))
5902 if slope > 0.:
5903 # Clamp the distance so that the gradient is not NaN for
5904 # coincident model and density particles
5905 dist = space.distance(
5906 xyz[slope_ps][:, jnp.newaxis] - xd[jnp.newaxis, :],
5907 min_dist=1e-8)
5908 score = score + slope * jnp.sum(dist)
5909 return score
5910
5911 return self._wrap_jax(jax_score, keys=['rigid_bodies'])
5912
5913
5914# Register GaussianEMRestraint in _IMP_isd:
5915_IMP_isd.GaussianEMRestraint_swigregister(GaussianEMRestraint)
5916class GaussianAnchorEMRestraint(ISDRestraint):
5917 r"""Proxy of C++ IMP::isd::GaussianAnchorEMRestraint class."""
5918
5919 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5920
5921 def __init__(self, *args):
5922 r"""__init__(GaussianAnchorEMRestraint self, IMP::ParticlesTemp model_ps, IMP::Floats model_sigs, IMP::Floats model_weights, IMP::ParticlesTemp density_ps, IMP::Floats density_sigs, IMP::Floats density_weights, Particle global_sigma, IMP::Float cutoff_dist, bool rigid, bool tabexp, std::string name="GaussianAnchorEMRestraint%1%") -> GaussianAnchorEMRestraint"""
5923 _IMP_isd.GaussianAnchorEMRestraint_swiginit(self, _IMP_isd.new_GaussianAnchorEMRestraint(*args))
5924
5925 def get_density_particles(self):
5926 r"""get_density_particles(GaussianAnchorEMRestraint self) -> IMP::ParticlesTemp"""
5927 return _IMP_isd.GaussianAnchorEMRestraint_get_density_particles(self)
5928 __swig_destroy__ = _IMP_isd.delete_GaussianAnchorEMRestraint
5929
5930 def __str__(self):
5931 r"""__str__(GaussianAnchorEMRestraint self) -> std::string"""
5932 return _IMP_isd.GaussianAnchorEMRestraint___str__(self)
5933
5934 def __repr__(self):
5935 r"""__repr__(GaussianAnchorEMRestraint self) -> std::string"""
5936 return _IMP_isd.GaussianAnchorEMRestraint___repr__(self)
5937
5938 @staticmethod
5939 def get_from(o):
5940 return _object_cast_to_GaussianAnchorEMRestraint(o)
5941
5942
5943# Register GaussianAnchorEMRestraint in _IMP_isd:
5944_IMP_isd.GaussianAnchorEMRestraint_swigregister(GaussianAnchorEMRestraint)
5945class GammaPrior(IMP.Restraint):
5946 r"""Proxy of C++ IMP::isd::GammaPrior class."""
5947
5948 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5949
5950 def __init__(self, *args):
5951 r"""__init__(GammaPrior self, Model m, Particle p, IMP::Float k, IMP::Float theta, std::string name="GammaPrior%1%") -> GammaPrior"""
5952 _IMP_isd.GammaPrior_swiginit(self, _IMP_isd.new_GammaPrior(*args))
5953
5954 def evaluate_at(self, val):
5955 r"""evaluate_at(GammaPrior self, IMP::Float val) -> double"""
5956 return _IMP_isd.GammaPrior_evaluate_at(self, val)
5957
5958 def do_get_inputs(self):
5959 r"""do_get_inputs(GammaPrior self) -> IMP::ModelObjectsTemp"""
5960 return _IMP_isd.GammaPrior_do_get_inputs(self)
5961
5962 def get_version_info(self):
5963 r"""get_version_info(GammaPrior self) -> VersionInfo"""
5964 return _IMP_isd.GammaPrior_get_version_info(self)
5965 __swig_destroy__ = _IMP_isd.delete_GammaPrior
5966
5967 def get_probability(self):
5968 r"""get_probability(GammaPrior self) -> double"""
5969 return _IMP_isd.GammaPrior_get_probability(self)
5970
5971 def __str__(self):
5972 r"""__str__(GammaPrior self) -> std::string"""
5973 return _IMP_isd.GammaPrior___str__(self)
5974
5975 def __repr__(self):
5976 r"""__repr__(GammaPrior self) -> std::string"""
5977 return _IMP_isd.GammaPrior___repr__(self)
5978
5979 @staticmethod
5980 def get_from(o):
5981 return _object_cast_to_GammaPrior(o)
5982
5983
5984# Register GammaPrior in _IMP_isd:
5985_IMP_isd.GammaPrior_swigregister(GammaPrior)
5986
5987def sample_points_from_density(dmap_orig, npoints, threshold=0.0):
5988 r"""sample_points_from_density(DensityMap dmap_orig, int npoints, IMP::Float threshold=0.0) -> IMP::FloatsList"""
5989 return _IMP_isd.sample_points_from_density(dmap_orig, npoints, threshold)
5990class ResidueProteinProximityRestraint(IMP.Restraint):
5991 r"""Proxy of C++ IMP::isd::ResidueProteinProximityRestraint class."""
5992
5993 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
5994
5995 def __init__(self, *args):
5996 r"""__init__(ResidueProteinProximityRestraint self, Model m, double cutoff=6.0, double sigma=3.0, double xi=0.5, bool part_of_log_score=False, std::string name="ResidueProteinProximityRestraint_%1%") -> ResidueProteinProximityRestraint"""
5997 _IMP_isd.ResidueProteinProximityRestraint_swiginit(self, _IMP_isd.new_ResidueProteinProximityRestraint(*args))
5998
5999 def add_pairs_container(self, pc):
6000 r"""add_pairs_container(ResidueProteinProximityRestraint self, PairContainer pc)"""
6001 return _IMP_isd.ResidueProteinProximityRestraint_add_pairs_container(self, pc)
6002
6003 def add_contribution_particles(self, ppis1, ppis2):
6004 r"""add_contribution_particles(ResidueProteinProximityRestraint self, IMP::ParticleIndexes const ppis1, IMP::ParticleIndexes const ppis2)"""
6005 return _IMP_isd.ResidueProteinProximityRestraint_add_contribution_particles(self, ppis1, ppis2)
6006
6007 def evaluate_for_contributions(self, c):
6008 r"""evaluate_for_contributions(ResidueProteinProximityRestraint self, IMP::Ints c) -> double"""
6009 return _IMP_isd.ResidueProteinProximityRestraint_evaluate_for_contributions(self, c)
6010
6011 def get_number_of_contributions(self):
6012 r"""get_number_of_contributions(ResidueProteinProximityRestraint self) -> unsigned int"""
6013 return _IMP_isd.ResidueProteinProximityRestraint_get_number_of_contributions(self)
6014
6015 def set_sigma(self, sigma):
6016 r"""set_sigma(ResidueProteinProximityRestraint self, double sigma)"""
6017 return _IMP_isd.ResidueProteinProximityRestraint_set_sigma(self, sigma)
6018
6019 def set_cutoff(self, cutoff):
6020 r"""set_cutoff(ResidueProteinProximityRestraint self, double cutoff)"""
6021 return _IMP_isd.ResidueProteinProximityRestraint_set_cutoff(self, cutoff)
6022
6023 def set_max_score(self, max_score):
6024 r"""set_max_score(ResidueProteinProximityRestraint self, double max_score)"""
6025 return _IMP_isd.ResidueProteinProximityRestraint_set_max_score(self, max_score)
6026
6027 def set_yi(self, yi):
6028 r"""set_yi(ResidueProteinProximityRestraint self, double yi)"""
6029 return _IMP_isd.ResidueProteinProximityRestraint_set_yi(self, yi)
6030
6031 def set_interpolation_factor(self, interpolation_factor):
6032 r"""set_interpolation_factor(ResidueProteinProximityRestraint self, double interpolation_factor)"""
6033 return _IMP_isd.ResidueProteinProximityRestraint_set_interpolation_factor(self, interpolation_factor)
6034
6035 def set_part_of_log_score(self, hey):
6036 r"""set_part_of_log_score(ResidueProteinProximityRestraint self, bool hey)"""
6037 return _IMP_isd.ResidueProteinProximityRestraint_set_part_of_log_score(self, hey)
6038
6039 def do_get_inputs(self):
6040 r"""do_get_inputs(ResidueProteinProximityRestraint self) -> IMP::ModelObjectsTemp"""
6041 return _IMP_isd.ResidueProteinProximityRestraint_do_get_inputs(self)
6042
6043 def get_version_info(self):
6044 r"""get_version_info(ResidueProteinProximityRestraint self) -> VersionInfo"""
6045 return _IMP_isd.ResidueProteinProximityRestraint_get_version_info(self)
6046 __swig_destroy__ = _IMP_isd.delete_ResidueProteinProximityRestraint
6047
6048 def __str__(self):
6049 r"""__str__(ResidueProteinProximityRestraint self) -> std::string"""
6050 return _IMP_isd.ResidueProteinProximityRestraint___str__(self)
6051
6052 def __repr__(self):
6053 r"""__repr__(ResidueProteinProximityRestraint self) -> std::string"""
6054 return _IMP_isd.ResidueProteinProximityRestraint___repr__(self)
6055
6056 @staticmethod
6057 def get_from(o):
6058 return _object_cast_to_ResidueProteinProximityRestraint(o)
6059
6060
6061# Register ResidueProteinProximityRestraint in _IMP_isd:
6062_IMP_isd.ResidueProteinProximityRestraint_swigregister(ResidueProteinProximityRestraint)
6063
6064def _get_crosslink_jax_for_restraints(rs, space, forward_model):
6065 """Get a JAX function that scores the given list of crosslink
6066 restraints (CrossLinkMSRestraint or ExactCrossLinkMSRestraint),
6067 using the given forward model. They must all have the same length,
6068 slope and get_log_prob flag."""
6069 import jax.numpy as jnp
6070
6071 def get_probability(xyz, r, scale, ps, sigma, psi, length,
6072 slope, segment_prod):
6073# If the residues are assigned to the same particle-domain
6074# get the distance as if the residue positions were randomly
6075# taken from within the sphere representing the domain
6076# Lund O, Protein Eng. 1997 Nov;10(11):1241-8.
6077# Let the space clamp the distance, so that the gradient is
6078# zero, rather than NaN, for coincident points and for
6079# same-particle contributions (which don't use the distance)
6080 dist = jnp.where(
6081 ps[:, 0] == ps[:, 1], 36.0 / 35.0 * r[ps[:, 0]],
6082 space.distance(xyz[ps[:, 0]] - xyz[ps[:, 1]],
6083 min_dist=0.0001))
6084 dist = jnp.maximum(dist, 0.0001)
6085 psi = scale[psi]
6086 sigmai = scale[sigma[:, 0]]
6087 sigmaj = scale[sigma[:, 1]]
6088
6089 pofr = forward_model(dist, sigmai, sigmaj, length)
6090 term = psi * (1.0 - pofr) + pofr * (1.0 - psi)
6091 if slope is not None:
6092 prior = jnp.exp(-slope * dist)
6093 term = term * prior
6094 onemprob = 1.0 - term
6095
6096 if segment_prod is None:
6097# If only one contribution to each restraint, we are done
6098 return 1.0 - onemprob
6099 else:
6100# Otherwise, take the product of all contributions to each
6101# restraint
6102 return 1.0 - segment_prod(onemprob.T).T
6103
6104 for r in rs:
6105 if r.get_is_length_variable():
6106 raise NotImplementedError("Only implemented for fixed-length")
6107 sigma = CrossLinkMSRestraint._get_contributions_sigma_numpy(rs)
6108 psi = CrossLinkMSRestraint._get_contributions_psi_numpy(rs)
6109 pis = CrossLinkMSRestraint._get_contributions_particles_numpy(rs)
6110 segments = CrossLinkMSRestraint._get_contributions_segments(rs)
6111 if segments is None:
6112 segment_prod = None
6113 else:
6114# jax.ops.segment_prod is not differentiable, so use our own
6115 from IMP.isd._jax_util import get_segment_prod
6116 segment_prod = get_segment_prod(segments, len(rs))
6117 get_log_prob = rs[0].get_log_prob()
6118 length = rs[0].get_length()
6119 slope = rs[0].get_slope() if rs[0].get_has_slope() else None
6120
6121 def jax_restraint(X):
6122 prob = get_probability(X['xyz'], X['r'], X['nuisance'], pis,
6123 sigma, psi, length, slope, segment_prod)
6124 if get_log_prob:
6125 return -jnp.log(prob)
6126 else:
6127 return prob
6128
6129# Note that we don't weight the restraint anywhere. This matches
6130# the behavior of the C++ restraint.
6131 return rs[0]._wrap_jax_multiple(rs[0], jax_restraint,
6132 keys=[Scale.get_scale_key()])
6133
6134
6135def _get_crosslink_jax_multiple(cls, restraints, space):
6136 """Get JAX functions for all restraints of type cls in the list"""
6137 import IMP._jax_util
6138# Get all groups of crosslink restraints that have the same length
6139# and slope (to 4 decimal places) and get_log_prob flag
6140 def rsrkey(r):
6141 if type(r) is cls:
6142 return ("%.4f" % r.get_length(),
6143 "%.4f" % r.get_slope() if r.get_has_slope() else None,
6144 r.get_log_prob())
6145 groups, ungrouped = IMP._jax_util.get_grouped_restraints(
6146 restraints, rsrkey)
6147
6148 return ([cls._get_jax_for_restraints(g, space) for g in groups],
6149 ungrouped)
6150
6151
6152def get_module_name():
6153 r"""get_module_name() -> std::string const"""
6154 return _IMP_isd.get_module_name()
6155
6156def get_module_version():
6157 r"""get_module_version() -> std::string const"""
6158 return _IMP_isd.get_module_version()
6159
6160def get_example_path(fname):
6161 r"""get_example_path(std::string fname) -> std::string"""
6162 return _IMP_isd.get_example_path(fname)
6163
6164def get_data_path(fname):
6165 r"""get_data_path(std::string fname) -> std::string"""
6166 return _IMP_isd.get_data_path(fname)
6167
6168from . import _version_check
6169_version_check.check_version(get_module_version())
6170__version__ = get_module_version()
6171
6172