I am trying to create two matrices key_mat and c_mat c_mat initially is (1,847) fixd_len = 847
while the number is not 0, Im trying to pile up key_mat and c_mat
so this could become some(n,847) Col :1 --> n
Each element in Cols of key_mat and c_mat is either 1 or 0 int type;
its not dot product.. specifically i need bit-wise so I am doing element-wise operation;
number = int(''.join(map(str,key_mat.tolist()[0])),2)
#Build matrix of Keys
#print key_mat
#print c_mat
while number >= 0:
#Divide integer>> by 2 until it covers all rows
number >>= 1
key_mat = np.concatenate((key_mat, np.matrix(list((np.binary_repr(number)).zfill(fixd_len)), dtype=int)))
c_mat = np.concatenate((c_mat, c_mat))
Does, this increase memory alot?
I suppose c_mat and key_mat are in shared RAM memory and key_mat and c_mat assignment happens over there and not cache.
im running it in a VPS and on my machine which is core i7, 8Gb Win 8;
PS: Consider 847 bit places..
938439603600587528746394711938657107663969949193687942084737423845328945327403963493426274822541422606069252398088182827397836333287780407720182613329988145004965865323862822167078543736143176539997470989737828269291292380585577139908076735904949708259328L
possible bits and that number being the highest possible decimal number;
you start dividing >> by 2, and you re assign in the same variable.
Notice this quick n dirty code, there is no strict type assigned and var are reused;
large matrix var is re assigned dynamically.
What is occupying memory??
I am not sure.
UPDATE: I found this interesting. still reading it.
UPDATE2: The above update gave good insight (esp answers and comments)
and if someone could tell me how to approach this problem (847 is still not very big). how do you tackle memory tight situation here? Would be grateful..