{"id":5008,"date":"2014-03-30T17:48:45","date_gmt":"2014-03-30T17:48:45","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-sparse-matrix-collection-of-common-programming-errors\/"},"modified":"2014-03-30T17:48:45","modified_gmt":"2014-03-30T17:48:45","slug":"problem-about-sparse-matrix-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-sparse-matrix-collection-of-common-programming-errors\/","title":{"rendered":"problem about sparse-matrix-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/42539fd7a3ab61a18589c700c5e66167?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTweet<br \/>\njava matrix sparse-matrix matrix-multiplication<br \/>\nI need simple opinion from all Guru!I developed a program to do some matrix calculations. It work all fine with small matrix. However when I start calculating BIG thousands column row matrix. It kills the speed. I was thinking to do processing on each row and write the result in a file then free the memory and start processing 2nd row and write in a file, so and so forth. Will it help in improving speed? I have to make big changes to implement this change. Thats why I need your opinion. What d<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e53b78d729a9fd8dbf49738d32f857ac?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\namit-agrawal<br \/>\nr matrix linear-algebra sparse-matrix eigenvalue<br \/>\nHow expensive is it to compute the eigenvalues of a matrix? What is the complexity of the best algorithms? How long might it take in practice if I have a 1000&#215;1000 matrix? I assume it helps if the matrix is sparse?Are there any cases where the eigenvalue computation would not terminate? In R, I can compute the eigenvalues as in the following toy example:&gt; m&lt;-matrix( c(13,2, 5,4), ncol=2, nrow=2 ) &gt; eigen(m, only.values=1) $values [1] 14 3Does anyone know what algorithm it uses? Are the<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ced37e94f2fabfd8b4bb78e573947a68?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nEvilTeach<br \/>\nc++ memory-management sparse-matrix<br \/>\nI know there are quite a few good ways to store a sparse matrix without taking up much memory. But I&#8217;m wondering whether there is a good way to store a sparse matrix during the construction of it? Here is the more detailed scenario: the program constructs a sparse matrix by figuring out where to put a non-zero value on each iteration; and since the coordinates of the non-zero value will not be known until runtime, they are totally random and unpredictable.I&#8217;m programming in C++. So is there a wa<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c0d88f5919940a096a367d0e5225b75c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser236215<br \/>\nc++ boost sparse-matrix<br \/>\nThe boost ublas::compressed_matrix should only allocate space for non-zero elements. But in the below example, I am getting strange results.#include &lt;boost\/numeric\/ublas\/matrix_sparse.hpp&gt; #include &lt;boost\/numeric\/ublas\/io.hpp&gt;using namespace std; using namespace boost::numeric::ublas;int main () { {compressed_matrix&lt;double,row_major&gt; m (4, 4, 2*2);cout &lt;&lt; sizeof(m) &lt;&lt; &#8220;\\n&#8221;; \/\/ prints 56cout &lt;&lt; m &lt;&lt; std::endl; }{matrix&lt;double&gt; m (4, 4);cout &lt;&amp;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0b3255fb82db0521fa96509a64a82240?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChthonic Project<br \/>\njava matrix sparse-matrix colt<br \/>\nI am using parallel colt wherein I need to find the rank of a matrix. The API documentation says the following about the following about DoubleAlgebra#rank:rank(DoubleMatrix2D A)Returns the effective numerical rank of matrix A, obtained from Singular Value Decomposition.But when I use it in my code, I get an IllegalArgumentException at runtime:Exception in thread &#8220;main&#8221; java.lang.IllegalArgumentException: Matrix must be denseat cern.colt.matrix.tdouble.algo.DoubleProperty.checkDense(Unknown Sour<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7996c385f1a5a46f478ce702479d1dbb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGorillaInR<br \/>\nr matrix sparse-matrix<br \/>\nIs there a built-in function in either slam package or Matrix package to convert a sparse matrix in simple triplet matrix form (from slam package) to a sparse matrix in dgTMatrix\/dgCMatrix form (from Matrix package) ? And is there a built-in way to access non-zero entries from simple triplet matrix ?I&#8217;m working in R<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4b8ce2e5dff7e913642c84213353f6a3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAmro<br \/>\nc matlab sparse-matrix mex sparse<br \/>\nThis file is in C:\\Program Files\\MATLAB\\R2013a\\extern\\examples\\refbook. After mex it, I used : aa = [1 2 3 ; 4 5 6] fulltosparse(aa)At the first time, the command maybe works. But try fulltosparse(aa) for more times. You will find it will crash. Could anyone tell me why ? mex -largeArrayDims fulltosparse.c aa = [1 2 3; 4 5 7]; fulltosparse(aa); fulltosparse(aa); fulltosparse(aa); fulltosparse(aa); fulltosparse(aa); fulltosparse(aa);<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/932d3fbb93a7cc8bc8ee1bd74de8929a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSean<br \/>\nmatlab machine-learning sparse-matrix pca sparse<br \/>\nI have about 1000 vectors x_i of dimension 50000, but they are very sparse; each has only about 50-100 nonzero elements. I want to do PCA on this dataset (in MATLAB) to reduce the unneeded extreme dimensionality of the data.Unfortunately, I don&#8217;t know any way to do this without an intermediate full matrix due to the need to subtract the means from all examples. And of course, a 1000&#215;50000 matrix is too big to fit into memory (it actually crashes my entire computer for some reason when I try). Ma<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4cc236071d02d59de0b35c9989de82eb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nVeivi<br \/>\nperl grid sparse-matrix<br \/>\nI have a Perl script, which parses datafile and writes 5 output files filled with 1100 x 1300 grid. The script works, but in my opinion, it&#8217;s clumsy and probably non-efficient. The script is also inherited code, which I have modified a little to make it more readable. Still, it&#8217;s a mess.At the moment, the script reads the datafile(~4Mb) and puts it into array. Then it loops through array parsing its content and pushing values to another array and finally printing them to file in another for loop<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e5d70b07efe98c43d8bdb01c0431f825?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBill<br \/>\njava generics sparse-matrix<br \/>\nI have an assignment where Im supposed to finish the implementation on a generic sparse matrix. Im stuck on the addition part. The matrix is only going to support numbers so I had it extend Number hoping I could then add the numbers, thats wrong. The data structure is NOT an array, it is essentially 2 linked lists. (one for rows and one for columns) Here is the code in question:public MatrixSparse&lt;? extends Number&gt; addition(MatrixSparse&lt;? extends Number&gt; A, MatrixSparse&lt;? extends<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2ade959cb4e27bf01a9ddf60e71c5547?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAdam Siegel<br \/>\njavascript jquery multidimensional-array sparse-matrix<br \/>\nI wrote this code to scrape a sparse array from a series of dom elements. when done in one dimension the code works but in 2 dimensions it fails. Is there something i&#8217;m missing?23 function initCellHover(){ 24 $cells.each(function(){ 25 var arrayX = $(this).position().left\/cellWidth; 26 var arrayY = $(this).position().top\/cellHeight; 27 var arrayValue = $(this); 28 cellLookup[ar<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tweet java matrix sparse-matrix matrix-multiplication I need simple opinion from all Guru!I developed a program to do some matrix calculations. It work all fine with small matrix. However when I start calculating BIG thousands column row matrix. It kills the speed. I was thinking to do processing on each row and write the result in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5008","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5008"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5008\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}