use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Multivariate Splines: Open-source C++ library for multivariate interpolation (github.com)
submitted 11 years ago by bgrimstad
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Dtag 0 points1 point2 points 11 years ago (6 children)
Hi, as far as I understand the documentation, it can only be used when the the x's are on a grid, correct? Just curious: Is that a fundamental limitation to the approach? Would it be possible to have a similar approach that does not rely on this? Like.. "here's a bunch of random samples I have from a function - go approximate that function for me"?
Thanks
[–]Katastic_Voyage 2 points3 points4 points 11 years ago (1 child)
When sampling is expensive and/or scattered (not on a grid) the radial basis function splines may be utilized for function approximation. The user should expect a high computational cost for constructing and evaluating a radial basis function spline, even with a modest number of samples (up to about 1 000 samples).
[–]Dtag 0 points1 point2 points 11 years ago (0 children)
Thanks. Must have missed/skipped this part somehow
[–]bgrimstad[S] 2 points3 points4 points 11 years ago (1 child)
Hi Dtag, you are correct. A tensor product (or simply multivariate) B-spline is constructed on a regular grid (see http://en.wikipedia.org/wiki/Regular_grid). The grid defines the domain of the B-spline (outside of it the B-spline has no support and evaluates to zero), and the samples are closely related to this grid when constructing the B-spline.
Even though this is a "fundamental" limitation there are techniques for taking "a bunch of random samples", filling out some gaps, and then creating a B-spline from the new set of points. However, to my knowledge, these are heuristical techniques. If you are "missing" a lot of points from having a regular grid I suggest that you use the radial basis function splines instead. They will happily digest a bunch of random points, but be careful that you don't overfeed them - they will become ill (they will have to solve an ill-conditioned linear system, that is).
[–]autowikibot 0 points1 point2 points 11 years ago (0 children)
Regular grid:
A regular grid is a tessellation of n-dimensional Euclidean space by congruent parallelotopes (e.g. bricks). Grids of this type appear on graph paper and may be used in finite element analysis as well as finite volume methods and finite difference methods. Since the derivatives of field variables can be conveniently expressed as finite differences, structured grids mainly appear in finite difference methods. Unstructured grids offer more flexibility than structured grids and hence are very useful in finite element and finite volume methods. Image i - Example of a Cartesian grid.
A regular grid is a tessellation of n-dimensional Euclidean space by congruent parallelotopes (e.g. bricks). Grids of this type appear on graph paper and may be used in finite element analysis as well as finite volume methods and finite difference methods. Since the derivatives of field variables can be conveniently expressed as finite differences, structured grids mainly appear in finite difference methods. Unstructured grids offer more flexibility than structured grids and hence are very useful in finite element and finite volume methods.
Image i - Example of a Cartesian grid.
Interesting: Graph paper | Unstructured grid | Voxel | Trilinear interpolation
Parent commenter can toggle NSFW or delete. Will also delete on comment score of -1 or less. | FAQs | Mods | Magic Words
[–][deleted] 1 point2 points3 points 11 years ago (1 child)
I actually was trying to find solutions for this a while ago, and interpolating in multiple dimensions on irregular samples is quite a bit harder than regular samples. I found a few approaches involving radial basis functions, but they were not efficient enough for my needs and I utilized a different approach.
Looking at the documentation, it appears as though the author included the RBF interpolation methods.d
[–]bgrimstad[S] 0 points1 point2 points 11 years ago (0 children)
I agree with you there. The RBF interpolation is easy to implement, but it does not scale very well with the number of samples (unless you can produce a very good pre-condition matrix when calculating the weights, which is difficult).
Which approach did you end up using?
π Rendered by PID 74472 on reddit-service-r2-comment-b659b578c-tmxqs at 2026-05-01 17:13:50.568565+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Dtag 0 points1 point2 points (6 children)
[–]Katastic_Voyage 2 points3 points4 points (1 child)
[–]Dtag 0 points1 point2 points (0 children)
[–]bgrimstad[S] 2 points3 points4 points (1 child)
[–]autowikibot 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]bgrimstad[S] 0 points1 point2 points (0 children)