-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept None in pylops.Block #110
Comments
Hi, Note that Pylops Zero operator has pretty much no additional memory footprint, so the argument for having None is purely stylistic. I am a bit concerned that users may start using any weird combination of A and None, say: [[A, None,], [A, None]] which is an ill-poses definition as you can’t derive the number of columns of None given just A. And same if you have a 3x3 block operator and put all None in a column. In other words, to allow the user not having to specify a Zero operator, we then need to do many different checks, ultimately adding computational cost instead of reducing it. I suggest we first tackle #109 and then see if this makes sense given the additional complexity it adds. We can also take a look at the inner working of the scipy method to see if we can do it in a similar fashion |
Yes, it is a purely stylistic issue, but still an issue (altough low priority). Indeed, the scipy bmat method is a perfect example of how it should be done. this function removes rows and colums which contain only None. |
The main problem is that Block would need to be redesigned completely. Now it is two lines taking advantage of the fact that a Block matrix is a vertical stack of horizontal stacks:
I am not that convinced of creating a much longer routine just to handle Unless you have any idea on how to have |
When creating a block operator, often some coefficients are zero. Right now, you need to use a Zero operator like:
while in for example
scipy.sparse.bmat
you can just writewhich is much more expressive, and the correct dimensions of the zero block are inferred from the other blocks.
The text was updated successfully, but these errors were encountered: