12 releases

new 0.1.11 Apr 15, 2024
0.1.9 Mar 31, 2024
0.1.1-rc9 Nov 28, 2023
0.1.1-rc8 Jul 22, 2023
0.1.0 May 23, 2022

#178 in Algorithms

Download history 5/week @ 2024-01-19 6/week @ 2024-01-26 11/week @ 2024-02-02 28/week @ 2024-02-09 173/week @ 2024-02-16 181/week @ 2024-02-23 193/week @ 2024-03-01 254/week @ 2024-03-08 155/week @ 2024-03-15 29/week @ 2024-03-22 197/week @ 2024-03-29 134/week @ 2024-04-05

528 downloads per month

MPL-2.0 license

1.5MB
33K SLoC

C 22K SLoC // 0.1% comments Python 2K SLoC // 0.0% comments Cython 1.5K SLoC // 0.0% comments Rust 1.5K SLoC // 0.0% comments Lua 1.5K SLoC // 0.4% comments C++ 1K SLoC Java 1K SLoC // 0.6% comments JavaScript 1K SLoC TypeScript 328 SLoC // 0.7% comments Scons 77 SLoC Forge Config 24 SLoC

Contains (obscure autoconf code, 4KB) script/configure.ac

An algorithm library {#mainpage}

docs conan xmake meson wasm msvc linux macos mingw msys2 freebsd

documentation

required tools

optional tools

build

xmake

xmake f
xmake
xmake i

cmake

cmake -S . -B build
cmake --build build
cmake --install build

meson

meson setup build
meson install -C build

vcpkg

cmake -S . -B build -DLIBA_VCPKG=1
cp -r build/vcpkg/* $VCPKG_INSTALLATION_ROOT
cp -r -Force build/vcpkg/* $ENV:VCPKG_INSTALLATION_ROOT

conan

conan create .

cargo

cargo build --release

cython

python setup.py build_ext --inplace

usage

C/C++

xmake.lua

add_requires("alib") -- static
add_requires("liba") -- shared

CMakeLists.txt

find_package(liba CONFIG REQUIRED)
target_link_libraries(<TARGET> PRIVATE alib) # static
target_link_libraries(<TARGET> PRIVATE liba) # shared

conanfile.txt

[requires]
liba/[~0.1]

Lua

luarocks install liba # release
luarocks install liba --dev # latest

main.lua

local liba = require("liba")
print("version", liba.VERSION)

Java

Main.java

public class Main {
    public static void main(String[] args) {
        System.out.println("version " + liba.VERSION);
    }
}

Rust

Cargo.toml

cargo add liba # release
cargo add --git https://github.com/tqfx/liba.git # latest

main.rs

use liba;
fn main() {
    println!(
        "version {}.{}.{}+{}",
        liba::version::major(),
        liba::version::minor(),
        liba::version::patch(),
        liba::version::tweak()
    );
}

Python

export LIBA_OPENMP=1
pip install liba # release
pip install git+https://github.com/tqfx/liba.git # latest

main.py

import liba
print("version", liba.VERSION)

JavaScript

npm i @tqfx/liba

index.js

import liba from "@tqfx/liba";
console.log("version", liba.VERSION);

QuickJS

main.js

import * as liba from "liba.so";
console.log("version", liba.VERSION);

Copyright (C) 2020-present tqfx, All rights reserved.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

No runtime deps