diff --git a/inc/impl.hpp b/inc/impl.hpp index daac9d4..bcdfc02 100644 --- a/inc/impl.hpp +++ b/inc/impl.hpp @@ -48,7 +48,7 @@ template struct SpMatRow; template struct SpMatVal; /*! - * 2D-array wrapper for v1 and v2 part of the exercise t use as RAII + * 2D-array wrapper for v1 and v2 part of the exercise used as RAII * and copy-prevention. * * This is a very thin abstraction layer over a native array. @@ -180,7 +180,7 @@ Matrix make_Matrix(IndexType s) { * A(3, 4) = 7; * \endcode * - * We also provide getCol() and getRow() functions witch return a viwer/iterator to rows and + * We also provide getCol() and getRow() functions witch return a viewer/iterator to rows and * columns of the matrix. In the case of a symmetric matrix instead of a row we return the * equivalent column. This way we gain speed due to CSC format nature. * @@ -290,15 +290,15 @@ struct SpMat { } /*! - * A read item functionality using binary search to find the correct row + * A read item functionality using linear search to find the correct row * * @param i The row number * @param j The column number * @return The value of the item or DataType{} if is not present. */ - DataType get2(IndexType i, IndexType j) { + DataType get_lin(IndexType i, IndexType j) { IndexType idx; bool found; - std::tie(idx, found) =find2_idx(rows, col_ptr[j], col_ptr[j+1], i); + std::tie(idx, found) =find_lin_idx(rows, col_ptr[j], col_ptr[j+1], i); return (found) ? values[idx] : 0; } @@ -318,7 +318,7 @@ struct SpMat { */ DataType set(DataType v, IndexType i, IndexType j) { IndexType idx; bool found; - std::tie(idx, found) = find2_idx(rows, col_ptr[j], col_ptr[j+1], i); + std::tie(idx, found) = find_lin_idx(rows, col_ptr[j], col_ptr[j+1], i); if (found) return values[idx] = v; // we don't change NNZ even if we write "0" else { @@ -402,10 +402,10 @@ private: else if (b >= e) return std::make_pair(end, false); else { if (v[m] < match) b = m +1; - else e = m -1; + else e = m -1; } } - return std::make_pair(end, false);; + return std::make_pair(end, false); } /*! * find helper for set using index for begin-end instead of iterators. @@ -418,7 +418,7 @@ private: * \param end The vector's index to end * \param match What to search */ - std::pair find2_idx(const std::vector& v, IndexType begin, IndexType end, IndexType match) { + std::pair find_lin_idx(const std::vector& v, IndexType begin, IndexType end, IndexType match) { for ( ; begin < end ; ++begin) { if (match == v[begin]) return std::make_pair(begin, true); else if (match < v[begin]) return std::make_pair(begin, false); diff --git a/inc/utils.h b/inc/utils.h index 3a2968b..89c77d6 100644 --- a/inc/utils.h +++ b/inc/utils.h @@ -223,10 +223,10 @@ private: }; /*! - * A Logger for entire programm. + * A Logger for entire program. */ struct Log { - struct Endl {} endl; //!< a tag objec to to use it as a new line request. + struct Endl {} endl; //!< a tag object to to use it as a new line request. //! We provide logging via << operator template diff --git a/src/elearn.cpp b/src/elearn.cpp index c734481..6010e4c 100644 --- a/src/elearn.cpp +++ b/src/elearn.cpp @@ -86,6 +86,7 @@ uint32_t* vertexWiseTriangleCounts (uint32_t *coo_row, uint32_t *coo_col, uint32 // convert input coo2csc_e (R, C, coo_row, coo_col, nz, n, 1); + // we use the lower triangular optimization just because ;) for (uint32_t i=0 ; i triang_v(matrix& A) { std::vector> c(A.size()); @@ -196,7 +196,7 @@ int nworkers() { return 1; } * \note * We use two methods of calculation based on \c --make_symmetric or \c --triangular_only * - A full matrix calculation which update only c[i] - * - A lower triangular matrix which update c[i], c[j], c[k]. This is wayyy faster. + * - A lower triangular matrix which update c[i], c[j], c[k]. This is waaayyy faster. */ std::vector triang_v(matrix& A) { std::vector c(A.size()); diff --git a/src/v4.cpp b/src/v4.cpp index f2d1b62..69c662a 100644 --- a/src/v4.cpp +++ b/src/v4.cpp @@ -45,7 +45,7 @@ int nworkers() { * \note * We use two methods of calculation based on \c --make_symmetric or \c --triangular_only * - A full matrix calculation which update only c[i] - * - A lower triangular matrix which update c[i], c[j], c[k]. This is wayyy faster. + * - A lower triangular matrix which update c[i], c[j], c[k]. This is waaayyy faster. * \warning * The later(--triangular_only) produce correct results ONLY if we are after the total count. */ @@ -128,7 +128,7 @@ int nworkers() { * \note * We use two methods of calculation based on \c --make_symmetric or \c --triangular_only * - A full matrix calculation which update only c[i] - * - A lower triangular matrix which update c[i], c[j], c[k]. This is wayyy faster. + * - A lower triangular matrix which update c[i], c[j], c[k]. This is waaayyy faster. * \warning * The later(--triangular_only) produce correct results ONLY if we are after the total count. */ @@ -199,7 +199,7 @@ int nworkers() { * \note * We use two methods of calculation based on \c --make_symmetric or \c --triangular_only * - A full matrix calculation which update only c[i] - * - A lower triangular matrix which update c[i], c[j], c[k]. This is wayyy faster. + * - A lower triangular matrix which update c[i], c[j], c[k]. This is waaayyy faster. * \warning * The later(--triangular_only) produce correct results ONLY if we are after the total count. */ @@ -297,7 +297,7 @@ int nworkers() { return 1; } * \note * We use two methods of calculation based on \c --make_symmetric or \c --triangular_only * - A full matrix calculation which update only c[i] - * - A lower triangular matrix which update c[i], c[j], c[k]. This is wayyy faster. + * - A lower triangular matrix which update c[i], c[j], c[k]. This is waaayyy faster. * \warning * The later(--triangular_only) produce correct results ONLY if we are after the total count. */