| 1 |
/** |
| 2 |
* Authors: |
| 3 |
* Tim Dwyer <[email protected]> |
| 4 |
* |
| 5 |
* Copyright (C) 2005 Authors |
| 6 |
* |
| 7 |
* This version is released under the CPL (Common Public License) with |
| 8 |
* the Graphviz distribution. |
| 9 |
* A version is also available under the LGPL as part of the Adaptagrams |
| 10 |
* project: http://sourceforge.net/projects/adaptagrams. |
| 11 |
* If you make improvements or bug fixes to this code it would be much |
| 12 |
* appreciated if you could also contribute those changes back to the |
| 13 |
* Adaptagrams repository. |
| 14 |
*/ |
| 15 |
|
| 16 |
/********************************************************** |
| 17 |
* Written by Tim Dwyer for the graphviz package * |
| 18 |
* https://graphviz.org * |
| 19 |
* * |
| 20 |
**********************************************************/ |
| 21 |
|
| 22 |
#pragma once |
| 23 |
|
| 24 |
#include <util/api.h> |
| 25 |
|
| 26 |
#ifdef __cplusplus |
| 27 |
extern "C" { |
| 28 |
#endif |
| 29 |
|
| 30 |
#ifdef DIGCOLA |
| 31 |
|
| 32 |
#include <neatogen/defs.h> |
| 33 |
#include <neatogen/digcola.h> |
| 34 |
#include <stdbool.h> |
| 35 |
|
| 36 |
typedef struct CMajEnvVPSC { |
| 37 |
float **A; |
| 38 |
int nv; /* number of actual vars */ |
| 39 |
int nldv; /* number of dummy nodes included in lap matrix */ |
| 40 |
int ndv; /* number of dummy nodes not included in lap matrix */ |
| 41 |
Variable **vs; |
| 42 |
int m; /* total number of constraints for next iteration */ |
| 43 |
int gm; /* number of global constraints */ |
| 44 |
Constraint **cs; |
| 45 |
/* global constraints are persistent throughout optimisation process */ |
| 46 |
Constraint **gcs; |
| 47 |
VPSC *vpsc; |
| 48 |
float *fArray1; /* utility arrays - reusable memory */ |
| 49 |
float *fArray2; |
| 50 |
float *fArray3; |
| 51 |
} CMajEnvVPSC; |
| 52 |
|
| 53 |
PRIVATE CMajEnvVPSC* initCMajVPSC(int n, float *packedMat, vtx_data* graph, ipsep_options *opt, int diredges); |
| 54 |
|
| 55 |
PRIVATE int constrained_majorization_vpsc(CMajEnvVPSC*, float*, float*, int); |
| 56 |
|
| 57 |
PRIVATE void deleteCMajEnvVPSC(CMajEnvVPSC *e); |
| 58 |
PRIVATE void generateNonoverlapConstraints( |
| 59 |
CMajEnvVPSC* e, |
| 60 |
float nsizeScale, |
| 61 |
float** coords, |
| 62 |
int k, |
| 63 |
bool transitiveClosure, |
| 64 |
ipsep_options* opt |
| 65 |
); |
| 66 |
|
| 67 |
PRIVATE void removeoverlaps(int,float**,ipsep_options*); |
| 68 |
|
| 69 |
typedef struct { |
| 70 |
int *nodes; |
| 71 |
int num_nodes; |
| 72 |
} DigColaLevel; |
| 73 |
|
| 74 |
/* |
| 75 |
* unpack the "ordering" array into an array of DigColaLevel (as defined above) |
| 76 |
*/ |
| 77 |
PRIVATE DigColaLevel* assign_digcola_levels(int *ordering, int n, int *level_inds, int num_divisions); |
| 78 |
PRIVATE int get_num_digcola_constraints(DigColaLevel *levels, int num_levels); |
| 79 |
|
| 80 |
#endif |
| 81 |
|
| 82 |
#ifdef __cplusplus |
| 83 |
} |
| 84 |
#endif |