Skip to content

Instantly share code, notes, and snippets.

@nvkv
Created January 7, 2013 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nvkv/4472766 to your computer and use it in GitHub Desktop.
Save nvkv/4472766 to your computer and use it in GitHub Desktop.
int*
concord_factor(matrix_t *m)
{
int *cfactor = malloc(m->rows - 1 * sizeof(int));
int i, j;
for (j = 0; j < m->lines; j++)
for (i = 0; i < m->rows - 1; i++)
cfactor[i] += (m->data[j][i] == m->data[j][m->rows - 1]) ? 1 : 0;
return cfactor;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment