fixed invalid assertion in ARandomNumberGenerator
using shared_ptr to share random number generator instance
code documentation
added template parameter to AIndexSelection base class to specify a compare function
code documentation