#include <array>
#include <string>
#include <vector>
Go to the source code of this file.
|
void | read_edges_from_file (const std::string &file_name, std::vector< std::array< int, 2 >> &v) |
|
std::vector< std::vector< int > > | get_node2nodes (std::vector< std::array< int, 2 >> const &edges) |
|
◆ get_node2nodes()
std::vector<std::vector<int> > get_node2nodes |
( |
std::vector< std::array< int, 2 >> const & |
edges | ) |
|
Determines the neighboring vertices for each node from the edge definition edges
. The node itself is not contained in the neighboring vertices.
- Parameters
-
[in] | edges | vector[ne][2] with edge vertices |
- Returns
- vector[nn][*] with all neighboring vertices for each node
- Warning
- We assume that the nodes are continuously numbered from 0 to nn-1. Otherwise we have to use map< int, vector<int> > as data structure.
◆ read_edges_from_file()
void read_edges_from_file |
( |
const std::string & |
file_name, |
|
|
std::vector< std::array< int, 2 >> & |
v |
|
) |
| |
This function opens the ASCII-file named file_name
and reads the int data into the C++ vector v
. If the file file_name
does not exist then the code stops with an appropriate message.
- Parameters
-
[in] | file_name | name of the ASCII-file |
[out] | v | C++ vector with edge vertices |