Installation¶
Install the LOWESS library for your preferred language.
# lowess (no_std compatible)
[dependencies]
lowess = "1.3"
# fastLowess (parallel + GPU)
[dependencies]
fastLowess = { version = "1.3", features = ["cpu"] }
| Crate | Feature | Description |
|---|---|---|
lowess |
std |
Enable standard library (default) |
fastLowess |
cpu |
Enable CPU parallelism via Rayon |
fastLowess |
gpu |
Enable GPU acceleration via wgpu (beta) |
<script type="module">
import { smooth } from "https://cdn.jsdelivr.net/npm/fastlowess-wasm@0.99/index.js";
</script>
# Install Rust first: https://rustup.rs/
# Install wasm-pack: https://rustwasm.github.io/wasm-pack/installer/
git clone https://github.com/thisisamirv/lowess-project
cd lowess-project/bindings/wasm
# For bundlers (Webpack, Vite, etc.)
wasm-pack build --target bundler
# For Node.js
wasm-pack build --target nodejs
# For browser (no bundler)
wasm-pack build --target web
wget https://github.com/thisisamirv/lowess-project/releases/latest/download/libfastlowess-linux-x64.so
wget https://github.com/thisisamirv/lowess-project/releases/latest/download/fastlowess.hpp
g++ -o myapp myapp.cpp -L. -lfastlowess-linux-x64
curl -LO https://github.com/thisisamirv/lowess-project/releases/latest/download/libfastlowess-macos-x64.dylib
curl -LO https://github.com/thisisamirv/lowess-project/releases/latest/download/fastlowess.hpp
clang++ -o myapp myapp.cpp -L. -lfastlowess-macos-x64
wget https://github.com/thisisamirv/lowess-project/releases/latest/download/fastlowess-win32-x64.dll
wget https://github.com/thisisamirv/lowess-project/releases/latest/download/fastlowess.hpp
cl myapp.cpp /link fastlowess-win32-x64.lib
# Install Rust first: https://rustup.rs/
git clone https://github.com/thisisamirv/lowess-project
cd lowess-project/bindings/cpp
# Build the library
cargo build --release
# Headers are at: include/fastlowess.hpp (C++)
# Library is at: target/release/libfastlowess_cpp.so (Linux)
# target/release/libfastlowess_cpp.dylib (macOS)
# target/release/fastlowess_cpp.dll (Windows)
Verify Installation¶
#include <fastlowess.hpp>
#include <iostream>
#include <vector>
int main() {
std::vector<double> x = {1.0, 2.0, 3.0, 4.0, 5.0};
std::vector<double> y = {2.0, 4.1, 5.9, 8.2, 9.8};
fastlowess::Lowess model;
auto result = model.fit(x, y);
std::cout << "Installed successfully!" << std::endl;
return 0;
}