Reputation
53,114
Next tag badge:
268/100 score
19/20 answers
Badges
6 87 208
Impact
~721k people reached

1d
comment SeriesData sucks when it can. How do I keep SeriesData from sucking?
How about SetOptions[Series, Analytic -> False]
Aug
23
comment Memory usage of compiled function: C vs WVM
The actual storage requirement for those tables is 8 bytes per element, so it looks like there is one additional copy present during evaluation of the C compiled function. My guess would be that the extra copy is the one created in the underlying LibraryFunction which must be copied to the kernel before it can be deleted.
Jul
26
comment Integrate over Piecewise function efficiently
It seems to help if you give Integrate the assumption Assumptions -> {0 < x < 10}
Jun
28
comment Plotting a set of points given by a complex expression
@Mack, try ListPlot@ReIm@list where list is your list of complex numbers.
Jun
25
comment What is the role of the pattern object in this implementation?
NonlinearModelFit does not have any Hold* attributes, so your code evaluates model[a, b, c] with symbolic arguments before NonlinearModelFit "sees" it.
Jun
20
comment Automatically grouping words into categories
You should look at Classify (the built-in classifier Classify["FacebookTopic", list] has too few categories unfortunately). You may also find WordData[word, "BroaderTerms"] useful.
Jun
7
comment How to properly generate messages from LibraryLink function?
@Ruslan, I'm not sure. I've never tried to send arguments with the message.
May
29
comment Making Mathematica function files like in MATLAB
@Oleksandr, ah yes of course. I forgot about auto-compilation.
May
28
comment Making Mathematica function files like in MATLAB
A couple of points: pure functions do not involve any compilation - they are faster because they do not use the pattern matcher. Also, your last example works because Times is listable, not Range.
May
24
comment Improve simulation speed using Compile
@user64620, More generally, I find it useful to have the Mathematica code closely reflect the compiled instructions, so that I can understand better what the compiler is doing. Sometimes you can spot optimisations more easily that way. Though as Oleksandr pointed out, it makes little difference for this problem since all the time is spent doing the dot products.
May
24
comment Improve simulation speed using Compile
@user64620, I needed to use an explicit loop so that I could compute the trace at each step. Since Compile translates NestList into a procedural loop anyway (as you can see from the CompilePrint output), there's nothing to lose from writing it that way.
May
24
comment Forcing a locator button to remain on the surface of a sphere
Related: 5802
May
19
comment What is the most convenient way to read definitions of in-memory symbols when we don't have the source files? (Spelunking tools)
I've only just seen this - awesome! It's really good to have something like this built in, many thanks.
May
15
comment Do not like quality of graphics when exported by Mathematica 9
and have you tried using EdgeForm[] in the graphics expression?
May
15
comment Do not like quality of graphics when exported by Mathematica 9
Are you using the default style sheet in Mathematica 9?
May
12
comment Different FourierParameters in each dimension for discrete Fourier transform
Maybe f[h_] := RotateRight@Reverse@Fourier[h, FourierParameters -> {1, -1}]
May
11
comment CompiledFunctionCall vs. LibraryFunction
@MariusLadegårdMeyer, in your question you are defining compBinomial to take real arguments but when you call it from within compsum you pass integer arguments. I think this type inconsistency is why the library function is not used.
May
10
comment Why does partitioning increase Dot execution speed?
I think with symbolic matrices you are just seeing an exponential increase in complexity with the number of matrices in the dot product - the timing is about the same for partitions of n and 24/n. The optimum partition size is probably around Sqrt[n].
May
9
comment Does Mathematica store hidden information for matrix objects?
A simple workaround is to create a new expression, e.g. AntihermitianMatrixQ[2 M / 2] or AntihermitianMatrixQ[0.0 + M]
May
6
comment Export Text with Colors
@d555, no I'm using Windows. Looks like you have a Mac specific bug...