static void
makewgraph(graph *g, xword *h, int n)
/* make x-format square graph */
{
register setword w,x;
register xword hi;
register int i,j;
for (i = 0; i < n; ++i)
{
w = g[i];
x = 0;
while (w)
{
j = FIRSTBIT(w);
w ^= bit[j];
x |= g[j];
}
x &= ~bit[i];
hi = 0;
while (x)
{
j = FIRSTBIT(x);
x ^= bit[j];
hi |= xbit[j];
}
h[i] = hi;
}
}
URL de trackback de esta historia http://zifra.blogalia.com//trackbacks/32266
1 |
|
||
Me pierdo un poco con la sintaxis de C (en realidad me pierdo del todo, lo mío es el GAP y el Singular). Sería mucho pedir una descripción más de andar por casa? |
2 |
|
||
Es realmente jodío (¿se puede decir jodío en una bitácora?). Por eso me está costando tanto la adaptación. |
3 |
|
||
Efectivamente, falta comentar-documentar el código. Al menos una descripción de los parámetros y funcines auxiliares.
|
4 |
|
||
GAP? Singular? En mi vida había oido hablar de ellos... |
5 |
|
||
No hay funciones auxiliares. Bueno, FIRSTBIT hace lo que su nombre indica ¿no?, y graph es una estructura de datos representado al grafo. Más en le manual de nauty ;-)
A setword is an unsigned integer type of either 16, 32 or 64 bits, depending on the compile time parameter WORDSIZE. (By default, WORDSIZE is the largest of 32 and the size of type int.) A set (by which we always mean a subset of V = {0, 1,...,n−1}) is represented by an array of m setwords, where m is some number such that WORDSIZE × m ≥ n. The bits of a set are numbered 0, 1,...,n−1 left to right(with in each setword: high order to low order). Bits which dont get numbers are called unnumbered and are assumed permanently zero. A set represents the subset { i | bit i is 1 }. A graph is represented by an array of n sets(so it has mn setwords altogether). The i-th set gives the vertices to which vertex i is adjacent, for 0 ≤ i |
6 |
|
||
Se supone que esta rutina parte de un grafo libre de cuadrados y crea otro libre de cuadrados. Lo que debo hacer es adaptarla a las ruedas. |
7 |
|
||
GAP es un sistema de algebra computacional orientado a teoría de grupos y combinatoria. Singular es otro orientado a anillos de polinómios.
|
8 |
|
||
Lo de llamar ruedas a "eso" me hace pensar en la cuadratura del círculo :D
|
9 |
|
||
Ah...el Gap... qué recuerdos cuando me pasaba las horas mirando grupos... |
< | Enero 2025 | |||||
Lu | Ma | Mi | Ju | Vi | Sa | Do |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | ||