diff -r 000000000000 -r 0efde00f9229 python/t1calc.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/t1calc.py Fri May 27 14:24:59 2011 +0530 @@ -0,0 +1,40 @@ +#!/usr/bin/python + +import pylab as pl +from indep import indep +from move import move + +def t1calc(S, Srows, T1, T1rows, sel, pr, Frows, Fbcols, abar, gap=None): + b = pl.array([1]) + sel = sel.squeeze() + while (T1rows < Frows - Fbcols) and pl.any(sel==1) and b.size!=0: + b = indep(S[pl.logical_and(sel, sel),:], gap) + if b.size != 0: + b = move(b, pl.find(sel), Srows) + b = b.squeeze() + j = b.shape[-1]-1 + while not (b[j] and pl.any(abar==j)): + j -= 1 + if j == -1: + print 'Message from t1calc, called from left_prm' + print 'Denominator is noninvertible' + exit() + aa = pl.remainder(pr, Frows) == pl.remainder(j, Frows) + bb = j