Reputation
12,157
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
1 28 63
Impact
~111k people reached

Jan
16
comment Pattern matching a pattern with patterns
I'm not sure why you feel the need to explicitly split up into lhs/rhs. Why not just match the entire patterns?
Jan
16
answered Trig angles simplifying in worksheet
Jan
16
asked Pattern matching a pattern with patterns
Jan
15
comment Compiling LinearSolve[] or creating a compilable procedural version of it
@Jagra What I was asking was how it changes. You posted a constant matrix and a constant array. They per definition never change. If you could for instance provide a matrix on the form {{a,b},{0,4}} and say with a and b having different values. That would be a useful description. Just saying "the values within the matrix and vector change constantly" is not useful, how do they change, do they all change?, which ones change etc. This is the information needed in order to judge whether you just need a single solution or a complete framework like LAPACK.
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