Hi all,
I am currently writing some higher level functions in C++ that access
poker-eval. While I
can see that
the underlying C code is well written, and lightning fast, it is to far above
my head to
use on a daily
basis. I have created classes for cards, and hands. I have also made a
HandEvaluator class
which wraps
around Hand_EVAL_N. What is the most efficient way to interface with
Hand_EVAL_N? The
fastest
version I have been able to come up with is:
inline int HandEvaluator::rankHand(Card &c1, Card &c2, Hand &h)
{
StdDeck_CardMask gCards = StdDeck_MASK(c1.gIndex);
StdDeck_CardMask_OR(gCards , gCards , StdDeck_MASK(c2.gIndex));
for(int i=0 ; i<h.cards[0] ; ++i)
{
StdDeck_CardMask_OR(gCards , gCards ,
StdDeck_MASK(h.cards[i+1]));
}
return Hand_EVAL_N(gCards, h.cards[0]+2);
}
This method takes about 150% of the time of the C function. Is there a more
efficient way
of setting
this method up?
Thanks for your help,
Ian
_______________________________________________
Pokersource-users mailing list
[email protected]
https://mail.gna.org/listinfo/pokersource-users