IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 22 years ago

Closed 21 years ago

Last modified 21 years ago

#74 closed defect (fixed)

psMatrix testing

Reported by: Paul Price Owned by: calvin.harman@…
Priority: high Milestone:
Component: types Version: unspecified
Severity: normal Keywords:
Cc:

Description

(a) Transpose fails for non-square matrices (deliberately), but the transpose of
a non-square matrix is well defined.

(b) Test C in tst_psMatrix03 generates:

Error: Resulting image is not PS_DIMEN_VECTOR

But this is in the validation, so the test passes (though it is a "positive"
test).... is it an error or not?

Change History (10)

comment:1 by robert.desonia@…, 22 years ago

Owner: changed from robert.desonia@… to calvin.harman@…

comment:2 by calvin.harman@…, 22 years ago

Owner: changed from calvin.harman@… to Paul Price

I corrected (b) below. It was a minor error in the test.

I have not corrected (a) below, because GSL will not transpose a non-square
matrix. I will create an algorithm from scratch to do the same when time is
available. Please leave this open until completed.

comment:3 by robert.desonia@…, 22 years ago

Owner: changed from Paul Price to calvin.harman@…

comment:4 by robert.desonia@…, 22 years ago

Status: newassigned

comment:5 by Paul Price, 22 years ago

Algorithm is:

/* For the upper diagonal only */
for (i = 0; i < Ni; i++) {

for (j = i + 1; j < Nj; j++) {

/* Swap the ij and ji entries */
temp = matrixData[i][j];
matrixData[i][j] = matrixData[j][i];
matrixData[j][i] = temp;

}

}

comment:6 by calvin.harman@…, 22 years ago

Not sure if this will work with non-square matrices, which was item (a) above.

comment:7 by Paul Price, 22 years ago

Of course, you're right.

How about expanding the matrix to square before transferring the entries, and
then collapsing to the correct dimensions afterward? An alternative would be to
allocate a new matrix, copy into there, free the old matrix, and return the new,
but I think that might be dangerous.

comment:8 by calvin.harman@…, 22 years ago

This has been fixed and will be in the January release of psLib

comment:9 by robert.desonia@…, 21 years ago

Resolution: fixed
Status: assignedclosed

comment:10 by Eric.VanAlst@…, 21 years ago

Code to perform general transpose is in release 4.

Note: See TracTickets for help on using tickets.