12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #include <igraph.h>
- #include "io.h"
- // From examples in igraph documentation.
- void print_vector(igraph_vector_t *v, FILE *f) {
- long int i;
- for (i=0; i<igraph_vector_size(v); i++) {
- fprintf(f, " %li", (long int) VECTOR(*v)[i]);
- }
- fprintf(f, "\n");
- }
- void print_graphml(graph_t *g) {
- if(g->initialised) {
- igraph_write_graph_graphml(g->graph, ost);
- }
- }
- void print_gml(graph_t *g) {
- if(g->initialised) {
- igraph_write_graph_gml(g->graph, ost, 0, 0);
- }
- }
- void print_pajek(graph_t *g) {
- if(g->initialised) {
- igraph_write_graph_pajek(g->graph, ost);
- }
- }
- void print_edgelist(graph_t *g) {
- if(g->initialised) {
- igraph_write_graph_edgelist(g->graph, ost);
- }
- }
- void print_ncol(graph_t *g) {
- if(g->initialised) {
- igraph_write_graph_ncol(g->graph, ost, 0, 0);
- }
- }
- void print_lgl(graph_t *g) {
- if(g->initialised) {
- igraph_write_graph_lgl(g->graph, ost, 0, 0, 1);
- }
- }
- void print_dot(graph_t *g) {
- if(g->initialised) {
- igraph_write_graph_dot(g->graph, ost);
- }
- }
- void print_error(graph_t *g) {
- fprintf(ost, "Invalid output format specified.\n");
- }
|