El 19 de julio de 2009 23:01, Brian Gough <[email protected]> escribió: > At Sat, 18 Jul 2009 13:30:54 +0200, > José Luis García Pallero wrote: > > But I don't understand clearly how these macros run. My idea is that the > > macros "return" in the argument 'pos' the position in the argument list > of > > the bad argument and then we can do the correct thing: > > - If we are working in cblas_* function, call cblas_xerbla > > - If we are working with gsl_cblas_* wrapper, call a function to convert > > from 'pos' to GSL_ERROR_CODE and return this code. > > I don't know exactly the behaviour of your macros. > > We can reuse the higher level macros like CHECK_GEMV but we would > need different implementations of the lower macros like CHECK_DIM. > > For example the cblas dimensions are 'int', and the gsl_blas > dimensions are 'size_t' -- therefore the check for dim<0 would not > work for size_t (we might instead want to make sure that dim is > <=INT_MAX for size_t). > > #define CHECK_DIM(pos,dim) if ((dim)>=INT_MAX) { ERROR("dimension " > #dim " exceeds maximum size", GSL_EBADLEN) ; } > > It's shouldn't be too much extra work to redo the lower macros for the > two cases as there are a limited number of them. >
I think that the low level macros can be the same. All arguments to check in cblas_* are integer, therefore we can implement a general macro like CHECK_LONGITUDE for checking the size of int arguments. This macro should be called before high level macros (CHECK_GEMV, etc.). -- ***************************************** José Luis García Pallero [email protected] (o< / / \ V_/_ Use Debian GNU/Linux and enjoy! ***************************************** _______________________________________________ Help-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gsl
