sparsegraph.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*************************************************************************
  2. * Copyright (c) 2011 AT&T Intellectual Property
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * https://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors: Details at https://graphviz.org
  9. *************************************************************************/
  10. #pragma once
  11. #include <stddef.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include "config.h"
  16. typedef struct {
  17. int nedges; /* no. of neighbors, including self */
  18. int *edges; /* edges[0..(nedges-1)] are neighbors; edges[0] is self */
  19. float *ewgts; /* preferred edge lengths */
  20. } v_data;
  21. typedef struct {
  22. size_t nedges; ///< no. of neighbors, including self
  23. int *edges; /* edges[0..(nedges-1)] are neighbors; edges[0] is self */
  24. float *ewgts; /* preferred edge lengths */
  25. float *eweights; /* edge weights */
  26. #ifdef DIGCOLA
  27. float *edists; /* directed dist reflecting the direction of the edge */
  28. #endif
  29. } vtx_data;
  30. typedef int DistType; /* must be signed!! */
  31. extern void freeGraphData(vtx_data * graph);
  32. extern void freeGraph(v_data * graph);
  33. #ifdef __cplusplus
  34. }
  35. #endif