Reputation
11,897
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
1 27 60
Impact
~97k people reached

Jan
15
comment Compiling LinearSolve[] or creating a compilable procedural version of it
@Jagra But you never change any elements of it? Then it's trivial to just solve it, since you don't even need to check that pivots are non-zero.
Jan
15
awarded  Nice Answer
Jan
15
answered Compiling LinearSolve[] or creating a compilable procedural version of it
Jan
15
comment Compiling LinearSolve[] or creating a compilable procedural version of it
@Jagra could you provide an update about what the general shape of your matrices is?
Jan
15
comment Compiling LinearSolve[] or creating a compilable procedural version of it
@Jagra You shouldn't be concerned with the return value. The question is what your input matrix looks like, for instance if it was {{a,b},{0,d} with rhs {r1,r2} where you know that a and d are non-zero, then you can call it once to see that your solution will always be: {(d r1 - b r2)/(a d), r2/d}. Now this method of cause will not work if you have an arbitrary matrix, but it you have a pattern and only some inputs, you can just solve once and compile the resulting definition.
Jan
14
answered Is there a concise form of Which or similar conditional?
Jan
14
comment Compiling LinearSolve[] or creating a compilable procedural version of it
Depending on how systematic the elements you are passing to LinearSolve, you could just solve it once and compile the resulting formula for the solution instead of trying to compile the function itself.
Jan
12
answered How to format a large Number
Jan
12
answered Pure Functions with Lists as arguments
Jan
12
comment Problem with ParametricPlot of multiple Curves
@user5373 You could provide arbitrary placeholder functions, just so people have somthing to test it with. I used f[Ne_?NumericQ,t_?NumericQ,T_?NumericQ]:={Ne t T,0} and g[t_,T_]:=t Sin[T] testing my solution.
Jan
11
comment How to write a function to remove comments from a .m source file preserving formatting such as line wrapping reasonably?
If add "*)"~~("\n"|"")~~s2__ it will also remove the newline as OP did in his example.
Jan
11
answered Problem with ParametricPlot of multiple Curves
Jan
10
comment Elegant manipulation of the variables list
@Mr.Wizard I quickly pasted the code into a notebook to test figure out if something was wrong and also wondered why c wasn't getting set, I updated the answer slightly. :)
Jan
10
revised Elegant manipulation of the variables list
added 45 characters in body
Jan
9
comment defining recursively a function with multiple if conditions
Your code doesn't seem to match your definition. For instance f depends on x not on A[x,n-1,l] as you write initially. Could you write out what F[input_] is supposed to be?
Jan
9
answered Pattern matching not going over a list when using default values
Jan
9
comment Plotting a 3D sphere i.e. how to vizualise the spanned volume $\int_0^{2\pi}\int_0^{\pi} d\theta d\phi$?
@MichaelE2 I like the output, I meant the code. For one thing, you have a huge load of code dealing with special cases for plotting the volume, why not just put this into a single function like buildVolume that way both the graphics generation is easier to read, and the whole special case handling.
Jan
8
comment Plotting a 3D sphere i.e. how to vizualise the spanned volume $\int_0^{2\pi}\int_0^{\pi} d\theta d\phi$?
Clean session, I'm also getting errors same as Hypnotoad. Also, if this is used in any sort of teaching setting, I would advice cleaning it up to improve readability.
Jan
8
answered How to override `?NumericQ`
Jan
8
comment Using Control Objects with TabView
Please post an example of code that displays this problem. I have a hunch about what it might be, but it's hard to tell without seeing some code.