Listing primes using list comprehensions with the aid of PLINQ in C# Programming Software Development by ddanbe … yet easy to comprehend.( That is I think it is :) ) PLINQ joins in as I use the `AsParallel()` extension on line… Optimizing Matrix Multiplication Programming Software Development by Momerath … we can. With .NET 4.0 came the introduction of PLINQ, which gives us an easy way to perform parallel tasks… N times with i ranging from 0 to N. Again, PLINQ gives us the easy way to do this: [code]var… times faster than our original code! With the magic of PLINQ we are creating 500 threads in this example and don… How do I find the example website "Forall" Programming Software Development by Tazsweet19 I tried to looking for website about ForAll() "Invokes the specified action for each element in the source sequence in paralle from LINQ (PLINQ). There is no example for ForAll(). Let me know thanks. Re: Listing primes using list comprehensions with the aid of PLINQ in C# Programming Software Development by Daniel_73 To improve speed, use a dictionary or hash table instead of List<int>. Re: Listing primes using list comprehensions with the aid of PLINQ in C# Programming Software Development by ddanbe It was not my intention to speed things up as I wanted to test the parallel feature. Thanks anyway. Re: Optimizing Matrix Multiplication Programming Software Development by ddanbe Wow! You must have spent some time to work this all out! This is great, great stuff! I'm working( well not all day ;) ) on a sort of matrix calculator, you surely gave me some ideas to rework my code. Rep X 10, but alas I can't:'( Re: Optimizing Matrix Multiplication Programming Software Development by ddanbe Would your implementation be faster than C++, who claims to be one of the fastest guys around the block? Re: Optimizing Matrix Multiplication Programming Software Development by Momerath Not the greatest C++ programmer, but trying to stick with the best method available I came up with: [code=C++]void MatMul(double** A, double** B, double** C) { for (int i = 0; i < N; i++) { double* iRowA = A[i]; double* iRowC = C[i]; for (int k = 0; k < N; k++) { double* kRowB = B[k];… Re: Optimizing Matrix Multiplication Programming Software Development by nismac Wow guy's u doin great job Re: Optimizing Matrix Multiplication Programming Software Development by Momerath Looking around I've also found the Microsoft has a Matrix class in their [URL="http://research.microsoft.com/en-us/um/cambridge/projects/infernet/"]Infer.net[/URL]. Testing it for a 500x500 matrix gives: Infer.net 1060 milliseconds Interesting to know that my code beats theirs even without using parallel execution :) Re: Optimizing Matrix Multiplication Programming Software Development by ddanbe @Momerath A question popped up: did you use the StopWatch class to time your code? Re: Optimizing Matrix Multiplication Programming Software Development by Momerath Yes I do Re: Optimizing Matrix Multiplication Programming Software Development by alud007 Hi, Could you please explain, is C the destination array (where A*B) is stored after the multiplication? Thanks Re: Optimizing Matrix Multiplication Programming Software Development by snizzzzle If you want to write fast MM code you need to write it in C, you need to use multliple threaded execution and you need to use the cache. Cache optimizations are going to give you the most speed up for single threaded execution. Tiling method - you chop the matrix into tiles small enough to fit in cache so that way there are less cache misses.… Re: Optimizing Matrix Multiplication Programming Software Development by EmmetCaulfield I'm late to the party, but for the benefit of others who may be reading this, it should be noted that the optimium loop ordering for dense matrix-matrix multiplication has been known since shortly after cache memory was introduced. See any book on numerical linear algebra, such as Golub and Van Loan's “Matrix Computations”, for [a thorough … Re: Optimizing Matrix Multiplication Programming Software Development by fran2884 hello, I'm a graduating student in math and I'm dealing with linear regression, I need some functions written in C code that use loop unrolling and blocking cache, the most optimized possible to compute this function: A = (C * C) -1 C * y, where C * is the transpose of C, and -1 represents the inverse. are not practical c, can you help? Re: How do I find the example website "Forall" Programming Software Development by Momerath At the bottom of [URL="http://www.daniweb.com/software-development/csharp/code/355645"]this[/URL] snippet you'll see that I use ForAll to help with Matrix Multiplication. If you have questions about it, please ask Re: How do I find the example website "Forall" Programming Software Development by Tazsweet19 I should put the double forall or can't use? Let me know Re: How do I find the example website "Forall" Programming Software Development by Momerath I don't understand the question.