hi,
hope the performance will be sufficient;
cmp:{x where (|/)flip[x z]{$[null y 1;x[0]=y 0;(&/)x=y]}\:/:flip y z}
cmp[b;a; `cond1`cond2]
patryk
On Apr 24, 2012 11:58 AM, "Charles Lin" <charl...@gmail.com> wrote:
Hi Charles,
You're right.
This will allow you to pass more columns, all can have wildcards:
cmp:{x where (|/)flip[x z]{(&/)null[y]|x=y]}\:/:flip y z}
It can be run the same way.
I'll have to think how to get rid of this cross.
It's not so bad for small 'a'...
cheers
patryk
--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/personal-kdbplus/-/n_4fBO5yZS0J.
To post to this group, send email to personal...@googlegroups.com.
To unsubscribe from this group, send email to personal-kdbpl...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=en.
ok, I have more vectorised one
cmp:{x where (|/)(x z){(&/)null[y]|y=x]}/:flip y z}
It's column set by condition check, I'm close to a conclusion that it's one if proper solutions, should also perform well.
cheers
patryk
Hi Patryk,
Sorry that I have been out of town the past few days and missed your reply
Thanks for the solution, I am really delighted to see the solution in that
1. It is a general solution applicable to not just integer, but all the other types
2. It can be extended to support wildcard for more columns
3. It is a column-based check, which should be quick fast comparing to atom by atom comparison
Allow me to correct a typo in your last solution. The function should be getting rid of the close bracket after y = x, i.e.
cmp:{x where (|/)(x z){(&/)null[y]|y=x}/:flip y z}