Skip to content

AlexEslikov/viktor

 
 

Repository files navigation

viktor Build Status

viktor implements a restricted subset of NumPy ndarray ndarray features in Kotlin. Here're some of the highlights:

  • A single core data type --- F64Array, an n-dimensional primitive array.

  • Efficient vectorized operations, which are accelerated using SIMD whenever possible.

  • Semi-sweet syntax.

    val m = F64Array(4, 3)
    m.V[0] = F64Array.full(3, 42.0)  // row-view.
    m.V[_I, 0]                       // column-view.
    m.V[0] = 42.0                    // broadcasting.
    m + 0.5 * m                      // arithmetic operations.
    m.V[0].exp() + 1.0               // math functions.

Installation

The latest version of viktor is available on Bintray bintray. If you're using Gradle just add the following to your build.gradle:

repositories {
    jCenter()
}

dependencies {
    compile 'org.jetbrains.bio:viktor:0.4.0'
}

The version available on Bintray currently targets only SSE2 and AVX on x64 Linux. For any other setup viktor would fall back to pure-Kotlin implementations. If you are interested in SIMD accelerations for a different instruction set or operating system feel free to file an issue to the [bug tracker] issues.

Building from source

viktor relies on boost.simd boost.simd for implementing SIMD accelerations. Therefore, you would need CMake and a C++11 compiler, but otherwise the build process is as simple as

$ ./gradlew assemble

Testing

No extra configuration is required for running the tests from Gradle

$ ./gradlew test

However, you might need to alter java.library.path to run the tests from the IDE. The following Java command line option should work for IDEA

-Djava.library.path=./build/libs

Publishing

You can publish a new release with a one-liner

./gradlew clean assemble test generatePomFileForMavenJavaPublication bintrayUpload

Make sure to set Bintray credentials (see API key section here) in $HOME/.gradle/gradle.properties.

$ cat $HOME/.gradle/gradle.properties
bintrayUser=CHANGEME
bintrayKey=CHANGEME

About

Efficient f64-only ndarray in Kotlin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 68.3%
  • C++ 21.6%
  • Java 10.1%