-
Notifications
You must be signed in to change notification settings - Fork 182
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
Comments on stdlib_stats_corr.f90 #955
Comments
Here are other lines in stdlib that do a calculation (computing a mean) in setting The Windows CMD command
gave the following lines. Presumably could be fixed by changing a few lines of
|
Thank you @Beliavsky for reviewing the code. Please consider that these parts of stdlib were some of the first added to stdlib, and therefore served as trials and errors for usage of
This is the result of the preprocessing. the formatting makes sense in the fypp files (at least to me).
if you refer to
In this case, I don't think it could be done as you proposed because the sd will depend on each combinasion
You are right, it should be fixed. Could you open a PR, please? |
I think there are a number of flaws in
corr_mask_2_rsp_rsp
from https://github.com/fortran-lang/stdlib/blob/stdlib-fpm/src/stdlib_stats_corr.f90. It is listed below.The spacing is poor. Why is there a continuation line such as
0._sp,& mask_)
Continuation lines should only be used when a line is too long. Another problem is that merge is used when one of the
tsource
andfsource
arguments require computation. Since Fortran does not mandate short-circuiting, an if block should be used instead. It also looks like the row and column means are computed more often than needed. If they are needed, they should be computed once and stored. The correlation equals the covariance divided by the product of the standard deviations. The standard deviations of the rows or columns should be computed once and stored. Instead, in a line such asthe standard deviations for the denominator are computed repeatedly instead of being stored and reused.
Finally,
mask_ = merge(.true., .false., mask(:, i) .and. mask(:, j))
should be written
mask_ =mask(:, i) .and. mask(:, j)
as I wrote in another issue #953.
The text was updated successfully, but these errors were encountered: