Skip to content
kyllingstad edited this page Jan 24, 2011 · 11 revisions

SciD

SciD is a collection of numerical routines and bindings written in and for the D programming language. Currently, the collection is rather small (see below) but expanding.

For the time being, SciD simply aims to be a freely usable repository of numerical algorithms. The long-term goal is to ultimately produce a full-fledged, general-purpose scientific library à la the GNU Scientific Library and SciPy.

Contents

Below is a list of the main modules. Click on the links to get to the documentation (updated 2010-07-22).

  • scid.calculus: Numerical integration (quadrature) and differentiation.
  • scid.constants: Fundamental constants of mathematics and Nature.
  • scid.exception: Contains the NumericsException class, thrown when an algorithm fails.
  • scid.functions: Special functions.
  • scid.linalg: Linear algebra functions, i.e. user-friendly interfaces to LAPACK.
  • scid.matrix: Contains the MatrixView type, which is a LAPACK-compatible matrix view of ordinary D arrays, as well as some utility functions.
  • scid.nonlinear: Contains a method for solving nonlinear equations sets. In the future, algorithms for nonlinear least-squares problems should be added.
  • scid.types: Useful types. (Right now, just the Result type, which contains the result and absolute error of a calculation.)
  • scid.util: Stuff that doesn't fit anywhere else.

There are also a few subpackages (click one of the links above and you'll find the API docs for these in the package tree):

  • scid.core: Things that are not directly related to numerics.
  • scid.bindings: Bindings to third-party libraries. Currently only contains the BLAS and LAPACK bindings by Bill Baxter. (Thanks, Bill!)
  • scid.ports: This is where a lot of the action actually takes place. This package contains ports of FORTRAN and C code from various sources, mainly Netlib. It's been ported it using a "get it to work - NOW" philosophy, and as such a lot of it is just FORTRAN code written with D syntax.

Requirements

  • DMD >=2.051
  • BLAS and LAPACK libraries

Installation

Currently, the only way to get SciD is to download the development version from the repository. To download the code, use the following command:

git clone git://github.com/kyllingstad/scid.git

This will create a new directory named 'scid' containing a duplicate of the SciD repository. When you have already cloned the repository and want to update it with the latest changes, run:

git pull

To build SciD, use the D program build.d, found in the root directory of the repository. The best way to run it is using the rdmd program which is bundled with the DMD compiler. To build the library and generate header files, run:

rdmd build

To generate the documentation, run:

rdmd build html

The generated files can be found in the generated/ subdirectory. Currently, further installation must be done manually, but this will improve soon.

Performance

For numerical code, performance is key. However, there are enough libraries that provide awesome performance behind a butt-ugly API, so SciD need not go down that road. The design priorities are therefore, in order,

  1. Correctness: Make the code work, and make it produce correct results.
  2. User-friendliness: Give the code a nice API.
  3. Performance: Optimise the code.

Luckily, D is the perfect programming language for hiding high-performance code behind a beautiful API, so ultimately SciD should be able to provide as good performance as other libraries.

Contributing

As stated in the introduction, a goal of SciD is to become a community project. Contributors are very welcome, so if you want to participate, let me know.

Here's a small tip: There is a lot of established and extremely well tested numerical code lying around the Internet, just waiting to be ported to D. A lot of it is in the public domain, so we are free to use it in any way we want. Instead of spending a lot of time re-inventing the wheel, port some existing code and try to improve on it when you get it working.

Here are a few starting points:

  • NetLib - the ultimate source of numerics software. It contains hundreds (thousands?) of algorithms, mainly written in FORTRAN, but you'll also find some C code there. The code is organised by (not-always-so-intuitive) package names only, therefore it is nice to have...
  • GAMS - the Guide to Available Mathematical Software, which indexes and categorises the code in Netlib and a bunch of other sources.
Clone this wiki locally