Exemplo n.º 1
0
static int
ref_nonsingle(struct saucy *s, struct coloring *c,
	const int *adj, const int *edg, int cf)
{
	int i, j, k, ret;
	const int cb = cf + c->clen[cf];
	const int size = cb - cf + 1;

	/* Double check for nonsingles which became singles later */
	if (cf == cb) {
		return ref_singleton(s, c, adj, edg, cf);
	}

	/* Establish connected list */
	memcpy(s->junk, c->lab + cf, size * sizeof(int));
	for (i = 0; i < size; ++i) {
		k = s->junk[i];
		for (j = adj[k]; j != adj[k+1]; ++j) {
			data_count(s, c, edg[j]);
		}
	}

	/* Refine the cells we're connected to */
	ret = refine_cell(s, c, ref_nonsingle_cell);

	/* Clear the counts; use lab because junk was overwritten */
	for (i = cf; i <= cb; ++i) {
		k = c->lab[i];
		for (j = adj[k]; j != adj[k+1]; ++j) {
			s->ccount[edg[j]] = 0;
		}
	}

	return ret;
}
Exemplo n.º 2
0
static int
ref_singleton(struct saucy *s, struct coloring *c,
	const int *adj, const int *edg, int cf)
{
	int i, k = c->lab[cf];

	/* Find the cells we're connected to, and mark our neighbors */
	for (i = adj[k]; i != adj[k+1]; ++i) {
		data_mark(s, c, edg[i]);
	}

	/* Refine the cells we're connected to */
	return refine_cell(s, c, ref_single_cell);
}
Exemplo n.º 3
0
/* Return 0 if failed */
int spg_refine_cell(double lattice[3][3],
		    double position[][3],
		    int types[],
		    const int num_atom,
		    const double symprec)
{
  sym_set_angle_tolerance(-1.0);

  return refine_cell(lattice,
		     position,
		     types,
		     num_atom,
		     symprec);
}
Exemplo n.º 4
0
Cell * ref_refine_cell(SPGCONST Cell * cell,
                       const double symprec)
{
    return refine_cell(cell, symprec);
}