contrib/stack/topsStack/invertIon.py
def least_sqares(H, S, W=None):
    '''
    #This can make use multiple threads (set environment variable: OMP_NUM_THREADS)
    linear equations:  H theta = s
    W:                 weight matrix
    '''

    S.reshape(H.shape[0], 1)
    if W is None:
        #use np.dot instead since some old python versions don't have matmul
        m1 = np.linalg.inv(np.dot(H.transpose(), H))
        Z = np.dot(       np.dot(m1, H.transpose())           , S)
    else:
        #use np.dot instead since some old python versions don't have matmul
        m1 = np.linalg.inv(np.dot(np.dot(H.transpose(), W), H))
        Z = np.dot(np.dot(np.dot(m1, H.transpose()), W), S)

    return Z.reshape(Z.size)

    #This can make use multiple threads (set environment variable: OMP_NUM_THREADS)
    linear equations:  H theta = s
    W:                 weight matrix
    
This can make use multiple threads (set environment variable: OMP_NUM_THREADS)
linear equations:  H theta = s
W:                 weight matrix
This can make use multiple threads ( set environment variable : OMP_NUM_THREADS ) linear equations : H theta = s W : weight matrix
def least_sqares(H, S, W=None):
    S.reshape(H.shape[0], 1)
    if W is None:
        m1 = np.linalg.inv(np.dot(H.transpose(), H))
        Z = np.dot(       np.dot(m1, H.transpose())           , S)
    else:
        m1 = np.linalg.inv(np.dot(np.dot(H.transpose(), W), H))
        Z = np.dot(np.dot(np.dot(m1, H.transpose()), W), S)
    return Z.reshape(Z.size)
def least_sqares ( H , S , W = None ) : S . reshape ( H . shape [ 0 ] , 1 ) if W is None : m1 = np . linalg . inv ( np . dot ( H . transpose ( ) , H ) ) Z = np . dot ( np . dot ( m1 , H . transpose ( ) ) , S ) else : m1 = np . linalg . inv ( np . dot ( np . dot ( H . transpose ( ) , W ) , H ) ) Z = np . dot ( np . dot ( np . dot ( m1 , H . transpose ( ) ) , W ) , S ) return Z . reshape ( Z . size )
This can make use multiple threads (set environment variable: OMP_NUM_THREADS)
linear equations:  H theta = s
W:                 weight matrix
This can make use multiple threads ( set environment variable : OMP_NUM_THREADS ) linear equations : H theta = s W : weight matrix
'''
    #This can make use multiple threads (set environment variable: OMP_NUM_THREADS)
    linear equations:  H theta = s
    W:                 weight matrix
    ''' #use np.dot instead since some old python versions don't have matmul #use np.dot instead since some old python versions don't have matmul
H
S
W