Rather than having to testing for 0 (or undef) in all your further calculations, it may be easier (and mathematically acceptable) to replace your zeros with a very small number, say 1e-308:
map $_//= 1e-308, @$_ for @matrix;
which should have negligible affect upon any calculations, but avoid lot of special casing.
In reply to Re: Calculate log of matrix values
by BrowserUk
in thread Calculate log of matrix values
by madM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |