Exemplo n.º 1
0
static gint ass_diff (AranSphericalSeriesd *res, AranSphericalSeriesd *ref)
{
  gint faults = 0;
  gint L = aran_spherical_seriesd_get_posdeg (ref);

  if (L != aran_spherical_seriesd_get_posdeg (res))
    {
      g_printerr ("AranSphericalSeriesd degree error %d != %d\n", L,
                  aran_spherical_seriesd_get_posdeg (res));
      faults ++;
    }
  else
    {
      faults += buffer_diff (L,
                             aran_spherical_seriesd_get_term (ref, 0, 0),
                             aran_spherical_seriesd_get_term (res, 0, 0));
    }

  L = aran_spherical_seriesd_get_negdeg (ref);

  if (L != aran_spherical_seriesd_get_negdeg (res))
    {
      g_printerr ("AranSphericalSeriesd degree error %d != %d\n", L,
                  aran_spherical_seriesd_get_negdeg (res));
      faults ++;
    }
  else if (L > 0)
    {
      faults += buffer_diff (L-1,
                             aran_spherical_seriesd_get_term (ref, -1, 0),
                             aran_spherical_seriesd_get_term (res, -1, 0));
    }

  return faults;
}
Exemplo n.º 2
0
/**
 * aran_development3d_clone:
 * @src: an #AranDevelopment3d.
 *
 * Duplicates @src.
 *
 * Returns: newly allocated copy of @src.
 */
AranDevelopment3d *aran_development3d_clone (AranDevelopment3d *src)
{
  AranDevelopment3d *dst;

  g_return_val_if_fail (src != NULL, NULL);

  dst =
    aran_development3d_new (aran_spherical_seriesd_get_posdeg (src->multipole),
			    aran_spherical_seriesd_get_negdeg (src->multipole));

  aran_development3d_copy (src, dst);

  return dst;
}