Skip to content

Add DLIB_CASSERT for optimization algorithms#3142

Open
KamalElFeniche wants to merge 1 commit intodavisking:masterfrom
KamalElFeniche:NaN-check-for-optim-algo
Open

Add DLIB_CASSERT for optimization algorithms#3142
KamalElFeniche wants to merge 1 commit intodavisking:masterfrom
KamalElFeniche:NaN-check-for-optim-algo

Conversation

@KamalElFeniche
Copy link
Copy Markdown

This PR adds an assert to check if the computed values are not NaNs. This is related to #1607.

@davisking
Copy link
Copy Markdown
Owner

Thanks, but this might break existing users code. E.g. someone could, by the current contract, have a function that is giving nans and be just ignoring it and taking the best result they found that wasn't nan. Which by the current contract they are allowed to do.

So better to let someone who doesn't want their objective to ever be nan to add that assert to their own output if that's what they want.

@davisking davisking closed this Apr 25, 2026
@davisking
Copy link
Copy Markdown
Owner

davisking commented Apr 25, 2026

Er, wait, sorry, just read the other thread. It segfaulted? That segfault should just be fixed. Can you post an example that causes the segfault? Although that other thread is very old. Did you observe a segfault? What bad thing does this fix exactly?

@davisking davisking reopened this Apr 25, 2026
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.

2 participants