From bc8fda9056f0fd52d42bd17bf58ce8309a6f3b0e Mon Sep 17 00:00:00 2001 From: Krishna Vedala Date: Thu, 28 May 2020 14:25:00 -0400 Subject: [PATCH] sparse matrix docs --- others/sparse_matrix.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/others/sparse_matrix.cpp b/others/sparse_matrix.cpp index d9878fda4..a358f0da4 100644 --- a/others/sparse_matrix.cpp +++ b/others/sparse_matrix.cpp @@ -1,10 +1,11 @@ /** @file * A sparse matrix is a matrix which has number of zeroes greater than - * \f$\frac{m*n}{2}\f$, where m and n are the dimensions of the matrix. + * \f$\frac{m\times n}{2}\f$, where m and n are the dimensions of the matrix. */ #include +/** main function */ int main() { int m, n; int counterZeros = 0; @@ -30,7 +31,8 @@ int main() { // counts the zero's for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { - if (a[i][j] == 0) counterZeros++; // Counting number of zeroes + if (a[i][j] == 0) + counterZeros++; // Counting number of zeroes } }