Skip to content

Commit

Permalink
240430.202701.HKT get back prima_is_success
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Apr 30, 2024
1 parent 4053ef5 commit dcc1d27
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions c/prima.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


#include "prima/prima_internal.h"
#include <float.h> // This providess DBL_EPSILON, which will be removed once ctol is introduced
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -240,3 +241,11 @@ prima_rc_t prima_minimize(const prima_algorithm_t algorithm, const prima_problem

return info;
}


// The function that checks whether the result is "successful"
bool prima_is_success(const prima_result_t result)
{
return (result.status == PRIMA_SMALL_TR_RADIUS ||
result.status == PRIMA_FTARGET_ACHIEVED) && (result.cstrv <= sqrt(DBL_EPSILON));
}

1 comment on commit dcc1d27

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@check-spelling-bot Report

🔴 Please review

See the 📜action log or 📝 job summary for details.

Unrecognized words (1)

providess

Some files were automatically ignored 🙈

These sample patterns would exclude them:

^\Qpython/profiles/bobyqa.txt\E$
^\Qpython/profiles/cobyla.txt\E$
^\Qpython/profiles/lincoa.txt\E$
^\Qpython/profiles/uobyqa_newuoa.txt\E$

You should consider adding them to:

.github/actions/spelling/excludes.txt

File matching is via Perl regular expressions.

To check these files, more of their words need to be in the dictionary than not. You can use patterns.txt to exclude portions, add items to the dictionary (e.g. by adding them to allow.txt), or fix typos.

To accept these unrecognized words as correct and update file exclusions, you could run the following commands

... in a clone of the [email protected]:libprima/prima.git repository
on the c_headers_internal branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/main/apply.pl' |
perl - 'https://github.com/libprima/prima/actions/runs/8894737375/attempts/1'
Warnings (1)

See the 📜action log or 📝 job summary for details.

ℹ️ Warnings Count
ℹ️ noisy-file 4

See ℹ️ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Please sign in to comment.