Reputation
6,885
Next privilege 10,000 Rep.
Access moderator tools
Badges
2 12 77
Impact
~67k people reached

Apr
13
comment Assumptions with patterns
Which version are you using? In v9.0.1, both of the assumptions failed. And in v8.0.4, the result is on the contrary!
Apr
11
comment How to make RegionPlot3D automatically choose PlotRange?
I've already upvoted it. BTW there is no definite relationship between upvotes and being answered.
Apr
11
comment How to make RegionPlot3D automatically choose PlotRange?
You're welcome, qsraaaa520.
Apr
11
comment How to make RegionPlot3D automatically choose PlotRange?
In v10.1 you can use the function MinMax :) BTW, I noticed something interesting. In v8.0.4 WolframAlpha["bat ineqalty", "Result"] only returns an inequality, not a pure function!
Apr
10
comment Fix my code to return a table of values
@Nasser Actually I just made a pact with the devil and got the ability to figure out the use of the code, at the cost of being unable to use Do in my answer :D
Apr
9
comment How can i subtract a surface from another
……我想我猜的没错吧?你的母语是汉语吧?你真的明白accept the answer和click the checkmark sign的意思吗?也就是说,至今为止你得到的答案没有一个让你满意的吗?
Apr
9
comment How can i subtract a surface from another
那啥,同学,我姑且确认一下,你知道上面那条Standard Welcome里的 accept the answer 指的是啥吗?
Apr
8
comment Compile, “global variables” and recursion
But this still calls MainEvaluate……
Apr
5
comment How to speed up auxilary DoolittleDecomposite function?
Well, I'm not that familiar with the internal mechanism, either, but the Compile`GetElement trick does work, at least on my machine.
Apr
4
comment How to speed up auxilary DoolittleDecomposite function?
For the reason why Compile`GetElement is fast, it's mentioned here that it turns off the bound check.
Apr
4
comment How to speed up auxilary DoolittleDecomposite function?
Maybe it's due to the compiler? I use TDM-GCC 4.8.1, with "CompileOptions"->"-Ofast", and this is my implementation: doolittleDecomposition2 = With[{g = Compile`GetElement}, Compile[{{a, _Real, 2}}, With[{n = Length[a]}, Module[{t = a}, Do[Do[Do[ t[[i, j]] -= g[t, i, k] g[t, k, j];, {k, 1, i - 1}];, {j, i, n}]; Do[Do[t[[j, i]] -= g[t, j, k] g[t, k, i];, {k, 1, i - 1}]; t[[j, i]] /= g[t, i, i];, {j, i + 1, n}];, {i, 1, n}]; t]], RuntimeOptions -> "Speed", CompilationTarget -> "C"]].
Apr
4
comment How to speed up auxilary DoolittleDecomposite function?
You can use Compile`GetElement to speed up doolittleDecomposition by a factor of 2. (See here for an example. )
Apr
3
comment Backslide of Limit
@MichaelE2 Yeah, I know, I just feel obligated to remind all the people who take part in the discussion for the correctness of v8 :)
Apr
3
comment Backslide of Limit
@MichaelE2 I added a step-by-step proof, have a look.
Apr
3
comment Backslide of Limit
I'm sorry but the answer given by v8 is undoubtedly correct. See my edit for the step-by step proof. @blochwave
Apr
3
comment Poisson PDE over a irregular region with FDM
@wlkyr It's just because I didn't use the original coordinate. Map it back if you like.
Apr
2
comment NIntegrate over a list of functions
I think it'll be better if you can add some screenshots etc. to illustrate the speed difference.
Apr
2
comment Backslide of Limit
BTW the Hold-ReleaseHold approach also works in v8.0.4, I feel it really surprising: In this case Limit[Hold[Sum[Sin[Pi*k/n]/(n + 1/k), {k, 1, n}]], n -> Infinity] returns Hold[2/π] i.e. Hold doesn't hold the expression! Quite unusual!
Apr
2
comment Backslide of Limit
@2012rcampion V8 can handle the finite summation: i.stack.imgur.com/urNrR.png
Apr
1
comment Compile, “global variables” and recursion
Quite interesting! BTW, the code can be simplified to LevelsNeeded = Compile[{{b, _Integer}, {M, _Integer}, {x, _Integer}}, If[M <= (x*b + Quotient[x (x - 1), 2]), x, LevelsNeeded[b, M, x + 1]], {{_LevelsNeeded, _Integer}}, CompilationOptions -> {"InlineExternalDefinitions" -> True}, CompilationTarget -> C];.