Changes

Jump to navigation Jump to search

Numpy linalg

210 bytes added, 14:41, 25 June 2014
# bytes_between_elements
bbe = 1 ND * power_itz
# bytes between row. The distance in bytes to next row is number of Columns elements multiplied with itemsize. NE * NS * NM * NO
bbr = ND 1 * power_itz
cut_strides = tuple([bbr, bbe, bbr]) print "cut_strides", cut_strides
print power_arr
# Zip them together and iterate
i = 0
oi = 0
mi = 0
for mat_i, pow_i in zip(mat_view, power_view):
print mat_i, pow_i
mat_power_view_i = matrix_power(mat_i, int(pow_i))
# Get the remainder after modulu division
di = i % ND
if di == 0 and i != 0:
oi = (ND-i) % NO
i += 1
print mat_i, pow_i, oi, di
 
 
 
# Execute main function.
if __name__ == "__main__":
main()
</source>

Navigation menu