Changeset 26172 for trunk/psModules
- Timestamp:
- Nov 17, 2009, 1:56:15 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceGroups.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceGroups.c
r26162 r26172 63 63 int nCells = nThreads * 2*2; // number of cells in a single set 64 64 int C = sqrt(nCells) + 0.5; 65 int Cx , Cy;// Number of cells in x and y65 int Cx = 1, Cy = 1; // Number of cells in x and y 66 66 67 67 // we need to assign Cx and Cy based on the dimensionality of the image 68 68 // crude way to find most evenly balanced factors of nCells: 69 if (C <= 1) { 70 Cx = Cy = 1; 71 } else { 72 for (int i = C; i >= 1; i--) { 73 int C1 = nCells / C; 74 int C2 = nCells / C1; 75 if (C1*C2 != nCells) continue; 69 for (int i = C; i >= 1; i--) { 70 int C1 = nCells / C; 71 int C2 = nCells / C1; 72 if (C1*C2 != nCells) continue; 76 73 77 if (readout->image->numRows > readout->image->numCols) { 78 Cx = PS_MAX(C1, C2); 79 Cy = PS_MIN(C1, C2); 80 } else { 81 Cx = PS_MAX(C1, C2); 82 Cy = PS_MIN(C1, C2); 83 } 74 if (readout->image->numRows > readout->image->numCols) { 75 Cx = PS_MAX(C1, C2); 76 Cy = PS_MIN(C1, C2); 77 } else { 78 Cx = PS_MAX(C1, C2); 79 Cy = PS_MIN(C1, C2); 84 80 } 85 81 }
Note:
See TracChangeset
for help on using the changeset viewer.
