Your ROOT_URL in app.ini is https://git.hpc.odu.edu/ but you are visiting https://git.wahab.hpc.odu.edu/wirawan0/wpylib/commit/d04ea8cbeafa613c3e7b4538c13afa871fb87662?style=unified&whitespace=show-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
1 changed files with
23 additions and
1 deletions
math/symmetrix-array-index.PY
@ -40,6 +40,28 @@ Note:
{m}
SUM a = 1 + 2 + ... + m = m(m+1)/2
{a=1}
"""
"""
Update 20120124: the jskip formula can be written in similar fashion to
the 'UD' array format, as shown below.
The endpoint of the array index is N(N+1)/2 .
The (negative) offset of the j index from the rightmost column is
dj = (N + 1 - j).
Note: dj is 1 on the rightmost column.
So, the jskip is given by:
N(N+1)/2 - (N+1-j)(N+2-j) / 2 =
= [ N**2 + N - ( N**2 + 3N - 2jN + 2 - 3j + j**2 ) ] / 2
= ( -2N + 2jN - 2 + 3j - j**2 ) / 2
= (j-1)N + (j-2)(j-1)/2
>>> the same formula as before.
"""
import numpy
@ -175,7 +197,7 @@ def Hack2_LD_enc_dec(N):
#print "%3d %3d | %6d | %3d %3d" % (i,j, ij, ii,jj)
print "%3d %3d | %6d %6d | %3d %3d // %8.4f" % (
i,j,
ij, LDsize-ij,
ij, ( LDsize-ij) * 2 ,
ii,jj,
jj2)