Skip to content

Commit ac5b873

Browse files
committed
This reduced sorting-setup works equally well
1 parent fd53eb0 commit ac5b873

3 files changed

Lines changed: 0 additions & 201 deletions

File tree

mcstas-comps/samples/Single_crystal.comp

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -396,77 +396,10 @@ struct hkl_data
396396
if (pa->tau_z < pb->tau_z) return -1;
397397
if (pa->tau_z > pb->tau_z) return 1;
398398

399-
/* In case of tie, sort by h also */
400-
if (pa->h < pb->h) return -1;
401-
if (pa->h > pb->h) return 1;
402-
403-
/* In case of tie, sort by k also */
404-
if (pa->k < pb->k) return -1;
405-
if (pa->k > pb->k) return 1;
406-
407-
/* In case of tie, sort by l also */
408-
if (pa->l < pb->l) return -1;
409-
if (pa->l > pb->l) return 1;
410-
411399
/* In case of tie, sort by F2 also */
412400
if (pa->F2 < pb->F2) return -1;
413401
if (pa->F2 > pb->F2) return 1;
414402

415-
/* In case of tie, sort by cutoff also */
416-
if (pa->cutoff < pb->cutoff) return -1;
417-
if (pa->cutoff > pb->cutoff) return 1;
418-
419-
/* In case of tie, sort by sig123 also */
420-
if (pa->sig123 < pb->sig123) return -1;
421-
if (pa->sig123 > pb->sig123) return 1;
422-
423-
/* In case of tie, sort by m1 also */
424-
if (pa->m1 < pb->m1) return -1;
425-
if (pa->m1 > pb->m1) return 1;
426-
427-
/* In case of tie, sort by sig123 also */
428-
if (pa->m2 < pb->m2) return -1;
429-
if (pa->m2 > pb->m2) return 1;
430-
431-
/* In case of tie, sort by m3 also */
432-
if (pa->m3 < pb->m3) return -1;
433-
if (pa->m3 > pb->m3) return 1;
434-
435-
/* In case of tie, sort by u1x also */
436-
if (pa->u1x < pb->u1x) return -1;
437-
if (pa->u1x > pb->u1x) return 1;
438-
439-
/* In case of tie, sort by u1y also */
440-
if (pa->u1y < pb->u1y) return -1;
441-
if (pa->u1y > pb->u1y) return 1;
442-
443-
/* In case of tie, sort by u1z also */
444-
if (pa->u1z < pb->u1z) return -1;
445-
if (pa->u1z > pb->u1z) return 1;
446-
447-
/* In case of tie, sort by u2x also */
448-
if (pa->u2x < pb->u2x) return -1;
449-
if (pa->u2x > pb->u2x) return 1;
450-
451-
/* In case of tie, sort by u2y also */
452-
if (pa->u2y < pb->u2y) return -1;
453-
if (pa->u2y > pb->u2y) return 1;
454-
455-
/* In case of tie, sort by u2z also */
456-
if (pa->u2z < pb->u2z) return -1;
457-
if (pa->u2z > pb->u2z) return 1;
458-
459-
/* In case of tie, sort by u3x also */
460-
if (pa->u3x < pb->u3x) return -1;
461-
if (pa->u3x > pb->u3x) return 1;
462-
463-
/* In case of tie, sort by u3y also */
464-
if (pa->u3y < pb->u3y) return -1;
465-
if (pa->u3y > pb->u3y) return 1;
466-
467-
/* In case of tie, sort by u3z also */
468-
if (pa->u3z < pb->u3z) return -1;
469-
if (pa->u3z > pb->u3z) return 1;
470403

471404
return 0;
472405
} /* SX_list_compare */

mcstas-comps/union/Single_crystal_process.comp

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -184,77 +184,10 @@ SHARE
184184
if (pa->tau_z < pb->tau_z) return -1;
185185
if (pa->tau_z > pb->tau_z) return 1;
186186

187-
/* In case of tie, sort by h also */
188-
if (pa->h < pb->h) return -1;
189-
if (pa->h > pb->h) return 1;
190-
191-
/* In case of tie, sort by k also */
192-
if (pa->k < pb->k) return -1;
193-
if (pa->k > pb->k) return 1;
194-
195-
/* In case of tie, sort by l also */
196-
if (pa->l < pb->l) return -1;
197-
if (pa->l > pb->l) return 1;
198-
199187
/* In case of tie, sort by F2 also */
200188
if (pa->F2 < pb->F2) return -1;
201189
if (pa->F2 > pb->F2) return 1;
202190

