Algebra3D
Algebra for 3D transformations
|
A small library to provide algebraic operations on vectors in 3D space. The package defines only 3 template classes:
Each of the template types is specialized only for double and float, i.e. only the following types can be used (these are typedefs for abbreviation):
In addition some helper functions are defined in global.h. Some of those are fully defined in the header to make it possible for the compiler to inline them.
The library can be obtained either by cloning the static Mercurial 2.8.1 repository:
hg clone http://lcvmwww.epfl.ch/software/algebra3d/repo algebra3d
or downloading a ZIP archive.
The library has no extra dependencies. Any extra compilation settings should be set in Makefile.config
. Provided all compilation setting are set appropriately the code can be build simply by running
$ make
which creates the following files:
./lib/libalgebra3d.a
– a static library ./lib/libalgebra3d.so
– a dynamic library$ otool -L /path/to/where/it/is/lib/libalgebra3d.soTo modify the install path use
$ install_name_tool -id /new/location/libalgebra3d.so /new/location/libalgebra3d.soIf you want just to rename the file to libalgebra3d.dylib (to use the MacOS convention) you would also need to do the above. To save yourself trouble you can also just use the static library.
The software has been tested on:
The library has a set of unit tests based on CppUnit 1.12.1. To build the tests you need to have CppUnit available in your include path and library path. If it is not in your default paths add what is necessary to Makefile.config
.
To build the tests use
$ make all_test
In addition to the results of products of the default build rule this will create test binaries:
./bin/TesterD
– double precision version of tests for dynamic library ./bin/TesterF
– single precision version of tests for dynamic library ./bin/TesterStaicD
– double precision version of tests for static library ./bin/TesterStaticF
– single precision version of tests for static libraryThe static and dynamic versions are exactly the same, they are both built to test static and dynamic linking. The pertinent rules in the Makefile
might be of interest.
A simple program for running performance tests is available in src/timing.cpp
. This is not compiled by the default make
rule, but can be built by:
$ make timing
which builds two binaries:
./bin/timingD
– a binary for timing double precision computations ./bin/timingF
– a binary for timing single precision computationsIf you find this code useful please cite:
Jonathan S. Mitchell, Jaroslaw Glowacki, Alexandre E. Grandchamp, Robert S. Manning and John H. Maddocks,
Sequence-dependent persistence lengths of DNA
submitted.
DOI: ?