25 fprintf(stderr,
"Calculating circuit model");
28 for (
int i = 0; i < nG; i++) {
30 for (
int j = 0; j < nG; j++)
35 return matinv(Gm, Gm_inv, nG - 1);
40 double **
const Gm =
new_array(nG, nG, 0.0);
41 double **
const Gm_inv =
new_array(nG, nG, 0.0);
51 Gm[i][j] = Gm[j][i] = -1.0 /
ED_dist(e);
58 for (
int i = 0; i < nG; i++) {
59 for (
int j = 0; j < nG; j++) {
61 Gm_inv[i][i] + Gm_inv[j][j] - 2.0 * Gm_inv[i][j];
int circuit_model(graph_t *g, int nG)
int solveCircuit(int nG, double **Gm, double **Gm_inv)
Agedge_t * agnxtedge(Agraph_t *g, Agedge_t *e, Agnode_t *n)
Agedge_t * agfstedge(Agraph_t *g, Agnode_t *n)
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
int matinv(double **A, double **Ainv, int n)
NEATOPROCS_API void free_array(double **rv)
NEATOPROCS_API double ** new_array(int i, int j, double val)