c - Getting error: expected '=', ',', ';', 'asm' or '__attribute__' before 'SolvePrecondMatrix' -
when try compile .c file in putty, throws me error :
expected '=', ',', ';', 'asm' or 'attribute' before 'solveprecondmatrix'.
i don't know how solve it. checked twice in code , didn't miss ";" don't know why then. can me pls.
#include<math.h> #include<stdio.h> #include<stdlib.h> #include<mpi.h> #define epsilon 1.0e-20 #define max_iterations 10000 /******************************************************************************/ void getpreconditionmatrix(double **bloc_precond_matrix, int noofrows_bloc, int noofcols) { /*... preconditional martix identity matrix .......*/ int bloc_matrixsize; int irow, icol, index; double *precond_matrix; bloc_matrixsize = noofrows_bloc*noofcols; precond_matrix = (double *) malloc(bloc_matrixsize * sizeof(double)); index = 0; for(irow=0; irow<noofrows_bloc; irow++){ for(icol=0; icol<noofcols; icol++){ precond_matrix[index++] = 1.0; } } *bloc_precond_matrix = precond_matrix; } /******************************************************************************/ double computevectordotproduct(double *vector1, double *vector2, int vectorsize) { int index; double product; product = 0.0; for(index=0; index<vectorsize; index++) product += vector1[index]*vector2[index]; return(product); } /******************************************************************************/ void calculateresiduevector(double *bloc_residue_vector, double *bloc_matrix_a, double *input_b, double *vector_x, int noofrows_bloc int vectorsize, int myrank) { /*... computes residue = ax - b .......*/ int irow, index, globalvectorindex; double value; globalvectorindex = myrank * noofrows_bloc; for(irow=0; irow<noofrows_bloc; irow++){ index = irow * vectorsize; value = computevectordotproduct(&bloc_matrix_a[index], vector_x, vectorsize); bloc_residue_vector[irow] = value - input_b[globalvectorindex++]; } } /******************************************************************************/ void solveprecondmatrix(double *bloc_precond_matrix, double *hvector, double *bloc_residue_vector, int bloc_vectorsize) { /*...hvector = bloc_precond_matrix inverse * bloc_residue_vector.......*/ int index; for(index=0; index<bloc_vectorsize; index++){ hvector[index] = bloc_residue_vector[index]/1.0; } }
the problem function:
void solveprecondmatrix(double *bloc_precond_matrix, double *hvector, double *bloc_residue_vector, int bloc_vectorsize)
it should have been:
void solveprecondmatrix(double *bloc_precond_matrix, double *hvector, double *bloc_residue_vector, int bloc_vectorsize)
that is, mistakenly capitalized void
void
.
Comments
Post a Comment