Skip to content

Commit

Permalink
Restore correct printing for svmlight, closes #564
Browse files Browse the repository at this point in the history
  • Loading branch information
ktalik committed Oct 2, 2015
1 parent 0fcc56b commit 5392d58
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions inst/include/utils/cutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
// FIXME?
#define C_EXIT(x)
#define C_FFLUSH(stream)
#define C_FPRINTF(stream, string, ...)
#define C_PRINTF(string, ...)
#define C_FPRINTF(stream, ...)
#define C_PRINTF(...)
#else
#define C_EXIT(x)
#define C_FFLUSH(stream)
#define C_FPRINTF(stream, string, ...)
#define C_PRINTF(string, ...)
#define C_EXIT(x) exit(x);
#define C_FFLUSH(stream) fflush(stream);
#define C_FPRINTF(stream, ...) fprintf(stream, __VA_ARGS__);
#define C_PRINTF(...) printf(__VA_ARGS__);
#endif

#endif
4 changes: 2 additions & 2 deletions src/svm/svm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2713,9 +2713,9 @@ int svm_save_model(const char *model_file_name, const svm_model *model, Logger &

const svm_node *p = SV[i];

if(param.kernel_type == PRECOMPUTED)
if(param.kernel_type == PRECOMPUTED) {
C_FPRINTF(fp,"0:%d ",(int)(p->value));
else
} else
while(p->index != -1)
{
C_FPRINTF(fp,"%d:%.8g ",p->index,p->value);
Expand Down
2 changes: 1 addition & 1 deletion src/svm/svmlight_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ std::string SVMLightRunner::SVMConfigurationToSVMLightLearnInputLine(
} else if (!target_value) {
ss << 0;
}else{
C_PRINTF("Unrecognized class label %d\n", target_value);
C_PRINTF("Unrecognized class label %f\n", target_value);
EXIT(1);
}

Expand Down

0 comments on commit 5392d58

Please sign in to comment.