Commit 6a79b63
fix(lib): correct main.cpp voxel ordering + harden simulateMTR per review
FIX 1: Rebuild spatialCoords in SIMPLNX z,y,x order (iz outer, iy middle,
ix inner) so row k matches sim.phi*/mtrIndex[k]. The old loop used z-x-y
order which mismatched coordinates with orientations for non-square grids.
FIX 2: Replace magic literals 72, 36, 72 in the simulateMTR call with
named constants (k_OdfBinsPhi1/PHI/Phi2) documenting the fixed 5-degree
Bunge-Euler MATLAB ODF grid layout (186624 bins).
FIX 3: Guard in simulateMTR that pgrf_result.mtrIndex.size() == N; throws
std::runtime_error if the PGRF result dimensions are inconsistent.
FIX 4: CSV loop now uses sim.nx*sim.ny*sim.nz to tie the bound to the
actual result rather than the pre-call N.
FIX 5: Add phi2 range check and phi1/phi/phi2 size-equality checks to the
statistical driver test.
FIX 6: Remove unused <numbers> include from main.cpp; ODFSampler.hpp
retained (ODFComponent is used directly).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent f331a9e commit 6a79b63
3 files changed
Lines changed: 31 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
242 | 248 | | |
243 | | - | |
| 249 | + | |
244 | 250 | | |
245 | 251 | | |
246 | 252 | | |
| |||
275 | 281 | | |
276 | 282 | | |
277 | 283 | | |
278 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
279 | 287 | | |
280 | 288 | | |
281 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
| 97 | + | |
93 | 98 | | |
0 commit comments