Skip to content

Latest commit

 

History

434 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPL

Why more tools may do a better job than one multipurpose tool?

MPL is a Multi-Purpose Standard Library based on header files written in C++

Requirements

  • C++17
  • OpenCV ≥ 4 (used by most headers)
  • POSIX system (macOS / Linux)
  • Optional backends: libcurl, libssh, cfitsio + Astrometry.net, IBM CPLEX

On errors the library prints a message to stderr and calls abort(): invalid input terminates the program, by design. The only exceptions are mpl::opt (command-line usage errors print the usage and call exit(EXIT_FAILURE)) and mpl::ssh_t (returns false).

Usage

Run make install once: it symlinks include/ to /usr/local/include/mpl, so every header is reachable as <mpl/<group>/<file>.hpp>.

Include a single module:

#include <mpl/math/geometry.hpp>

…or pull in the whole library through the umbrella header:

#include <mpl/mpl.hpp>

<mpl/mpl.hpp> includes everything except the modules that need heavy/optional third-party backends; those are opt-in and can be enabled by defining a macro before the include (MPL_WITH_CPLEX, MPL_WITH_FITS, MPL_WITH_SSH, MPL_WITH_CURL).

Tests

make test

builds and runs the regression smoke-test suite against the working-tree headers (no install needed). See tests/README.md for the per-function coverage map.

make check-backends

compile-checks (no link, no run) the optional backends MPL_WITH_CURL, MPL_WITH_SSH, MPL_WITH_FITS against the installed libcurl/libssh/cfitsio headers.

Open work and known limitations are tracked in TODO.md.

Files structure

Headers are grouped by theme under include/. Every header lives in the mpl:: namespace (the mpl/<group>/<file>.hpp include path mirrors the folder layout); most files use a short one-level namespace under mpl (e.g. mpl::geometry, mpl::statistic, mpl::distance).

include/
├── core/         stdlib, log, opt, configure, profile, ssh, curl,
│                 bimap, graph, range, neighbors, stdio, loader,
│                 gnuplot, fits, params, algorithm
├── math/         math, matrix, stat, histogram, kalman, fit, angles,
│                 rk4, cubicspline, lagrange, distance, geometry,
│                 orientation, quaternion, kabsch, alphaShape, hull,
│                 mvee, multifit, clustering, cplex
└── vision/       camera, cameraSystem, convert, normalization, point4d,
                  reconstruction, reprojection, undistort, utils
core/
  • core/stdlib.hpp - string/utility helpers (mpl::parse, mpl::itoa, set operations, ...)
  • core/log.hpp - logging (mpl::log)
  • core/opt.hpp - command-line option parsing (mpl::opt)
  • core/configure.hpp - configuration files (mpl::configure)
  • core/profile.hpp - time/memory profiling (mpl::profile)
  • core/ssh.hpp - SSH client wrapper (mpl::ssh_t, libssh)
  • core/curl.hpp - libcurl wrapper (mpl::curl)
  • core/bimap.hpp - bidirectional map (mpl::bimap)
  • core/graph.hpp - graph data structure (mpl::graph)
  • core/range.hpp - generic range (mpl::range_t)
  • core/neighbors.hpp - nearest neighbors (mpl::neighbors)
  • core/stdio.hpp - filesystem/IO helpers (mpl::io)
  • core/loader.hpp - tabular data loader (mpl::loader)
  • core/gnuplot.hpp - gnuplot driver (mpl::gnuplot, gnuplot binary)
  • core/fits.hpp - FITS support (cfitsio + Astrometry): mpl::fits::solveField, mpl::cvFits
  • core/params.hpp - typed parameters (mpl::params_t)
  • core/algorithm.hpp - generic algorithm helper (mpl::algorithm_t)
math/
  • math/math.hpp - mpl::math: combinations(), polySolve(), solveCubic(), svd(), eigen()
  • math/matrix.hpp - mpl::Mat/Vec/Mat3/Mat4 wrappers over OpenCV cv::Mat with direct element access
  • math/stat.hpp - mpl::statistic: avg(), median(), running statistics (stat_t), Gaussian PDFs
  • math/histogram.hpp - histograms (mpl::statistic::histoInt_t, histo_t)
  • math/kalman.hpp - Kalman filter (mpl::kalman_t)
  • math/fit.hpp - curve fitting (mpl::fit::parabola/linear/orear)
  • math/angles.hpp - degree/radian conversions (mpl::angles)
  • math/rk4.hpp - Runge-Kutta integration step (mpl::integration::rk4)
  • math/cubicspline.hpp - global cubic polynomial fit (mpl::cubicspline)
  • math/lagrange.hpp - Lagrange interpolation (mpl::lagrange)
  • math/distance.hpp - point/set/line/plane distances (mpl::distance)
  • math/geometry.hpp - barycenter, rotations, RTS, line intersections, ... (mpl::geometry)
  • math/orientation.hpp, math/quaternion.hpp - shape orientation, quaternions (mpl::geometry)
  • math/kabsch.hpp - Kabsch best rigid transform (mpl::kabsch)
  • math/alphaShape.hpp - 2D alpha shape (mpl::geometry::alphaShape)
  • math/hull.hpp - Andrew's monotone chain 2D convex hull (mpl::geometry::hull)
  • math/mvee.hpp - minimum volume enclosing ellipsoid (mpl::mvee)
  • math/multifit.hpp - non-linear least squares (mpl::multifit, OpenCV backend)
  • math/clustering.hpp - connectedComponents, kmeans, gmm, dbscan, ... (mpl::clustering)
  • math/cplex.hpp - CPLEX wrapper (mpl::cplex)
vision/
  • vision/camera.hpp, vision/cameraSystem.hpp - camera model and multi-camera systems
  • vision/convert.hpp, vision/normalization.hpp, vision/undistort.hpp
  • vision/point4d.hpp - homogeneous 4D point
  • vision/reconstruction.hpp, vision/reprojection.hpp
  • vision/utils.hpp - vision utilities (triangulation, ...)

About

Multi-Purpose Standard Library

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages