Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
248 views
in Technique[技术] by (71.8m points)

c++ - Best way to solve large block diagonal system with Eigen?

I have got this problem: a large 10000x10000 block diagonal matrix M with square blocks of various sizes (for example 1000 blocks, all of size 10), and I want to solve a linear system using the Eigen library.

I think the best way to do this is to loop over each M.block(i, j, p, q) store it into a dense matrix, create a vector of Eigen solvers and compute the decomposition. Then solve the systems in parallel with openmp maybe.

How does one go about doing this, the only way is copying all the .block(i, j, p, q) into dense matrices? then using a vector of Eigen solvers? Can I just store the decomposition into the solvers?

Is there an automatic way to do this in Eigen? Will solving the large sparse linear system do the same (in the sense that it will analyze the pattern and use a built in block diagonal solver?).

Thanks for clarifying!

PS: also I know eigen uses parallelization if the program is compiled with -fopenmp, but this would mean that each 10x10 system is solver in paraller right? Can I switch parallelization off and do it myself on a global system wide basis?

question from:https://stackoverflow.com/questions/65932524/best-way-to-solve-large-block-diagonal-system-with-eigen

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...