345 reputation
19
bio website
location
age
visits member for 1 year, 10 months
seen Feb 21 at 17:25

Apr
25
comment How to find the index of a square matrix in Mathematica quickly?
Excellent idea. Can you check that why your technique cannot produce the result for a simple matrix in floating points arithmetic as follows: $n=100; a = RandomReal[{}, {n, n}]$. I faced with some errors such as "Transpose::nmtx: "The first two levels of the one-dimensional list {} cannot be transposed."".
Apr
25
comment How to find the index of a square matrix in Mathematica quickly?
Mr. Wizard, can you revise your code in order to give $A^k$ and $A^{k+1}$ as well. I mean I also need the last two matrices $A^{k+1}$ and $A^{k}$! Although $k$ is obvious but I do not want to compute them again because it might be time-consuming for large matrices! Can you give me a hand in this?
Apr
25
comment How to find the index of a square matrix in Mathematica quickly?
Thanks Mr. Wizard. It works good. Any improvement on the code will be appreciated.
Apr
24
comment How to find the index of a square matrix in Mathematica quickly?
I think the code is not working well, Mr. Wizard is right down here. For a random matrix, it sould give 0 while produces 5 as the $Ind(A)$.
Apr
24
comment How to find the index of a square matrix in Mathematica quickly?
You are totally right Mr. Wizard, the codes sounds to be incorrect. For the 500*500 example of you, the answer must be $Ind(A)=0$. Because $A^0$ and $A^1$ agrees in terms of rank. So is there any bug here?
Apr
24
comment How to find the index of a square matrix in Mathematica quickly?
Yes, your answer always gives 2 as the output by varying $n$, while the output of Szabolcs's code is correct and is what I want. Your technique to accelerate the process is nice, but currently not working.
Apr
24
comment How to find the index of a square matrix in Mathematica quickly?
I think Mr. Wizard answer needs some revision. I mean the answers are not the same. For instance, check the following sample examples: Clear["Global`*"] SeedRandom[1234]; n = 500; A = RandomReal[{}, {n, n}]; Length@NestWhileList[A.# &, A, MatrixRank[#] == MatrixRank[#2] &, 2] // AbsoluteTiming Length@NestWhileList[{A.#[[1]], MatrixRank@#[[1]]} &, {A, -1}, #[[2]] == #2[[2]] &, 2] // AbsoluteTiming
Apr
24
asked How to find the index of a square matrix in Mathematica quickly?
Apr
6
comment How to draw Fractal images of iteration functions on the Riemann sphere?
Thanks. An excellent answer. Just one note. There might be some diverging points (black areas) in the fractal picture for some test problems. On the other hand, we used a color correspond to a point in a sphere or a rectangular domain. So, the domain of working (I mean the mesh of points) are finite. So is it possible to count the number of diverging points? I mean it would be nice to have the percentage of diverging points for each fractal picture. Is it possible to cunt the number of diverging points in your implementation?
Apr
5
awarded  Nice Question
Mar
11
comment How to use Compile for accelerating matrix multiplications?
So, is there any other way such as parallelization?
Mar
11
comment How to use Compile for accelerating matrix multiplications?
As far as I know, for smin and smax, Mathematica 8 uses the Arnoldi algorithm with at most 1000 MaxIterations. However, this part is quite fast. Do you think, is there any way to use Compile for speeding this code up?
Mar
11
asked How to use Compile for accelerating matrix multiplications?
Feb
26
comment How could we define a function recursively?
Thank you ssch. The second way that you describe is my question. That is, the old beta is in the right side and the new beta must be obtained as the left beta. Therefore, in your second part of the answer, there are still some drawbacks in my idea. Since, I need the final formula as an iteration function (similar to the case of Sign[z]), not to be defined numerically as you have done for four nested values. Is there any way to define this recursive function by two parts I mean the first part calculate a new value (a new value) and the second part update beta?
Feb
26
asked How could we define a function recursively?
Feb
24
awarded  Commentator
Feb
24
comment How to accelerate updating some parts of sparse matrices?
In my idea, the best way is to extract the diagonal elements of the matrix inverse, and then update your matrix $mat$. In such a way, the norm of the matrix $Id-A.mat$ will decrease much more and with one replacement you might obtain the best possible approximate inverse. The only problem is that how to extract or find the diagonal entries of the matrix inverse very fast for a very large sparse matrix!
Feb
24
comment How to accelerate updating some parts of sparse matrices?
I think the above piece of codes fail even when we test a 300*300 sparse matrix. I mean sometimes in my MMA 8, it gives the results and sometimes when I increase $num$ to 3 (for instance), it fails and the MMA generates a beep!
Feb
21
revised How Simplify and Assume can be combined on matrix products?
added 3 characters in body
Feb
21
asked How Simplify and Assume can be combined on matrix products?