This project has moved and is read-only. For the latest updates, please go here.

Tridiagonal matrix

Dec 19, 2013 at 9:22 AM

I need to represent and solve a tridiagonal matrix.

Do Math.Net Numerics have an efficient way to represent and solve this kind of matrix or should be represented and solved as a generic matrix?

Dec 19, 2013 at 9:49 AM
Edited Dec 19, 2013 at 9:49 AM

Although we have a specialized diagonal matrix type, there is none for tridiagonal matrices.

In recent v3 alpha versions, if the matrix is small, I'd start with dense matrices and use a factorization to solve (i.e. Matrix.Solve methods). If it is large then I'd start with a sparse matrix and iterative solvers (i.e. Matrix.SolveIterative methods). If dense you may want to consider using our native provider.

But you may want to do some benchmarks with your specific use case to find out what works best.

Dec 19, 2013 at 9:55 AM
Edited Dec 19, 2013 at 9:55 AM
NB: there are very efficient algorithms to directly solve tridiagonal matrix problems, we probably should consider to better support this common case.
Dec 19, 2013 at 10:24 AM
Thanks Christoph for your reply.

Since the library does not support this specific case I am considering to implement by myself this algorithm.
It seems simple and efficient
Marked as answer by cdrnet on 12/30/2013 at 6:45 AM