Skip to content

fixed ! vs == operator precedence #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions svm_struct_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ classify_struct_example (PATTERN x,
if (! fn_array) {
mexErrMsgTxt("Field PARM.CLASSIFYFN not found") ;
}
if (! mxGetClassID(fn_array) == mxFUNCTION_CLASS) {
if (mxGetClassID(fn_array) != mxFUNCTION_CLASS) {
mexErrMsgTxt("PARM.CLASSIFYFN must be a valid function handle") ;
}

Expand Down Expand Up @@ -247,7 +247,7 @@ find_most_violated_constraint_slackrescaling (PATTERN x, LABEL y,
if (! fn_array) {
mexErrMsgTxt("Field PARM.CONSTRAINTFN not found") ;
}
if (! mxGetClassID(fn_array) == mxFUNCTION_CLASS) {
if (mxGetClassID(fn_array) != mxFUNCTION_CLASS) {
mexErrMsgTxt("PARM.CONSTRAINTFN must be a valid function handle") ;
}

Expand Down Expand Up @@ -325,7 +325,7 @@ find_most_violated_constraint_marginrescaling (PATTERN x, LABEL y,
if (! fn_array) {
mexErrMsgTxt("Field PARM.CONSTRAINTFN not found") ;
}
if (! mxGetClassID(fn_array) == mxFUNCTION_CLASS) {
if (mxGetClassID(fn_array) != mxFUNCTION_CLASS) {
mexErrMsgTxt("PARM.CONSTRAINTFN is not a valid function handle") ;
}

Expand Down Expand Up @@ -422,7 +422,7 @@ psi (PATTERN x, LABEL y, STRUCTMODEL *sm,
if (! fn_array) {
mexErrMsgTxt("Field PARM.FEATUREFN not found") ;
}
if (! mxGetClassID(fn_array) == mxFUNCTION_CLASS) {
if (mxGetClassID(fn_array) != mxFUNCTION_CLASS) {
mexErrMsgTxt("PARM.FEATUREFN must be a valid function handle") ;
}

Expand All @@ -440,9 +440,9 @@ psi (PATTERN x, LABEL y, STRUCTMODEL *sm,
}

if (! mxIsSparse(out) ||
! mxGetClassID(out) == mxDOUBLE_CLASS ||
! mxGetN(out) == 1 ||
! mxGetM(out) == sm->sizePsi) {
mxGetClassID(out) != mxDOUBLE_CLASS ||
mxGetN(out) != 1 ||
mxGetM(out) != sm->sizePsi) {
mexErrMsgTxt("PARM.FEATUREFN must return a sparse column vector "
"of the prescribed size") ;
}
Expand Down Expand Up @@ -500,7 +500,7 @@ loss (LABEL y, LABEL ybar, STRUCT_LEARN_PARM *sparm)
if (! fn_array) {
mexErrMsgTxt("Field PARM.LOSSFN not found") ;
}
if (! mxGetClassID(fn_array) == mxFUNCTION_CLASS) {
if (mxGetClassID(fn_array) != mxFUNCTION_CLASS) {
mexErrMsgTxt("PARM.LOSSFN must be a valid function handle") ;
}

Expand Down Expand Up @@ -551,7 +551,7 @@ finalize_iteration (double ceps, int cached_constraint,
fn_array = mxGetField(sparm->mex, 0, "endIterationFn") ;

if (! fn_array) return 0 ;
if (! mxGetClassID(fn_array) == mxFUNCTION_CLASS) {
if (mxGetClassID(fn_array) != mxFUNCTION_CLASS) {
mexErrMsgTxt("PARM.ENDITERATIONFN must be a valid function handle") ;
}

Expand Down
2 changes: 1 addition & 1 deletion svm_struct_learn_mex.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ mexFunction (int nout, mxArray ** out, int nin, mxArray const ** in)
labels_array = mxGetField(sparm_array, 0, "labels") ;
if (! labels_array ||
! mxIsCell(labels_array) ||
! mxGetNumberOfElements(labels_array) == numExamples) {
mxGetNumberOfElements(labels_array) != numExamples) {
mexErrMsgTxt("SPARM.LABELS must be a cell array "
"with the same number of elements of "
"SPARM.PATTERNS") ;
Expand Down