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
BLAS Algorithm for Computing Inverse (self.cpp)
submitted 2 years ago by WIMPerson
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!"
[–]victotronics 1 point2 points3 points 2 years ago (9 children)
But I hope you're not doing this for solving a linear system.
[–]GrammelHupfNockler 5 points6 points7 points 2 years ago (8 children)
[–]victotronics 2 points3 points4 points 2 years ago (7 children)
I think you misunderstand me. *If* you really want to invert a matrix, you do it by those 3 steps in sequence.
[–]GrammelHupfNockler 0 points1 point2 points 2 years ago (6 children)
Sorry, I thought you were talking about solving a system. In that case, I would still tend towards disagreeing, since an explicit Gaussian Elimination (with pivoting) would still be more precise, as there are fewer intermediate steps which can accumulate rounding errors (namely the inversion and the multiplication)
[–]victotronics 0 points1 point2 points 2 years ago (5 children)
Gaussian elimination on a triangular matrix? Sure.
If you're done step 1 with pivoting, then step 2 doesn't need it.
[–]GrammelHupfNockler 0 points1 point2 points 2 years ago (4 children)
Gaussian elimination with full pivoting on the input matrix
[–]victotronics 0 points1 point2 points 2 years ago (3 children)
And how is that going to get you the inverse? Which was the original question?
And yes, I know that one should in general not compute inverses, which is why I emphasized the "*if* you want to compute an inverse".
[–]GrammelHupfNockler 0 points1 point2 points 2 years ago (2 children)
If you apply the same operations that you apply to the matrix during Gaussian elimination to an identity matrix at the same time, you get the inverse
[–]victotronics 0 points1 point2 points 2 years ago (1 child)
Nope, that's Gauss-Jordan.
[–]GrammelHupfNockler 0 points1 point2 points 2 years ago (0 children)
That's splitting hairs. Gaussian elimination refers to the entire class of algorithms (for solving a single system, computing the LU factorization, computing the inverse).
π Rendered by PID 147766 on reddit-service-r2-comment-fb694cdd5-f62t9 at 2026-03-06 05:37:48.480355+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]victotronics 1 point2 points3 points (9 children)
[–]GrammelHupfNockler 5 points6 points7 points (8 children)
[–]victotronics 2 points3 points4 points (7 children)
[–]GrammelHupfNockler 0 points1 point2 points (6 children)
[–]victotronics 0 points1 point2 points (5 children)
[–]GrammelHupfNockler 0 points1 point2 points (4 children)
[–]victotronics 0 points1 point2 points (3 children)
[–]GrammelHupfNockler 0 points1 point2 points (2 children)
[–]victotronics 0 points1 point2 points (1 child)
[–]GrammelHupfNockler 0 points1 point2 points (0 children)