debian/0000755000000000000000000000000012046425026007167 5ustar debian/changelog0000644000000000000000000001510012046425026011036 0ustar ball (1.4.1+20111206-4ubuntu2) raring; urgency=low * Rebuild against sip-api-9.0. -- Colin Watson Wed, 07 Nov 2012 09:29:56 +0000 ball (1.4.1+20111206-4ubuntu1) quantal; urgency=low * Transition to libglew1.8. -- Dmitrijs Ledkovs Sat, 08 Sep 2012 13:16:58 +0100 ball (1.4.1+20111206-4) unstable; urgency=low * Fix compilation with g++ >= 4.7 (Closes: 674226) * Updated policy to 3.9.3 (no changes required) -- Andreas Hildebrandt Wed, 15 Aug 2012 00:50:32 +0200 ball (1.4.1+20111206-3) unstable; urgency=low * Fixed "const" in .sip files (Closes: #653626) -- Steffen Moeller Fri, 06 Jan 2012 16:43:51 +0100 ball (1.4.1+20111206-2) unstable; urgency=low * Added "signed" to char because of platform differences -- Steffen Moeller Fri, 09 Dec 2011 13:55:01 +0100 ball (1.4.1+20111206-1) unstable; urgency=low * New upstream version. * Depending on ghostscript, not gs-common (Closes: #649711) -- Andreas Hildebrandt Thu, 08 Dec 2011 19:53:09 +0100 ball (1.4.1-1) UNRELEASED; urgency=low * Updated to new upstream release 1.4.1 -- Andreas Hildebrandt Thu, 20 Oct 2011 21:36:03 +0200 ball (1.4.0-5) unstable; urgency=low * Added myself to Uploaders * Rebuilt with current version of python (Closes: #632488). * Added dependency on texlive-latex-recommended and the build instructions should already separate the documentation from the rest (Closes: #631999). * Unsigned char issue was at some point already fixed (Closes: #631998). -- Steffen Moeller Fri, 22 Jul 2011 17:17:06 +0200 ball (1.4.0-4) UNRELEASED; urgency=low * Documentation packages are in conflict (Closes: #631911) * Removed (redundant) conflict of ballview to itself * Helped quirk in descrition (Closes: #598081) -- Andreas or Steffen Thu, 21 Jul 2011 17:55:28 +0200 ball (1.4.0-3) unstable; urgency=low * Added -fpermissive to compiler flags to avoid "narrowing" error -- Steffen Moeller Wed, 20 Jul 2011 17:47:51 +0200 ball (1.4.0-2) unstable; urgency=low * Addressing build failures (Closes: #615670, #631999) - removed -j2 in build instructions (Closes: #632483) - added texlive-recommends not covered by doxygen-latex -- Steffen Moeller Wed, 20 Jul 2011 15:19:18 +0200 ball (1.4.0-1) unstable; urgency=low [Andreas] * Updated to new upstream release 1.4.0 * Cherry-pick upstream patch for linguist files * Cherry-pick upstream patch for new DSO linking scheme * Updated policy to 3.9.2 * Split out arch-independent data package * Depend on libgl1-mesa-glx instead of libgl1-mesa-swx11 * Introduce suitable conflicts against older versions where necessary * Install cmake BALL exports and config * build-depend on doxygen-latex instead of texlive-* (Closes: 616200) * Split build dependencies into Build-Deps and Build-Deps-Indep [Steffen] * Moved all build instructions to debian/rules. * Corrected email address -- Andreas Hildebrandt Tue, 21 Jun 2011 18:29:51 +0200 ball (1.3.2-3) UNRELEASED; urgency=low [Steffen Moeller] * Updated policy to 3.8.4 (no changes required) * Added libgl1-mesa-swx11 explicitly as a dependency to ballview [Andreas Hildebrandt] * Depend on python-sip-dev instead of python-sip4-dev (Closes: #611072) -- Andreas Hildebrandt Tue, 01 Mar 2011 08:30:58 +0100 ball (1.3.2-2) unstable; urgency=low [Andreas Hildebrandt] * Improvements for CMake build system (Closes: 546311) * Some fixes for less common architectures and fixes in the sip dependencies (Closes: 565694) [Jonathan Wiltshire] * Depend on python-support and call dh_pysupport in debian/rules. Let python-support decide dependencies for python-ball and python-ballview. (Closes: #566036) -- Andreas Hildebrandt Thu, 11 Feb 2010 22:15:09 +0100 ball (1.3.2-1) unstable; urgency=low * Updated to new upstream release 1.3.2 -- Andreas Hildebrandt Tue, 19 Jan 2010 12:34:33 +0100 ball (1.3.1-2) unstable; urgency=low * Add python-sip4 as an explicit build-dependency (fixes an FTBFS) -- Andreas Hildebrandt Tue, 12 Jan 2010 10:25:36 +0100 ball (1.3.1-1) unstable; urgency=low * Updated to new upstream release 1.3.1 (Closes: 551241) * Switched from autoconf to CMake (Closes: 552809) -- Andreas Hildebrandt Fri, 18 Dec 2009 14:20:08 +0100 ball (1.3.0-2) UNRELEASED; urgency=low [ Andreas Hildebrandt ] * Increased dependency to python-sip4 to version 4.8.2, which would need to be adjusted for lenny (4.7.2). The real (unexpressable) dependency is to have the same version at build- and run-time. [Steffen] [ Charles Plessy ] * Documented informations in ‘debian/upstream-metadata.yaml’. -- Andreas Hildebrandt Thu, 17 Sep 2009 22:30:28 +0200 ball (1.3.0-1) unstable; urgency=low * New upstream release * BALL no longer uses gSoap (Closes: #542215) * Added s390 to list of supported processors (Closes: #546311) * Fixed broken maintainer address (Closes: #544932) * Updated policy-compliance to 3.8.3 (no changes reguired) * Updated build-dependencies to demand more recent libtool -- Andreas Hildebrandt Thu, 17 Sep 2009 22:30:28 +0200 ball (1.3+rc2-1) unstable; urgency=low * Removed debian/copyright entries for files no longer in the repository * Updated to new upstream release candidate * Removed build-dependency on libboost-asio-dev (Closes: #542251) * Some small packaging improvements -- Andreas Hildebrandt Thu, 17 Sep 2009 22:25:51 +0200 ball (1.3+beta2.1-2) unstable; urgency=low * Re-upload upon initial rejection to improve debian/copyright (Closes: #407665) * Improved Doc-Base * Eliminated two lintian warnings -- Andreas Hildebrandt Sun, 16 Aug 2009 01:23:30 +0200 ball (1.3+beta2.1-1) UNRELEASED; urgency=low * Preparing for new upstream version 1.3 (Closes: #407665) * Improvements for Debian packaging - providing VIEW-independent and -dependent debs - corrected for problematic copyright statements -- Andreas Hildebrandt Mon, 6 Jul 2009 17:43:00 +0100 ball (1.2-1) UNRELEASED; urgency=low * Initial packaging -- Andreas Hildebrandt Sun, 16 Nov 2008 20:24:32 +0100 debian/ballview.install0000644000000000000000000000005712013304225012355 0ustar debian/ballview.desktop usr/share/applications debian/rules0000755000000000000000000001665712013304225010255 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 export CFLAGS = -Wall -g -Wno-unused-variable -fpermissive -Wno-format-security ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif export CPPFLAGS=$(CFLAGS) SOVERSION=1.4 BALL_INSTALL_PATH=build PYTHON_VERSION=2.6 PYTHON_SITE_PATH=$(shell python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,0)[4:];") configure: configure-stamp configure-stamp: dh_testdir #bash debian/debian-ball-install configure mkdir build cd build && CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" cmake .. -DCMAKE_SOURCE_DIR=$(CURDIR) -DCMAKE_INSTALL_PREFIX=./usr -DBALL_PATH=/usr -DBALL_DATA_PATH=/usr/share/BALL-$(SOVERSION)/data touch $@ #build: build-stamp #build-stamp: build-arch-stamp build-indep-stamp # touch $@ build: echo "Please call either build-arch or build-indep" build-arch: build-arch-stamp build-arch-stamp: configure-stamp dh_testdir #bash debian/debian-ball-install build-arch make -C build BALL VIEW BALLView install touch $@ # The arch dependent bits need to be uilt also for the independent bits build-indep: build-arch-stamp build-indep-stamp build-indep-stamp: configure-stamp dh_testdir #bash debian/debian-ball-install build-arch make -C build doc doc_tutorial install touch $@ clean: dh_testdir dh_testroot #bash debian/debian-ball-install clean [ -d source ] && cd source ; \ if [ -f Makefile ] ; \ then \ make clean ; \ cd PYTHON/EXTENSIONS; \ make clean; \ rm -rf ../lib/Linux*; \ rm -rf ../doc/doxygen/latex/*; \ rm -f $(CURDIR)/source/config.status 2>/dev/null; \ fi rm -f data/BALLView/translations/BALLView.de_DE.qm rm -f data/BALLView/translations/BALLView.zh_TW.qm rm -f doc/TUTORIAL/*.aux rm -rf $(BALL_INSTALL_PATH) find . -name "*.o" | xargs -r rm find . -type l | xargs -r rm find doc/TUTORIAL/ -name "tutorial.*" | egrep -v ".(tex|bib)$$" |xargs -r rm find . -name "*.doc" -delete dh_clean build-stamp configure-stamp build-arch-stamp build-indep-stamp install-arch: build-arch dh_testdir dh_testroot dh_clean -k dh_installdirs mkdir -p debian/libball$(SOVERSION)/usr/lib \ debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION) \ debian/libballview$(SOVERSION)/usr/lib \ debian/python-ball/usr/share/BALL-$(SOVERSION) \ debian/python-ball/usr/$(PYTHON_SITE_PATH) \ debian/python-ballview/usr/$(PYTHON_SITE_PATH) mkdir -p debian/ballview/usr/share/BALL-$(SOVERSION)/data/graphics cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/BALLView/* debian/ballview/usr/share/doc/ballview/html cp $(BALL_INSTALL_PATH)/usr/bin/BALLView debian/ballview/usr/bin/ find $(BALL_INSTALL_PATH)/usr/lib/ -name libBALL*.so.* | xargs -r cp --target-directory debian/libball$(SOVERSION)/usr/lib/ find $(BALL_INSTALL_PATH)/usr/lib/ -name libVIEW*.so.* | xargs -r cp --target-directory debian/libballview$(SOVERSION)/usr/lib/ # debian needs the logo in the ballview - package, not in the libball cp $(BALL_INSTALL_PATH)/usr/share/BALL/data/graphics/ballview*.xpm debian/ballview/usr/share/pixmaps/ cp -r source/EXAMPLES/PYTHON debian/python-ball/usr/share/BALL-$(SOVERSION) cp $(BALL_INSTALL_PATH)/usr/lib/BALL.py debian/python-ball/usr/$(PYTHON_SITE_PATH) cp $(BALL_INSTALL_PATH)/usr/lib/BALLCore.so debian/python-ball/usr/$(PYTHON_SITE_PATH) cp $(BALL_INSTALL_PATH)/usr/lib/VIEW.so debian/python-ballview/usr/$(PYTHON_SITE_PATH) chmod ugo-x debian/python-ball/usr/share/BALL-$(SOVERSION)/PYTHON/UTILITIES/*.py chmod ugo-x debian/python-ball/usr/share/BALL-$(SOVERSION)/PYTHON/BALLView/*.py chmod ugo-x debian/python-ball/usr/share/BALL-$(SOVERSION)/PYTHON/howtos/*.py # -dev packages are arch dependent mkdir -p debian/libball$(SOVERSION)-dev/usr/lib \ debian/libballview$(SOVERSION)-dev/usr/include/BALL \ debian/libballview$(SOVERSION)-dev/usr/lib \ debian/libball$(SOVERSION)-dev/usr/include # move the cmake configuration files to their final location cp -R $(BALL_INSTALL_PATH)/usr/lib/cmake/ debian/libball$(SOVERSION)-dev/usr/lib cp -r $(BALL_INSTALL_PATH)/usr/include/BALL debian/libball$(SOVERSION)-dev/usr/include cp -r $(BALL_INSTALL_PATH)/usr/include/BALL/VIEW debian/libballview$(SOVERSION)-dev/usr/include/BALL # get rid of the VIEW includes in libball-dev rm -rf debian/libball$(SOVERSION)-dev/usr/include/BALL/VIEW # eliminating chrpath settings chmod 755 debian/ballview/usr/bin/BALLView chrpath -d debian/ballview/usr/bin/BALLView find debian -name "*.so" | xargs -r chrpath -d dh_pysupport -s dh_sip -s install-indep: build-indep dh_testdir dh_testroot dh_clean -k dh_installdirs mkdir -p debian/libball$(SOVERSION)-doc/usr/share/doc/libball$(SOVERSION)/html \ debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc cp $(BALL_INSTALL_PATH)/usr/share/BALL/doc/TUTORIAL/tutorial.pdf debian/libball$(SOVERSION)-doc/usr/share/doc/libball$(SOVERSION)/ cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/classes debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/internal debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc # we need the BALLView documentation in the data path as well... sorry for that cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/BALLView debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/doc cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/doc/BALL debian/libball$(SOVERSION)-doc/usr/share/doc/libball$(SOVERSION)/html cp -r $(BALL_INSTALL_PATH)/usr/share/BALL/data debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION) # This should already be fixed, by the debian permcheck #chmod ugo-x debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/data/QSAR/* #chmod ugo-x debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/data/CHARMM/charmm* #chmod ugo-x debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/data/graphics/* ##chmod 755 debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/data/graphics/QuEasy/ #chmod 755 debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/data/graphics/icons/ #chmod ugo-x debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/data/structures/* #chmod 755 debian/libball$(SOVERSION)-data/usr/share/BALL-$(SOVERSION)/data/structures/DB/ # links shoulds become relative # FIXME investigate how to achieve that properly #ln -s ${LIBBALL_TARGET} libball$(SOVERSION)-dev/usr/lib/libBALL.so #ln -s ${LIBVIEW_TARGET} libballview$(SOVERSION)-dev/usr/lib/libVIEW.so dh_pysupport -i dh_sip -i binary-common: dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples dh_install dh_installmenu # dh_python dh_installman dh_link dh_strip --dbg-package=ballview-dbg dh_compress dh_fixperms dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb # Build architecture independant packages using the common target. binary-indep: build-indep install-indep $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common # Build architecture dependant packages using the common target. binary-arch: build-arch install-arch $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common get-orig-source: if [ -x /usr/bin/uscan ]; then \ uscan --verbose --force-download ; \ else \ echo "uscan is not installed to perform the download." ; \ fi binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure build-arch build-indep debian/ballview.10000644000000000000000000000333412013304225011050 0ustar .\" Copyright 1998-2009 BALL project group .TH BALLView 1 "24 January 2009" .SH NAME BALLView - A free molecular modeling and molecular graphics tool .SH SYNOPSIS .B BALLView .RI [Molecular-file] .SH DESCRIPTION .B BALLView BALLView provides fast OpenGL-based visualization of molecular structures, molecular mechanics methods (minimization, MD simulation using the AMBER and CHARMM force fields), calculation and visualization of electrostatic properties (FDPB). .P BALLView is based on BALL (Biochemical Algorithms Library) , which is currently being developed in the groups of Oliver Kohlbacher (University of Tuebingen, Germany), Andreas Hildebrandt (Saarland University, Saarbruecken, Germany), and Hans-Peter Lenhof (Saarland University, Saarbruecken, Germany). BALL is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. It provides an extensive set of data structures as well as classes for Molecular Mechanics, advanced solvation methods, comparison and analysis of protein structures, file import/export, and visualization. .P BALLView is available under the LGPL licence. .P Homepage: www.BALLView.org .SH USAGE .PP To run BALLView, simply type: .PP .RS BALLView .P or .P BALLView file.pdp .RE .PP where .I file.pdb is your PDB file. BALLView also supports HIN, MOL, MOL2 and SD files. .P BALLView provides HTML documentation, that is available in the application itself (see Help menu). .P This package also includes Python example scripts, that can be run in BALLView. They can be found under /usr/share/BALL/PYTHON. .SH AUTHOR BALLView is copyright 1998-2009 by the BALL project group .SH "SEE ALSO" .br .B http://www.ballview.org debian/watch0000644000000000000000000000015612013304225010211 0ustar version=3 opts=uversionmangle=s/-(.*)/+$1/ \ http://ball-www.bioinf.uni-sb.de/Releases/all/BALL-(.*)\.tar\.gz debian/upstream0000644000000000000000000000141412013304225010741 0ustar # Collection of meta-data about the upstream project, # see http://wiki.debian.org/UpstreamMetadata for reference. Contact: BALL authors Homepage: http://www.ballview.org Name: BALL Reference: author: Moll, Andreas and Hildebrandt, Andreas and Lenhof, Hans-Peter and Kohlbacher, Oliver title: > BALLView: a tool for research and education in molecular modeling journal: Bioinformatics volume: 22 number: 3 pages: 365-366 year: 2006 PMID: 16332707 DOI: 10.1093/bioinformatics/bti818 URL: http://bioinformatics.oxfordjournals.org/cgi/content/abstract/22/3/365 eprint: http://bioinformatics.oxfordjournals.org/cgi/reprint/22/3/365.pdf Watch: | opts=uversionmangle=s/-(.*)/+$1/ \ http://ball-www.bioinf.uni-sb.de/Releases/all/BALL-(.*)\.tar\.gz debian/README.source0000644000000000000000000000057212013304225011341 0ustar The installation files for Windows and MacOS were not removed from the source tree. This would have slightly reduced the source code, but would have increased difficulties for remote administrators to provide homogeneous distributed environments. For scientific computing such reliability is essential. -- Steffen Moeller Tue, 21 Jul 2009 22:40:21 +0200 debian/BALLView0000644000000000000000000000032112013304225010442 0ustar #!/bin/sh export LD_LIBRARY_PATH=/usr/lib/BALL export BALL_DATA_PATH=/usr/share/BALL/data export PYTHONPATH=/usr/lib/BALL/ # set Antialiasing for NVIDIA cards export __GL_FSAA_MODE=6 /usr/lib/BALL/BALLView $@ debian/ballview.doc-base0000644000000000000000000000125512013304225012365 0ustar Document: ballview Title: The ballview application's manual Author: Andreas Hildebrandt Abstract: BALLView is a free molecular modeling and molecular graphics tool BALLView provides fast OpenGL-based visualization of molecular structures, molecular mechanics methods (minimization, MD simulation using the AMBER, CHARMM, and MMFF94 force fields), calculation and visualization of electrostatic properties (FDPB) and molecular editing features. The application's documentation is available as HTML and can be read from within the program itself. Section: Science/Chemistry Format: HTML Index: /usr/share/doc/ballview/html/index.html Files: /usr/share/doc/ballview/html/*.html debian/compat0000644000000000000000000000000212013304225010354 0ustar 5 debian/README.Debian0000644000000000000000000000227112013304225011221 0ustar The BALL suite for structural biology has an enormous flexibility in its field of applications. There are so many, that a single group, or even collaborating groups like the ones behind BALL, cannot provide all the possible tools that would come handy to prepare the input for BALL or to further interpret its output. The Debian community provides a nice environment, very useful already, and we are happy to have further contributed to it. The maintainer of this package is from BALL's upstream development team (http://www.ballview.org). The Debian-Med community (http://debian-med.alioth.debian.org) jumps in to lower the entry barriers a bit. We all are very open towards new experiences and ideas about what the distribution of BALL with Debian/Ubuntu might bring or has brought for structural bioinformatics. If there are workflows (interactions with other tools in Debian-Med) you are now experimenting with that were previously too tedious to prepare or an increased accessibility of distributed computing (clusters, clouds, ...?) then please drop us a note. Andreas Hildebrandt (on behalf of the BALL developers) and Steffen Moeller (on behalf of Debian-Med) Tue, 21 Jul 2009 23:38:45 +0200 debian/source/0000755000000000000000000000000012013304225010456 5ustar debian/source/format0000644000000000000000000000001412013304225011664 0ustar 3.0 (quilt) debian/ballview.links0000644000000000000000000000010212013304225012016 0ustar usr/share/man/man1/ballview.1.gz usr/share/man/man1/BALLView.1.gz debian/remove_nonslash_tags.sh0000755000000000000000000000015512013304225013736 0ustar #!/bin/bash for i in $(git tag); do (echo $i | grep -q / - ); if test $? == 1; then git tag -d $i; fi; done debian/libball1.4-doc.lintian-overrides0000644000000000000000000000016112013304225015123 0ustar libball1.4-doc binary: postinst-does-not-call-installdocs libball1.4-doc binary: prerm-does-not-call-installdocs debian/control0000644000000000000000000002117112022633761010575 0ustar Source: ball Section: science Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian Med Packaging Team DM-Upload-Allowed: yes Uploaders: Andreas Hildebrandt Build-Depends: debhelper (>= 5), qt4-dev-tools, libqt4-dev, libqt4-gui, libqt4-opengl, libqt4-opengl-dev, libqt4-sql, libqt4-network, python-sip-dev (>= 4.8.2), flex, bison, cmake, libglew-dev, libfftw3-dev, libgsl0-dev, python-dev (>= 2.4), libxrender-dev, libboost-dev, libboost-iostreams-dev, libboost-thread-dev, libboost-math-dev | libboost-dev (<< 1.37), libboost-system-dev | libboost-dev (<< 1.37), libasio-dev, libboost-regex-dev, libxmu-dev, tidy, ghostscript, graphviz, chrpath, python-support (>= 0.90.0) Build-Depends-Indep: texlive-fonts-recommended, doxygen-latex|doxygen, doxygen-latex|latex-xcolor, doxygen-latex|texlive-extra-utils, doxygen-latex|texlive-latex-extra XS-Python-Version: all Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/git/debian-med/ball.git Vcs-Browser: http://git.debian.org/?p=debian-med/ball.git Homepage: http://www.ballview.org Package: libball1.4-data Section: science Architecture: all Depends: ${misc:Depends} Description: Biochemical Algorithms Library BALL (Biochemical Algorithms Library) is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. It provides an extensive set of data structures as well as classes for Molecular Mechanics, advanced solvation methods, comparison and analysis of protein structures, file import/export, and visualization. BALL is currently being developed in the groups of Oliver Kohlbacher (University of Tuebingen, Germany), Andreas Hildebrandt (Saarland University, Saarbruecken, Germany), and Hans-Peter Lenhof (Saarland University, Saarbruecken, Germany). . This package contains the data files (force field parameters, fragment data bases, etc) necessary for using BALL. Package: libball1.4 Section: science Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libball1.4-data Description: Biochemical Algorithms Library BALL (Biochemical Algorithms Library) is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. It provides an extensive set of data structures as well as classes for Molecular Mechanics, advanced solvation methods, comparison and analysis of protein structures, file import/export, and visualization. BALL is currently being developed in the groups of Oliver Kohlbacher (University of Tuebingen, Germany), Andreas Hildebrandt (Saarland University, Saarbruecken, Germany), and Hans-Peter Lenhof (Saarland University, Saarbruecken, Germany). . This package contains the view - independent parts of BALL (libBALL, data directories et al., except for libVIEW) and can be installed on machines without X11. Package: libball1.4-dev Section: libdevel Architecture: any Depends: libball1.4 (= ${binary:Version}), ${misc:Depends} Conflicts: libball1.3-dev Suggests: libball1.4-doc Description: Header files for the Biochemical Algorithms Library This package comprises the header files allowing to create one's own applications with the BALL library. Package: libballview1.4 Section: science Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Biochemical Algorithms Library, VIEW framework BALL (Biochemical Algorithms Library) is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. It provides an extensive set of data structures as well as classes for Molecular Mechanics, advanced solvation methods, comparison and analysis of protein structures, file import/export, and visualization. BALL is currently being developed in the groups of Oliver Kohlbacher (University of Tuebingen, Germany), Andreas Hildebrandt (Saarland University, Saarbruecken, Germany), and Hans-Peter Lenhof (Saarland University, Saarbruecken, Germany). . This package contains the view parts of BALL (libVIEW). Those are required for molecular visualization and for running BALLView. Package: libballview1.4-dev Section: libdevel Architecture: any Depends: libballview1.4 (= ${binary:Version}), ${misc:Depends} Conflicts: libballview1.3-dev Recommends: libball1.4-doc Description: Header files for the VIEW part of the Biochemical Algorithms Library BALL (Biochemical Algorithms Library) is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. This package comprises the header files allowing to create one's own applications with the VIEW framework of the BALL library. Package: python-ball Architecture: any Section: python Depends: ${shlibs:Depends}, ${python:Depends}, ${sip:Depends}, libball1.4, ${misc:Depends} Conflicts: python-ball (<< ${binary:Version}) Description: Python bindings for the Biochemical Algorithms Library BALL (Biochemical Algorithms Library) is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. This package provides scripting access to the VIEW-independent functionality of the Biochemical Algorithms Library (BALL). Package: python-ballview Architecture: any Section: python Depends: ${shlibs:Depends}, ${python:Depends}, ${sip:Depends}, libball1.4, libballview1.4, python-ball (= ${binary:Version}), ${misc:Depends} Conflicts: python-ballview (<< ${binary:Version}) Description: Python bindings for VIEW-parts of the Biochemical Algorithms Library BALL (Biochemical Algorithms Library) is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. This package provides scripting access to the VIEW-dependent functionality of the Biochemical Algorithms Library (BALL). Package: ballview Section: science Architecture: any Depends: ${shlibs:Depends}, libgl1-mesa-glx|libgl1, libball1.4, libballview1.4, python-ball, python-ballview, ${misc:Depends} Description: free molecular modeling and molecular graphics tool BALLView provides fast OpenGL-based visualization of molecular structures, molecular mechanics methods (minimization, MD simulation using the AMBER, CHARMM, and MMFF94 force fields), calculation and visualization of electrostatic properties (FDPB) and molecular editing features. . BALLView can be considered a graphical user interface on the basis of BALL (Biochemical Algorithms Library) with a focus on the most common demands of protein chemists and biophysicists in particular. It is developed in the groups of Hans-Peter Lenhof (Saarland University, Saarbruecken, Germany) and Oliver Kohlbacher (University of Tuebingen, Germany). BALL is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. It provides an extensive set of data structures as well as classes for Molecular Mechanics, advanced solvation methods, comparison and analysis of protein structures, file import/export, and visualization. Package: libball1.4-doc Architecture: all Section: doc Depends: libball1.4, ${misc:Depends} Conflicts: libball1.3-doc Description: documentation for the BALL library BALL (Biochemical Algorithms Library) is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. The package comprises an extensive manual on how to program molecular modelling programs with BALL. Package: ballview-dbg Architecture: any Priority: extra Section: debug Depends: python-ballview, ballview, ${misc:Depends} Description: debug symbols for BALL and VIEW libraries BALL (Biochemical Algorithms Library) is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. The package comprises an extensive manual on how to program molecular modelling programs with BALL. . This package contains all the extra information on the libraries of BALL, BALLView and the Python wrappers to help debuggers like GDB to interpret a core dump. This is tremendously useful for debugging and maybe even more so for the communication between the user of this package and upstream when something goes wrong. debian/patches/0000755000000000000000000000000012013304225010605 5ustar debian/patches/0009-Fixed-a-bug-in-the-AssignBondOrderProcessor.patch0000644000000000000000000003054512013304225022356 0ustar From: Anna Dehof Date: Fri, 27 Apr 2012 18:41:52 +0200 Subject: Fixed a bug in the AssignBondOrderProcessor --- .../STRUCTURE/BONDORDERS/bondOrderAssignment.h | 2 +- source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C | 13 +++-- source/STRUCTURE/assignBondOrderProcessor.C | 27 +++++++---- source/TEST/AssignBondOrderProcessor_test.C | 50 +++++++++++++++----- 4 files changed, 67 insertions(+), 25 deletions(-) diff --git a/include/BALL/STRUCTURE/BONDORDERS/bondOrderAssignment.h b/include/BALL/STRUCTURE/BONDORDERS/bondOrderAssignment.h index 57adc41..f8aab75 100644 --- a/include/BALL/STRUCTURE/BONDORDERS/bondOrderAssignment.h +++ b/include/BALL/STRUCTURE/BONDORDERS/bondOrderAssignment.h @@ -68,7 +68,7 @@ namespace BALL float total_charge; int node_expansions; int queue_size; - + AtomContainer* ac; }; } diff --git a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C index 107823e..6572d96 100644 --- a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C +++ b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C @@ -108,7 +108,8 @@ namespace BALL } else { - /* Log.info() << "AssignBondOrderProcessor: strategy FPT does not support computeNextSolution(). " << endl + // since we return a pointer, nothing to do here + /* Log.info() << "AssignBondOrderProcessor: strategy FPT does not support computeNextSolution(). " << endl << "Please use the options Option::MAX_NUMBER_OF_SOLUTIONS or Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS " << endl << "to compute additional solutions." << endl; */ } @@ -1429,12 +1430,12 @@ namespace BALL bool FPTBondOrderStrategy::DPBackTracking_::hasMoreSolutions() const { - return (!queue_.empty() && (!max_num_solutions_ || (num_computed_solutions_ <= max_num_solutions_))); + return (!queue_.empty() && (!max_num_solutions_ || (num_computed_solutions_ < max_num_solutions_))); } void FPTBondOrderStrategy::DPBackTracking_::nextSolution() { - if (queue_.empty() || max_heap_size_ == 0 || ((max_num_solutions_ > 0) && (num_computed_solutions_ > max_num_solutions_))) + if (queue_.empty() || (max_heap_size_ == 0) || ((max_num_solutions_ > 0) && (num_computed_solutions_ > max_num_solutions_))) { throw Exception::OutOfRange(__FILE__, __LINE__); } @@ -1987,7 +1988,9 @@ namespace BALL bool FPTBondOrderStrategy::DPBackTrackingCombiner_::hasMoreSolutions() const { - return (!priority_queue_.empty() || (getNextMinimumBackTracker_().second) < upper_bound_); + std::pair next_min = getNextMinimumBackTracker_(); + + return (backtrackers_[next_min.first]->hasMoreSolutions() && (!priority_queue_.empty() || (next_min.second) < upper_bound_)); } void FPTBondOrderStrategy::DPBackTrackingCombiner_::nextSolution() @@ -2014,7 +2017,7 @@ namespace BALL // compute next minimal Solution std::pair next_min = getNextMinimumBackTracker_(); - if (next_min.second < upper_bound_ && (priority_queue_.empty() || next_min.second < priority_queue_.top().penalty)) + if ((next_min.second < upper_bound_) && (priority_queue_.empty() || (next_min.second < priority_queue_.top().penalty))) { DPBackTracking_& min_back_tracker = *backtrackers_[next_min.first]; diff --git a/source/STRUCTURE/assignBondOrderProcessor.C b/source/STRUCTURE/assignBondOrderProcessor.C index 9863a54..9443fb8 100644 --- a/source/STRUCTURE/assignBondOrderProcessor.C +++ b/source/STRUCTURE/assignBondOrderProcessor.C @@ -295,8 +295,20 @@ namespace BALL ) { Log.error() << __FILE__ << " " << __LINE__ - << " : Error in options! FPT cannot be used with these options." << endl - << " Consider switch to solution strategy ASTAR by setting Option::ALGORITHM to Algorithm::ASTAR." << endl + << " : Error in options! FPT cannot be used with these option(s): "; + if (options.getReal(Option::BOND_LENGTH_WEIGHTING) > 0.) + Log.error() << "BOND_LENGTH_WEIGHTING "; + if (options.getBool(Option::ADD_HYDROGENS)) + Log.error() << "ADD_HYDROGENS "; + if (options.getBool(Option::COMPUTE_ALSO_CONNECTIVITY)) + Log.error() << "COMPUTE_ALSO_CONNECTIVITY "; + if (options.getBool(Option::OVERWRITE_SELECTED_BONDS)) + Log.error() << "OVERWRITE_SELECTED_BONDS "; + if (!options.getBool(Option::OVERWRITE_SINGLE_BOND_ORDERS)) + Log.error() << "OVERWRITE_SINGLE_BOND_ORDERS "; + Log.error() << endl; + + Log.error() << " Consider switch to solution strategy ASTAR by setting Option::ALGORITHM to Algorithm::ASTAR." << endl << " Abort." << endl; ret = false; } @@ -321,8 +333,8 @@ namespace BALL #ifdef DEBUG cout << " OPTIONS:" << endl; -cout << " \t Algorithm: " << options[Option::Option::ALGORITHM] << endl; -cout << " \t Heuristic: " << options[Option::Option::HEURISTIC] << endl; +cout << " \t Algorithm: " << options[Option::ALGORITHM] << endl; +cout << " \t Heuristic: " << options[Option::HEURISTIC] << endl; cout << " \t Overwrite bonds (single, double, triple, selected):" << options.getBool(Option::OVERWRITE_SINGLE_BOND_ORDERS) << " " @@ -334,7 +346,7 @@ cout << " \t Overwrite bonds (single, double, triple, selected):" cout << " \t Add hydrogens : " << options.getBool(Option::ADD_HYDROGENS) << endl; cout << " \t Use fine penalty : " << options.getBool(Option::USE_FINE_PENALTY) << endl; cout << " \t Kekulizer: " << options.getBool(Option::KEKULIZE_RINGS) << endl; -cout << " \t Penalty file " << options[Option::Option::INIFile] << endl; +cout << " \t Penalty file " << options[Option::INIFile] << endl; cout << " \t alpha: " << options[Option::BOND_LENGTH_WEIGHTING] << endl; cout << " \t max bond order: " << options[Option::MAX_BOND_ORDER] << endl; cout << " \t max number of solutions " << options[Option::MAX_NUMBER_OF_SOLUTIONS] << endl; @@ -549,7 +561,7 @@ cout << "preassignPenaltyClasses_:" << preassignPenaltyClasses_() << " precomput boost::shared_ptr solution = strategy->computeNextSolution(); // Do we have a solution? - if (!solution) + if (!solution || !solution->valid) { Log.info() << "AssignBondOrderProcessor: No valid bond order assignment found!" << endl; #if defined DEBUG_TIMER @@ -1237,7 +1249,6 @@ cout << " ~~~~~~~~ added hydrogen dump ~~~~~~~~~~~~~~~~" << endl; AssignBondOrderProcessor::Default::APPLY_FIRST_SOLUTION); } - bool AssignBondOrderProcessor::apply(Position i) { bool result = false; @@ -1370,7 +1381,7 @@ cout << " ~~~~~~~~ added hydrogen dump ~~~~~~~~~~~~~~~~" << endl; boost::shared_ptr solution = strategy->computeNextSolution(); - if (solution) + if (solution && solution->valid) { solutions_.push_back(*solution); found_a_sol = true; diff --git a/source/TEST/AssignBondOrderProcessor_test.C b/source/TEST/AssignBondOrderProcessor_test.C index 6dfafcc..fdf92d1 100644 --- a/source/TEST/AssignBondOrderProcessor_test.C +++ b/source/TEST/AssignBondOrderProcessor_test.C @@ -201,6 +201,8 @@ RESULT CHECK(check Options for consistency) + Log.error().disableOutput(); + AssignBondOrderProcessor testbop; testbop.setDefaultOptions(); TEST_EQUAL(testbop.hasValidOptions(), true) @@ -208,21 +210,17 @@ CHECK(check Options for consistency) testbop.setDefaultOptions(); testbop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::FPT); testbop.options.set(AssignBondOrderProcessor::Option::ADD_HYDROGENS, true); - TEST_EQUAL(testbop.hasValidOptions(), false) testbop.setDefaultOptions(); testbop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::FPT); testbop.options.set(AssignBondOrderProcessor::Option::OVERWRITE_SELECTED_BONDS, true); - TEST_EQUAL(testbop.hasValidOptions(), false) testbop.setDefaultOptions(); testbop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::FPT); testbop.options.set(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS, 0); - - TEST_EQUAL(testbop.hasValidOptions(), false) - + TEST_EQUAL(testbop.hasValidOptions(), true) testbop.setDefaultOptions(); testbop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::FPT); @@ -230,9 +228,8 @@ CHECK(check Options for consistency) testbop.options.set(AssignBondOrderProcessor::Option::OVERWRITE_SINGLE_BOND_ORDERS, true); testbop.options.set(AssignBondOrderProcessor::Option::COMPUTE_ALSO_CONNECTIVITY, true); testbop.options.set(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS, 0); - TEST_EQUAL(testbop.hasValidOptions(), false) - + Log.error().enableOutput(); RESULT /////////////////////// ALGORITHMS ////////////////////// @@ -841,10 +838,11 @@ CHECK(getTotalPenalty(Position i) and operator() FPT single solution) System sys2; MOL2File mol_in2(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_AN06.mol2), std::ios::in); mol_in2 >> sys2; + TEST_EQUAL(testbop.getNumberOfComputedSolutions(), 10) + sys2.apply(testbop); TEST_REAL_EQUAL(testbop.getTotalPenalty(0), 2.f)//0.00625) - System sys3; MOL2File mol_in3(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_BEWCUB.mol2), std::ios::in); mol_in3 >> sys3; @@ -856,6 +854,7 @@ CHECK(getTotalPenalty(Position i) and operator() FPT single solution) MOL2File mol15(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_CUDJAM_sol_5.mol2), std::ios::in); mol15 >> sys15; sys15.apply(testbop); + TEST_REAL_EQUAL(testbop.getTotalPenalty(1), 2.f ) //0.0015528 ) TEST_REAL_EQUAL(testbop.getTotalPenalty(2), 5.f ) //0.00388199) TEST_REAL_EQUAL(testbop.getTotalPenalty(3), 7.f ) //0.00543478) @@ -904,6 +903,34 @@ CHECK(getTotalPenalty(Position i) and operator() FPT single solution) RESULT +CHECK(operator() FPT vs A*) + AssignBondOrderProcessor testbop_a; + testbop_a.options.set(AssignBondOrderProcessor::Option::ALGORITHM,AssignBondOrderProcessor::Algorithm::A_STAR); + testbop_a.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, true); + + AssignBondOrderProcessor testbop_fpt; + testbop_fpt.options.set(AssignBondOrderProcessor::Option::ALGORITHM,AssignBondOrderProcessor::Algorithm::FPT); + testbop_fpt.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, true); + + System sys4; + MOL2File mol4(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_CITSED10_sol_6.mol2), std::ios::in); + mol4 >> sys4; + sys4.apply(testbop_a); + sys4.apply(testbop_fpt); + TEST_REAL_EQUAL(testbop_a.getNumberOfComputedSolutions(), testbop_fpt.getNumberOfComputedSolutions()) + + TEST_REAL_EQUAL(testbop_a.getTotalPenalty(0), testbop_fpt.getTotalPenalty(0)) //1.f ) + TEST_REAL_EQUAL(testbop_a.getTotalPenalty(1), testbop_fpt.getTotalPenalty(1)) //1.f ) + TEST_REAL_EQUAL(testbop_a.getTotalPenalty(2), testbop_fpt.getTotalPenalty(2)) //32.f) + TEST_REAL_EQUAL(testbop_a.getTotalPenalty(3), testbop_fpt.getTotalPenalty(3)) //34.f) + TEST_REAL_EQUAL(testbop_a.getTotalPenalty(4), testbop_fpt.getTotalPenalty(4)) //34.f) + TEST_REAL_EQUAL(testbop_a.getTotalPenalty(5), testbop_fpt.getTotalPenalty(5)) //34.f) + TEST_REAL_EQUAL(testbop_a.getTotalPenalty(6), testbop_fpt.getTotalPenalty(6)) //66.f) + TEST_REAL_EQUAL(testbop_a.getTotalPenalty(7), testbop_fpt.getTotalPenalty(7)) //66.f) + TEST_REAL_EQUAL(testbop_a.getTotalPenalty(8), testbop_fpt.getTotalPenalty(8)) //67.f) + +RESULT + CHECK(getTotalCharge(Position i)) // This feature is experimental!! @@ -1023,7 +1050,7 @@ CHECK(computeNextSolution() using ILP) MOL2File mol_in(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_AN06.mol2), std::ios::in); mol_in >> sys; sys.apply(testbop); - TEST_EQUAL(testbop.getNumberOfComputedSolutions(),1) + TEST_EQUAL(testbop.getNumberOfComputedSolutions(), 1) TEST_REAL_EQUAL(testbop.getTotalPenalty(0), 2.f)//0.00625)// 2.) TEST_EQUAL(testbop.computeNextSolution(), true) TEST_REAL_EQUAL(testbop.getTotalPenalty(1), 32.f)//0.1)//32.) @@ -1091,9 +1118,10 @@ CHECK(computeNextSolution() using FPT) MOL2File mol_in(BALL_TEST_DATA_PATH(AssignBondOrderProcessor_test_AN06.mol2), std::ios::in); mol_in >> sys; sys.apply(testbop); - TEST_EQUAL(testbop.getNumberOfComputedSolutions(),1) + TEST_EQUAL(testbop.getNumberOfComputedSolutions(), 1) TEST_REAL_EQUAL(testbop.getTotalPenalty(0), 2.f)//0.00625)// 2.) - TEST_EQUAL(testbop.computeNextSolution(), false) + bool test = testbop.computeNextSolution(); + TEST_EQUAL(test, false) RESULT debian/patches/0008-Added-MAX_PENALTY-option-to-bond-order-assignment.patch0000644000000000000000000011657312013304225023175 0ustar From: Anna Dehof Date: Mon, 26 Mar 2012 19:11:39 +0200 Subject: Added MAX_PENALTY option to bond order assignment --- include/BALL/DATATYPE/GRAPH/treeWidth.h | 28 +-- .../STRUCTURE/BONDORDERS/FPTBondOrderStrategy.h | 16 +- include/BALL/STRUCTURE/assignBondOrderProcessor.h | 30 ++- source/APPLICATIONS/UTILITIES/assign_bond_orders.C | 34 +++- source/DATATYPE/GRAPH/treeWidth.C | 2 +- source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C | 199 +++++++++----------- source/STRUCTURE/assignBondOrderProcessor.C | 44 +++-- 7 files changed, 186 insertions(+), 167 deletions(-) diff --git a/include/BALL/DATATYPE/GRAPH/treeWidth.h b/include/BALL/DATATYPE/GRAPH/treeWidth.h index f7687ef..53ecffc 100644 --- a/include/BALL/DATATYPE/GRAPH/treeWidth.h +++ b/include/BALL/DATATYPE/GRAPH/treeWidth.h @@ -100,14 +100,14 @@ namespace BALL typedef boost::adjacency_list, - boost::property > >, + boost::property > >, boost::no_property> TreeDecompositionGraph; typedef typename boost::graph_traits::vertex_descriptor TreeDecompositionBag; typedef boost::iterator_property_map::iterator, - typename boost::property_map::type> + typename boost::property_map::type> TreeDecompositionParentMap; typedef boost::graph_as_tree TreeDecomposition; @@ -131,7 +131,7 @@ namespace BALL class ComponentFilter_ { public: - ComponentFilter_(ComponentMap cm, Position i) + ComponentFilter_(ComponentMap cm, Position i) : cm_(cm), component_(i) { } @@ -144,7 +144,7 @@ namespace BALL protected: ComponentMap cm_; - Position component_; + Position component_; }; /** PropertyWriter for graphviz output. @@ -167,7 +167,7 @@ namespace BALL // TODO: would UndirectedGraph suffice here? MolecularGraph const* input_; - std::vector > components_; + std::vector > components_; std::vector > nice_tree_decompositions_; std::vector > nice_tree_decomposition_graphs_; @@ -201,7 +201,7 @@ namespace BALL * @tparam Reducer the reducer which removes a vertex from the graph to reduce it's size */ template - class GeneralLowerBoundAlgorithm + class GeneralLowerBoundAlgorithm : public UnaryFunctor { public: @@ -284,7 +284,7 @@ namespace BALL * @throw BALL::GRAPH::UnconnectedGraphException if called on unconnected graphs */ template - class GreedyX + class GreedyX : public UnaryFunctor >, Size> > { @@ -296,7 +296,7 @@ namespace BALL * A criterium for GreedyFillIn which search for a vertex with * minimum number of additional edges after eliminating */ - struct FillInHeuristic + struct FillInHeuristic { VertexType& operator() (UndirectedGraph& graph); @@ -323,8 +323,8 @@ namespace BALL */ enum SIMPLICIAL_TYPE { - NOT_SIMPLICIAL, - ALMOST_SIMPLICIAL, + NOT_SIMPLICIAL, + ALMOST_SIMPLICIAL, IS_SIMPLICIAL }; @@ -484,7 +484,7 @@ namespace BALL TreeDecompositionBag buildJoin_(TreeDecompositionBag node, TreeDecompositionBag left, TreeDecompositionBag right, bool do_forget); - TreeDecompositionBag buildSingle_(TreeDecompositionBag node, int node_type, + TreeDecompositionBag buildSingle_(TreeDecompositionBag node, int node_type, TreeDecompositionBag child); TreeDecompositionBag buildLinkage_(TreeDecompositionBag node, TreeDecompositionBag child); @@ -492,8 +492,8 @@ namespace BALL TreeDecompositionBag linkWithIntroduceNodes_(TreeDecompositionContent parent_set, TreeDecompositionBag child); TreeDecompositionBag linkWithForgetNodes_ (TreeDecompositionContent parent_set, TreeDecompositionBag child); - TreeDecompositionBag branch_(TreeDecompositionBag node, int node_type, - typename std::vector::iterator begin, + TreeDecompositionBag branch_(TreeDecompositionBag node, int node_type, + typename std::vector::iterator begin, typename std::vector::iterator end); boost::shared_ptr tree_; diff --git a/include/BALL/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.h b/include/BALL/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.h index 55cef31..ba129b0 100644 --- a/include/BALL/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.h +++ b/include/BALL/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.h @@ -1117,6 +1117,11 @@ namespace BALL Size max_heap_size_; /** + * The number of solutions produced so far. + */ + Size num_computed_solutions_; + + /** * current upperbound. This algorithm will just iterate solutions which are better than this upperbound; */ Penalty upper_bound_; @@ -1248,14 +1253,6 @@ namespace BALL Size solution_number, Penalty upper_bound = infinite_penalty); /** - * Construct a DPBackTrackingCombiner with the given FPTBondOrder and the number of solutions - * @param bondAssignments vector with the bond assignments. Call #compute before constructing - * @param solutionNumber the maximum number of solutions you want to backtrack - */ - DPBackTrackingCombiner_(std::vector& bond_assignments, - Size solution_number, Penalty upper_bound = infinite_penalty); - - /** * Copy constructor */ DPBackTrackingCombiner_(DPBackTrackingCombiner_ const& copy); @@ -1407,9 +1404,6 @@ namespace BALL */ std::vector > const* atom_to_block_; - /// upper bound on the penalty values for which we compute solutions - Penalty upper_bound_; - /** * A shared pointer to the computing data, so that you can copy this instance without copying * all the computing data diff --git a/include/BALL/STRUCTURE/assignBondOrderProcessor.h b/include/BALL/STRUCTURE/assignBondOrderProcessor.h index f8065d6..0d14af8 100644 --- a/include/BALL/STRUCTURE/assignBondOrderProcessor.h +++ b/include/BALL/STRUCTURE/assignBondOrderProcessor.h @@ -183,17 +183,35 @@ namespace BALL /** the maximal number of solutions to compute * - * If set to zero all optimal solutions will be computed. + * If set to zero all optimal or all up to \link MAX_PENALTY MAX_PENALTY \endlink + * solutions will be computed. * - * @see Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS + * @see Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS + * @see Option::MAX_PENALTY */ static const char* MAX_NUMBER_OF_SOLUTIONS; - /** compute also non-optimal solutions but not more than - * \link MAX_NUMBER_OF_SOLUTIONS MAX_NUMBER_OF_SOLUTIONS \endlink solutions. + /** the maximal penalty score allowed + * + * This option respects option \link MAX_NUMBER_OF_SOLUTIONS MAX_NUMBER_OF_SOLUTIONS \endlink + * if specified. * + * If set to -1 this option will be ignored. + * + * @see Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS * @see Option::MAX_NUMBER_OF_SOLUTIONS */ + static const char* MAX_PENALTY; + + /** compute also sub-optimal solutions but not more than + * \link MAX_NUMBER_OF_SOLUTIONS MAX_NUMBER_OF_SOLUTIONS \endlink solutions. + * + * Alternatively \link Option::MAX_PENALTY Option::MAX_PENALTY \endlink + * allows to specify a maximal penalty. + * + * @see Option::MAX_NUMBER_OF_SOLUTIONS + * @see Option::MAX_PENALTY + */ static const char* COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS; /** weighting of bond length penalties wrt valence penalties. @@ -227,6 +245,7 @@ namespace BALL static const String INIFile; static const int MAX_BOND_ORDER; static const int MAX_NUMBER_OF_SOLUTIONS; + static const int MAX_PENALTY; static const bool COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS; static const float BOND_LENGTH_WEIGHTING; static const bool APPLY_FIRST_SOLUTION; @@ -716,6 +735,9 @@ namespace BALL // the max number of solutions to compute int max_number_of_solutions_; + // the max penalty score + int max_penalty_; + // flag to indicate, whether also non-optimal solutions should be computed bool compute_also_non_optimal_solutions_; diff --git a/source/APPLICATIONS/UTILITIES/assign_bond_orders.C b/source/APPLICATIONS/UTILITIES/assign_bond_orders.C index cefef9b..7053baa 100644 --- a/source/APPLICATIONS/UTILITIES/assign_bond_orders.C +++ b/source/APPLICATIONS/UTILITIES/assign_bond_orders.C @@ -16,10 +16,10 @@ using namespace BALL; int main(int argc, char** argv) { - if ((argc < 3) || (argc > 4)) + if (argc < 3) // if (argc != 3) { - Log << "Usage:" << argv[0] << " [num_sol]" << endl; + Log << "Usage:" << argv[0] << " [--num-sol=n] [--strategy=(fpt|a_star|ilp)] [--max-penalty=m]" << endl; return 1; } @@ -49,24 +49,40 @@ int main(int argc, char** argv) // set the options: // // the solution strategy (A*, ILP or FPT) - abop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::A_STAR); + abop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::FPT); // specify the inifile with the atomic valence penalties abop.options.set(AssignBondOrderProcessor::Option::INIFile, AssignBondOrderProcessor::Default::INIFile); // options for considering bond length as well - abop.options.setReal(AssignBondOrderProcessor::Option::BOND_LENGTH_WEIGHTING, 0); - abop.options.setReal(AssignBondOrderProcessor::Option::USE_FINE_PENALTY, true); +// abop.options.setReal(AssignBondOrderProcessor::Option::BOND_LENGTH_WEIGHTING, 0); +// abop.options.setReal(AssignBondOrderProcessor::Option::USE_FINE_PENALTY, true); // the combination of the following two options causes the computation of all optimal solutions abop.options.setInteger(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS, 0); abop.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, false); - if (argc == 4) + if (argc > 3) { - Log << " with compute fixed number (" << argv[3] << ") solutions" << endl; - abop.options.setInteger(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS, String(argv[3]).toInt()); - abop.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, true); + for (Index i=3; i::OriginalVertexType ov = *tdc_it; Atom const* atom = boost::get(boost::vertex_atom_ptr, *original_graph_, ov); diff --git a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C index 42040e5..107823e 100644 --- a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C +++ b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C @@ -12,10 +12,6 @@ namespace BALL const FPTBondOrderStrategy::Penalty FPTBondOrderStrategy::infinite_penalty = 1e5; const FPTBondOrderStrategy::Valence FPTBondOrderStrategy::max_valence = 8; - String FPTBondOrderStrategy::Option::UPPER_PENALTY_BOUND = "upper_penalty_bound"; - - FPTBondOrderStrategy::Penalty FPTBondOrderStrategy::Default::UPPER_PENALTY_BOUND = infinite_penalty; - FPTBondOrderStrategy::FPTBondOrderStrategy(AssignBondOrderProcessor* parent) : BondOrderAssignmentStrategy(parent) { @@ -33,15 +29,11 @@ namespace BALL bool FPTBondOrderStrategy::readOptions(const Options& options) { - upper_bound_ = options.get(Option::UPPER_PENALTY_BOUND).toFloat(); - return true; } void FPTBondOrderStrategy::setDefaultOptions() { - abop->options.setDefault(FPTBondOrderStrategy::Option::UPPER_PENALTY_BOUND, - FPTBondOrderStrategy::Default::UPPER_PENALTY_BOUND); } void FPTBondOrderStrategy::init() @@ -64,16 +56,22 @@ namespace BALL std::vector > & ntds = computing_data_->tw->getNiceTreeDecompositions(); std::vector& bond_assignments = computing_data_->bond_assignments; + int max_penalty = abop->max_penalty_; + if (max_penalty == -1) + max_penalty = infinite_penalty; + else + max_penalty += 1; + bond_assignments.reserve(ntds.size()); for (Position i = 0; i < ntds.size(); ++i) { - bond_assignments.push_back(new FPTBondOrderAssignment_(*this, ntds[i], upper_bound_)); - bond_assignments[i]->compute(); + bond_assignments.push_back(new FPTBondOrderAssignment_(*this, ntds[i], max_penalty)); + Penalty result = bond_assignments[i]->compute(); } // initialize backtracking combiner_ = boost::shared_ptr( - new DPBackTrackingCombiner_(bond_assignments, abop->max_number_of_solutions_, upper_bound_)); + new DPBackTrackingCombiner_(bond_assignments, abop->max_number_of_solutions_, max_penalty)); } boost::shared_ptr FPTBondOrderStrategy::computeNextSolution() @@ -144,7 +142,7 @@ namespace BALL int penalty = (*penalties_)[start_index + position]; return (penalty < 0) ? infinite_penalty : static_cast(penalty); - } + } else { return infinite_penalty; @@ -155,20 +153,20 @@ namespace BALL //* DPConfig_ * //***************************************************************************************************** - FPTBondOrderStrategy::DPConfig_::DPConfig_() - : consumed_valences(0), + FPTBondOrderStrategy::DPConfig_::DPConfig_() + : consumed_valences(0), bond_assignments(0) { } - FPTBondOrderStrategy::DPConfig_::DPConfig_(Size atoms, Size bonds) - : consumed_valences(atoms, 0), + FPTBondOrderStrategy::DPConfig_::DPConfig_(Size atoms, Size bonds) + : consumed_valences(atoms, 0), bond_assignments(bonds, 0) { } - FPTBondOrderStrategy::DPConfig_::DPConfig_(std::vector const& v, std::vector const& bo) - : consumed_valences(v), + FPTBondOrderStrategy::DPConfig_::DPConfig_(std::vector const& v, std::vector const& bo) + : consumed_valences(v), bond_assignments(bo) { } @@ -258,12 +256,12 @@ namespace BALL //* DPTable_ * //***************************************************************************************************** - FPTBondOrderStrategy::DPTable_::DPTable_() + FPTBondOrderStrategy::DPTable_::DPTable_() : table() { } - FPTBondOrderStrategy::DPTable_::DPTable_(DPTable_ const& dptab) + FPTBondOrderStrategy::DPTable_::DPTable_(DPTable_ const& dptab) : table(dptab.table) { } @@ -345,7 +343,7 @@ namespace BALL if (insertion.second) { return true; - } + } else { if (insertion.first->second > penalty) @@ -353,7 +351,7 @@ namespace BALL insertion.first->second = penalty; return true; - } + } else { return false; @@ -365,14 +363,14 @@ namespace BALL //* AdditionalBagProperties_ * //***************************************************************************************************** - FPTBondOrderStrategy::AdditionalBagProperties_::AdditionalBagProperties_() - : bonds(), - table(new DPTable_()) + FPTBondOrderStrategy::AdditionalBagProperties_::AdditionalBagProperties_() + : bonds(), + table(new DPTable_()) { } - FPTBondOrderStrategy::AdditionalBagProperties_::AdditionalBagProperties_(AdditionalBagProperties_ const& copy) - : bonds(copy.bonds), + FPTBondOrderStrategy::AdditionalBagProperties_::AdditionalBagProperties_(AdditionalBagProperties_ const& copy) + : bonds(copy.bonds), table(new DPTable_(*copy.table)) { } @@ -384,7 +382,7 @@ namespace BALL FPTBondOrderStrategy::AdditionalBagProperties_& FPTBondOrderStrategy::AdditionalBagProperties_::operator=(AdditionalBagProperties_ const& copy) { - if (© != this) + if (© != this) { bonds = copy.bonds; table = new DPTable_(*copy.table); @@ -447,7 +445,7 @@ namespace BALL { throw Exception::NullPointer(__FILE__, __LINE__); } - case TreeWidth::LEAF_BAG: + case TreeWidth::LEAF_BAG: break; case TreeWidth::END_BAG: if (boost::num_vertices(*molecule_) == 0 && (bag == root(*ntd_))) @@ -455,7 +453,7 @@ namespace BALL // empty molecule -> empty table bag_properties.table->insert(DPConfig_(), 0); return bag_properties.table; - } + } else { // else nice tree decomposition is damaged @@ -603,7 +601,7 @@ namespace BALL return bonds; } - void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeIntroduceBag(TreeDecompositionBag& bag, DPTable_& child, + void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeIntroduceBag(TreeDecompositionBag& bag, DPTable_& child, AdditionalBagProperties_& property) { typedef TreeWidth::TreeDecompositionContent TreeDecompositionContent; @@ -614,7 +612,7 @@ namespace BALL TreeDecompositionContent vertices = boost::get(boost::vertex_bag_content, *ntd_, bag); Size num_valences = vertices.size(); - + std::vector& bonds = property.bonds; Size num_bonds = bonds.size(); @@ -654,7 +652,7 @@ namespace BALL { // remember the indizes of the new introduced bonds indices.push_back(vindex); - } + } else { conf.bond_assignments[vindex] = child_entry.first.get().bond_assignments[cindex++]; @@ -662,7 +660,7 @@ namespace BALL } // if there are any introduced bonds we have to fill them with each possible value - if (indices.size() > 0) + if (indices.size() > 0) { std::vector bond_values(indices.size()); @@ -685,7 +683,7 @@ namespace BALL ++current_index; } } - } + } else { table.insert(conf, child_entry.second); @@ -768,7 +766,7 @@ namespace BALL return parent_->getPenaltyFor_(forgotten_vertex, forgotten_valence) + child_row.second; } - void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeForgetBag(TreeDecompositionBag& bag, DPTable_& child, + void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeForgetBag(TreeDecompositionBag& bag, DPTable_& child, AdditionalBagProperties_& property) { typedef TreeWidth::TreeDecompositionContent TreeDecompositionContent; @@ -795,7 +793,7 @@ namespace BALL } } - void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeRootBag(TreeDecompositionBag& bag, + void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeRootBag(TreeDecompositionBag& bag, DPTable_& child, AdditionalBagProperties_& bag_properties) { DPConfig_ empty(0, 0); @@ -816,7 +814,8 @@ namespace BALL } void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeJoinBag(TreeDecompositionBag& bag, - DPTable_& left_child, DPTable_& right_child, AdditionalBagProperties_& property) + DPTable_& left_child, DPTable_& right_child, + AdditionalBagProperties_& property) { typedef TreeWidth::TreeDecompositionContent TreeDecompositionContent; @@ -1268,22 +1267,23 @@ namespace BALL //* DPBackTracking_ * //***************************************************************************************************** - FPTBondOrderStrategy::DPBackTracking_::DPBackTracking_(FPTBondOrderAssignment_& bond_assignment, Size max_num_solutions, - std::vector const& bonds, Penalty upper_bound) - : bond_assignment_(&bond_assignment), - current_state_(NULL), - queue_(), - max_num_solutions_(max_num_solutions), + FPTBondOrderStrategy::DPBackTracking_::DPBackTracking_(FPTBondOrderAssignment_& bond_assignment, Size max_num_solutions, + std::vector const& bonds, Penalty upper_bound) + : bond_assignment_(&bond_assignment), + current_state_(NULL), + queue_(), + max_num_solutions_(max_num_solutions), bonds_(&bonds), - bags_(boost::shared_ptr >(new std::vector)), - max_heap_size_(max_num_solutions), + bags_(boost::shared_ptr >(new std::vector)), + max_heap_size_(1e6), + num_computed_solutions_(0), upper_bound_(upper_bound) { // order bags in preorder if (bond_assignment.ntd_ == NULL) { throw Exception::NullPointer(__FILE__, __LINE__); - } + } else { bags_->reserve(boost::num_vertices(bond_assignment.ntd_->_g)); @@ -1303,14 +1303,15 @@ namespace BALL } } - FPTBondOrderStrategy::DPBackTracking_::DPBackTracking_(DPBackTracking_ const& copy) - : bond_assignment_(copy.bond_assignment_), - current_state_(NULL), + FPTBondOrderStrategy::DPBackTracking_::DPBackTracking_(DPBackTracking_ const& copy) + : bond_assignment_(copy.bond_assignment_), + current_state_(NULL), queue_(), - max_num_solutions_(copy.max_num_solutions_), - bonds_(copy.bonds_), - bags_(copy.bags_), + max_num_solutions_(copy.max_num_solutions_), + bonds_(copy.bonds_), + bags_(copy.bags_), max_heap_size_(copy.max_heap_size_), + num_computed_solutions_(copy.num_computed_solutions_), upper_bound_(copy.upper_bound_) { if (copy.current_state_ != NULL) @@ -1345,6 +1346,7 @@ namespace BALL bonds_ = copy.bonds_; bags_ = copy.bags_; max_heap_size_ = copy.max_heap_size_; + num_computed_solutions_ = copy.num_computed_solutions_; upper_bound_ = copy.upper_bound_; } @@ -1365,6 +1367,7 @@ namespace BALL std::vector copy(queue_.begin(), queue_.end()); queue_.clear(); + num_computed_solutions_ = 0; for (std::vector::iterator iter = copy.begin(); iter != copy.end(); ++iter) { @@ -1372,7 +1375,7 @@ namespace BALL } } - bool FPTBondOrderStrategy::DPBackTracking_::StateComparator_::operator() (BackTrackingState_ const * left, + bool FPTBondOrderStrategy::DPBackTracking_::StateComparator_::operator() (BackTrackingState_ const * left, BackTrackingState_ const * right) const { return *left < *right; @@ -1397,7 +1400,7 @@ namespace BALL if (order < properties.size()) { return properties[order]; - } + } else { throw Exception::IndexOverflow(__FILE__, __LINE__, static_cast(order), properties.size()); @@ -1426,12 +1429,12 @@ namespace BALL bool FPTBondOrderStrategy::DPBackTracking_::hasMoreSolutions() const { - return (!queue_.empty() && (max_heap_size_ > 0)); + return (!queue_.empty() && (!max_num_solutions_ || (num_computed_solutions_ <= max_num_solutions_))); } void FPTBondOrderStrategy::DPBackTracking_::nextSolution() { - if (queue_.empty() || max_heap_size_ == 0) + if (queue_.empty() || max_heap_size_ == 0 || ((max_num_solutions_ > 0) && (num_computed_solutions_ > max_num_solutions_))) { throw Exception::OutOfRange(__FILE__, __LINE__); } @@ -1444,7 +1447,7 @@ namespace BALL std::multiset::iterator first = queue_.begin(); current_state_ = *first; queue_.erase(first); - --max_heap_size_; + ++num_computed_solutions_; TreeDecomposition& tree = *bond_assignment_->ntd_; @@ -1469,7 +1472,7 @@ namespace BALL { TreeDecomposition::children_iterator c_2 = c_i; ++c_2; - visitJoin(*current_state_, bag, getTable(boost::get(boost::vertex_index, tree, *c_i)), + visitJoin(*current_state_, bag, getTable(boost::get(boost::vertex_index, tree, *c_i)), getTable(boost::get(boost::vertex_index, tree, *c_2))); break; } @@ -1769,7 +1772,7 @@ namespace BALL if (d < bonds_->size()) { return d; - } + } else { throw Exception::IndexOverflow(__FILE__, __LINE__, static_cast(d), bonds_->size()); @@ -1795,7 +1798,7 @@ namespace BALL bool FPTBondOrderStrategy::DPBackTracking_::isSolutionNeeded(Penalty penalty) { - if (max_heap_size_ == 0) {return false;} + if (max_heap_size_ == 0 || ((max_num_solutions_ > 0) && (num_computed_solutions_ > max_num_solutions_))) {return false;} if (queue_.size() >= max_heap_size_) {return Maths::isLess(penalty, upper_bound_);} return Maths::isLessOrEqual(penalty, upper_bound_); } @@ -1846,7 +1849,7 @@ namespace BALL if (queue_.empty() || max_heap_size_ == 0) { return FPTBondOrderStrategy::infinite_penalty; - } + } else { return (*queue_.begin())->assignment.penalty; @@ -1857,25 +1860,25 @@ namespace BALL //* DPBackTrackingCombiner_ * //***************************************************************************************************** - FPTBondOrderStrategy::DPBackTrackingCombiner_::DPBackTrackingCombiner_(DPBackTrackingCombiner_ const& copy) - : backtrackers_(copy.deepCopyOfBacktrackers_()), + FPTBondOrderStrategy::DPBackTrackingCombiner_::DPBackTrackingCombiner_(DPBackTrackingCombiner_ const& copy) + : backtrackers_(copy.deepCopyOfBacktrackers_()), priority_queue_(copy.priority_queue_), - component_solutions_(copy.component_solutions_), + component_solutions_(copy.component_solutions_), assignment_(copy.assignment_), - solution_number_(copy.solution_number_), - optimum_(copy.optimum_), + solution_number_(copy.solution_number_), + optimum_(copy.optimum_), upper_bound_(copy.upper_bound_) { } - FPTBondOrderStrategy::DPBackTrackingCombiner_::DPBackTrackingCombiner_(std::vector& bond_assignments, - Size solution_number, Penalty upper_bound) - : backtrackers_(), - priority_queue_(), + FPTBondOrderStrategy::DPBackTrackingCombiner_::DPBackTrackingCombiner_(std::vector& bond_assignments, + Size solution_number, Penalty upper_bound) + : backtrackers_(), + priority_queue_(), component_solutions_(bond_assignments.size()), - assignment_(), - solution_number_(solution_number), - optimum_(FPTBondOrderStrategy::infinite_penalty), + assignment_(), + solution_number_(solution_number), + optimum_(FPTBondOrderStrategy::infinite_penalty), upper_bound_(upper_bound) { if (bond_assignments.empty()) @@ -1897,7 +1900,7 @@ namespace BALL FPTBondOrderStrategy::EdgeComparator_ ec(&graph); std::sort(sorted_edges.begin(), sorted_edges.end(), ec); - for (std::vector::const_iterator iter = bond_assignments.begin(); + for (std::vector::const_iterator iter = bond_assignments.begin(); iter != bond_assignments.end(); ++iter) { backtrackers_.push_back(new DPBackTracking_(**iter, solution_number_, sorted_edges, upper_bound_)); @@ -1906,39 +1909,6 @@ namespace BALL initialize_(); } - FPTBondOrderStrategy::DPBackTrackingCombiner_::DPBackTrackingCombiner_(std::vector& bond_assignments, - Size solution_number, Penalty upper_bound) - : backtrackers_(), - priority_queue_(), - component_solutions_(bond_assignments.size()), - assignment_(), - solution_number_(solution_number), - optimum_(FPTBondOrderStrategy::infinite_penalty), - upper_bound_(upper_bound) - { - backtrackers_.reserve(bond_assignments.size()); - - MolecularGraph& graph = *bond_assignments[0].molecule_; - sorted_edges.reserve(boost::num_edges(graph)); - - BGL_FORALL_EDGES(edge_it, graph, MolecularGraph) - { - sorted_edges.push_back(edge_it); - } - - // sort bonds - the second vertex could be in false order - FPTBondOrderStrategy::EdgeComparator_ ec(&graph); - std::sort(sorted_edges.begin(), sorted_edges.end(), ec); - - for (std::vector::iterator iter = bond_assignments.begin(); - iter != bond_assignments.end(); ++iter) - { - backtrackers_.push_back(new DPBackTracking_(*iter, solution_number_, sorted_edges, upper_bound_)); - } - - initialize_(); - } - FPTBondOrderStrategy::DPBackTrackingCombiner_::~DPBackTrackingCombiner_() { clear(); @@ -1946,14 +1916,14 @@ namespace BALL void FPTBondOrderStrategy::DPBackTrackingCombiner_::clear() { - for (std::vector::iterator iter = backtrackers_.begin(); + for (std::vector::iterator iter = backtrackers_.begin(); iter != backtrackers_.end(); ++iter) { delete *iter; } } - FPTBondOrderStrategy::DPBackTrackingCombiner_& + FPTBondOrderStrategy::DPBackTrackingCombiner_& FPTBondOrderStrategy::DPBackTrackingCombiner_::operator = (DPBackTrackingCombiner_ const& copy) { if (this != ©) @@ -1972,7 +1942,7 @@ namespace BALL return *this; } - std::pair + std::pair FPTBondOrderStrategy::DPBackTrackingCombiner_::getNextMinimumBackTracker_() const { if (backtrackers_.size() == 1) @@ -2034,7 +2004,7 @@ namespace BALL assignment_ = ass; return; - } + } else { throw Exception::OutOfRange(__FILE__, __LINE__); @@ -2061,7 +2031,7 @@ namespace BALL assignment_ = priority_queue_.top(); priority_queue_.pop(); - } + } else { throw Exception::OutOfRange(__FILE__, __LINE__); @@ -2151,7 +2121,7 @@ namespace BALL return assignment_; } - std::vector + std::vector FPTBondOrderStrategy::DPBackTrackingCombiner_::deepCopyOfBacktrackers_() const { std::vector ts; @@ -2166,5 +2136,4 @@ namespace BALL return ts; } - } diff --git a/source/STRUCTURE/assignBondOrderProcessor.C b/source/STRUCTURE/assignBondOrderProcessor.C index f8acc4f..9863a54 100644 --- a/source/STRUCTURE/assignBondOrderProcessor.C +++ b/source/STRUCTURE/assignBondOrderProcessor.C @@ -108,6 +108,9 @@ namespace BALL const char* AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS = "max_number_of_solutions"; const int AssignBondOrderProcessor::Default::MAX_NUMBER_OF_SOLUTIONS = 10; + const char* AssignBondOrderProcessor::Option::MAX_PENALTY = "max_penalty_score"; + const int AssignBondOrderProcessor::Default::MAX_PENALTY = -1; + const char* AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS = "compute_also_non_optimal_solutions"; const bool AssignBondOrderProcessor::Default::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS = false; @@ -148,6 +151,7 @@ namespace BALL max_bond_order_(), alpha_(), max_number_of_solutions_(), + max_penalty_(-1), compute_also_non_optimal_solutions_(), add_missing_hydrogens_(), compute_also_connectivity_(), @@ -237,13 +241,14 @@ namespace BALL ret &= s_it->second->readOptions(options); } - max_bond_order_ = options.getInteger(Option::MAX_BOND_ORDER); - alpha_ = options.getReal(Option::BOND_LENGTH_WEIGHTING); - max_number_of_solutions_ = options.getInteger(Option::MAX_NUMBER_OF_SOLUTIONS); + max_bond_order_ = options.getInteger(Option::MAX_BOND_ORDER); + alpha_ = options.getReal(Option::BOND_LENGTH_WEIGHTING); + max_number_of_solutions_ = options.getInteger(Option::MAX_NUMBER_OF_SOLUTIONS); + max_penalty_ = options.getInteger(Option::MAX_PENALTY); compute_also_non_optimal_solutions_ = options.getBool(Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS); - add_missing_hydrogens_ = options.getBool(Option::ADD_HYDROGENS); + add_missing_hydrogens_ = options.getBool(Option::ADD_HYDROGENS); compute_also_connectivity_ = options.getBool(Option::COMPUTE_ALSO_CONNECTIVITY); - use_fine_penalty_ = options.getBool(Option::USE_FINE_PENALTY); + use_fine_penalty_ = options.getBool(Option::USE_FINE_PENALTY); if (max_bond_order_ <= 0) { @@ -257,6 +262,12 @@ namespace BALL << " : Error in options! Please check the option Option::MAX_NUMBER_OF_SOLUTIONS." << endl; ret = false; } + if (max_penalty_ < -1) + { + Log.error() << __FILE__ << " " << __LINE__ + << " : Error in options! Please check the option Option::MAX_PENALTY." << endl; + ret = false; + } if ((alpha_ < 0) || ((alpha_ > 1))) { Log.error() << __FILE__ << " " << __LINE__ @@ -280,14 +291,13 @@ namespace BALL || (options.getBool(Option::OVERWRITE_SELECTED_BONDS) == true) || (options.getBool(Option::OVERWRITE_SINGLE_BOND_ORDERS) == false) || (options.getBool(Option::OVERWRITE_DOUBLE_BOND_ORDERS) == false) - || (options.getBool(Option::OVERWRITE_TRIPLE_BOND_ORDERS) == false) - || (options.getInteger(Option::MAX_NUMBER_OF_SOLUTIONS) == 0)) + || (options.getBool(Option::OVERWRITE_TRIPLE_BOND_ORDERS) == false) ) ) { Log.error() << __FILE__ << " " << __LINE__ << " : Error in options! FPT cannot be used with these options." << endl - << " Switch to solution strategy ASTAR by setting Option::ALGORITHM to Algorithm::ASTAR." << endl; - + << " Consider switch to solution strategy ASTAR by setting Option::ALGORITHM to Algorithm::ASTAR." << endl + << " Abort." << endl; ret = false; } @@ -328,6 +338,7 @@ cout << " \t Penalty file " << options[Option::Option::INIFile] << endl; cout << " \t alpha: " << options[Option::BOND_LENGTH_WEIGHTING] << endl; cout << " \t max bond order: " << options[Option::MAX_BOND_ORDER] << endl; cout << " \t max number of solutions " << options[Option::MAX_NUMBER_OF_SOLUTIONS] << endl; +cout << " \t max penalty " << options[Option::MAX_PENALTY] << endl; cout << " \t compute also non-optimal solutions: " << options.getBool(Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS) << endl; cout << " \t compute also connectivity: " << options.getBool(Option::COMPUTE_ALSO_CONNECTIVITY) << endl; cout << " \t connectivity cutoff: " << options[Option::CONNECTIVITY_CUTOFF] << endl; @@ -354,7 +365,7 @@ cout << endl; // check the options // What kind of composite do we have? - // Do we have a molecule? (Nothingelse is allowed) + // Do we have a molecule? (Nothing else is allowed) if (RTTI::isKindOf(ac)) { // Store the AtomContainer @@ -517,7 +528,7 @@ cout << "preassignPenaltyClasses_:" << preassignPenaltyClasses_() << " precomput #ifdef BALL_HAS_LPSOLVE strategy = strategies_["ILP"].get(); #else - Log.error() << "Error: BALL was configured without lpsolve support! Try A_STAR instead!" << + Log.error() << "Error: BALL was configured without lpsolve support! Try A_STAR or FPT instead!" << __FILE__ << " " << __LINE__<< std::endl; return Processor::ABORT; @@ -552,16 +563,20 @@ cout << "preassignPenaltyClasses_:" << preassignPenaltyClasses_() << " precomput solutions_.push_back(*solution); // Do we have to find more solutions? - bool found_another = true; - bool last_sol_is_optimal = true; + bool found_another = true; + bool last_sol_is_optimal = true; + bool consider_max_penalty = (max_penalty_ > -1); + double last_penalty = getTotalPenalty(0); while ( found_another && ((getNumberOfComputedSolutions() < max_number_of_solutions_) || (!max_number_of_solutions_)) && (last_sol_is_optimal || (compute_also_non_optimal_solutions_)) + && ((last_penalty <= max_penalty_) || (!consider_max_penalty)) ) { found_another = computeNextSolution(options.getBool(Option::APPLY_FIRST_SOLUTION)); last_sol_is_optimal &= (fabs(getTotalPenalty(0) - getTotalPenalty(solutions_.size()-1)) < 1.e-4); + last_penalty = getTotalPenalty(solutions_.size()-1); } #if defined DEBUG_TIMER timer_.stop(); @@ -1206,6 +1221,9 @@ cout << " ~~~~~~~~ added hydrogen dump ~~~~~~~~~~~~~~~~" << endl; options.setDefaultInteger(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS, AssignBondOrderProcessor::Default::MAX_NUMBER_OF_SOLUTIONS); + options.setDefaultInteger(AssignBondOrderProcessor::Option::MAX_PENALTY, + AssignBondOrderProcessor::Default::MAX_PENALTY); + options.setDefaultBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, AssignBondOrderProcessor::Default::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS); debian/patches/0010-Fix-compilation-of-FTPBondOrderStrategy-Fixes-451.patch0000644000000000000000000001361712013304225023214 0ustar From: Anna Dehof Date: Fri, 8 Jun 2012 19:28:12 +0200 Subject: Fix compilation of FTPBondOrderStrategy (Fixes #451) This patch is due to Daniel Stoeckel. --- source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C | 33 +++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C index 6572d96..98adf98 100644 --- a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C +++ b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C @@ -322,7 +322,7 @@ namespace BALL } } - return *best; + return DPConstRow_(boost::reference_wrapper(best->first), best->second); } FPTBondOrderStrategy::Penalty FPTBondOrderStrategy::DPTable_::operator[](FPTBondOrderStrategy::DPConfig_ const& config) const @@ -601,6 +601,9 @@ namespace BALL return bonds; } + +#define convertToCRow(tmp)\ + std::make_pair(boost::reference_wrapper((tmp).first), (tmp).second) void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeIntroduceBag(TreeDecompositionBag& bag, DPTable_& child, AdditionalBagProperties_& property) @@ -621,7 +624,7 @@ namespace BALL // copy with n new bondvalue-columns with different values for (DPTable_::const_iterator iter = child.begin(); iter != child.end(); ++iter) { - DPConstRow_ child_entry = *iter; + DPConstRow_ child_entry = convertToCRow(*iter); DPConfig_ conf(num_valences, num_bonds); Size vindex = 0; @@ -786,7 +789,7 @@ namespace BALL for (DPTable_::const_iterator entry_iterator = child.begin(); entry_iterator != child.end(); ++entry_iterator) { - Penalty entry_penalty(forgetInnerVertexIn(bag, *entry_iterator, new_entry, child_property.bonds, forgotten_index)); + Penalty entry_penalty(forgetInnerVertexIn(bag, convertToCRow(*entry_iterator), new_entry, child_property.bonds, forgotten_index)); if (entry_penalty < upper_bound_) { property.table->insert(new_entry, entry_penalty); @@ -803,7 +806,7 @@ namespace BALL Penalty min_penalty = FPTBondOrderStrategy::infinite_penalty; for (DPTable_::const_iterator iter = child.begin(); iter != child.end(); ++iter) { - min_penalty = std::min(min_penalty, forgetInnerVertexIn(bag, *iter, empty, empty_list, 0)); + min_penalty = std::min(min_penalty, forgetInnerVertexIn(bag, convertToCRow(*iter), empty, empty_list, 0)); if (Maths::isEqual(0, min_penalty)) { @@ -830,14 +833,14 @@ namespace BALL // insert each entry of the left child into a DPJoinMap for (DPTable_::const_iterator left_iter = left_child.begin(); left_iter != left_child.end(); ++left_iter) { - DPConstRow_ left_entry = *left_iter; + DPConstRow_ left_entry = convertToCRow(*left_iter); map.insert(std::pair (left_entry.first.get_pointer(), left_entry.second)); } // find for each entry of the right child's table appropiate entries in the DPJoinMap (which have the same bondvalues) for (DPTable_::const_iterator r_iter = right_child.begin(); r_iter != right_child.end(); ++r_iter) { - DPConstRow_ right_entry = *r_iter; + DPConstRow_ right_entry = convertToCRow(*r_iter); DPConfig_ const* right_conf = right_entry.first.get_pointer(); std::pair matching_range(map.equal_range(right_conf)); @@ -1602,7 +1605,7 @@ namespace BALL // insert possible antecessors in vectors for (DPTable_::const_iterator iter = left_table.begin(); iter != left_table.end(); ++iter) { - DPConstRow_ antecessor = *iter; + DPConstRow_ antecessor = convertToCRow(*iter); if (comp.compare(&successor, antecessor.first.get_pointer()) == 0) { left_entries.push_back(iter); @@ -1611,7 +1614,7 @@ namespace BALL for (DPTable_::const_iterator iter = right_table.begin(); iter != right_table.end(); ++iter) { - DPConstRow_ antecessor = *iter; + DPConstRow_ antecessor = convertToCRow(*iter); if (comp.compare(&successor, antecessor.first.get_pointer()) == 0) { right_entries.push_back(iter); @@ -1623,10 +1626,10 @@ namespace BALL for (std::vector::const_iterator left = left_entries.begin(); left != left_entries.end(); ++left) { - DPConstRow_ left_entry = **left; + DPConstRow_ left_entry = convertToCRow(**left); for (std::vector::const_iterator right = right_entries.begin(); right != right_entries.end(); ++right) { - DPConstRow_ right_entry = **right; + DPConstRow_ right_entry = convertToCRow(**right); // check sum of valences bool correct_valences = true; @@ -1657,8 +1660,8 @@ namespace BALL Penalty best_penalty = best.first->second + best.second->second; - DPConstRow_ left = *best.first; - DPConstRow_ right = *best.second; + DPConstRow_ left = convertToCRow(*best.first); + DPConstRow_ right = convertToCRow(*best.second); extendState(state, left.first, 0); ++state.index; @@ -1668,8 +1671,8 @@ namespace BALL { DPPairIt_ entry = *iter; - DPConstRow_ left = *entry.first; - DPConstRow_ right = *entry.second; + DPConstRow_ left = convertToCRow(*entry.first); + DPConstRow_ right = convertToCRow(*entry.second); Penalty add_penalty = (left.second + right.second) - best_penalty; if (isSolutionNeeded(state.assignment.penalty + add_penalty)) @@ -1720,7 +1723,7 @@ namespace BALL // check for each row entry: is it a possible anteccessor? for (DPTable_::iterator iter = table.begin(); iter != table.end(); ++iter) { - Penalty pen = bond_assignment_->forgetInnerVertexIn(bag, *iter, test_entry, child_bonds, forgotten_index); + Penalty pen = bond_assignment_->forgetInnerVertexIn(bag, convertToCRow(*iter), test_entry, child_bonds, forgotten_index); if (pen < FPTBondOrderStrategy::infinite_penalty && test_entry == successor) { debian/patches/0001-missingSigned.patch0000644000000000000000000000221212013304225015004 0ustar From: Andreas Hildebrandt Date: Tue, 14 Aug 2012 17:14:31 +0200 Subject: missingSigned =================================================================== --- include/BALL/DATATYPE/hashGrid.h | 2 +- source/DATATYPE/hashGrid.C | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/BALL/DATATYPE/hashGrid.h b/include/BALL/DATATYPE/hashGrid.h index 30df8ba..f4f260a 100644 --- a/include/BALL/DATATYPE/hashGrid.h +++ b/include/BALL/DATATYPE/hashGrid.h @@ -37,7 +37,7 @@ namespace BALL { namespace __private { - extern const char BALL_EXPORT neighbour_table_[27][3]; + extern const signed char BALL_EXPORT neighbour_table_[27][3]; } template class HashGrid3; diff --git a/source/DATATYPE/hashGrid.C b/source/DATATYPE/hashGrid.C index 01607f0..bb782bf 100644 --- a/source/DATATYPE/hashGrid.C +++ b/source/DATATYPE/hashGrid.C @@ -9,7 +9,7 @@ namespace BALL { namespace __private { - const char neighbour_table_[27][3] = + const signed char neighbour_table_[27][3] = { { 0, 0, 0 }, { 0, 0, -1 }, { 0, 0, 1 }, { 0, -1, -1 }, { 0, -1, 0 }, { 0, -1, 1 }, debian/patches/0006-Fix-compilation-of-binaryFileAdaptor-with-gcc-4.7.patch0000644000000000000000000000521012013304225023261 0ustar From: Andreas Hildebrandt Date: Tue, 14 Aug 2012 17:31:04 +0200 Subject: Fix compilation of binaryFileAdaptor with gcc-4.7 --- include/BALL/SYSTEM/binaryFileAdaptor.h | 53 ++++++++++++++++--------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/include/BALL/SYSTEM/binaryFileAdaptor.h b/include/BALL/SYSTEM/binaryFileAdaptor.h index 64f0f5d..6488e18 100644 --- a/include/BALL/SYSTEM/binaryFileAdaptor.h +++ b/include/BALL/SYSTEM/binaryFileAdaptor.h @@ -10,6 +10,33 @@ namespace BALL { + /** Coping with endianness. This function swaps the bytes of a variable + of type T if this type is of size 2n. + */ + template + void swapBytes(T& t) + { + if (sizeof(T) % 2 != 0) + { + Log.error() << "Cannot swap types of uneven size." << std::endl; + return; + } + + char* tmp = reinterpret_cast(&t); + std::reverse(tmp, tmp + sizeof(T)); + } + + //In the following some specialisations of swapBytes are provided for efficiency reasons + //These should also cover BALL types like Size, Position and Index + template<> BALL_EXPORT void swapBytes(unsigned short&); + template<> BALL_EXPORT void swapBytes(short&); + template<> BALL_EXPORT void swapBytes(unsigned int&); + template<> BALL_EXPORT void swapBytes(int&); + template<> BALL_EXPORT void swapBytes(unsigned long&); + template<> BALL_EXPORT void swapBytes(long&); + template<> BALL_EXPORT void swapBytes(float&); + template<> BALL_EXPORT void swapBytes(double&); + /** * Helper class for data conversion. * BinaryFileAdaptors are used to read and write binary data from and to @@ -152,32 +179,6 @@ namespace BALL return is; } - /** Coping with endianness. This function swaps the bytes of a variable - of type T if this type is of size 2n. - */ - template - void swapBytes(T& t) - { - if (sizeof(T) % 2 != 0) - { - Log.error() << "Cannot swap types of uneven size." << std::endl; - return; - } - - char* tmp = reinterpret_cast(&t); - std::reverse(tmp, tmp + sizeof(T)); - } - - //In the following some specialisations of swapBytes are provided for efficiency reasons - //These should also cover BALL types like Size, Position and Index - template<> BALL_EXPORT void swapBytes(unsigned short&); - template<> BALL_EXPORT void swapBytes(short&); - template<> BALL_EXPORT void swapBytes(unsigned int&); - template<> BALL_EXPORT void swapBytes(int&); - template<> BALL_EXPORT void swapBytes(unsigned long&); - template<> BALL_EXPORT void swapBytes(long&); - template<> BALL_EXPORT void swapBytes(float&); - template<> BALL_EXPORT void swapBytes(double&); } //namespace BALL #ifndef BALL_NO_INLINE_FUNCTIONS debian/patches/0003-Add-Copyconstructor-to-String.patch0000644000000000000000000000210312013304225017774 0ustar From: Daniel Stoeckel Date: Wed, 25 Apr 2012 23:25:08 +0200 Subject: Add Copyconstructor to String Needed for GCC 4.7 --- include/BALL/DATATYPE/string.h | 3 +++ include/BALL/DATATYPE/string.iC | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/include/BALL/DATATYPE/string.h b/include/BALL/DATATYPE/string.h index 1172180..2ce6e60 100644 --- a/include/BALL/DATATYPE/string.h +++ b/include/BALL/DATATYPE/string.h @@ -155,6 +155,9 @@ namespace BALL /// STL string copy constructor String(const string& string); + /// Copy constructor + String(const String& s); + #ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES /// Move constructor String(String&& s); diff --git a/include/BALL/DATATYPE/string.iC b/include/BALL/DATATYPE/string.iC index b255849..c347588 100644 --- a/include/BALL/DATATYPE/string.iC +++ b/include/BALL/DATATYPE/string.iC @@ -8,6 +8,11 @@ String::String() { } +BALL_INLINE String::String(const String& s) + : string(s) +{ +} + #ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES BALL_INLINE String::String(String&& s) debian/patches/0005-Modify-BALL_RELEASE_STRING-macro.patch0000644000000000000000000000122712013304225017476 0ustar From: Daniel Stoeckel Date: Wed, 25 Apr 2012 23:26:57 +0200 Subject: Modify BALL_RELEASE_STRING macro GCC 4.7 mistook DATE__ for a c++11 literal --- source/COMMON/version.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/COMMON/version.C b/source/COMMON/version.C index 1a0987b..853413d 100644 --- a/source/COMMON/version.C +++ b/source/COMMON/version.C @@ -12,7 +12,7 @@ namespace BALL { const char* VersionInfo::getVersion() { - return BALL_RELEASE_STRING " ("__DATE__", " __TIME__ ")"; + return BALL_RELEASE_STRING " (" __DATE__", " __TIME__ ")"; } int VersionInfo::getMinorRevision() debian/patches/0011-Fix-compilation-of-Python-bindings-with-new-sip-vers.patch0000644000000000000000000000161712013304225024236 0ustar From: Andreas Hildebrandt Date: Wed, 15 Aug 2012 00:12:49 +0200 Subject: Fix compilation of Python bindings with new sip versions. For some reason, sip does not like static members of the same type as the class. In this case, a varget_... - method is generated with the wrong arguments (unnamed parameter which should be called "sipSelf"). This patch works around it. --- source/PYTHON/EXTENSIONS/BALL/PTE_.sip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/PYTHON/EXTENSIONS/BALL/PTE_.sip b/source/PYTHON/EXTENSIONS/BALL/PTE_.sip index 4589e92..3e5f8ff 100644 --- a/source/PYTHON/EXTENSIONS/BALL/PTE_.sip +++ b/source/PYTHON/EXTENSIONS/BALL/PTE_.sip @@ -61,7 +61,7 @@ class Element //friend ostream& operator << (ostream& s, const Element&); bool isUnknown() const; - static Element UNKNOWN; + Element UNKNOWN; }; class PTE_ debian/patches/0002-fix_python_sip_const.patch0000644000000000000000000000376612013304225016471 0ustar From: Andreas Hildebrandt Date: Tue, 14 Aug 2012 17:14:31 +0200 Subject: fix_python_sip_const =================================================================== --- source/PYTHON/EXTENSIONS/BALL/file.sip | 2 +- source/PYTHON/EXTENSIONS/BALL/periodicBoundary.sip | 4 ++-- source/PYTHON/EXTENSIONS/VIEW/mainControl.sip | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/PYTHON/EXTENSIONS/BALL/file.sip b/source/PYTHON/EXTENSIONS/BALL/file.sip index e29170a..6ec6dc4 100644 --- a/source/PYTHON/EXTENSIONS/BALL/file.sip +++ b/source/PYTHON/EXTENSIONS/BALL/file.sip @@ -70,7 +70,7 @@ class File // std::fstream& getFileStream(); bool copyTo(const String&); bool moveTo(const String&); - bool remove() const; + bool remove(); bool renameTo(const String&); bool truncate(int) const; bool operator == (const File& /file/) const; diff --git a/source/PYTHON/EXTENSIONS/BALL/periodicBoundary.sip b/source/PYTHON/EXTENSIONS/BALL/periodicBoundary.sip index 2b79778..f8ab293 100644 --- a/source/PYTHON/EXTENSIONS/BALL/periodicBoundary.sip +++ b/source/PYTHON/EXTENSIONS/BALL/periodicBoundary.sip @@ -22,8 +22,8 @@ using namespace BALL; void disable(); SimpleBox3 getBox() const; void setBox(const SimpleBox3&); - int addSolvent(const String&) const; - int removeSolvent() const; + int addSolvent(const String&); + int removeSolvent(); bool isEnabled() const; void updateMolecules(); Options* options; diff --git a/source/PYTHON/EXTENSIONS/VIEW/mainControl.sip b/source/PYTHON/EXTENSIONS/VIEW/mainControl.sip index 0a6c319..61d4596 100644 --- a/source/PYTHON/EXTENSIONS/VIEW/mainControl.sip +++ b/source/PYTHON/EXTENSIONS/VIEW/mainControl.sip @@ -139,7 +139,7 @@ class MainControl virtual void openFile(const String&) throw(); void saveBALLViewProjectFile(const String&); void loadBALLViewProjectFile(const String&) throw(); - void quickSave() const; + void quickSave(); void quickLoad(); void processEvents(Size); }; debian/patches/0007-Fixed-the-FPT-version-of-bond-order-assignment.patch0000644000000000000000000003563012013304225022751 0ustar From: Anna Dehof Date: Mon, 26 Mar 2012 15:27:56 +0200 Subject: Fixed the FPT version of bond order assignment This commit fixes quite a large number of bugs, e.g., crashes due to uninitialized variables for hand-drawn molecules (had strange bond ordering and were thus ignored) or wrong tree decompositions. The most important change was fixing the tree decomposition for cases where greedy did not return the correct solution (which fortunately is very rare). --- include/BALL/DATATYPE/GRAPH/graphAlgorithms.h | 7 +- include/BALL/DATATYPE/GRAPH/treeWidth.h | 44 ++++++- include/BALL/DATATYPE/GRAPH/treeWidth.iC | 131 +++++++++++++------- source/DATATYPE/GRAPH/treeWidth.C | 24 ++++ source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C | 12 +- 5 files changed, 154 insertions(+), 64 deletions(-) diff --git a/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h b/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h index d10de34..5e218ff 100644 --- a/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h +++ b/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h @@ -25,7 +25,7 @@ namespace boost enum vertex_orig_ptr_t { vertex_orig_ptr }; enum edge_bond_ptr_t { edge_bond_ptr }; - enum edge_orig_ptr_t { edge_orig_ptr }; + enum edge_orig_ptr_t { edge_orig_ptr }; BOOST_INSTALL_PROPERTY(vertex, atom_ptr); BOOST_INSTALL_PROPERTY(vertex, orig_ptr); @@ -150,7 +150,7 @@ namespace BALL { bi = ai; ++bi; for (; bi != ai_end; ++bi) - if (!boost::edge(*ai, *bi, graph).second) + if (*bi != *ai && !boost::edge(*ai, *bi, graph).second) boost::add_edge(*ai, *bi, graph); } @@ -179,7 +179,6 @@ namespace BALL typedef typename boost::property_traits::type>::value_type EdgeProperties; - EdgeProperties ep = boost::get(boost::edge_all_t(), graph, boost::edge(vertex, *ai, graph).first) ; result.getEdgeProperties().push_back(boost::get(boost::edge_all_t(), graph, boost::edge(vertex, *ai, graph).first)); bi = ai; ++bi; @@ -189,7 +188,7 @@ namespace BALL { boost::add_edge(*ai, *bi, graph); result.getEdges().push_back(std::make_pair(boost::get(boost::vertex_index, graph, *ai), - boost::get(boost::vertex_index, graph, *bi))); + boost::get(boost::vertex_index, graph, *bi))); } } } diff --git a/include/BALL/DATATYPE/GRAPH/treeWidth.h b/include/BALL/DATATYPE/GRAPH/treeWidth.h index dc7cdc5..f7687ef 100644 --- a/include/BALL/DATATYPE/GRAPH/treeWidth.h +++ b/include/BALL/DATATYPE/GRAPH/treeWidth.h @@ -30,10 +30,12 @@ #include #include #include +#include #include #include #include +#include #include namespace boost @@ -91,7 +93,7 @@ namespace BALL END_BAG }; - typedef typename GRAPH::GraphTraits::EditableGraph EditableGraph; + typedef typename GRAPH::GraphTraits::EditableGraph EditableGraph; typedef typename boost::graph_traits::vertex_descriptor OriginalVertexType; typedef std::set TreeDecompositionContent; @@ -111,6 +113,16 @@ namespace BALL TreeWidth(UndirectedGraph const& input); + /** Compute the tree width of a given tree decomposition. + * This function iterates over all nodes in the graph to determine the tree width, + * i.e., the (maximum number of vertices over all bags) - 1 + */ + static Size computeTreeWidth(TreeDecomposition const& td); + + /** Write a tree decomposition in graphviz format. + */ + void writeGraphvizFile(std::ostream& out, TreeDecomposition const& td); + std::vector >& getComponents() { return components_; } std::vector >& getNiceTreeDecompositions() { return nice_tree_decompositions_; } @@ -120,25 +132,44 @@ namespace BALL { public: ComponentFilter_(ComponentMap cm, Position i) - : cm_(&cm), + : cm_(cm), component_(i) { } template bool operator() (const Vertex& e) const { - return ((*cm_)[e] == component_); + return ((cm_)[e] == component_); } protected: - ComponentMap* cm_; + ComponentMap cm_; Position component_; }; + /** PropertyWriter for graphviz output. + */ + class BagContentWriter + { + public: + BagContentWriter(TreeDecomposition const* td, UndirectedGraph const* original_graph) + : td_(td), + original_graph_(original_graph) + { } + + void operator() (std::ostream& out, const TreeDecompositionBag& v) const; + + protected: + TreeDecomposition const* td_; + UndirectedGraph const* original_graph_; + }; + + // TODO: would UndirectedGraph suffice here? MolecularGraph const* input_; + std::vector > components_; - std::vector > nice_tree_decompositions_; + std::vector > nice_tree_decompositions_; std::vector > nice_tree_decomposition_graphs_; }; @@ -397,6 +428,9 @@ namespace BALL * The bitset remembers the eliminated vertices without an ordering. */ BitSet buildBitset() const; + + protected: + std::map index_to_vertex_; }; /** diff --git a/include/BALL/DATATYPE/GRAPH/treeWidth.iC b/include/BALL/DATATYPE/GRAPH/treeWidth.iC index ba0c82b..d79deb2 100644 --- a/include/BALL/DATATYPE/GRAPH/treeWidth.iC +++ b/include/BALL/DATATYPE/GRAPH/treeWidth.iC @@ -68,6 +68,34 @@ namespace BALL } } + template + Size TreeWidth::computeTreeWidth(TreeDecomposition const& td) + { + Size result = 1; + + BGL_FORALL_VERTICES_T(current_vertex, td._g, UndirectedGraph) + { + result = std::max((Size)(boost::get(boost::vertex_bag_content, td, current_vertex).size()), result); + } + + return result - 1; + } + + template + void TreeWidth::writeGraphvizFile(std::ostream& out, TreeDecomposition const& td) + { + boost::write_graphviz(out, td._g, BagContentWriter(&td, input_)); + } + + template <> + void TreeWidth::BagContentWriter::operator() (std::ostream& out, const TreeDecompositionBag& v) const; + + template + void TreeWidth::BagContentWriter::operator() (std::ostream& out, const TreeDecompositionBag& v) const + { + out << "[label=\"" << boost::get(boost::vertex_index, *td_, v) << "\"]"; + } + // ***************************************************************************************** // * TreeWidthImplementation * // ***************************************************************************************** @@ -322,8 +350,9 @@ namespace BALL if (boost::out_degree(vertex, graph_) <= 1) return IS_SIMPLICIAL; - VertexType* n1 = NULL; - VertexType* n2 = NULL; + VertexType n1 = VertexType(); + VertexType n2 = VertexType(); + bool found_unconnected = false; typename boost::graph_traits::adjacency_iterator a_i, a_j, ai_end; @@ -337,20 +366,21 @@ namespace BALL if (!boost::edge(i, j, graph_).second) { - if (!n1) + if (!found_unconnected) { - n1 = &i; - n2 = &j; + n1 = i; + n2 = j; + found_unconnected = true; } - else if (i == *n1 || i == *n2) + else if (i == n1 || i == n2) { - n1 = &i; - n2 = &i; + n1 = i; + n2 = i; } - else if (j == *n1 || j == *n2) + else if (j == n1 || j == n2) { - n1 = &j; - n2 = &j; + n1 = j; + n2 = j; } else { @@ -376,11 +406,10 @@ namespace BALL { Size nxt = cstate.permutation.size(); - std::map index_to_vertex; BGL_FORALL_VERTICES_T(current_vertex, graph_, UndirectedGraph) { Size index = boost::get(boost::vertex_index, graph_, current_vertex); - index_to_vertex[index] = current_vertex; + index_to_vertex_[index] = current_vertex; SIMPLICIAL_TYPE simplicial(isSimplicial(current_vertex)); if (simplicial == IS_SIMPLICIAL || simplicial == ALMOST_SIMPLICIAL) { @@ -388,14 +417,13 @@ namespace BALL } } - - for (typename std::vector::const_iterator st_iter = cstate.permutation.begin() + nxt; - st_iter != cstate.permutation.end(); ++st_iter) + for (typename std::vector::const_iterator st_iter = cstate.permutation.begin() + nxt; + st_iter != cstate.permutation.end(); + ++st_iter) { - VertexType vertex = index_to_vertex[*st_iter]; + VertexType vertex = index_to_vertex_[*st_iter]; cstate.g = std::max(cstate.g, (Size)boost::out_degree(vertex, graph_)); cstate.f = std::max(cstate.f, cstate.g); - GRAPH::eliminateVertex(vertex, graph_); } } @@ -459,55 +487,62 @@ namespace BALL { upper_bound = nstate.f; state.permutation = nstate.permutation; - state.permutation.push_back(0); + BGL_FORALL_VERTICES_T(v, graph_, UndirectedGraph) // yes, it is only one, but still... + { + state.permutation.push_back(boost::get(boost::vertex_index, graph_, v)); + } } } else { - std::map index_to_vertex; + index_to_vertex_.clear(); BGL_FORALL_VERTICES_T(v, graph_, UndirectedGraph) { - index_to_vertex[boost::get(boost::vertex_index, graph_, v)] = v; + index_to_vertex_[boost::get(boost::vertex_index, graph_, v)] = v; } for (typename std::vector::iterator viter = greedy_solution.first.begin(); viter != greedy_solution.first.end(); ++viter) { - VertexType& vertex = index_to_vertex[*viter]; - Size degree = boost::out_degree(vertex, graph_); + if (index_to_vertex_.find(*viter) != index_to_vertex_.end()) + { + VertexType& vertex = index_to_vertex_[*viter]; + Size degree = boost::out_degree(vertex, graph_); - GRAPH::UndoEliminateOperation elimination(graph_, vertex); + GRAPH::UndoEliminateOperation elimination = GRAPH::eliminateVertexUndoable(vertex, graph_); - QuickBBState xstate(nstate); - xstate.g = std::max(nstate.g, degree); - xstate.permutation.push_back(boost::get(boost::vertex_index, graph_, vertex)); + QuickBBState xstate(nstate); + xstate.g = std::max(nstate.g, degree); + xstate.permutation.push_back(*viter); - BitSet bitset(buildBitset()); + BitSet bitset(buildBitset()); - Size lower_bound = L()(graph_); - xstate.h = lower_bound; - xstate.f = std::max(xstate.g, lower_bound); + Size lower_bound = L()(graph_); + xstate.h = lower_bound; + xstate.f = std::max(xstate.g, lower_bound); - if (xstate.f >= upper_bound) - { - elimination.undo(); + if (xstate.f >= upper_bound) + { + VertexType vertex_replace = elimination.undo(); + index_to_vertex_[*viter] = vertex_replace; + continue; + } - continue; - } + MapPos entry(visitedSubgraphs.insert(MapEntry(bitset, xstate.f))); - MapPos entry(visitedSubgraphs.insert(MapEntry(bitset, xstate.f))); + if (entry.second) + { + branchAndBound(xstate); + } + else if ((entry.first)->second > xstate.f) + { + entry.first->second = xstate.f; + branchAndBound(xstate); + } - if (entry.second) - { - branchAndBound(xstate); - } - else if ((entry.first)->second > xstate.f) - { - entry.first->second = xstate.f; - branchAndBound(xstate); + VertexType vertex_replace = elimination.undo(); + index_to_vertex_[*viter] = vertex_replace; } - - elimination.undo(); } } } @@ -687,7 +722,7 @@ namespace BALL typename TreeWidth::TreeDecompositionBag TreeWidthImplementation::TreeDecompositionBuilder::buildRoot_(TreeDecompositionBag child) { - TreeDecompositionBag last_vertex; + TreeDecompositionBag last_vertex = TreeDecompositionBag(); TreeDecompositionContent content = boost::get(boost::vertex_bag_content, *nice_tree_, child); diff --git a/source/DATATYPE/GRAPH/treeWidth.C b/source/DATATYPE/GRAPH/treeWidth.C index 981605d..7485305 100644 --- a/source/DATATYPE/GRAPH/treeWidth.C +++ b/source/DATATYPE/GRAPH/treeWidth.C @@ -1 +1,25 @@ #include + +#include + +namespace BALL +{ + template <> + void TreeWidth::BagContentWriter::operator() (std::ostream& out, const TreeDecompositionBag& v) const + { + out << "[label=\""; + + // find all vertices in the current bag + TreeDecompositionContent content = boost::get(boost::vertex_bag_content, *td_, v); + + for (typename TreeDecompositionContent::const_iterator tdc_it = content.begin(); tdc_it != content.end(); ++tdc_it) + { + TreeWidth::OriginalVertexType ov = *tdc_it; + Atom const* atom = boost::get(boost::vertex_atom_ptr, *original_graph_, ov); + + out << atom->getFullName() << " (" << atom << ") " << "\\n"; + } + + out << "\"]"; + } +} diff --git a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C index c239fea..42040e5 100644 --- a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C +++ b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C @@ -68,7 +68,7 @@ namespace BALL for (Position i = 0; i < ntds.size(); ++i) { bond_assignments.push_back(new FPTBondOrderAssignment_(*this, ntds[i], upper_bound_)); - Penalty result = bond_assignments[i]->compute(); + bond_assignments[i]->compute(); } // initialize backtracking @@ -647,8 +647,8 @@ namespace BALL { Edge e = *it; - MolecularGraphTraits::VertexType source = boost::source(*it, *molecule_); - MolecularGraphTraits::VertexType target = boost::target(*it, *molecule_); + MolecularGraphTraits::VertexType source = boost::source(e, *molecule_); + MolecularGraphTraits::VertexType target = boost::target(e, *molecule_); if (iv == source || iv == target) { @@ -1890,8 +1890,7 @@ namespace BALL BGL_FORALL_EDGES(edge_it, graph, MolecularGraph) { - if (boost::source(edge_it, graph) < boost::target(edge_it, graph)) - sorted_edges.push_back(edge_it); + sorted_edges.push_back(edge_it); } // sort bonds - the second vertex could be in false order @@ -1924,8 +1923,7 @@ namespace BALL BGL_FORALL_EDGES(edge_it, graph, MolecularGraph) { - if (boost::source(edge_it, graph) < boost::target(edge_it, graph)) - sorted_edges.push_back(edge_it); + sorted_edges.push_back(edge_it); } // sort bonds - the second vertex could be in false order debian/patches/0004-Fix-compilation-of-hashMap.h-on-gcc-4.7.patch0000644000000000000000000000176412013304225021142 0ustar From: Andreas Hildebrandt Date: Tue, 14 Aug 2012 17:23:22 +0200 Subject: Fix compilation of hashMap.h on gcc-4.7 --- include/BALL/DATATYPE/hashMap.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/include/BALL/DATATYPE/hashMap.h b/include/BALL/DATATYPE/hashMap.h index 329db2b..f185b8c 100644 --- a/include/BALL/DATATYPE/hashMap.h +++ b/include/BALL/DATATYPE/hashMap.h @@ -236,7 +236,7 @@ namespace BALL template const T& HashMap::operator [] (const Key& key) const { - ConstIterator it = find(key); + ConstIterator it = this->find(key); if (it == Base::end()) { throw IllegalKey(__FILE__, __LINE__); @@ -272,12 +272,7 @@ namespace BALL T& HashMap::operator [] (const Key& key) { - Iterator it = find(key); - if (it == Base::end()) - { - it = insert(ValueType(key, T())).first; - } - return it->second; + return BALL_MAP_NAME::operator[] (key); } } // namespace BALL debian/patches/series0000644000000000000000000000105112013304225012017 0ustar 0001-missingSigned.patch 0002-fix_python_sip_const.patch 0003-Add-Copyconstructor-to-String.patch 0004-Fix-compilation-of-hashMap.h-on-gcc-4.7.patch 0005-Modify-BALL_RELEASE_STRING-macro.patch 0006-Fix-compilation-of-binaryFileAdaptor-with-gcc-4.7.patch 0007-Fixed-the-FPT-version-of-bond-order-assignment.patch 0008-Added-MAX_PENALTY-option-to-bond-order-assignment.patch 0009-Fixed-a-bug-in-the-AssignBondOrderProcessor.patch 0010-Fix-compilation-of-FTPBondOrderStrategy-Fixes-451.patch 0011-Fix-compilation-of-Python-bindings-with-new-sip-vers.patch debian/libball1.4-doc.doc-base.manual0000644000000000000000000000112612013304225014420 0ustar Document: ball-manual Title: Developers' manual for BALL, the Biochmical Algorithms Library Author: The developers of BALL Abstract: BALL (Biochemical Algorithms Library) is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. The library documentation comprises an extensive manual on how to program molecular modelling programs with BALL. Section: Science/Chemistry Format: HTML Index: /usr/share/doc/libball1.4/html/BALL/index.html Files: /usr/share/doc/libball1.4/html/BALL/*.html debian/ballview.manpages0000644000000000000000000000002212013304225012472 0ustar debian/ballview.1 debian/ballview.lintian-overrides0000644000000000000000000000014512013304225014343 0ustar ballview binary: postinst-does-not-call-installdocs ballview binary: prerm-does-not-call-installdocs debian/libball1.4-dev.dirs0000644000000000000000000000004612013304225012441 0ustar /usr/include/BALL /usr/lib/cmake/BALL debian/copyright0000644000000000000000000001127712013304225011121 0ustar This package was debianized by Andreas Moll (2007) and Andreas Hildebrandt (2008-2009), with some assistance by Steffen Moeller and first completed on Mon, 17 Aug 2009 16:49:06 +0200. It was downloaded from http://ball-www.bioinf.uni-sb.de/Releases/all/ Main Upstream Authors: Andreas Hildebrandt , Oliver Kohlbacher , Andreas Moll Further contributers as listed on http://www.ballview.org/Overview/Team : Tim Aubertin, Christian Bender, Andreas Bertsch, Nicolas Pascal Boghossian, Andreas Burchardt, Andreas Crauser, Anna Dehof, Carla Haid, Andreas Kerzmann, Heiko Klein, Hans-Peter Lenhof, Bettina Leonhardt, Peter Müller, Stefan Strobel, Marc Sturm Copyright: 1998-2009, the BALL project group License: This package is free software; you can redistribute it and/or modify it either under the terms of the GNU Lesser General Public License (libraries) or the GNU General Public License (the ballview application) as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The respective source code will indicate which license is applying for the code of your interest. If in doubt, contact the the authors. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA File: source/configure Copyright: (C) 1992-6, 1998-2006 Free Software Foundation, Inc. License: This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. File: source/config/m4/ltversion.m4 Copyright: (C) 2004 Free Software Foundation, Inc. Author: Scott James Remnant, 2004 License: This file is free software; the Free Software Foundation gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. File: source/config/m4/libtool.m4 Copyright: (C) 1996-2008 Free Software Foundation, Inc. Author: Gordon Matzigkeit, 1996 This file is part of GNU Libtool. GNU Libtool is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libtool is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Libtool; see the file COPYING. If not, a copy can be downloaded from http://www.gnu.org/licenses/gpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. File: source/config/m4/ax_boost_*.m4 Copyright: (C) 2008 Thomas Porschberg , Michael Tindal, Daniel Casimiro , License: Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. File: source/config/m4/ac_python_devel.m4 Copyright: (C) 2008 Sebastian Huber Alan W. Irwin , Rafael Laboissiere , Andrew Collier , Matteo Settenvini , Horst Knorr License: GPL3+ On Debian systems, the complete text of the GNU Lesser General Public License can be found in `/usr/share/common-licenses/LGPL-2' and the GNU Public License can be found in `/usr/share/common-licenses/GPL-2'. The Debian packaging is (C) 2007-8, Andreas Moll and Andreas Hildebrandt and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. debian/debian-ball-install0000755000000000000000000000241712013304225012706 0ustar #!/bin/bash # script to build BALL / BALLView to create and compile a Debian/Ubuntu source package set -e #adapt to your settings export BALL_PATH=`pwd | sed -e 's%/debian-upstream$%%g' -e 's%/debian$%%g'` if [ ! -d "$BALL_PATH" ]; then echo "$0: cannot find directory '$BALL_PATH' as presumed root of the source tree." echo "Pwd: " `pwd` exit -1 fi unset QTDIR echo $1 if [ "$1" == "configure" ] then cd $BALL_PATH mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=./usr -DBALL_PATH=/usr -DBALL_DATA_PATH=/usr/share/BALL-1.4/data exit $? fi if [ "$1" == "build" ] then cd $BALL_PATH/build && make -j 2 all doc doc_tutorial install # cd $BALL_PATH/source && echo "Running doxygen... This can take a while..." && make doc && echo "Doxygen done!" && make depend && mymake && make install # cd $BALL_PATH/source/PYTHON/EXTENSIONS && mymake && make install # cd $BALL_PATH/source/APPLICATIONS/BALLVIEW && mymake exit $? fi if [ "$1" == "install" ] then bash debian/createBALLDeb source exit $? fi if [ "$1" == "clean" ] then cd $BALL_PATH/source if [ -f Makefile ] then make clean cd PYTHON/EXTENSIONS make clean rm -rf ../lib/Linux* rm -rf ../doc/doxygen/latex/* rm -f $BALL_PATH/source/config.status 2>/dev/null fi exit $? fi debian/libball1.4-doc.doc-base.tutorial0000644000000000000000000000073112013304225015007 0ustar Document: ball-tutorial Title: BALL Programming Tutorial Author: Andreas Hildebrandt Abstract: BALL (Biochemical Algorithms Library) is an application framework in C++ that has been specifically designed for rapid software development in Molecular Modeling and Computational Molecular Biology. This tutorial contains a small structured introduction into programming with BALL. Section: Science/Chemistry Format: PDF Files: /usr/share/doc/libball1.4/tutorial.pdf.gz debian/ballview.desktop0000644000000000000000000000040412013304225012354 0ustar [Desktop Entry] Version=1.0 Terminal=false Icon=ballview Exec=BALLView Name=BALLView GenericName=Molecular modeling and visualization tool Type=Application MimeType=chemical/x-pdb;chemical/x-mdl-molfile;chemical/x-mol2; Categories=Education;Science;Chemistry; debian/ballview.dirs0000644000000000000000000000014112013304225011642 0ustar usr/bin usr/share/man/man1 usr/share/doc/ballview/html usr/share/applications usr/share/pixmaps debian/ballview.menu0000644000000000000000000000034612013304225011654 0ustar ?package(ballview):\ needs="X11"\ section="Applications/Science/Chemistry"\ title="BALLView"\ command="/usr/bin/BALLView"\ icon="ballview_32x32.xpm"\ longtitle="BALLView: A Molecular modeling and molecular graphics tool"