{"id":15031444,"url":"https://github.com/jlogan03/interpn","last_synced_at":"2025-08-22T22:05:28.715Z","repository":{"id":208554659,"uuid":"714824264","full_name":"jlogan03/interpn","owner":"jlogan03","description":"N-dimensional interpolation methods in Rust, no-std compatible","archived":false,"fork":false,"pushed_at":"2025-03-14T23:16:33.000Z","size":41,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T22:37:13.466Z","etag":null,"topics":["interpolation","no-std","rust","rust-embedded","rust-lang","rustlang","scientific-computing"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jlogan03.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-05T22:50:23.000Z","updated_at":"2025-03-14T23:14:54.000Z","dependencies_parsed_at":"2024-01-25T08:25:32.842Z","dependency_job_id":"89bbad59-3fc3-43fd-803c-98f65a742b8d","html_url":"https://github.com/jlogan03/interpn","commit_stats":null,"previous_names":["jlogan03/interpn"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlogan03%2Finterpn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlogan03%2Finterpn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlogan03%2Finterpn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlogan03%2Finterpn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlogan03","download_url":"https://codeload.github.com/jlogan03/interpn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248109758,"owners_count":21049367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["interpolation","no-std","rust","rust-embedded","rust-lang","rustlang","scientific-computing"],"created_at":"2024-09-24T20:15:41.750Z","updated_at":"2025-04-09T20:41:15.563Z","avatar_url":"https://github.com/jlogan03.png","language":"Rust","readme":"# InterpN\nN-dimensional interpolation/extrapolation methods, no-std and no-alloc compatible,\nprioritizing correctness, performance, and compatiblity with memory-constrained environments.\n\n# Performance Scalings\nNote that for a self-consistent multidimensional linear interpolation, there are 2^ndims grid values that contribute\nto each observation point, and as such, that is the theoretical floor for performance scaling. That said,\ndepending on the implementation, the constant term can vary by more than an order of magnitude.\n\nCubic interpolations require two more degrees of freedom per dimension, which results in a minimal runtime scaling of 4^ndims.\nSimilar to the linear methods, depending on implementation, the constant term can vary by orders of magnitude,\nas can the RAM usage.\n\nRectilinear methods perform a bisection search to find the relevant grid cell, which takes\na worst-case number of iterations of log2(number of grid elements).\n\n| Method                        | RAM       | Interp. / Extrap. Cost       |\n|-------------------------------|-----------|------------------------------|\n| multilinear::regular          | O(ndims)  | O(2^ndims)                   |\n| multilinear::rectilinear      | O(ndims)  | O(2^ndims) + log2(gridsize)  |\n| multicubic::regular           | O(ndims)  | O(4^ndims)                   |\n| multicubic::rectilinear       | O(ndims)  | O(4^ndims) + log2(gridsize)  |\n\n# Example: Multilinear and Multicubic w/ Regular Grid\n```rust\nuse interpn::{multilinear, multicubic};\n\n// Define a grid\nlet x = [1.0_f64, 2.0, 3.0, 4.0];\nlet y = [0.0_f64, 1.0, 2.0, 3.0];\n\n// Grid input for rectilinear method\nlet grids = \u0026[\u0026x[..], \u0026y[..]];\n\n// Grid input for regular grid method\nlet dims = [x.len(), y.len()];\nlet starts = [x[0], y[0]];\nlet steps = [x[1] - x[0], y[1] - y[0]];\n\n// Values at grid points\nlet z = [2.0; 16];\n\n// Observation points to interpolate/extrapolate\nlet xobs = [0.0_f64, 5.0];\nlet yobs = [-1.0, 3.0];\nlet obs = [\u0026xobs[..], \u0026yobs[..]];\n\n// Storage for output\nlet mut out = [0.0; 2];\n\n// Do interpolation\nmultilinear::regular::interpn(\u0026dims, \u0026starts, \u0026steps, \u0026z, \u0026obs, \u0026mut out);\nmulticubic::regular::interpn(\u0026dims, \u0026starts, \u0026steps, \u0026z, false, \u0026obs, \u0026mut out);\n```\n\n# Example: Multilinear and Multicubic w/ Rectilinear Grid\n```rust\nuse interpn::{multilinear, multicubic};\n\n// Define a grid\nlet x = [1.0_f64, 2.0, 3.0, 4.0];\nlet y = [0.0_f64, 1.0, 2.0, 3.0];\n\n// Grid input for rectilinear method\nlet grids = \u0026[\u0026x[..], \u0026y[..]];\n\n// Values at grid points\nlet z = [2.0; 16];\n\n// Points to interpolate/extrapolate\nlet xobs = [0.0_f64, 5.0];\nlet yobs = [-1.0, 3.0];\nlet obs = [\u0026xobs[..], \u0026yobs[..]];\n\n// Storage for output\nlet mut out = [0.0; 2];\n\n// Do interpolation\nmultilinear::rectilinear::interpn(grids, \u0026z, \u0026obs, \u0026mut out).unwrap();\nmulticubic::rectilinear::interpn(grids, \u0026z, false, \u0026obs, \u0026mut out).unwrap();\n```\n\n# Development Roadmap\n* Methods for unstructured triangular and tetrahedral meshes\n\n# License\nLicensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlogan03%2Finterpn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlogan03%2Finterpn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlogan03%2Finterpn/lists"}