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.
--
Brian Gough
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl