Comments (5)
Scanning over the document I couldn't find a reference to QR, neither to the graph Laplacian.
Regarding rank deficient systems in general: the pseudo-inverse may be used to get the best solution (in a least squares sense) and the QR factorization can be used to find it, though you have to be careful when dealing with sparse matrices. Here's some Matlab code [improved qrginv]:
function ginv = IMqrginv(A)
[Q,R,P] = qr(A);
r=sum(any(abs(R)>1e-5,2));
Q = Q(:, 1:r);
R = R(1:r, :);
ginv = P*(R'/(R*R')*Q');
end
EDIT Some remarks:
- Of course, you don't want to compute the last matrix product, since it will be dense. You'd have to follow the solving procedure of the SparseQR class.
- SparseQR doesn't provide the full Q matrix (and you should never compute it, see here), but you don't need it here. Just apply the first
r
Househoulder vectors (r
= rank of the matrix, in case of the Laplacian of a connected graph =n-1
). - Use the code from Factorization members wiki page to get the QR factorization data.
Alternatively, if you're interested in only one particular solution, you could try the MINRES iterative solver, which can handle singular systems.
from csparse.net.
Thanks for the reply! The equation involving the Laplacian matrix in the document is Poisson's equation Lc.phi=d
, at the fourth page, left column.
We try to retrieve a function whose gradient is equal to a given value (the eikonal equation), this is thus natural that the solution is given up to a constant. Since the matrix is semi-definite positive, I tried a Tikhonov regularization by solving (Lc+epsilon*Identity)*phi=d
together with a Cholesky Factorization. It works very well for small graphs, but not for large ones, I am still investigating why. I wonder if you have ever tried this kind of regularization scheme with CSparse.NET
?
Best,
Romain
from csparse.net.
This seems like a valid approach, though I never had to use this kind of regularization. Obviously, depending on your choice of epsilon
, the system gets ill-conditioned and errors in the solution process might amplify in higher dimensions. Additionally, mesh quality always plays a role, so if the solution fails, you might check for sharp angles or other defects.
from csparse.net.
Hello,
thanks for your reply. I performed some tests with 10k vertices (which is enough for my application), and with epsilon=1e-6
. The LU factorization gives satisfying results with the Tikhonov regularization technique. I guess that some numerical errors mesh processing and laplacian matrix construction make my matrix slightly non-symmetric and make the Cholesky factorization algorithm unstable (for the record, the mesh is a Delaunay triangulation and the Laplacian matrix is supposed to by semi-definite negative, so a small shift and multiplication by -1 should make the problem sdp). The performance with LU factorization is enough for what I want to achieve, I will try to implement a solution inspired by your first reply for the sake of completeness.
from csparse.net.
FYI, I've pushed MINRES to wo80/csparse-extensions@185dd0d . Not tested in practice, though.
Here's an example how to use it: MinResTest.cs
from csparse.net.
Related Issues (20)
- Dual Licensing HOT 2
- CoordinatedStorage HOT 1
- L*D*Lt decomposition HOT 7
- CLSCompliant HOT 4
- Problem with the QR factorization HOT 4
- Nonlinear equation system HOT 13
- Can I create a sparse matrix by a list of triples? HOT 4
- [Question] Adding two sparse matrices HOT 8
- Rectangular QR decomposition with MathNet.Numerics HOT 4
- this[i,j] indexing for DenseMatrix HOT 1
- A bug when converting a COO matrix into CSC matrix HOT 4
- Can I slice a CSC sparse matrix? HOT 4
- Performance Issue HOT 12
- Can I construct sparse matrix from multiple diagonals? HOT 4
- Nuget .net version compatibility HOT 2
- Set value in SparseMatrix is unable? HOT 4
- Adding Span and Memory HOT 4
- `CompressedColumnStorage<T>.Transpose` yields wrong result leading to sequential issues in `Solver`s HOT 9
- Publish symbols and source for debugging HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csparse.net.