简体   繁体   中英

Sparse linear algebra solvers for C#

I'm working on an experimental implementation of Goldenthal et.al's inextensible cloth algorithm in C#.

First I used Math.NET Iridium to assemble and solve the matrices, but quickly replaced this with dnAnalytics since the latter allows me to reuse matrices, almost eliminating further memory allocation, which is important for real-time performance (small cloths) or iterative solving in general.

The problem is that the solvers (of primary interest are LU and Bi-CG) in dnAnalytics still allocate matrices and vectors behind the scenes, instead of reusing past allocations.

=> Are there any sparse linear algebra libraries out there that reuse memory out-of-the-box, or will I have to rewrite the code myself?

This advice may be superfluous, but when using dnAnalytics, make sure you use the Intel Math kernel library. As tempting as the idea of a pure-C# implementation sounds, I've found the performance difference to be staggering; Dense systems were solved about one hundred times faster.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM