« first day (2786 days earlier)      last day (1996 days later) » 

01:51
0
Q: Integration of Interpolation takes an unacceptable amount of time

QuarklyI've seen other posts on this subject, but the answers didn't help. I have a modest interpolation function. Integrating it takes up to a minute. This particular calculation goes inside another integral which makes the whole thing un-calculable in eight hours time (terminates with $Aborted). F...

02:45
@KraZug that should work, maybe I can figure out a more accurate work-around that involves interpolation...I wonder, though, how one might be measuring cw vs ccw when the curve is flattened? It would be sweet if it takes into account the ordering of the points that go into constructing the line/curve. I will find out!
 
2 hours later…
04:59
When I see a question that just so obviously shows no thought or effort I have to fight the urge to troll to the point that it's painful sometimes ;_;
 
4 hours later…
09:18
@CATrevillian, I haven't investigated it too much, it generally works fine for my eigenvalue package, but I always give it a closed curve.
 
6 hours later…
15:24
Look at the following snippet
fc = Compile[{{m, _Real, 2}},
  Map[Max[1.0, #] &, m, {2}]
]
This compiles down, but the map is not run in parallel. Is there a way to make this Max behave like e.g. m+1 which is threaded automatically?
 
1 hour later…
16:37
@halirutan In so far as that is possible, I would have expected the syntax to be
fc2 = Compile[x,
   Max[1.0, x],
   RuntimeAttributes -> {Listable},
   Parallelization -> True
   ];
I don't see any increase in speed from doing this, however.
17:12
@C.E. Hmm.. the thing is that something like 3.4*data + 1.2 is more than an order of magnitude faster. For a 512^3 sized array, I get about 3.2 seconds for fc2 and 0.2 seconds for the multiplication and addition.
I'd like to have the performance that Unitize has and for something trivial as Max[1.0, #] there doesn't seem to be a way.
18:25
@halirutan Have you tried using Clip? For example, Clip[mat, {1, max}] should be equivalent, and about 3 times faster than your compiled function.
 
1 hour later…
19:40
@CarlWoll Embarrassing..
Let's say it played a role that I'm almost 22h awake now and acknowledge that I at least knew it had something to do with Unitize because that's how I found Clip the last time. It just didn't click this time although I saw it in the related section of the docs for Unitize.
Thanks a bunch.
 
2 hours later…
21:42
@CarlWoll Huh, didn't know about that one. Glad to delete one more homebrewed function.

« first day (2786 days earlier)      last day (1996 days later) »