bc889006b64e63457d81a496122463c57998f218,scipy/sparse/linalg/dsolve/linsolve.py,,spsolve,#Any#Any#Any#Any#,50

Before Change


            for j in range(b.shape[1]):
                col = b[:, j].toarray()
                xj = Afactsolve(ravel(col))
                w = nonzero(xj)[0]
                tempj.fill(j)
                x = x + A.__class__((xj[w], (w, tempj[:len(w)])),
                                    shape=b.shape, dtype=A.dtype)

After Change


            // Create a sparse output matrix by repeatedly applying
            // the sparse factorization to solve columns of b.
            data_segs = []
            row_segs = []
            col_segs = []
            for j in range(b.shape[1]):
                bj = b[:, j].A.ravel()
                xj = Afactsolve(bj)
                w = np.flatnonzero(xj)
                segment_length = w.shape[0]
                row_segs.append(w)
                col_segs.append(np.ones(segment_length, dtype=int)*j)
                data_segs.append(np.asarray(xj[w], dtype=A.dtype))
            sparse_data = np.concatenate(data_segs)
            sparse_row = np.concatenate(row_segs)
            sparse_col = np.concatenate(col_segs)
            x = A.__class__((sparse_data, (sparse_row, sparse_col)),
                           shape=b.shape, dtype=A.dtype)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: scipy/scipy
Commit Name: bc889006b64e63457d81a496122463c57998f218
Time: 2015-01-17
Author: argriffi@ncsu.edu
File Name: scipy/sparse/linalg/dsolve/linsolve.py
Class Name:
Method Name: spsolve


Project Name: NeuromorphicProcessorProject/snn_toolbox
Commit Name: e22aef4d42d1d20a093240933181f627dcd830e7
Time: 2016-10-13
Author: bodo.rueckauer@gmail.com
File Name: snntoolbox/core/inisim.py
Class Name:
Method Name: softmax_activation


Project Name: OpenNMT/OpenNMT-py
Commit Name: 3a71ecffa3a8aff931a0ff865434e11e8ea08ba3
Time: 2018-10-22
Author: guillaume.klein@systrangroup.com
File Name: onmt/translate/translator.py
Class Name: Translator
Method Name: _fast_translate_batch