git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@12124 626c5289-ae23-0410-ae9c-e8d60b6d4f22
29 lines
717 B
C
29 lines
717 B
C
double sumitems(double *first, int nbRow, int nbCol) {
|
|
int i;
|
|
double total;
|
|
for (i=0; i<(nbRow*nbCol); i++) {
|
|
total+=first[i];
|
|
}
|
|
return total;
|
|
}
|
|
|
|
void sumitems_argoutput(double *first, int nbRow, int nbCol,double** result,int* nbrowres,int* nbcolsres) {
|
|
int i;
|
|
*nbrowres=nbRow;
|
|
*nbcolsres=nbCol;
|
|
*result=malloc(nbRow*nbCol*sizeof(double));
|
|
for (i=0; i<(nbRow*nbCol); i++) {
|
|
(*result)[i]=first[i]+first[i];
|
|
}
|
|
return;
|
|
}
|
|
|
|
double* getValues(int *numberOfRow, int *numberOfCol) {
|
|
*numberOfRow=23; *numberOfCol=3;
|
|
double *tempMatrix = (double*)malloc(sizeof(double) * *numberOfRow * *numberOfCol);
|
|
int i;
|
|
for (i=0; i<((*numberOfRow)*(*numberOfCol)); i++) {
|
|
tempMatrix[i]=i*2;
|
|
}
|
|
return tempMatrix;
|
|
}
|