203-
/* In case of tie, sort by cutoff also */
204-
if (pa->cutoff < pb->cutoff) return -1;
205-
if (pa->cutoff > pb->cutoff) return 1;
206-
207-
/* In case of tie, sort by sig123 also */
208-
if (pa->sig123 < pb->sig123) return -1;
209-
if (pa->sig123 > pb->sig123) return 1;
210-
211-
/* In case of tie, sort by m1 also */
212-
if (pa->m1 < pb->m1) return -1;
213-
if (pa->m1 > pb->m1) return 1;
214-
215-
/* In case of tie, sort by sig123 also */
216-
if (pa->m2 < pb->m2) return -1;
217-
if (pa->m2 > pb->m2) return 1;
218-
219-
/* In case of tie, sort by m3 also */
220-
if (pa->m3 < pb->m3) return -1;
221-
if (pa->m3 > pb->m3) return 1;
222-
223-
/* In case of tie, sort by u1x also */
224-
if (pa->u1x < pb->u1x) return -1;
225-
if (pa->u1x > pb->u1x) return 1;
226-
227-
/* In case of tie, sort by u1y also */
228-
if (pa->u1y < pb->u1y) return -1;
229-
if (pa->u1y > pb->u1y) return 1;
230-
231-
/* In case of tie, sort by u1z also */
232-
if (pa->u1z < pb->u1z) return -1;
233-
if (pa->u1z > pb->u1z) return 1;
234-
235-
/* In case of tie, sort by u2x also */
236-
if (pa->u2x < pb->u2x) return -1;
237-
if (pa->u2x > pb->u2x) return 1;
238-
239-
/* In case of tie, sort by u2y also */
240-
if (pa->u2y < pb->u2y) return -1;
241-
if (pa->u2y > pb->u2y) return 1;
242-
243-
/* In case of tie, sort by u2z also */
244-
if (pa->u2z < pb->u2z) return -1;
245-
if (pa->u2z > pb->u2z) return 1;
246-
247-
/* In case of tie, sort by u3x also */
248-
if (pa->u3x < pb->u3x) return -1;
249-
if (pa->u3x > pb->u3x) return 1;
250-
251-
/* In case of tie, sort by u3y also */
252-
if (pa->u3y < pb->u3y) return -1;
253-
if (pa->u3y > pb->u3y) return 1;
254-
255-
/* In case of tie, sort by u3z also */
256-
if (pa->u3z < pb->u3z) return -1;
257-
if (pa->u3z > pb->u3z) return 1;
258191

259192
return 0;
260193
} /* SX_list_compare */

mcxtrace-comps/samples/Single_crystal.comp

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -413,77 +413,10 @@ SHARE
413413
if (pa->tau_z < pb->tau_z) return -1;
414414
if (pa->tau_z > pb->tau_z) return 1;
415415

416-
/* In case of tie, sort by h also */
417-
if (pa->h < pb->h) return -1;
418-
if (pa->h > pb->h) return 1;
419-
420-
/* In case of tie, sort by k also */
421-
if (pa->k < pb->k) return -1;
422-
if (pa->k > pb->k) return 1;
423-
424-
/* In case of tie, sort by l also */
425-
if (pa->l < pb->l) return -1;
426-
if (pa->l > pb->l) return 1;
427-
428416
/* In case of tie, sort by F2 also */
429417
if (pa->F2 < pb->F2) return -1;
430418
if (pa->F2 > pb->F2) return 1;
431419

432-
/* In case of tie, sort by cutoff also */
433-
if (pa->cutoff < pb->cutoff) return -1;
434-
if (pa->cutoff > pb->cutoff) return 1;
435-
436-
/* In case of tie, sort by sig123 also */
437-
if (pa->sig123 < pb->sig123) return -1;
438-
if (pa->sig123 > pb->sig123) return 1;
439-
440-
/* In case of tie, sort by m1 also */
441-
if (pa->m1 < pb->m1) return -1;
442-
if (pa->m1 > pb->m1) return 1;
443-
444-
/* In case of tie, sort by sig123 also */
445-
if (pa->m2 < pb->m2) return -1;
446-
if (pa->m2 > pb->m2) return 1;
447-
448-
/* In case of tie, sort by m3 also */
449-
if (pa->m3 < pb->m3) return -1;
450-
if (pa->m3 > pb->m3) return 1;
451-
452-
/* In case of tie, sort by u1x also */
453-
if (pa->u1x < pb->u1x) return -1;
454-
if (pa->u1x > pb->u1x) return 1;
455-
456-
/* In case of tie, sort by u1y also */
457-
if (pa->u1y < pb->u1y) return -1;
458-
if (pa->u1y > pb->u1y) return 1;
459-
460-
/* In case of tie, sort by u1z also */
461-
if (pa->u1z < pb->u1z) return -1;
462-
if (pa->u1z > pb->u1z) return 1;
463-
464-
/* In case of tie, sort by u2x also */
465-
if (pa->u2x < pb->u2x) return -1;
466-
if (pa->u2x > pb->u2x) return 1;
467-
468-
/* In case of tie, sort by u2y also */
469-
if (pa->u2y < pb->u2y) return -1;
470-
if (pa->u2y > pb->u2y) return 1;
471-
472-
/* In case of tie, sort by u2z also */
473-
if (pa->u2z < pb->u2z) return -1;
474-
if (pa->u2z > pb->u2z) return 1;
475-
476-
/* In case of tie, sort by u3x also */
477-
if (pa->u3x < pb->u3x) return -1;
478-
if (pa->u3x > pb->u3x) return 1;
479-
480-
/* In case of tie, sort by u3y also */
481-
if (pa->u3y < pb->u3y) return -1;
482-
if (pa->u3y > pb->u3y) return 1;
483-
484-
/* In case of tie, sort by u3z also */
485-
if (pa->u3z < pb->u3z) return -1;
486-
if (pa->u3z > pb->u3z) return 1;
487420

488421
return 0;
489422
} /* SX_list_compare */

0 commit comments

Comments
 (0)