Skip to content
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

grdsample: Fix the incorrect handling of -Am and -Ap #8667

Merged
merged 2 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/gmt_vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ GMT_LOCAL uint64_t gmtvector_fix_up_path_cartesian (struct GMT_CTRL *GMT, double
if (step <= 0.0) step = 1.0; /* Sanity valve; if step not given we set it to 1 */

for (i = 1; i < n; i++) {
if (mode == GMT_STAIRS_Y) { /* First follow x, then y */
if (mode == GMT_STAIRS_X) { /* First follow x, then y */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if-statement should check mode == GMT_STAIR_X, because at lines 455, the y values are constant and the x values are changing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and with GMT_STAIRS_Y = 1, GMT_STAIRS_X = 2, that matches now all the comments.
As a matter of fact, I met this issue once, but thought I had made a user error.

n_step = lrint (fabs (x[i] - x[i-1]) / step);
for (j = 1; j <= n_step; j++) {
c = j / (double)n_step;
Expand All @@ -465,7 +465,7 @@ GMT_LOCAL uint64_t gmtvector_fix_up_path_cartesian (struct GMT_CTRL *GMT, double
}
k = 0;
}
else if (mode == GMT_STAIRS_X) { /* First follow y, then x */
else if (mode == GMT_STAIRS_Y) { /* First follow y, then x */
n_step = lrint (fabs (y[i]-y[i-1]) / step);
for (j = 1; j <= n_step; j++) {
c = j / (double)n_step;
Expand Down Expand Up @@ -1378,7 +1378,7 @@ void gmt_matrix_matrix_mult (struct GMT_CTRL *GMT, double *A, double *B, uint64_
#else
dgemm_ ("t", tr, &na, &nb, &nc, &one, A, &nd, B, &ne, &zero, C, &nf);
#endif

#else
/* Plain matrix multiplication, no speed up; space must exist */
uint64_t row, col, k, a_ij, b_ij, c_ij, n_colsA = n_rowsB;
Expand Down
2 changes: 1 addition & 1 deletion test/baseline/sample1d.dvc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
outs:
- md5: 80fefdb9f9002469c5c61275f23d5532.dir
- md5: d40cf3c06eab98f9cd49288dc20ff315.dir
nfiles: 5
path: sample1d
hash: md5
Loading