Giter Site home page Giter Site logo

qingmu-io / algo4j Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ice1000/algo4j

0.0 2.0 0.0 764 KB

:horse_racing: An algorithm library using java native interface

License: GNU Lesser General Public License v3.0

C++ 39.62% Java 30.04% Kotlin 17.60% C 12.06% CMake 0.46% Batchfile 0.22%

algo4j's Introduction

algo4j

Continuous Integration Status
Travis CI Build Status
CircleCI CircleCI
CodeShip CodeShip
AppVeyor Build status

JitPack Gitter Stories in Ready codecov


δΈ­ζ–‡

This is an algorithm library for Java, whose core is written in C++, linked with JNI.

It is test-driven(also benchmarks), well-documented, with code generation for some special cases.

Project structure

file name usage
jni C++ codes
code_drafts something written but not used ATM
libjni.dll/libjni.so/libjni.dylib jni library
jni/cpp-test C++ tests
src/main/java source(independent)
src/main/kotlin Kotlin extension library
src/test tests

The jni library above is not included in the repo, please build it yourself, or download at:

Put it to your working directory after download or build one.

Overview

  • Binary indexed tree, including P(point)-U(update)-I(interval)-Q(query), I-U-P-Q and I-U-I-Q.
  • Trigonometric functions, including: sin, cos, tan, cot, sec, csc.
  • Union set. including path compression and heuristic merge.
  • Math utils, including fast power series, primes, fibs, etc.
  • Sequence utils, like sorts, discretization, kmp, toString, etc.
  • Graph theory algorithms, like SPFA, Floyd, Kruskal, Bellman Ford, Dijkstra, dfs, etc.
  • A Win32API interface for windows only, right call something like 'Beep'.
  • Linear data structure, Stack and Queue.
  • Minimum binary heap(priority queue), support adding and extracting.
  • Trie tree, whose key supports ASCII 32-127, as Trie : Map<String, T>.
  • Multi-threading quick sort implementation.
  • Fast power for big integers.
  • Big Integer(plus minus mul div rem), faster(usually) than java.math.BigInteger.
  • Segment Tree, multi-implementations.
  • Durable Segment Tree, multi-implementations.

Actually, every java classes are well-documented.
For more information, see JavaDocs in each java file or package-info.java.

Languages

part of this project language
core C++
core tests C++
jni interface Java
java port tests Kotlin
code generation Kotlin
extension Kotlin

Contribution

There is a README file under jni path, it's strongly-recommended right read that.

This library is Test-driven, so there are tests for every class. If you want to contribute, please offer tests for your classes.

Rules of contribution

  • Each class should be well-documented.
  • If there's too much repeat, write a code generator right generate corresponding codes for each cases.
  • For C++, you should follow the code style.
  • For each class with native methods, provide a unit-test.
  • I'll write the library itself with Java and tests with Kotlin, but I also accept Tests with other languages.
  • Issues and pull requests are always welcomed.

algo4j's People

Contributors

ice1000 avatar phosphorus15 avatar ray-eldath avatar

Watchers

 avatar  avatar

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.