Confused about extending.

Joonas Paalasmaa joonas at olen.to
Wed Feb 21 16:38:31 EST 2001


I have made the following C-function and now I would like to
use it via Python in that way, that it would
manipulate Python lists smoothedValues and originalValues.
But I am just a beginner with C and I got confused with extending HowTo.
I would be glad if someone would explain how to manipulate the code to
make it extendingable.

Joonas.



void SmoothedList(double *originalValues, double *smoothedValues,
        int listSize, int filterSize)
{
        double tmpResult;
        int i, j;
        int iterations = listSize - filterSize + 1;

        for(i = 0; i < iterations; i++)
        {
                for(j = 0, tmpResult = 0.0; j < filterSize; j++)
                        tmpResult += originalValues[i + j];
                smoothedValues[i] = tmpResult / (double)filterSize;
        }
}



More information about the Python-list mailing list