C/C++ Nonlinear Least Squares C/C++ Code for Carpet Evaluation

AI Thread Summary
The discussion centers on finding C/C++ code for non-linear least squares fitting, specifically for evaluating a worn-out carpet using a laser-scanned point cloud. The user is seeking to model a profile through the point cloud to determine lengths l1, l2, l3, l4, and height difference z, emphasizing the non-linear nature of the problem and the need for numerical approximation of partial derivatives. While the user found a program called Levmar, they noted its inadequate documentation. Alternatives mentioned include the Galahad library, which can be used in C/C++, and Ipopt for nonlinear optimization. Additionally, "Numerical Recipes in C" is suggested as a resource for algorithms related to nonlinear least squares, although the code cannot be copied without owning the book.
Simon666
Messages
93
Reaction score
0
Do you know of code (preferably C/C++) to do this for non linear least squares? i found a program called levmar on the internet, but it seems inadequately documented on how to use it and probably not so useful to my purposes.

My problem is evaluation of a carpet. The middle is worn out and it is laser scanned. i have a point cloud of about a couple of hundred thousand pointsand I need to model the following profile through it. Desired to find are the lengths l1, l2 l3, l4 (l5=width of carpet-l1-l2-l3-l4) and the height difference z. I have to find this using Least Squares Fitting. This seems quite non linear (unless maybe around good initial values which could be found) and the partial derivatives would also have to be determined approximatingly and numerically.


Code:
[FONT="Courier New"]-------------\                     /---------------     ^
              \-------------------/                     |  z
l1            l2         l3        l4         l5        |
 
Last edited:
Technology news on Phys.org
Well there's galahad but it's in fortran
http://galahad.rl.ac.uk/

You can use it in C/C++ code though I believe.Also there's Ipopt for nonlinear optimization written in C++.
https://projects.coin-or.org/Ipopt

You might also want to check out Numerical Recipes in C
The book is available online (here - http://www.nrbook.com/a/bookcpdf.php) and it provides algorithms for a large number of problems including nonlinear least squares. You can't copy their code without owning the book though I believe.
 
Last edited:
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top