From: Matthew Fernandez Date: Mon, 31 May 2021 16:34:45 +0000 (-0700) Subject: remove unused SparseMatrix_normalize_to_rowsum1 X-Git-Tag: 2.47.3~10^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da10016950b354b90074bdf719e91f0873541b9a;p=graphviz remove unused SparseMatrix_normalize_to_rowsum1 --- diff --git a/lib/sparse/SparseMatrix.c b/lib/sparse/SparseMatrix.c index ce532aaf1..96f35ff41 100644 --- a/lib/sparse/SparseMatrix.c +++ b/lib/sparse/SparseMatrix.c @@ -2097,37 +2097,6 @@ SparseMatrix SparseMatrix_get_real_adjacency_matrix_symmetrized(SparseMatrix A){ return A; } - - -SparseMatrix SparseMatrix_normalize_to_rowsum1(SparseMatrix A){ - int i, j; - real sum, *a; - - if (!A) return A; - if (A->format != FORMAT_CSR && A->type != MATRIX_TYPE_REAL) { -#ifdef DEBUG - printf("only CSR and real matrix supported.\n"); -#endif - return A; - } - - a = (real*) A->a; - for (i = 0; i < A->m; i++){ - sum = 0; - for (j = A->ia[i]; j < A->ia[i+1]; j++){ - sum += a[j]; - } - if (sum != 0){ - for (j = A->ia[i]; j < A->ia[i+1]; j++){ - a[j] /= sum; - } - } - } - return A; -} - - - SparseMatrix SparseMatrix_normalize_by_row(SparseMatrix A){ int i, j; real max, *a; diff --git a/lib/sparse/SparseMatrix.h b/lib/sparse/SparseMatrix.h index 1926e04ee..66e1182aa 100644 --- a/lib/sparse/SparseMatrix.h +++ b/lib/sparse/SparseMatrix.h @@ -82,7 +82,6 @@ SparseMatrix SparseMatrix_remove_diagonal(SparseMatrix A); SparseMatrix SparseMatrix_remove_upper(SparseMatrix A);/* remove diag and upper diag */ SparseMatrix SparseMatrix_divide_row_by_degree(SparseMatrix A); SparseMatrix SparseMatrix_get_real_adjacency_matrix_symmetrized(SparseMatrix A); /* symmetric, all entries to 1, diaginal removed */ -SparseMatrix SparseMatrix_normalize_to_rowsum1(SparseMatrix A);/* for real only! */ void SparseMatrix_multiply_dense(SparseMatrix A, int ATranspose, real *v, int vTransposed, real **res, int res_transpose, int dim); SparseMatrix SparseMatrix_apply_fun(SparseMatrix A, double (*fun)(double x));/* for real only! */ SparseMatrix SparseMatrix_apply_fun_general(SparseMatrix A, void (*fun)(int i, int j, int n, double *x));/* for real and complex (n=2) */