<commit_before>/*
 * This file is part of the alglib project.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE file
 * that was distributed with this source code.
 */

#pragma once

#include <type_traits>

template<typename vertex_t, typename attr_t = int, typename Enable = void>
struct edge_t : public attr_t {

    vertex_t from;
    vertex_t to;
};


template<typename vertex_t, typename attr_t>
struct edge_t<vertex_t, attr_t,
              typename std::enable_if<std::is_fundamental<attr_t>::value>::type> {
              
    vertex_t from;
    vertex_t to;
    attr_t attribute;
};

template<typename vertex_t, typename attr_t>
std::ostream& operator<<(std::ostream& out, const edge_t<vertex_t, attr_t>& e) {

    std::cout << "(" << e.from << ", " << e.to << ") ";
    return out;
}

/*

template<typename vertex_t, typename attr_t>
edge_t<vertex_t, attr_t> make_edge (vertex_t from, vertex_t to,
                                    attr_t attribute = -1) {
    return edge_t<vertex_t, attr_t> {from, to, attribute};
}
*/


<commit_msg>Remove the derived edge_t type<commit_after>/*
 * This file is part of the alglib project.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE file
 * that was distributed with this source code.
 */

#pragma once

#include <type_traits>

template<typename vertex_t, typename attr_t>
struct edge_t {
              
    vertex_t from;
    vertex_t to;
    attr_t attribute;

    edge_t(const vertex_t& u, const vertex_t& v, const vertex_t& attr) {
        from = u;
        to = v;
        attribute = attr;
    }
    
    bool operator==(const edge_t<vertex_t, edge_t>& other) const
    { return attribute == other.attribute; }

    bool operator!=(const edge_t<vertex_t, edge_t>& other) const 
    { return attribute != other.attribute; }

    bool operator>(const edge_t<vertex_t, edge_t>& other) const 
    { return attribute > other.attribute; }

    bool operator<(const edge_t<vertex_t, edge_t>& other) const 
    { return attribute < other.attribute; }

    bool operator>=(const edge_t<vertex_t, edge_t>& other) const 
    { return attribute >= other.attribute; }

    bool operator<=(const edge_t<vertex_t, edge_t>& other) const 
    { return attribute <= other.attribute; }
};

template<typename vertex_t, typename attr_t>
std::ostream& operator<<(std::ostream& out, const edge_t<vertex_t, attr_t>& e) {

    out << "(from: " << e.from << ", to: " << e.to
        << ", attr: " << e.attribute << ")";
    return out;
}


template<typename vertex_t, typename attr_t>
edge_t<vertex_t, attr_t> make_edge(vertex_t from, vertex_t to,
                                   attr_t attribute) {
    return edge_t<vertex_t, attr_t>(from, to, attribute);
}


{'fraction_non_alphanumeric': 0.12175151299394803, 'fraction_numerical': 0.000355998576005696, 'mean_word_length': 3.187779433681073, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5243645', 'n_tokens_mistral': 933, 'n_tokens_neox': 900, 'n_words': 259}