Skip to content

Add DLIB_CASSERT for optimization algorithms#3142

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

Add DLIB_CASSERT for optimization algorithms#3142
KamalElFeniche wants to merge 1 commit into
davisking: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
@dlib-issue-bot
Copy link
Copy Markdown
Collaborator

Warning: this issue has been inactive for 35 days and will be automatically closed on 2026-06-09 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

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.

3 participants