Changeset 5530 for trunk/psLib/src/math/psStats.c
- Timestamp:
- Nov 16, 2005, 1:07:10 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r5517 r5530 17 17 * 18 18 * 19 * @version $Revision: 1.15 0$ $Name: not supported by cvs2svn $20 * @date $Date: 2005-11-1 5 20:10:32$19 * @version $Revision: 1.151 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2005-11-16 23:06:19 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 2334 2334 newHist = (psHistogram* ) psAlloc(sizeof(psHistogram)); 2335 2335 psMemSetDeallocator(newHist, (psFreeFunc) histogramFree); 2336 newHist->bounds = psVectorAlloc(n + 1, PS_TYPE_F32); 2337 *(int *)&newHist->bounds->n = newHist->bounds->nalloc; 2336 psVector* newBounds = psVectorAlloc(n + 1, PS_TYPE_F32); 2337 newHist->bounds = newBounds; 2338 newBounds->n = newHist->bounds->nalloc; 2338 2339 2339 2340 // Calculate the bounds for each bin. … … 2343 2344 binSize += FLT_EPSILON; 2344 2345 for (i = 0; i < n + 1; i++) { 2345 new Hist->bounds->data.F32[i] = lower + (binSize * (psF32)i);2346 newBounds->data.F32[i] = lower + (binSize * (psF32)i); 2346 2347 } 2347 2348 … … 2383 2384 newHist = (psHistogram* ) psAlloc(sizeof(psHistogram)); 2384 2385 psMemSetDeallocator(newHist, (psFreeFunc) histogramFree); 2385 newHist->bounds = psVectorAlloc(bounds->n, PS_TYPE_F32); 2386 *(int *)&newHist->bounds->n = newHist->bounds->nalloc; 2386 psVector* newBounds = psVectorAlloc(bounds->n, PS_TYPE_F32); 2387 newHist->bounds = newBounds; 2388 newBounds->n = newHist->bounds->nalloc; 2387 2389 for (i = 0; i < bounds->n; i++) { 2388 new Hist->bounds->data.F32[i] = bounds->data.F32[i];2390 newBounds->data.F32[i] = bounds->data.F32[i]; 2389 2391 } 2390 2392
Note:
See TracChangeset
for help on using the changeset viewer.
