sparse-matrix

Fortran 90/95 library for sparse matrices?

 ̄綄美尐妖づ 提交于 2019-12-31 20:31:51
问题 I am looking for a library for dealing with sparse matrices in fortran 90/95. I only need very basic operations like matrix-vector multiplication. What do you suggest I use? I have searched around and an extension(?) to BLAS called "sparse blas", documented in chapter 3 of the blast technical forum specification: http://www.netlib.org/blas/blast-forum/, seems ideal. According to that document, there should be a fortran 95 interface to the library. However, I haven't been able to find an

Serializing Decomposed Matrix from eigen (SparseLU object)

泄露秘密 提交于 2019-12-30 14:40:30
问题 I am trying to solve Ax=b where the matrix A can be big close to 1M x 1M in size, is sparse and symmetric but might not be positively defined. Problem is that it might take a long time to compute the decomposition using the sparseLU object in eigen and it will be idea for one to store the sparseLU matrix instead of the original matrix such that whenever we perform similar operation using the same matrix A, we can speed things up by not needing to re-compute the A quick search on stackoverflow

Serializing Decomposed Matrix from eigen (SparseLU object)

北城以北 提交于 2019-12-30 14:40:28
问题 I am trying to solve Ax=b where the matrix A can be big close to 1M x 1M in size, is sparse and symmetric but might not be positively defined. Problem is that it might take a long time to compute the decomposition using the sparseLU object in eigen and it will be idea for one to store the sparseLU matrix instead of the original matrix such that whenever we perform similar operation using the same matrix A, we can speed things up by not needing to re-compute the A quick search on stackoverflow

Matlab 3d-matrix

匆匆过客 提交于 2019-12-30 08:33:42
问题 I have to create a very big 3D matrix (such as: 500000x60x60 ). Is there any way to do this in matlab? When I try omega = zeros(500000,60,60,'single'); I get an out-of-memory error. The sparse function is no option since it is only meant for 2D matrices. So is there any alternative to that for higher dimensional matrices? 回答1: Matlab only has support for sparse matrices (2D). For 3D tensors/arrays, you'll have to use a workaround. I can think of two: linear indexing cell arrays Linear

Randomly shuffle a sparse matrix in python

左心房为你撑大大i 提交于 2019-12-30 06:20:31
问题 is there an easy way to shuffle a sparse matrix in python? This is how I shuffle a non-sparse matrix: index = np.arange(np.shape(matrix)[0]) np.random.shuffle(index) return matrix[index] How can I do it with numpy sparse? 回答1: Ok, found it. The sparse format looks a bit confusing in the print-out. index = np.arange(np.shape(matrix)[0]) print index np.random.shuffle(index) return matrix[index, :] 回答2: In case anyone is looking to randomly get a subsample of rows from a sparse matrix, this

Argmax of each row or column in scipy sparse matrix

帅比萌擦擦* 提交于 2019-12-30 04:17:06
问题 scipy.sparse.coo_matrix.max returns the maximum value of each row or column, given an axis. I would like to know not the value, but the index of the maximum value of each row or column. I haven't found a way to make this in an efficient manner yet, so I'll gladly accept any help. 回答1: From scipy version 0.19, both csr_matrix and csc_matrix support argmax() and argmin() methods. 回答2: I would suggest studying the code for moo._min_or_max_axis where moo is a coo_matrix . mat = mat.tocsc() # for

Building and updating a sparse matrix in python using scipy

谁说胖子不能爱 提交于 2019-12-29 20:12:13
问题 I'm trying to build and update a sparse matrix as I read data from file. The matrix is of size 100000X40000 What is the most efficient way of updating multiple entries of the sparse matrix? specifically I need to increment each entry by 1. Let's say I have row indices [2, 236, 246, 389, 1691] and column indices [117, 3, 34, 2757, 74, 1635, 52] so all the following entries must be incremented by one: (2,117) (2,3) (2,34) (2,2757) ... (236,117) (236,3) (236, 34) (236,2757) ... and so on. I'm

Building and updating a sparse matrix in python using scipy

你。 提交于 2019-12-29 20:12:09
问题 I'm trying to build and update a sparse matrix as I read data from file. The matrix is of size 100000X40000 What is the most efficient way of updating multiple entries of the sparse matrix? specifically I need to increment each entry by 1. Let's say I have row indices [2, 236, 246, 389, 1691] and column indices [117, 3, 34, 2757, 74, 1635, 52] so all the following entries must be incremented by one: (2,117) (2,3) (2,34) (2,2757) ... (236,117) (236,3) (236, 34) (236,2757) ... and so on. I'm

Building and updating a sparse matrix in python using scipy

99封情书 提交于 2019-12-29 20:11:39
问题 I'm trying to build and update a sparse matrix as I read data from file. The matrix is of size 100000X40000 What is the most efficient way of updating multiple entries of the sparse matrix? specifically I need to increment each entry by 1. Let's say I have row indices [2, 236, 246, 389, 1691] and column indices [117, 3, 34, 2757, 74, 1635, 52] so all the following entries must be incremented by one: (2,117) (2,3) (2,34) (2,2757) ... (236,117) (236,3) (236, 34) (236,2757) ... and so on. I'm

sparse matrix library for C++ [closed]

二次信任 提交于 2019-12-29 04:58:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 12 months ago . Is there any sparse matrix library that can do these: solve linear algebraic equations support operations like matrix-matrix/number multiplication/addition/subtraction,matrix transposition, get a row/column of a matrix,and so on matrix size could be 40k*40k or bigger,like 250k*250k fast can be used in Windows