Given a matrix QT:
% ipython
Python 2.7.3
In [3]: QT.dtype
Out[3]: dtype('float64')
In [4]: QT.__class__
Out[4]: numpy.ndarray
In [5]: QT.flags
Out[5]:
C_CONTIGUOUS : True
F_CONTIGUOUS : False
OWNDATA : True
WRITEABLE : True
ALIGNED : True
UPDATEIFCOPY : False
I need the results of:
QT.T * QT
Problem: Whenever I try to compute these matrices multiplication, the memory overflows and the code stop running. This happen because of the matrix copy numpy is doing behind.
Tried solutions:
First:
Q = numpy.array(QT.T, order='C')
numpy.dot(Q, QT)
Second:
QT = numpy.array(QT, order='F')
Q = numpy.array(QT.T, order='F')
numpy.dot(Q, QT)
Third:
QT = numpy.matrix(QT)
QT = QT.copy('F')
Q = numpy.matrix(QT.T)
Q = Q.copy('F')
Q.dot(QT)
However, none of them is solving.
Question
How can I operate QT.T * QT without having the memory to explode?
References
http://numpy-discussion.10968.n7.nabble.com/inplace-matrix-multiplication-td21817.html
Is there an "enhanced" numpy/scipy dot method?