aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGertjan van den Burg <burg@ese.eur.nl>2016-12-05 20:06:26 +0100
committerGertjan van den Burg <burg@ese.eur.nl>2016-12-05 20:06:26 +0100
commit463e406d4af8ad20a1ec2c3b9e01f3f80267c0dd (patch)
treec263185666cc4abf474c9f53830de482ed3bcb79 /src
parentadd octave testfiles to git (diff)
downloadgensvm-463e406d4af8ad20a1ec2c3b9e01f3f80267c0dd.tar.gz
gensvm-463e406d4af8ad20a1ec2c3b9e01f3f80267c0dd.zip
fix missing test in gensvm_optimize and expose doublesort
Diffstat (limited to 'src')
-rw-r--r--src/gensvm_consistency.c5
-rw-r--r--src/gensvm_io.c4
2 files changed, 4 insertions, 5 deletions
diff --git a/src/gensvm_consistency.c b/src/gensvm_consistency.c
index eaa4f8c..3881bb9 100644
--- a/src/gensvm_consistency.c
+++ b/src/gensvm_consistency.c
@@ -272,7 +272,7 @@ void gensvm_consistency_repeats(struct GenQueue *q, long repeats,
* @param[in] elem2 number 2
* @returns comparison of number 1 larger than number 2
*/
-int doublesort(const void *elem1, const void *elem2)
+int gensvm_dsort(const void *elem1, const void *elem2)
{
const double t1 = (*(double *) elem1);
const double t2 = (*(double *) elem2);
@@ -304,7 +304,7 @@ double gensvm_percentile(double *values, long N, double p)
for (i=0; i<N; i++)
local[i] = values[i];
- qsort(local, N, sizeof(double), doublesort);
+ qsort(local, N, sizeof(double), gensvm_dsort);
p /= 100.0;
p = p*N + 0.5;
pi = maximum(minimum(floor(p), N-1), 1);
@@ -315,4 +315,3 @@ double gensvm_percentile(double *values, long N, double p)
return boundary;
}
-
diff --git a/src/gensvm_io.c b/src/gensvm_io.c
index 1da5597..e77d647 100644
--- a/src/gensvm_io.c
+++ b/src/gensvm_io.c
@@ -39,8 +39,8 @@
* Read the data from the data_file. The data matrix X is augmented
* with a column of ones, to get the matrix Z. The data is expected
* to follow a specific format, which is specified in the @ref spec_data_file.
- * The class labels are corrected internally to correspond to the interval
- * [1 .. K], where K is the total number of classes.
+ * The class labels are checked to make sure they correspond to the interval
+ * [1 .. K], where K is the total number of classes, without any gaps.
*
* @todo
* Make sure that this function allows datasets without class labels for