Hello,

I am using GSL on  CodeBlocks with Mingw. I have a program working in
debug mode but not release !!


gsl: ..\permutation\init.c:51: ERROR: failed to allocate space for
permutation data
Default GSL error handler invoked.

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.




void Snake::InitInternalEnergyMatrix()
{
    double a = 2 * Alpha + 6 * Beta;
    double b = - Alpha -4 * Beta;
    double c = Beta;
    try{
    gsl_matrix *InternalEnergyMatrix = gsl_matrix_calloc( Size , Size );
    for (int i=0;i<Size;i++)
    {
        gsl_matrix_set(InternalEnergyMatrix, i, i, a + 1); // May be 1 * Gamma
        if (i<Size-1)gsl_matrix_set(InternalEnergyMatrix, i, i + 1, b);
        if (i<Size-2)gsl_matrix_set(InternalEnergyMatrix, i, i + 2, c);
        if (i>0)gsl_matrix_set(InternalEnergyMatrix, i, i - 1, b);
        if (i>1)gsl_matrix_set(InternalEnergyMatrix, i, i - 2, c);
    }
    gsl_matrix_set(InternalEnergyMatrix, 0, Size-1, b);
    gsl_matrix_set(InternalEnergyMatrix, 0, Size-2, c);
    gsl_matrix_set(InternalEnergyMatrix, 1, Size-1, c);
    gsl_matrix_set(InternalEnergyMatrix, Size-2, 0, c);
    gsl_matrix_set(InternalEnergyMatrix, Size-1, 0, b);
    gsl_matrix_set(InternalEnergyMatrix, Size-1, 1, c);
    InternalEnergyMatrixInv = gsl_matrix_calloc( Size , Size );
    gsl_permutation *p = gsl_permutation_calloc( Size );
    gsl_linalg_LU_invert ( InternalEnergyMatrix , p , InternalEnergyMatrixInv );
    gsl_permutation_free( p );
    gsl_matrix_free( InternalEnergyMatrix );
    }
    catch(...){
        Log::Write("Snake::InitInternalEnergyMatrix",Config::FLog, 0);
    }
}


_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to