[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] using gsl_blas_dgemm

From: Dipankar Maitra
Subject: [Help-gsl] using gsl_blas_dgemm
Date: Thu, 19 May 2011 16:30:23 -0400


I am trying to use gsl_blas_dgemm() to multiply two matrices, with
somewhat strict warning options (as a part of a bigger project).  The
code, alongwith its compile options is given below.  When trying to
compile the code I get the following warnings:

joe.c: In function ‘main’:
joe.c:49: warning: passing argument 1 of ‘gsl_blas_dgemm’ with
different width due to prototype
joe.c:49: warning: passing argument 2 of ‘gsl_blas_dgemm’ with
different width due to prototype

Is there a way I can fix this?  Note that this is the same example
posted at
, although I modified it a bit (the matrix sizes are now defined as
size_t) to get rid of similar warnings as above, but I was unable to
resolve the warning in line 49.  Any help would be greatly


/* **** Code joe.c *** */
/* Purpose: To iillustrate the problem with:
   "passing argument 1 of ‘gsl_blas_dgemm’ with different width due to

   The code is taken from

   gcc joe.c -o joe -Wall -W -Werror -Winline -O0          \
       -ansi -pedantic -fshort-enums -fno-common -Dinline=       \
       -Wpointer-arith -Wcast-qual -Wcast-align -Wshadow         \
       -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
       -Wconversion -Wwrite-strings \
       `gsl-config --cflags` `gsl-config --libs`


/* Includes */ /*{{{*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <gsl/gsl_blas.h>

/* Function Prototypes */  /*{{{*/
int main (void);

int main (void)
{ /*{{{*/
        size_t m=2,n=3;
        double a[] = { 0.11, 0.12, 0.13,
                       0.21, 0.22, 0.23 };

        double b[] = { 1011, 1012,
                       1021, 1022,
                       1031, 1032 };

        double c[] = { 0.00, 0.00,
                       0.00, 0.00 };

        gsl_matrix_view A = gsl_matrix_view_array(a, m, n);
        gsl_matrix_view B = gsl_matrix_view_array(b, n, m);
        gsl_matrix_view C = gsl_matrix_view_array(c, m, m);

        /* Compute C = A B */
        gsl_blas_dgemm (CblasNoTrans, CblasNoTrans,
                        1.0, &A.matrix, &B.matrix,
                        0.0, &C.matrix);

        printf ("[ %g, %g\n", c[0], c[1]);
        printf ("  %g, %g ]\n", c[2], c[3]);

        return 0;
} /*}}}*/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]