diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-07-25 18:14:55 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-07-25 18:14:55 -0400 |
commit | 9be622f7703193cde9955b9663cea1259ac48efc (patch) | |
tree | acd44702cfd8e52306c0a524cce8885c7a78eb80 /lib/graph.h | |
parent | a3162d7baf9096df1e5d88edfd9dcd79cf81dff0 (diff) | |
download | c++-9be622f7703193cde9955b9663cea1259ac48efc.tar.gz c++-9be622f7703193cde9955b9663cea1259ac48efc.tar.bz2 c++-9be622f7703193cde9955b9663cea1259ac48efc.zip |
trying some new c++ things, starting with graph
Diffstat (limited to 'lib/graph.h')
-rw-r--r-- | lib/graph.h | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/lib/graph.h b/lib/graph.h index beb7f4c..a4732fb 100644 --- a/lib/graph.h +++ b/lib/graph.h @@ -2,27 +2,20 @@ #pragma once #include <inttypes.h> -#include <math.h> +#include <cmath> #include <stdlib.h> +#include <vector> #include "types.h" -#ifdef __cplusplus -extern "C" { -#endif +class graph_t { + public: + v_t ne; + v_t nv; + std::vector<std::vector<v_t>> v_adj; -typedef struct { - v_t ne; - v_t nv; - v_t *v_i; - v_t *v_adj; -} graph_t; + graph_t(D_t D, L_t L); + void add_ext(); -graph_t *graph_create_square(D_t D, L_t L); -graph_t *graph_add_ext(const graph_t *G); -void graph_free(graph_t *h); - -#ifdef __cplusplus -} -#endif +}; |