From e63a88ea567744d890d923d1d7aa46e583cbb0ec Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 5 Feb 2019 00:50:28 -0500 Subject: add km_set_print(), refactor main.c --- src/km-set.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/km-set.c') diff --git a/src/km-set.c b/src/km-set.c index 69ae6c0..fcf1054 100644 --- a/src/km-set.c +++ b/src/km-set.c @@ -263,5 +263,15 @@ km_set_get_row( const size_t i ) { const size_t num_floats = set->shape.num_floats; - return set->floats + i * num_floats; + return (num_floats) ? (set->floats + i * num_floats) : NULL; +} + +// get row from data set +int * +km_set_get_row_ints( + const km_set_t * const set, + const size_t i +) { + const size_t num_ints = set->shape.num_ints; + return (num_ints) ? (set->ints + i * num_ints) : NULL; } -- cgit v1.2.3