Add DLIB_CASSERT for optimization algorithms#3142
Conversation
|
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. |
|
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? |
|
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. |
This PR adds an assert to check if the computed values are not NaNs. This is related to #1607.