[[ I am resending this since I forgot to select "Reply all", and
bug-gsl@gnu.org <mailto:bug-gsl@gnu.org> was by accident not included
in the recepients ]]
Yes, I agree that seems like a good reason to exclude those functions.
Otherwise, I have no strong opinion on whether to include it or not.
I am trying to write Perl bindings to the GSL library using swig, see
https://github.com/leto/math--gsl/issues/231
<https://github.com/leto/math--gsl/issues/231>
According to the gsl_spmatrix_uchar.h header file (line 175):
https://git.savannah.gnu.org/cgit/gsl.git/tree/spmatrix/gsl_spmatrix_uchar.h#n175
<https://git.savannah.gnu.org/cgit/gsl.git/tree/spmatrix/gsl_spmatrix_uchar.h#n175>
there should be a function gsl_spmatrix_uchar_norm1(), so swig gets
confused and creates a wrapper for a non-existing function.
Maybe that line 175 could be commented out?
Håkon
On Fri, Jun 25, 2021 at 6:46 PM Patrick Alken <alken@colorado.edu
<mailto:alken@colorado.edu>> wrote:
Hello,
Unsigned versions of this function were excluded (uchar, uint,
ushort), because there is the possibility of adding two large uchar
values together during the 1-norm calculation and ending up with a
smaller value due to it wrapping back to 0. This didn't make much
sense
to me when I wrote the function, so I excluded the unsigned versions.
Do you think it makes sense to have a uchar_norm1 function?
Patrick
On 6/25/21 11:45 AM, Håkon Hægland wrote:
> I am on Ubuntu 21.04, using GSL 2.7. Here is my test program
norm.c :
>
>
> #include <stdio.h>
> #include <gsl/gsl_spmatrix.h>
> int
> main()
> {
> gsl_spmatrix_uchar *A = gsl_spmatrix_uchar_alloc(2, 2);
>
> gsl_spmatrix_uchar_set(A, 0, 0, 1);
> gsl_spmatrix_uchar_set(A, 0, 1, 2);
> gsl_spmatrix_uchar_set(A, 1, 0, 3);
> gsl_spmatrix_uchar_set(A, 1, 1, 4);
>
> double norm = gsl_spmatrix_uchar_norm1(A);
> printf("norm = %g\n", norm);
> gsl_spmatrix_uchar_free(A);
>
> return 0;
> }
>
> When I compile this I get an error message from the linker:
>
> $ gcc -Wall -I/opt/gsl/gsl-2.7/include -c norm.c
> $ gcc -L/opt/gsl/gsl-2.7/lib -o norm norm.o -lgsl -lgslcblas -lm
> /bin/ld: norm.o: in function `main':
> norm.c:(.text+0x93): undefined reference to
`gsl_spmatrix_uchar_norm1'
> collect2: error: ld returned 1 exit status
>
> Best regards,
> Håkon Hægland