Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
|
Authors: F. Cazals and T. Dreyfus and S. Loriot
This package provides a generic geometric data structure and algorithm for computing the surface area and the volume of the union of a family of 3D balls. Compared to other algorithms, it warranties:
Calculations are handled in a "as most as possible" exact (due to trigonometric functions, the volume and surface area cannot be exact), or using interval arithmetics.
Having commented above on the decomposition of a union of balls into restrictions, it is sufficient to comment on the geometry of a restriction. As established in [43] , a partition of a restriction can be defined using two types of pyramids, as shown on Fig. Pyramides:
As established using Gauss' divergence theorem, computing the volume of a pyramid is easily done from the surface area of its base [43] , be it flat or curvy:
Thus, the primitive algorithm is the computation of the boundary of the union [4] , which is implemented in the package Union_of_balls_boundary_3.
Partitioning a restriction. The two types of pyramides |
The main class is SBL::GT::T_Union_of_Balls_surface_volume_3< AlphaComplex3 , SphericalKernel3 , Union_of_balls_boundary_3 > : it takes as input a family of 3D balls, and stores for each 3D ball its contribution to the surface area and volume of the union of the whole family. The three template parameters are:
An example of use of SBL::GT::T_Union_of_Balls_surface_volume_3 is shown in section Computing the Volume and Surface Area of Input 3D Balls .
The class SBL::GT::T_Union_of_Balls_surface_volume_3 is partially serializable – see the section Partial Serialization. The partial serialization becomes available by including the file SBL/IO/Union_of_balls_surface_volume_3_oserialization.hpp in the source file where it is required.
An example of partial serialization of SBL::GT::T_Union_of_Balls_surface_volume_3 is shown in section Serializing the Contributions of 3D Balls to the Volume and Surface Area of their Union .
This package provides also the module SBL::CSB::T_Union_of_balls_surface_volume_3_module< ModuleTraits , OutputArchive > that computes the surface area and the volume of the union of a family of 3D balls that are represented by:
In the first case, the computation of the boundary has to be done before computing the surface area and volume. The two template parameters are:
The module provides also options for switching between different computation modes (exact or interval arithmetics, number of floating points, etc...)
An example of usage of this module is shown in section Using Modules for Computing the Volume and Surface Area .
This example shows how to compute the surface area and the volume of the union of a family of 3D balls:
This example shows how to partially serialize the data structure SBL::CSB::T_Union_of_balls_surface_volume_3. The steps are the same as the example of section Computing the Volume and Surface Area of Input 3D Balls, except the third step, for which a Boost XML archive is created, and then the contribution of each 3D ball is partially serialized in this archive.
This example presents the module SBL::CSB::T_Union_of_balls_surface_volume_3_module: