@@ -292,66 +292,72 @@ inline Bool_t Chebyshev3D::isInside(const Double_t* par) const
292292// / Evaluates Chebyshev parameterization for 3d->DimOut function
293293inline void Chebyshev3D::Eval (const Float_t* par, Float_t* res)
294294{
295+ Float_t coef[3 ]; // mapped arguments, local so that evaluation is reentrant
295296 for (int i = 3 ; i--;) {
296- mTemporaryCoefficient [i] = mapToInternal (par[i], i);
297+ coef [i] = mapToInternal (par[i], i);
297298 }
298299 for (int i = mOutputArrayDimension ; i--;) {
299- res[i] = getChebyshevCalc (i)->Eval (mTemporaryCoefficient );
300+ res[i] = getChebyshevCalc (i)->Eval (coef );
300301 }
301302}
302303
303304// / Evaluates Chebyshev parameterization for 3d->DimOut function
304305inline void Chebyshev3D::Eval (const Double_t* par, Double_t* res)
305306{
307+ Float_t coef[3 ]; // mapped arguments, local so that evaluation is reentrant
306308 for (int i = 3 ; i--;) {
307- mTemporaryCoefficient [i] = mapToInternal (par[i], i);
309+ coef [i] = mapToInternal (par[i], i);
308310 }
309311 for (int i = mOutputArrayDimension ; i--;) {
310- res[i] = getChebyshevCalc (i)->Eval (mTemporaryCoefficient );
312+ res[i] = getChebyshevCalc (i)->Eval (coef );
311313 }
312314}
313315
314316// / Evaluates Chebyshev parameterization for idim-th output dimension of 3d->DimOut function
315317inline Double_t Chebyshev3D::Eval (const Double_t* par, int idim)
316318{
319+ Float_t coef[3 ]; // mapped arguments, local so that evaluation is reentrant
317320 for (int i = 3 ; i--;) {
318- mTemporaryCoefficient [i] = mapToInternal (par[i], i);
321+ coef [i] = mapToInternal (par[i], i);
319322 }
320- return getChebyshevCalc (idim)->Eval (mTemporaryCoefficient );
323+ return getChebyshevCalc (idim)->Eval (coef );
321324}
322325
323326// / Evaluates Chebyshev parameterization for idim-th output dimension of 3d->DimOut function
324327inline Float_t Chebyshev3D::Eval (const Float_t* par, int idim)
325328{
329+ Float_t coef[3 ]; // mapped arguments, local so that evaluation is reentrant
326330 for (int i = 3 ; i--;) {
327- mTemporaryCoefficient [i] = mapToInternal (par[i], i);
331+ coef [i] = mapToInternal (par[i], i);
328332 }
329- return getChebyshevCalc (idim)->Eval (mTemporaryCoefficient );
333+ return getChebyshevCalc (idim)->Eval (coef );
330334}
331335
332336// / Returns the gradient matrix
333337inline void Chebyshev3D::evaluateDerivative3D (const Float_t* par, Float_t dbdr[3 ][3 ])
334338{
339+ Float_t coef[3 ]; // mapped arguments, local so that evaluation is reentrant
335340 for (int i = 3 ; i--;) {
336- mTemporaryCoefficient [i] = mapToInternal (par[i], i);
341+ coef [i] = mapToInternal (par[i], i);
337342 }
338343 for (int ib = 3 ; ib--;) {
339344 for (int id = 3 ; id--;) {
340- dbdr[ib][id] = getChebyshevCalc (ib)->evaluateDerivative (id, mTemporaryCoefficient ) * mBoundaryMappingScale [id];
345+ dbdr[ib][id] = getChebyshevCalc (ib)->evaluateDerivative (id, coef ) * mBoundaryMappingScale [id];
341346 }
342347 }
343348}
344349
345350// / Returns the gradient matrix
346351inline void Chebyshev3D::evaluateDerivative3D2 (const Float_t* par, Float_t dbdrdr[3 ][3 ][3 ])
347352{
353+ Float_t coef[3 ]; // mapped arguments, local so that evaluation is reentrant
348354 for (int i = 3 ; i--;) {
349- mTemporaryCoefficient [i] = mapToInternal (par[i], i);
355+ coef [i] = mapToInternal (par[i], i);
350356 }
351357 for (int ib = 3 ; ib--;) {
352358 for (int id = 3 ; id--;) {
353359 for (int id1 = 3 ; id1--;) {
354- dbdrdr[ib][id][id1] = getChebyshevCalc (ib)->evaluateDerivative2 (id, id1, mTemporaryCoefficient ) *
360+ dbdrdr[ib][id][id1] = getChebyshevCalc (ib)->evaluateDerivative2 (id, id1, coef ) *
355361 mBoundaryMappingScale [id] * mBoundaryMappingScale [id1];
356362 }
357363 }
@@ -361,22 +367,24 @@ inline void Chebyshev3D::evaluateDerivative3D2(const Float_t* par, Float_t dbdrd
361367// Evaluates Chebyshev parameterization derivative for 3d->DimOut function
362368inline void Chebyshev3D::evaluateDerivative (int dimd, const Float_t* par, Float_t* res)
363369{
370+ Float_t coef[3 ]; // mapped arguments, local so that evaluation is reentrant
364371 for (int i = 3 ; i--;) {
365- mTemporaryCoefficient [i] = mapToInternal (par[i], i);
372+ coef [i] = mapToInternal (par[i], i);
366373 }
367374 for (int i = mOutputArrayDimension ; i--;) {
368- res[i] = getChebyshevCalc (i)->evaluateDerivative (dimd, mTemporaryCoefficient ) * mBoundaryMappingScale [dimd];
375+ res[i] = getChebyshevCalc (i)->evaluateDerivative (dimd, coef ) * mBoundaryMappingScale [dimd];
369376 };
370377}
371378
372379// Evaluates Chebyshev parameterization 2nd derivative over dimd1 and dimd2 dimensions for 3d->DimOut function
373380inline void Chebyshev3D::evaluateDerivative2 (int dimd1, int dimd2, const Float_t* par, Float_t* res)
374381{
382+ Float_t coef[3 ]; // mapped arguments, local so that evaluation is reentrant
375383 for (int i = 3 ; i--;) {
376- mTemporaryCoefficient [i] = mapToInternal (par[i], i);
384+ coef [i] = mapToInternal (par[i], i);
377385 }
378386 for (int i = mOutputArrayDimension ; i--;) {
379- res[i] = getChebyshevCalc (i)->evaluateDerivative2 (dimd1, dimd2, mTemporaryCoefficient ) *
387+ res[i] = getChebyshevCalc (i)->evaluateDerivative2 (dimd1, dimd2, coef ) *
380388 mBoundaryMappingScale [dimd1] * mBoundaryMappingScale [dimd2];
381389 }
382390}
@@ -385,20 +393,22 @@ inline void Chebyshev3D::evaluateDerivative2(int dimd1, int dimd2, const Float_t
385393// / function
386394inline Float_t Chebyshev3D::evaluateDerivative (int dimd, const Float_t* par, int idim)
387395{
396+ Float_t coef[3 ]; // mapped arguments, local so that evaluation is reentrant
388397 for (int i = 3 ; i--;) {
389- mTemporaryCoefficient [i] = mapToInternal (par[i], i);
398+ coef [i] = mapToInternal (par[i], i);
390399 }
391- return getChebyshevCalc (idim)->evaluateDerivative (dimd, mTemporaryCoefficient ) * mBoundaryMappingScale [dimd];
400+ return getChebyshevCalc (idim)->evaluateDerivative (dimd, coef ) * mBoundaryMappingScale [dimd];
392401}
393402
394403// / Evaluates Chebyshev parameterization 2ns derivative over dimd1 and dimd2 dimensions for idim-th output dimension of
395404// / 3d->DimOut function
396405inline Float_t Chebyshev3D::evaluateDerivative2 (int dimd1, int dimd2, const Float_t* par, int idim)
397406{
407+ Float_t coef[3 ]; // mapped arguments, local so that evaluation is reentrant
398408 for (int i = 3 ; i--;) {
399- mTemporaryCoefficient [i] = mapToInternal (par[i], i);
409+ coef [i] = mapToInternal (par[i], i);
400410 }
401- return getChebyshevCalc (idim)->evaluateDerivative2 (dimd1, dimd2, mTemporaryCoefficient ) *
411+ return getChebyshevCalc (idim)->evaluateDerivative2 (dimd1, dimd2, coef ) *
402412 mBoundaryMappingScale [dimd1] * mBoundaryMappingScale [dimd2];
403413}
404414
0 commit comments