Skip to content
Find file History
Latest commit 7ecd2b4 May 15, 2016 @saudet saudet Release version 1.2
..
Failed to load latest commit information.
src/main/java/org/bytedeco/javacpp
COPYING * Add presets for GSL 1.16 Jun 17, 2014
README.md
cppbuild.sh * Prevent creating text relocations for shared libraries on Android … Mar 15, 2016
gsl-2.1-android.patch * Upgrade presets for GSL 2.1 (issue bytedeco/javacpp#55) Dec 24, 2015
gsl-2.1-macosx.patch * Upgrade presets for GSL 2.1 (issue bytedeco/javacpp#55) Dec 24, 2015
pom.xml Release version 1.2 May 16, 2016

README.md

JavaCPP Presets for GSL

Introduction

This directory contains the JavaCPP Presets module for:

Please refer to the parent README.md file for more detailed information about the JavaCPP Presets.

Documentation

Java API documentation is available here:

Sample Usage

Here is a simple example of GSL ported to Java from this C source file:

We can use Maven 3 to download and install automatically all the class files as well as the native binaries. To run this sample code, after creating the pom.xml and src/main/java/Example.java source files below, simply execute on the command line:

 $ mvn compile exec:java

The pom.xml build file

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.bytedeco.javacpp-presets.gsl</groupId>
    <artifactId>example</artifactId>
    <version>1.2</version>
    <properties>
        <exec.mainClass>Example</exec.mainClass>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.bytedeco.javacpp-presets</groupId>
            <artifactId>gsl</artifactId>
            <version>2.1-1.2</version>
        </dependency>
    </dependencies>
</project>

The src/main/java/Example.java source file

import org.bytedeco.javacpp.*;
import static org.bytedeco.javacpp.gsl.*;

public class Example {
    public static void main(String[] args) {
        double x = 5.0;
        double y = gsl_sf_bessel_J0(x);
        System.out.printf("J0(%g) = %.18e\n", x, y);
    }
}
Something went wrong with that request. Please try again.