{"id":19182038,"url":"https://github.com/glentner/cubicsplinelib","last_synced_at":"2025-05-07T23:07:23.763Z","repository":{"id":26199139,"uuid":"29645279","full_name":"glentner/CubicSplineLib","owner":"glentner","description":"C++ facility for natural cubic spline interpolation in 1D, 2D, and 3D.","archived":false,"fork":false,"pushed_at":"2015-02-10T21:42:27.000Z","size":652,"stargazers_count":38,"open_issues_count":1,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T23:07:18.399Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glentner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-22T02:36:27.000Z","updated_at":"2025-01-23T11:54:34.000Z","dependencies_parsed_at":"2022-07-24T09:45:05.254Z","dependency_job_id":null,"html_url":"https://github.com/glentner/CubicSplineLib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glentner%2FCubicSplineLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glentner%2FCubicSplineLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glentner%2FCubicSplineLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glentner%2FCubicSplineLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glentner","download_url":"https://codeload.github.com/glentner/CubicSplineLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252968118,"owners_count":21833251,"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":[],"created_at":"2024-11-09T10:56:19.357Z","updated_at":"2025-05-07T23:07:23.739Z","avatar_url":"https://github.com/glentner.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Cubic Spline Library\n====================\n\nThis small C++ library contains my working code for performing\nnatural cubic spline interpolation in one, two, and three\ndimensions.\n\n**dependencies:** OpenMP (omp.h)\n\nThe CubicSpline class is fully functional. A test program is\navailable in *CubicSpineTest.cc*, the results of which I\nhave plotted in *CubicSplineTest.png* using Python.\n\n![example](CubicSplineTest.png \"Results of CubicSplineTest\")\n\nBiCubicSpline and TriCubicSpline are still being developed.\nDocumentation and usage will be provided in the future.\n\n##Building\n\nYou should be able to just run 'make'. This compiles and links\nthe programs. The user will either need to make this available\non their standard include path or link to this directory.\n\nI recommend something like:\n```\nexport CSLDIR=/path/to/CubicSplineLib\nexport CSLINC=\"-I$CSLDIR -L$CSLDIR -lCubicSpline -fopenmp\"\n```\nAfter which, programs can be compiled similar to:\n```bash\ng++ your_program.cc $CSLINC\n```\n\n##Short Example Usage\n```C++\n// create spline object\nCubicSpline\u003cdouble\u003e raw_data( x, y, 2 );\n\n// resample 'x' data \nstd::vector\u003cdouble\u003e new_y = raw_data.interpolate( new_x );\n```\n\nThe user can construct the spline object with float, \ndouble, or long double types. The third argument in\nthe constructor is optional and has a default value\nof one. This says what the maximum allowed threads\nshould be for OpenMP. There is a fourth optional argument\nthat takes either true or false. By default this\nimplementation uses a quicksort algorithm to ensure\nthe horizontal axis is in ascending order before \nbuilding the spline polynomials. This behavior can\nbe supressed by specifying false. Also, in the \ninterpolation function, an optional second and third\nargument taking either true or false and a numeric\ntype the same as the template respectively allow\nfor returning fixed values outside the domain of the\noriginal data.\n\ne.g.,\n```C++\nraw_data.interpolate( new_x, true, 0.0 );\n```\nwould return a std::vector containing 0.0 for all positions\noutside the original domain of 'x'.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglentner%2Fcubicsplinelib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglentner%2Fcubicsplinelib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglentner%2Fcubicsplinelib/lists"}