# HG changeset patch # User michelemartone # Date 1434916104 0 # Node ID f4cf214fe3a4e672e0e57430fc4c0a64cfcea363 # Parent cca1aed268cc87f7ae902390cb85b7b36589beb3 The interface to rsb_mtx_get_info_str will at least return the result of RSB_MIF_MATRIX_INFO__TO__CHAR_P now. Documented this as well. diff -r cca1aed268cc -r f4cf214fe3a4 main/sparsersb/NEWS --- a/main/sparsersb/NEWS Sun Jun 21 19:29:06 2015 +0000 +++ b/main/sparsersb/NEWS Sun Jun 21 19:48:24 2015 +0000 @@ -3,7 +3,9 @@ sparsersb-1???? Release Date: 2015-??-?? =============================================================================== ** Documentation fixes: ??? -** ("get",...) ??? +** sparsersb("get",...) functionality ??? +** sparsersb(A,"any_query_string") functionality (interface to librsb's + rsb_mtx_get_info_str ) has been documented and fixed ??? ** ... =============================================================================== sparsersb-1.0.0 Release Date: 2015-05-31 diff -r cca1aed268cc -r f4cf214fe3a4 main/sparsersb/doc/sparsersb.txt --- a/main/sparsersb/doc/sparsersb.txt Sun Jun 21 19:29:06 2015 +0000 +++ b/main/sparsersb/doc/sparsersb.txt Sun Jun 21 19:48:24 2015 +0000 @@ -73,7 +73,9 @@ If A is a sparsersb matrix and QS is a string, QS will be interpreted as a query string about matrix A. String `V' will be - returned. + returned. See librsb's `rsb_mtx_get_info_str()'. *Note*: this + feature is still incomplete, and whatever the value of QS, a + general information string will be returned. If A is a sparsersb matrix and the "render" keyword is specified, and FILENAME is a string, A will be rendered as an Encapsulated diff -r cca1aed268cc -r f4cf214fe3a4 main/sparsersb/src/sparsersb.cc --- a/main/sparsersb/src/sparsersb.cc Sun Jun 21 19:29:06 2015 +0000 +++ b/main/sparsersb/src/sparsersb.cc Sun Jun 21 19:48:24 2015 +0000 @@ -1994,7 +1994,8 @@ If @var{mif} is a string specifying a valid librsb matrix info string (valid for librsb's @code{rsb_mtx_get_info_from_string()}), then the corresponding value will be returned for matrix @code{@var{A}}, in string @code{@var{v}}. If @var{mif} is the an empty string (\"\"), matrix structure information will be returned.\n\ \n\ \ -If @var{A} is a " RSBOI_FNS " matrix and @var{QS} is a string, @var{QS} will be interpreted as a query string about matrix @var{A}. String @code{@var{v}} will be returned.\n\ +If @var{A} is a " RSBOI_FNS " matrix and @var{QS} is a string, @var{QS} will be interpreted as a query string about matrix @var{A}. String @code{@var{v}} will be returned. See librsb's @code{rsb_mtx_get_info_str()}.\n\ +@strong{Note}: this feature is still incomplete, and whatever the value of @var{QS}, a general information string will be returned.\n\ \n"\ /*If any of @var{sv}, @var{i} or @var{j} are scalars, they are expanded\n\ to have a common size.\n*/ @@ -2192,9 +2193,13 @@ if (nargin == 2 && isr && args(1).is_string()) { char ss[RSBOI_INFOBUF]; + rsb_err_t errval = RSB_ERR_NO_ERROR; + if(!osmp || !osmp->mtxAp)goto ret;/* FIXME: error handling missing here */ - rsb_mtx_get_info_str(osmp->mtxAp,"RSB_MIF_MATRIX_INFO__TO__CHAR_P",ss,RSBOI_INFOBUF); - /* FIXME: to add interpretation */ + errval = rsb_mtx_get_info_str(osmp->mtxAp,"RSB_MIF_MATRIX_INFO__TO__CHAR_P",ss,RSBOI_INFOBUF); + if(!RSBOI_SOME_ERROR(errval)) + retval.append(ss); + /* TODO, FIXME: to add interpretation (we are ignoring args(1) !): this is unfinished */ RSBOI_WARN(RSBOI_0_UNFFEMSG);/* FIXME: this is yet unfinished */ // octave_stdout << "Matrix information (in the future, supplementary information may be returned, as more inquiry functionality will be implemented):\n" << ss << "\n"; /* FIXME: shall not print out, but rather return the info as a string*/ @@ -2454,6 +2459,8 @@ %!test %! # sparsersb("get","RSB_IO_WANT_VERBOSE_TUNING","1") %!test +%! sparsersb(sparsersb([11,0;21,22]),"RSB_MIF_TOTAL_SIZE__TO__SIZE_T") +%!test %! sparsersb(sparsersb([11,0;21,22]),"save","sparsersb_temporary_matrix_file.mtx") %!test %! [S, NROWS, NCOLS, NNZ, REPINFO, FIELD, SYMMETRY] = sparsersb("sparsersb_temporary_matrix_file.mtx" ); assert(NROWS==2);assert(NCOLS==2);assert(NNZ==3);assert(FIELD=="real" );assert(SYMMETRY=='U');