19.03.2013 - Version 0.3.0 ported to Mac OS X
This commit is contained in:
18
pimath.cpp
18
pimath.cpp
@@ -405,9 +405,9 @@ void PIFFT::ftbasegeneratecomplexfftplan(uint n, ftplan* plan) {
|
||||
int ftbase_ftbasecffttask = 0;
|
||||
ftbase_ftbasegenerateplanrec(n, ftbase_ftbasecffttask, plan, &plansize, &precomputedsize, &planarraysize, &tmpmemsize, &stackmemsize, stackptr);
|
||||
if (stackptr!=0) { return;}//ae_assert(stackptr==0, "Internal error in FTBaseGenerateComplexFFTPlan: stack ptr!");
|
||||
curplan.stackbuf.resize(piMax(stackmemsize,1));//ae_vector_set_length(&curplan.stackbuf, ae_maxint(stackmemsize, 1));
|
||||
curplan.tmpbuf.resize(piMax(tmpmemsize,1));//ae_vector_set_length(&(curplan.tmpbuf), ae_maxint(tmpmemsize, 1));
|
||||
curplan.precomputed.resize(piMax(precomputedsize,1));//ae_vector_set_length(&curplan.precomputed, ae_maxint(precomputedsize, 1));
|
||||
curplan.stackbuf.resize(piMax<int>(stackmemsize,1));//ae_vector_set_length(&curplan.stackbuf, ae_maxint(stackmemsize, 1));
|
||||
curplan.tmpbuf.resize(piMax<int>(tmpmemsize,1));//ae_vector_set_length(&(curplan.tmpbuf), ae_maxint(tmpmemsize, 1));
|
||||
curplan.precomputed.resize(piMax<int>(precomputedsize,1));//ae_vector_set_length(&curplan.precomputed, ae_maxint(precomputedsize, 1));
|
||||
stackptr = 0;
|
||||
ftbase_ftbaseprecomputeplanrec(plan, 0, stackptr);
|
||||
if (stackptr!=0) { return;}//ae_assert(stackptr==0, "Internal error in FTBaseGenerateComplexFFTPlan: stack ptr!");
|
||||
@@ -475,7 +475,7 @@ void PIFFT::ftbase_ftbasegenerateplanrec(
|
||||
}
|
||||
ftbasefactorize(n, &n1, &n2);
|
||||
if( n1!=1 ) {
|
||||
*tmpmemsize = piMax(*tmpmemsize, 2*n1*n2);
|
||||
*tmpmemsize = piMax<int>(*tmpmemsize, 2*n1*n2);
|
||||
curplan.plan[entryoffset+0] = esize;
|
||||
curplan.plan[entryoffset+1] = n1;
|
||||
curplan.plan[entryoffset+2] = n2;
|
||||
@@ -509,7 +509,7 @@ void PIFFT::ftbase_ftbasegenerateplanrec(
|
||||
} else {
|
||||
k = 2*n2-1;
|
||||
m = ftbasefindsmooth(k);
|
||||
*tmpmemsize = piMax(*tmpmemsize, 2*m);
|
||||
*tmpmemsize = piMax<int>(*tmpmemsize, 2*m);
|
||||
curplan.plan[entryoffset+0] = esize;
|
||||
curplan.plan[entryoffset+1] = n2;
|
||||
curplan.plan[entryoffset+2] = -1;
|
||||
@@ -517,7 +517,7 @@ void PIFFT::ftbase_ftbasegenerateplanrec(
|
||||
curplan.plan[entryoffset+4] = m;
|
||||
curplan.plan[entryoffset+5] = *plansize;
|
||||
stackptr = stackptr+2*2*m;
|
||||
*stackmemsize = piMax(*stackmemsize, stackptr);
|
||||
*stackmemsize = piMax<int>(*stackmemsize, stackptr);
|
||||
ftbase_ftbasegenerateplanrec(m, ftbase_ftbasecffttask, plan, plansize, precomputedsize, planarraysize, tmpmemsize, stackmemsize, stackptr);
|
||||
stackptr = stackptr-2*2*m;
|
||||
curplan.plan[entryoffset+6] = -1;
|
||||
@@ -638,7 +638,7 @@ Is number smooth?
|
||||
*************************************************************************/
|
||||
void PIFFT::ftbase_ftbasefindsmoothrec(int n, int seed, int leastfactor, int* best) {
|
||||
if( seed>=n ) {
|
||||
*best = piMin(*best, seed);
|
||||
*best = piMin<int>(*best, seed);
|
||||
return;
|
||||
}
|
||||
if( leastfactor<=2 )
|
||||
@@ -672,7 +672,7 @@ void PIFFT::ftbase_fftirltrec(PIVector<double>* a, int astart, int astride, PIVe
|
||||
int m1, n1;
|
||||
if( m==0||n==0 )
|
||||
return;
|
||||
if( piMax(m, n)<=8 ) {
|
||||
if( piMax<int>(m, n)<=8 ) {
|
||||
for(int i=0; i<=m-1; i++) {
|
||||
idx1 = bstart+i;
|
||||
idx2 = astart+i*astride;
|
||||
@@ -711,7 +711,7 @@ void PIFFT::ftbase_ffticltrec(PIVector<double>* a, int astart, int astride, PIVe
|
||||
int idx1, idx2, m2, m1, n1;
|
||||
if( m==0||n==0 )
|
||||
return;
|
||||
if( piMax(m, n)<=8 ) {
|
||||
if( piMax<int>(m, n)<=8 ) {
|
||||
m2 = 2*bstride;
|
||||
for(int i=0; i<=m-1; i++) {
|
||||
idx1 = bstart+2*i;
|
||||
|
||||
Reference in New Issue
Block a user