def __init__(self,T,Vs,pos=0):
if pos>len(Vs) or pos<0:
raise ValueError('Bs __init__ error: pos(%s) should be in range(0,%s).'%(pos,len(Vs)))
self.pos=pos
self.extend([None]*len(Vs))
Vs=np.array(Vs)
for i,V in enumerate(Vs[0:pos]):
if i==0:
self[i]=B(*svd(V.dot(T)))
else:
self[i]=self[i-1].ldot(V.dot(T))
for i,V in enumerate(Vs[pos:][::-1]):
if i==0:
self[len(Vs)-1-i]=B(*svd(V.dot(T)))
else:
self[i]=self[len(Vs)-1-i]=self[len(Vs)-i].rdot(V.dot(T))
评论列表
文章目录