Skip to content

bobyqa: replace trueloc indexing with allocation-free where/masked sum - #315

Open
pawlenartowicz wants to merge 1 commit into
libprima:mainfrom
pawlenartowicz:main
Open

bobyqa: replace trueloc indexing with allocation-free where/masked sum#315
pawlenartowicz wants to merge 1 commit into
libprima:mainfrom
pawlenartowicz:main

Conversation

@pawlenartowicz

Copy link
Copy Markdown

Every y(trueloc(mask)) in fortran/bobyqa/ becomes where(mask) y = ... or sum(..., mask=mask). Same floating-point operations in the same order; trajectories and all internal states are bit-identical to the previous commit. Removes 3-4 heap allocations per call site from the trsbox and geostep hot loops; 1.7x-2.1x faster per solve with gfortran 15 -O3.

Every y(trueloc(mask)) in fortran/bobyqa/ becomes where(mask) y = ... or
sum(..., mask=mask). Same floating-point operations in the same order;
trajectories and all internal states are bit-identical to the previous
commit. Removes 3-4 heap allocations per call site from the trsbox and
geostep hot loops; 1.7x-2.1x faster per solve with gfortran 15 -O3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant