![]() I’d 100% take this approach if I didn’t need this code to run on multiple machines with different OS’s, some of which belong to collaborators and are geographically nowhere near me compiling mex’s is kinda a pain in the ass, especially once you add collaborators who don’t have experience with it into the mix. I figured I’d translate to C and compile to mex, depending on speed. I figured I’d use a loop like this if I don’t find anything else that works. Not half baked at all! It’s the most direct way to approach the problem and it would be the fastest method in a compiled language. Thus, is there a more efficient way of getting the results I need? Is there a more efficient alternative to the built-in all function? Memory efficiency is most important for me, but CPU efficiency wouldn't' hurt either. In addition to the memory issues, converting large isn't particularly efficient from a CPU standpoint, either. running this function requires at least 81GB of ram (for context, in sparse representation, A requires only 40MB of memory). This is a problem because A is a 98,304x98,304 double precision matrix, for the smallest of problems that I'm solving i.e. Unfortunately, it appears that the all function works on full matrices and, if you feed it a sparse matrix, it will convert it to a full matrix. ![]() ![]() I am currently using rows=find(all(A=0,2)), where A is my sparse matrix. I need to identify the rows/columns of a positive semi definite sparse matrix that have all zero values. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |