GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Add easier way to create dense vectors and matrices · Issue #378 · python-graphblas/python-graphblas Closed Labels featureSomething is missingSomething is missingioData input, output, and conversionsData input, output, and conversions DescriptionIt may be nice to have constructors to create Creating full objects from numpy arrays is more difficult than it ought to be in GraphBLAS. For example, see Relatedly, we could add a method to create a diagonal matrix from an array or scalar (for example, to create an identity matrix). These are all possible to do today, such as: A = Matrix(a.dtype, nrows=a.shape[0], ncols=a.shape[1]) A[:, :] = a # vs A = Matrix.from_foo(a) and A = Matrix(nrows=nrows, ncols=ncols) A << scalar # vs A = Matrix.from_foo(scalar, nrows=nrows, ncols=ncols) and v = Vector(a.dtype, size=a.size) v[:] = a A = v.diag() # vs A = Vector.from_foo(a).diag() # vs A = Vector.from_coo(np.arange(n), a, size=n).diag() # vs A = Matrix.from_coo(np.arange(n), np.arange(n), a, nrows=n, ncols=n) # vs A = Matrix.from_bar(a) (Note that there are suitesparse-specific constructors such as Possible signatures: def from_foo(values, dtype=None, *, nrows=None, ncols=None, name=None): ... # create full matrix from array, list of lists, or scalar # what about rowwise or columnwise? Should we add `order="rowwise"` keyword? def from_bar(values, dtype=None, *, k=0, nrows=None, ncols=None, name=None): ... # create matrix with data on the kth diagonal from array, list, or scalar (or Vector?) Also related is Reacted by Sultan Orazbayev Activity
MetadataMetadataAssigneesLabelsfeatureSomething is missingSomething is missingioData input, output, and conversionsData input, output, and conversions TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |