GithubHelp home page GithubHelp logo

oandrieu / ocamlgsl Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 320 KB

Automatically exported from code.google.com/p/ocamlgsl

License: GNU General Public License v3.0

Makefile 2.12% OCaml 53.08% Awk 0.05% C 43.76% C++ 0.98%

ocamlgsl's Introduction

This is an interface to GSL (GNU scientific library), for the
Objective Caml langage. 


* REQUIREMENTS
- gsl >= 1.10
- ocaml >= 3.07
- awk and GNU make
- gcc or MSVC

The platform must not need to align doubles on double-word addresses,
i.e. ARCH_ALIGN_DOUBLE must be undefined in <caml/config.h>


* BUILDING & INSTALLING
- have a look at the variables in Makefile and gcc.mak/msvc.mak.
  comment out DYNAMIC_LINKING if it isn't supported on your platform.
- make
- (optional) make install INSTALLDIR=/absolute/path/to/installdir 
        or : make install-findlib

to link :
  ocamlopt -I gsldir bigarray.cmxa gsl.cmxa my_prog.ml
or :
  ocamlc -I gsldir -dllpath gsldir bigarray.cma gsl.cma my_prog.ml


* CHANGES
cf. the NEWS file to see what's changed between ocamlgsl versions.

WARNING : the code is not heavily tested !


* DOCUMENTATION
Check the GSL manual ! You can browse the module interfaces with the
ocamldoc-generated HTML files in the doc/ directory.


* VECTOR / MATRICES
There are several datatypes for handling vectors and matrices.

 - modules Gsl_vector, Gsl_vector.Single, Gsl_vector_complex,
   Gsl_vector_complex.Single and the corresponding matrix modules use
   bigarrays with single or double precisions real or complex values.

 - modules Gsl_vector_flat, Gsl_vector_complex_flat and the
   corresponding matrix modules use a record wrapping a regular caml
   float array. This is the equivalent of the gsl_vector and
   gsl_matrix structs in GSL.

 - module Gsl_vectmat defines a sum type with polymorphic variants
   that regroups these two representations. For instance :

     Gsl_vectmat.v_add (`V v1) (`VF v2)

   adds a vector in a caml array to a bigarray.

  - modules Gsl_blas Gsl_blas_flat and Gsl_blas_gen provide a (quite
    incomplete) interface to CBLAS for these types.


* ERROR HANDLING
Errors in GSL functions are reported as exceptions :
  Gsl_error.Gsl_exn (errno, msg)
You have to call Gsl_error.init () so as to initialize error
reporting; otherwise, the default GSL error handler is used and aborts
the program, leaving a core dump (not so helpful with caml).

If a callback (for minimizers, solvers, etc.) raises an exception,
ocamlgsl either return GSL_FAILURE or NaN to GSL, depending on the
type of callback. In either case the original caml exception is not
propagated. The GSL function will either return normally (but probably
with values containing NaNs somewhere) or raise a Gsl_exn exception.


* CONTACT
Project homepage (with source code browser and bug tracker):
  http://code.google.com/p/ocamlgsl/

Olivier Andrieu <[email protected]>

ocamlgsl's People

Contributors

oandrieu avatar

Watchers

 avatar

ocamlgsl's Issues

Incomplete error handling

Some GSL functions return an int status other than GSL_CONTINUE without calling 
the error 
handler (eg, the _iterate functions for minimization and root-finding). The 
corresponding caml 
function returns unit, no exception is raised and thus some information is lost.

Solutions:
1. manually call the error handler in the wrapper for these functions. Problem 
is to identify them 
(probably no other way than having a thorough look at the GSL source)

2. stop using the GSL error handler alltogether and always check the return 
status of all GSL 
functions. Problem: lots of changes in ocamlgsl :)

Original issue reported on code.google.com by [email protected] on 23 Nov 2009 at 9:23

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.