Beispiel #1
0
Expression CFunction::operator()( const Expression &arg ){

    uint run1,run2;

    CFunction thisFunction(*this);
    thisFunction.nn = arg.getDim();

    for( run1 = 0; run1 < maxAlloc; run1++ ){
        thisFunction.xStore   [run1] = new double[thisFunction.nn];
        thisFunction.seedStore[run1] = new double[thisFunction.nn];
        for( run2 = 0; run2 < thisFunction.nn; run2++ ){
            thisFunction.xStore   [run1][run2] = 0.0;
            thisFunction.seedStore[run1][run2] = 0.0;
        }
    }

    Expression tmp(dim);

    COperator dummy;
    dummy.increaseID();

    for( run1 = 0; run1 < dim; run1++ ){
        delete tmp.element[run1];
        tmp.element[run1] = new COperator( thisFunction, arg, run1 );
    }

    return tmp;
}