Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change definition of arreglo_2d for handling of 2-d arrays #464

Open
palmoreck opened this issue Apr 30, 2018 · 2 comments
Open

Change definition of arreglo_2d for handling of 2-d arrays #464

palmoreck opened this issue Apr 30, 2018 · 2 comments

Comments

@palmoreck
Copy link
Member

This definition of arreglo_2d needs that m is defined somewhere in the code:

//arreglo2d:
typedef struct{
int m, n;
#define renglones(arreglo) ((arreglo)->m)
#define columnas(arreglo) ((arreglo)->n)
double *arr;
#define entradas(arreglo) ((arreglo)->arr)
#define entrada(arreglo,i,j) ((arreglo)->arr[j*m+i]) //almacenamos column major
}arreglo_2d;
typedef arreglo_2d *arreglo_2d_T;

Snippet from:
https://github.com/ITAM-DS/analisis-numerico-computo-cientifico/tree/master/C/BLAS/ejemplos
https://github.com/ITAM-DS/analisis-numerico-computo-cientifico/tree/master/C/LAPACK/ejemplos
https://github.com/ITAM-DS/analisis-numerico-computo-cientifico/tree/master/C/extensiones_a_C/MPI/openMPI/ejemplos/3_openMPI_y_BLAS

To avoid this define arreglo_2d as:

//arreglo2d:
typedef struct{
int m, n;
#define renglones(arreglo) ((arreglo)->m)
#define columnas(arreglo) ((arreglo)->n)
double *arr;
#define entradas(arreglo) ((arreglo)->arr)
#define entrada(arreglo,i,j) ((arreglo)->arr[j*renglones(arreglo)+i]) //almacenamos column major
}arreglo_2d;
typedef arreglo_2d *arreglo_2d_T;

So I have to run examples of BLAS, LAPACK and BLAS-OPENMPI to check everything is ok¡

@palmoreck
Copy link
Member Author

palmoreck commented Apr 30, 2018

thanks to @cristianchallu @dsharpc @lizsolisd !

@palmoreck
Copy link
Member Author

checking of BLAS, LAPACK examples was successful. TODO: check BLAS-OPENMPI examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant