mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-04-30 12:00:39 +00:00
8c7017a99d
- Update obioptions.Version from "Release 4.4.29" to "/v/ Release v5" - Update version.txt from 4.29 → .30 (automated by Makefile)
1.3 KiB
1.3 KiB
obistats Package — Semantic Overview
The obistats package provides lightweight, general-purpose numerical utilities in Go. It includes:
-
Basic arithmetic helpers:
maxint,minint: return the maximum/minimum of two integers.sumint(xs []int) int: computes the sum over a slice of integers.
-
Root-finding via bisection:
bisect(...): numerically finds a root of a real-valued function within[low, high], using the classical bisection method. Returns(root, success).- Requires
f(low)andf(high)to have opposite signs; panics otherwise.
-
Boolean bisection:
bisectBool(...): locates the transition point where a boolean function flips (e.g., threshold detection). Returns adjacent points(x1, x2)straddling the change. Panics iff(low) == f(high).
-
Series summation:
series(...): computes the infinite sum ∑ₙ₌₀^∞ f(n) by iterating until convergence (i.e.,y == ypwithin floating-point precision).- Note: Fast but may suffer from rounding errors for slowly converging or oscillating series.
All functions are designed for performance and simplicity, with no external dependencies beyond fmt (for error messages). The package is a stripped-down copy of internal utilities, likely used in performance-critical or statistical computations.