bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gsl] redundant checks in triangle_selection_fails


From: Alexey A. Illarionov
Subject: Re: [Bug-gsl] redundant checks in triangle_selection_fails
Date: Thu, 11 Jul 2013 13:38:14 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0 SeaMonkey/2.16.2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, the function should be

static
int
triangle_selection_fails(int two_ja, int two_jb, int two_jc)
{
  return ((two_jb < abs(two_ja - two_jc)) || (two_jb > two_ja +
two_jc)) || GSL_IS_ODD(two_jb + two_ja + two_jc);
}

This should also solve the problem of 6j and 9j.

Btw, the the algorithm of evaluation of 3j, 6j, 9j in GSL is the worst
possible. It just follows the Racah formula and does not use any
symmetry properties. See [Tuzun et all, Comp Phys Comm, 1998] for 3j,
6j algorithms.

Håkan Johansson wrote:
> 
> In bzr trunk, the function triangle_selection_fails in 
> specfunc/coupling.c has grown a number of redundant tests since
> v1.15. It is enough to check the triangle condition for one spin vs
> the other two.  (See attached test program.)  Perhaps put a comment
> to keep the function lean?
> 
> Cheers, Håkan Johansson


- -- 
С уважением, Алексей Александрович Илларионов.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iQEcBAEBAgAGBQJR3u2GAAoJEEBWYSFzoNKeRv4H/ROOBVQ4ZxvQXsi1C4Zgxd/G
6wyIckdDBNcG39fl/CUsZdvOkX05JV8YW84KoHsMAS+Mtl7qsGIFIqnoWBXBJ8yJ
D7zZIZw8rl9hEDSzMvlF+ZKUsUXZ8hDeqjAw2vHjrIq3LQjCGkfAuYwbU0DfIXny
UD+ZdVxLayhp8zNNrBsWReRXqjgD0w2fldjd/54ndnTDh5EILLbXKFwxui7mMHFr
GBpiYMKLWH9AibpPppYPs8Xp9j7YdcEN1f7WcdZ2Nu2rVIEI7Tsw9eu8/qib0322
GIysVJWb273MwohMF3dMZLLw6yLl+gDwvaOV4SkT6hJdzpXxlKU3uD6tOYLGRCM=
=eQC1
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]