From c73917355476eb6a23e3d15b5472b3427054bc1d Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 20 Nov 2025 05:20:03 +0000 Subject: [PATCH] Removing old files --- .devcontainer/reinstall-cmake.sh | 59 ---------- README.md | 10 +- include/barry/barraycol-bones.hpp.old | 72 ------------ include/barry/barraycol-meat.hpp.old | 116 ------------------- include/barry/barraydense-bones.hpp.old | 142 ------------------------ 5 files changed, 5 insertions(+), 394 deletions(-) delete mode 100644 .devcontainer/reinstall-cmake.sh delete mode 100644 include/barry/barraycol-bones.hpp.old delete mode 100644 include/barry/barraycol-meat.hpp.old delete mode 100644 include/barry/barraydense-bones.hpp.old diff --git a/.devcontainer/reinstall-cmake.sh b/.devcontainer/reinstall-cmake.sh deleted file mode 100644 index 408b81d22..000000000 --- a/.devcontainer/reinstall-cmake.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash -#------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. -#------------------------------------------------------------------------------------------------------------- -# -set -e - -CMAKE_VERSION=${1:-"none"} - -if [ "${CMAKE_VERSION}" = "none" ]; then - echo "No CMake version specified, skipping CMake reinstallation" - exit 0 -fi - -# Cleanup temporary directory and associated files when exiting the script. -cleanup() { - EXIT_CODE=$? - set +e - if [[ -n "${TMP_DIR}" ]]; then - echo "Executing cleanup of tmp files" - rm -Rf "${TMP_DIR}" - fi - exit $EXIT_CODE -} -trap cleanup EXIT - - -echo "Installing CMake..." -apt-get -y purge --auto-remove cmake -mkdir -p /opt/cmake - -architecture=$(dpkg --print-architecture) -case "${architecture}" in - arm64) - ARCH=aarch64 ;; - amd64) - ARCH=x86_64 ;; - *) - echo "Unsupported architecture ${architecture}." - exit 1 - ;; -esac - -CMAKE_BINARY_NAME="cmake-${CMAKE_VERSION}-linux-${ARCH}.sh" -CMAKE_CHECKSUM_NAME="cmake-${CMAKE_VERSION}-SHA-256.txt" -TMP_DIR=$(mktemp -d -t cmake-XXXXXXXXXX) - -echo "${TMP_DIR}" -cd "${TMP_DIR}" - -curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_BINARY_NAME}" -O -curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_CHECKSUM_NAME}" -O - -sha256sum -c --ignore-missing "${CMAKE_CHECKSUM_NAME}" -sh "${TMP_DIR}/${CMAKE_BINARY_NAME}" --prefix=/opt/cmake --skip-license - -ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake -ln -s /opt/cmake/bin/ctest /usr/local/bin/ctest diff --git a/README.md b/README.md index 1cb4a36d7..32c35c230 100644 --- a/README.md +++ b/README.md @@ -62,11 +62,11 @@ int main() { // Creating counter object for the network and adding stats to count netcounters::NetStatsCounter counter(&net); - netcounters::counter_edges(counter.counters); - netcounters::counter_ttriads(counter.counters); - netcounters::counter_isolates(counter.counters); - netcounters::counter_ctriads(counter.counters); - netcounters::counter_mutual(counter.counters); + netcounters::counter_edges(counter.get_counters()); + netcounters::counter_ttriads(counter.get_counters()); + netcounters::counter_isolates(counter.get_counters()); + netcounters::counter_ctriads(counter.get_counters()); + netcounters::counter_mutual(counter.get_counters()); // Counting and printing the results std::vector< double > counts = counter.count_all(); diff --git a/include/barry/barraycol-bones.hpp.old b/include/barry/barraycol-bones.hpp.old deleted file mode 100644 index 50c0894b2..000000000 --- a/include/barry/barraycol-bones.hpp.old +++ /dev/null @@ -1,72 +0,0 @@ -#include "typedefs.hpp" - -#ifndef BARRY_BARRAYCOL_BONES_HPP -#define BARRY_BARRAYCOL_BONES_HPP 1 - -template -class BArrayCol { -private: - - BArray * Array; - std::vector< Cell > iter_vec; - size_t i; - -public: - - BArrayCol(BArray * Array_, size_t i_, bool check_bounds = true) : - Array(Array_), i(i_) { - if (check_bounds) { - - if (i >= Array->ncol()) - throw std::length_error("Col out of range."); - - } - }; - - ~BArrayCol(){}; - void operator=(const Cell_Type & val); - void operator+=(const Cell_Type & val); - void operator-=(const Cell_Type & val); - void operator*=(const Cell_Type & val); - void operator/=(const Cell_Type & val); - - operator Cell_Type() const; - bool operator==(const Cell_Type & val) const; - - Col_type::iterator begin() noexcept; - Col_type::iterator end() noexcept; - -}; - -template -class BArrayCol_const { -private: - - const BArray * Array; - size_t i; - -public: - - BArrayCol(const BArray * Array_, size_t i_, bool check_bounds = true) : - Array(Array_), i(i_) { - if (check_bounds) { - - if (i >= Array->ncol()) - throw std::length_error("Col out of range."); - - } - }; - - ~BArrayCol_const(){}; - - // operator std::vector< Cell_Type() > const; - bool operator==(const Cell_Type & val) const; - bool operator!=(const Cell_Type & val) const; - bool operator<(const Cell_Type & val) const; - bool operator>(const Cell_Type & val) const; - bool operator<=(const Cell_Type & val) const; - bool operator>=(const Cell_Type & val) const; - -}; - -#endif \ No newline at end of file diff --git a/include/barry/barraycol-meat.hpp.old b/include/barry/barraycol-meat.hpp.old deleted file mode 100644 index 503645564..000000000 --- a/include/barry/barraycol-meat.hpp.old +++ /dev/null @@ -1,116 +0,0 @@ -#include "barraycol-bones.hpp" - -#ifndef BARRY_BARRAYCOL_MEAT_HPP -#define BARRY_BARRAYCOL_MEAT_HPP 1 - -template -inline void BArrayCol::operator=(const Cell_Type & val) { - - if (Array->is_empty(i, j, false)) { - Array->insert_cell(i, j, val, false, false); - } else { - Array->el_ij.at(i).at(j).value = val; - } - -} - -template -inline void BArrayCol::operator+=(const Cell_Type & val) { - - if (Array->is_empty(i, j, false)) { - Array->insert_cell(i, j, val, false, false); - } else { - Array->el_ij.at(i).at(j).value += val; - } - -} - -template -inline void BArrayCol::operator-=(const Cell_Type & val) { - - if (Array->is_empty(i, j, false)) { - Array->insert_cell(i, j, -val, false, false); - } else { - Array->el_ij.at(i).at(j).value -= val; - } - -} - -template -inline void BArrayCol::operator*=(const Cell_Type & val) { - - if (!Array->is_empty(i, j, false)) { - Array->el_ij.at(i).at(j).value *= val; - } - -} - -template -inline void BArrayCol::operator/=(const Cell_Type & val) { - - if (!Array->is_empty(i, j, false)) { - Array->el_ij.at(i).at(j).value /= val; - } - -} - -template -inline BArrayCol::operator Cell_Type() const { - return Array->get_cell(i, j, false); -} - -template -inline bool BArrayCol::operator==(const Cell_Type & val) const { - return Array->get_cell(i, j, false) == static_cast(val); -} - -template -inline Col_type::iterator BArrayCol::begin() noexcept { - return this->Array->el_ji[this->i].begin(); -} - -template -inline Col_type::iterator BArrayCol::end() noexcept { - return this->Array->el_ji[this->i].end(); -} - -/******************************************************************************* - * Const Col - * ****************************************************************************/ - -template -inline BArrayCol_const::operator Cell_Type() const { - return Array->get_cell(i, j, false); -} - -template -inline bool BArrayCol_const::operator==(const Cell_Type & val) const { - return Array->get_cell(i, j, false) == static_cast(val); -} - -template -inline bool BArrayCol_const::operator!=(const Cell_Type & val) const { - return !(this->operator==(val)); -} - -template -inline bool BArrayCol_const::operator<(const Cell_Type & val) const { - return Array->get_cell(i, j, false) < static_cast(val); -} - -template -inline bool BArrayCol_const::operator>(const Cell_Type & val) const { - return Array->get_cell(i, j, false) > static_cast(val); -} - -template -inline bool BArrayCol_const::operator<=(const Cell_Type & val) const { - return Array->get_cell(i, j, false) <= static_cast(val); -} - -template -inline bool BArrayCol_const::operator>=(const Cell_Type & val) const { - return Array->get_cell(i, j, false) >= static_cast(val); -} - -#endif \ No newline at end of file diff --git a/include/barry/barraydense-bones.hpp.old b/include/barry/barraydense-bones.hpp.old deleted file mode 100644 index 12f602991..000000000 --- a/include/barry/barraydense-bones.hpp.old +++ /dev/null @@ -1,142 +0,0 @@ -// #include -// #include -// #include "typedefs.hpp" - -/** - * @brief Dense bi-dimensional array - * - * @details elements is stored in a std::vector, in col-major order. - * - * @tparam Cell_Type - */ -template -class BArrayDense { -private: - size_t N; ///< Number of rows - size_t M; ///< Number of columns - std::vector< Cell_Type > elements; - Data_Type * data = nullptr; - -public: - BArrayDense(); - BArrayDense( - size_t N_, size_t M_, - std::vector< Cell_Type > elements_ = {} - ); - ~BArrayDense() {}; - - void fill(const Cell_Type & d); - - const std::vector< Cell_Type > & elements_raw() const noexcept; - const std::vector< Cell_Type > * elements_ptr() const noexcept; - size_t nrow() const noexcept; - size_t ncol() const noexcept; - - Cell_Type operator()(size_t i, size_t j, bool check_bounds = true) const; - Cell_Type operator[](size_t i) const; - - void print() const; - -}; - -template -inline BArrayDense::BArrayDense() -{ - - N = 0u; - M = 0u; - elements.resize(0u); - - elements.size() - -} - -template -inline BArrayDense::BArrayDense( - size_t N_, size_t M_, - std::vector< Cell_Type > elements_ -) : N(N_), M(M_) -{ - - if (elements_->size() != static_cast(N*M)) - throw std::logic_error("N*M don't match thedim of the elements."); - - elements.resize(elements_.size()); - std::copy(elements_.begin(), elements_.end(), elements.begin()); - -} - -template -inline void BArrayDense::fill(const Cell_Type & d) -{ - std::fill(elements.begin(), elements.end(), d); -} - - -template -inline const std::vector< Cell_Type > & - BArrayDense::elements_raw() const noexcept -{ - return elements; -} - -template -inline const std::vector< Cell_Type > * - BArrayDense::elements_ptr() const noexcept -{ - return *elements; -} - -template -inline size_t BArrayDense::nrow() const noexcept -{ - return N; -} - -template -inline size_t BArrayDense::ncol() const noexcept -{ - return M; -} - -template -inline Cell_Type BArrayDense::operator()( - size_t i, size_t j, bool check_bounds -) const -{ - if (check_bounds) - { - - if (i >= N) - throw std::range_error("Row index i out of range."); - else if (j >= M) - throw std::range_error("Col index j out of range."); - - } - - return elements[j * N + i]; - -} - -template -inline Cell_Type BArrayDense::operator[](size_t i) const -{ - return elements[i]; -} - -template -inline void BArrayDense::print() const { - - if (N*M == 0u) - printf_barry("< empty dense array >\n"); - - for (size_t i = 0u; i < N; ++i) - { - printf_barry("[%3i,]", i); - for (size_t j = 0u; j < M; ++j) - printf_barry(" %.2f ", elements[j*N + i]); - - printf_barry("\n"); - } - -} \ No newline at end of file