In article <sh01r2$frq$
1...@gioia.aioe.org>,
Janis Papanagnou <
janis_pa...@hotmail.com> wrote:
...
...
>Although this is the function I want to examine the questions can be
>taken more generally for any function that is not available in Awk.
>General Awk solutions/suggestions or GNU Awk specific are both welcome.
Well, there are really two parts to your question, then:
1) How do I get access to functions that aren't provided directly in GAWK?
2) What exactly is the "Poisson distribution/function" and how to I
convert the mathematical notation that I see for it in Wikipedia
into computer source code in some language?
The first is on-topic and probably something that I and others on this
newsgroup can help you with. The second, not so much. Note that if
For the first, there are (at least) 3 routes I could see as reasonable
paths to pursue (presented in no particular order):
1) Find a library of AWK code somewhere that has what you need.
(This seems unlikely to me, but stranger things have happened...)
2) Write your own AWK code to what what you need to do. I assume this
is what you are trying to avoid.
3) Find a library written in C (or similar) and then figure out how to
link to it via writing a GAWK extension library yourself. This
option is pretty easy once you've done it a few times, but
represents a sizable hurdle for first-timers. As far as I know,
you've not yet done one of these.
Note that if the function you were looking for was something simple, that
is in the C library but not in GAWK - such as acos() - then it would be
straightforward to write an extension lib to get to it (*), but I don't
think your Poisson function is in the standard library - hence the need to
find a (third party) lib that does have it.
Note, BTW, that acos() really is in the C math lib, but not in GAWK.
Purists will point out that (I think this is true - haven't verified it
100%) that it is unnecessary, since it can be derived from atan2(), which
*is* in GAWK. Again, I'm not sure about all this, but I think it is true.
(*) I, of course, would just use my call_any() library and I'd be done, but
that may not be available to you at the present time.
--
This is the GOP's problem. When you're at the beginning of the year
and you've got nine Democrats running for the nomination, maybe one or
two of them are Dennis Kucinich. When you have nine Republicans, seven
or eight of them are Michelle Bachmann.