(R)
| 200 | |
| 201 | |
| 202 | def _debug_rotation(R): |
| 203 | D = np.max(R.shape) |
| 204 | identity = np.identity(D, dtype=np.float32) |
| 205 | RtR = np.dot(R.T, R) |
| 206 | |
| 207 | R_det = np.linalg.det(RtR) |
| 208 | print "determinant of R*R: ", R_det |
| 209 | R_trace = np.trace(RtR) |
| 210 | print "trace of R*R, trace divided by D: {}, {}".format(R_trace, R_trace / D) |
| 211 | off_diagonal_abs_mean = np.mean(np.abs(RtR - identity)) |
| 212 | print "mean(abs(off diagonals of R*R)): ", off_diagonal_abs_mean |
| 213 | |
| 214 | if R_det < .999 or R_det > 1.001: |
| 215 | raise NumericalException("Bad determinant") |
| 216 | if R_trace < .999 * D or R_trace > 1.001 * D: |
| 217 | raise NumericalException("Bad trace") |
| 218 | if off_diagonal_abs_mean > .001: |
| 219 | raise NumericalException("Bad off-diagonals") |
| 220 | |
| 221 | |
| 222 | def opq_rotate(X, R): # so other code need not know what to transpose |
nothing calls this directly
no test coverage detected