#2435 reverse merge of all trunk changes for updating to alglib version 3.9.0 (r12790:12792, r12798, r12801)