refactor_x86_simd
refactor_x86_simd

Refactor the LDA math code so that the different approaches can now be
selected via the command line:

	--math-mode [fast-approx|approx|precise|simd]

SIMD is the default. Precise uses the Boost math version of digamma,
lgamme and friends. Fast-approx/approx uses the various Mineiro
approximations.

Update x86 SIMD code and use SSE3, SSE4.2 intrinsics, if the compiler
has them enabled. Vector element extraction is templated code with a
specialization for the 0'th element. All of this results in better
instruction selection in clang, nominally better in gcc. (NOTE: The user
would need to add "-msse4.2" to their compile flags to get the SSE 4.2
instructions.)

Also prefer STL algorithms in a few places where they make sense, show
examples of how C++ lambdas work (it's a C++0x feature.)

marko-asplund/vowpal_wabbit,ffyu/vowpal_wabbit,VerveWireless/vowpal_wabbit,ml-lab/vowpal_wabbit,zachmayer/vowpal_wabbit,hal3/vowpal_wabbit,danmelamed/vowpal_wabbit,zachmayer/vowpal_wabbit,trufanov-nok/vowpal_wabbit,lmatthieu/myvw,michaelbrundage/vowpal_wabbit,zhoususheng/vowpal_wabbit,emjotde/vowpal_wabbit,VerveWireless/vowpal_wabbit,followyourheart/vowpal_wabbit,KaiWeiChang/vowpal_wabbit,swjo207/vowpal_wabbit,tzukuoh/vowpal_wabbit,jmorra/vowpal_wabbit,stathwang/vowpal_wabbit,abimannans/vowpal_wabbit,pombredanne/vowpal_wabbit,feynman0825/vowpal_wabbit,trufanov-nok/vowpal_wabbit,pombredanne/vowpal_wabbit,hhexiy/vowpal_wabbit,deaktator/vowpal_wabbit,VerveWireless/vowpal_wabbit,deaktator/vowpal_wabbit-jmorra,pombredanne/vowpal_wabbit,marko-asplund/vowpal_wabbit,tzukuoh/vowpal_wabbit,elkingtonmcb/vowpal_wabbit,abimannans/vowpal_wabbit,jon-morra-zefr/vowpal_wabbit,swjo207/vowpal_wabbit,martinbel/vowpal_wabbit,jon-morra-zefr/vowpal_wabbit,deaktator/vowpal_wabbit,haipengl/vowpal_wabbit,yonglehou/vowpal_wabbit,lmatthieu/myvw,followyourheart/vowpal_wabbit,zhoususheng/vowpal_wabbit,zachmayer/vowpal_wabbit,ffyu/vowpal_wabbit,haipengl/vowpal_wabbit,martinpopel/vowpal_wabbit,deaktator/vowpal_wabbit,ml-lab/vowpal_wabbit,feynman0825/vowpal_wabbit,elkingtonmcb/vowpal_wabbit,lmatthieu/myvw,elkingtonmcb/vowpal_wabbit,jmorra/vowpal_wabbit,jon-morra-zefr/vowpal_wabbit,zachmayer/vowpal_wabbit,trufanov-nok/vowpal_wabbit,byzhang/vowpal_wabbit,chenmoshushi/vowpal_wabbit,pombredanne/vowpal_wabbit,michaelbrundage/vowpal_wabbit,feynman0825/vowpal_wabbit,chenmoshushi/vowpal_wabbit,michaelbrundage/vowpal_wabbit,swjo207/vowpal_wabbit,deaktator/vowpal_wabbit,trufanov-nok/vowpal_wabbit,trufanov-nok/vowpal_wabbit,raosudha89/vowpal_wabbit,VerveWireless/vowpal_wabbit,marko-asplund/vowpal_wabbit,jmorra/vowpal_wabbit,danmelamed/vowpal_wabbit,byzhang/vowpal_wabbit,lhoang29/vowpal_wabbit,jon-morra-zefr/vowpal_wabbit,zzzbit/vowpal_wabbit,michaelbrundage/vowpal_wabbit,marko-asplund/vowpal_wabbit,raosudha89/vowpal_wabbit,stathwang/vowpal_wabbit,marcovzla/vowpal_wabbit,feynman0825/vowpal_wabbit,sandyice74/vowpal_wabbit,trufanov-nok/vowpal_wabbit,byzhang/vowpal_wabbit,deaktator/vowpal_wabbit,deaktator/vowpal_wabbit-jmorra,lhoang29/vowpal_wabbit,swjo207/vowpal_wabbit,lhoang29/vowpal_wabbit,byzhang/vowpal_wabbit,printedheart/vowpal_wabbit,martinbel/vowpal_wabbit,zzzbit/vowpal_wabbit,danmelamed/vowpal_wabbit,obrianjunior/vowpal_wabbit,digitalreasoning/vowpal_wabbit,byzhang/vowpal_wabbit,emjotde/vowpal_wabbit,zzzbit/vowpal_wabbit,jon-morra-zefr/vowpal_wabbit,michaelbrundage/vowpal_wabbit,deaktator/vowpal_wabbit,zachmayer/vowpal_wabbit,yonglehou/vowpal_wabbit,feynman0825/vowpal_wabbit,hal3/vowpal_wabbit,yonglehou/vowpal_wabbit,stathwang/vowpal_wabbit,gregsharp/vowpal_wabbit,digitalreasoning/vowpal_wabbit,digitalreasoning/vowpal_wabbit,jmorra/vowpal_wabbit,byzhang/vowpal_wabbit,hhexiy/vowpal_wabbit,jmorra/vowpal_wabbit,KaiWeiChang/vowpal_wabbit,deaktator/vowpal_wabbit-jmorra,printedheart/vowpal_wabbit,deaktator/vowpal_wabbit-jmorra,sandyice74/vowpal_wabbit,sandyice74/vowpal_wabbit,ffyu/vowpal_wabbit,deaktator/vowpal_wabbit-jmorra,jon-morra-zefr/vowpal_wabbit,tzukuoh/vowpal_wabbit,marko-asplund/vowpal_wabbit,yonglehou/vowpal_wabbit,marko-asplund/vowpal_wabbit,byzhang/vowpal_wabbit,martinpopel/vowpal_wabbit,swjo207/vowpal_wabbit,gregsharp/vowpal_wabbit,lhoang29/vowpal_wabbit,ml-lab/vowpal_wabbit,followyourheart/vowpal_wabbit,deaktator/vowpal_wabbit,martinpopel/vowpal_wabbit,elkingtonmcb/vowpal_wabbit,obrianjunior/vowpal_wabbit,michaelbrundage/vowpal_wabbit,sandyice74/vowpal_wabbit,marcovzla/vowpal_wabbit,KaiWeiChang/vowpal_wabbit,obrianjunior/vowpal_wabbit,VerveWireless/vowpal_wabbit,raosudha89/vowpal_wabbit,KaiWeiChang/vowpal_wabbit,followyourheart/vowpal_wabbit,feynman0825/vowpal_wabbit,chenmoshushi/vowpal_wabbit,haipengl/vowpal_wabbit,marko-asplund/vowpal_wabbit,haipengl/vowpal_wabbit,raosudha89/vowpal_wabbit,chenmoshushi/vowpal_wabbit,robin-lai/vowpal_wabbit,robin-lai/vowpal_wabbit,hhexiy/vowpal_wabbit,ffyu/vowpal_wabbit,danmelamed/vowpal_wabbit,KaiWeiChang/vowpal_wabbit,yonglehou/vowpal_wabbit,lmatthieu/myvw,followyourheart/vowpal_wabbit,zhoususheng/vowpal_wabbit,swjo207/vowpal_wabbit,ffyu/vowpal_wabbit,followyourheart/vowpal_wabbit,pombredanne/vowpal_wabbit,jmorra/vowpal_wabbit,sandyice74/vowpal_wabbit,hhexiy/vowpal_wabbit,followyourheart/vowpal_wabbit,VerveWireless/vowpal_wabbit,marcovzla/vowpal_wabbit,robin-lai/vowpal_wabbit,yonglehou/vowpal_wabbit,jmorra/vowpal_wabbit,swjo207/vowpal_wabbit,martinpopel/vowpal_wabbit,robin-lai/vowpal_wabbit,sandyice74/vowpal_wabbit,lhoang29/vowpal_wabbit,hal3/vowpal_wabbit,ml-lab/vowpal_wabbit,obrianjunior/vowpal_wabbit,printedheart/vowpal_wabbit,hal3/vowpal_wabbit,byzhang/vowpal_wabbit,sandyice74/vowpal_wabbit,robin-lai/vowpal_wabbit,zzzbit/vowpal_wabbit,tzukuoh/vowpal_wabbit,stathwang/vowpal_wabbit,swjo207/vowpal_wabbit,deaktator/vowpal_wabbit-jmorra,abimannans/vowpal_wabbit,abimannans/vowpal_wabbit,pombredanne/vowpal_wabbit,lmatthieu/myvw,michaelbrundage/vowpal_wabbit,jmorra/vowpal_wabbit,pombredanne/vowpal_wabbit,KaiWeiChang/vowpal_wabbit,lhoang29/vowpal_wabbit,digitalreasoning/vowpal_wabbit,danmelamed/vowpal_wabbit,hal3/vowpal_wabbit,chenmoshushi/vowpal_wabbit,lmatthieu/myvw,zhoususheng/vowpal_wabbit,byzhang/vowpal_wabbit,danmelamed/vowpal_wabbit,emjotde/vowpal_wabbit,zhoususheng/vowpal_wabbit,printedheart/vowpal_wabbit,raosudha89/vowpal_wabbit,chenmoshushi/vowpal_wabbit,hal3/vowpal_wabbit,followyourheart/vowpal_wabbit,hal3/vowpal_wabbit,gregsharp/vowpal_wabbit,marko-asplund/vowpal_wabbit,abimannans/vowpal_wabbit,martinpopel/vowpal_wabbit,zhoususheng/vowpal_wabbit,lhoang29/vowpal_wabbit,VerveWireless/vowpal_wabbit,ffyu/vowpal_wabbit,obrianjunior/vowpal_wabbit,abimannans/vowpal_wabbit,haipengl/vowpal_wabbit,emjotde/vowpal_wabbit,lhoang29/vowpal_wabbit,zzzbit/vowpal_wabbit,stathwang/vowpal_wabbit,abimannans/vowpal_wabbit,ffyu/vowpal_wabbit,raosudha89/vowpal_wabbit,sandyice74/vowpal_wabbit,digitalreasoning/vowpal_wabbit,hhexiy/vowpal_wabbit,raosudha89/vowpal_wabbit,printedheart/vowpal_wabbit,printedheart/vowpal_wabbit,sandyice74/vowpal_wabbit,danmelamed/vowpal_wabbit,jon-morra-zefr/vowpal_wabbit,martinpopel/vowpal_wabbit,marcovzla/vowpal_wabbit,tzukuoh/vowpal_wabbit,marcovzla/vowpal_wabbit,gregsharp/vowpal_wabbit,printedheart/vowpal_wabbit,lmatthieu/myvw,abimannans/vowpal_wabbit,trufanov-nok/vowpal_wabbit,martinpopel/vowpal_wabbit,feynman0825/vowpal_wabbit,haipengl/vowpal_wabbit,hhexiy/vowpal_wabbit,digitalreasoning/vowpal_wabbit,jon-morra-zefr/vowpal_wabbit,gregsharp/vowpal_wabbit,trufanov-nok/vowpal_wabbit,deaktator/vowpal_wabbit,hal3/vowpal_wabbit,zhoususheng/vowpal_wabbit,obrianjunior/vowpal_wabbit,marko-asplund/vowpal_wabbit,digitalreasoning/vowpal_wabbit,deaktator/vowpal_wabbit-jmorra,lmatthieu/myvw,printedheart/vowpal_wabbit,abimannans/vowpal_wabbit,trufanov-nok/vowpal_wabbit,followyourheart/vowpal_wabbit,ml-lab/vowpal_wabbit,deaktator/vowpal_wabbit-jmorra,deaktator/vowpal_wabbit,martinbel/vowpal_wabbit,robin-lai/vowpal_wabbit,robin-lai/vowpal_wabbit,michaelbrundage/vowpal_wabbit,emjotde/vowpal_wabbit,emjotde/vowpal_wabbit,elkingtonmcb/vowpal_wabbit,VerveWireless/vowpal_wabbit,zzzbit/vowpal_wabbit,robin-lai/vowpal_wabbit,digitalreasoning/vowpal_wabbit,hal3/vowpal_wabbit,tzukuoh/vowpal_wabbit,printedheart/vowpal_wabbit,lhoang29/vowpal_wabbit,ffyu/vowpal_wabbit,tzukuoh/vowpal_wabbit,followyourheart/vowpal_wabbit,robin-lai/vowpal_wabbit,ffyu/vowpal_wabbit,ml-lab/vowpal_wabbit,stathwang/vowpal_wabbit,emjotde/vowpal_wabbit,feynman0825/vowpal_wabbit,martinbel/vowpal_wabbit,hhexiy/vowpal_wabbit,abimannans/vowpal_wabbit,VerveWireless/vowpal_wabbit,raosudha89/vowpal_wabbit,stathwang/vowpal_wabbit,michaelbrundage/vowpal_wabbit,zhoususheng/vowpal_wabbit,obrianjunior/vowpal_wabbit,marcovzla/vowpal_wabbit,elkingtonmcb/vowpal_wabbit,deaktator/vowpal_wabbit,marcovzla/vowpal_wabbit,chenmoshushi/vowpal_wabbit,tzukuoh/vowpal_wabbit,obrianjunior/vowpal_wabbit,printedheart/vowpal_wabbit,sandyice74/vowpal_wabbit,gregsharp/vowpal_wabbit,feynman0825/vowpal_wabbit,marko-asplund/vowpal_wabbit,ml-lab/vowpal_wabbit,chenmoshushi/vowpal_wabbit,ml-lab/vowpal_wabbit,yonglehou/vowpal_wabbit,zzzbit/vowpal_wabbit,KaiWeiChang/vowpal_wabbit,elkingtonmcb/vowpal_wabbit,marcovzla/vowpal_wabbit,danmelamed/vowpal_wabbit,zhoususheng/vowpal_wabbit,elkingtonmcb/vowpal_wabbit,zachmayer/vowpal_wabbit,gregsharp/vowpal_wabbit,emjotde/vowpal_wabbit,gregsharp/vowpal_wabbit,michaelbrundage/vowpal_wabbit,digitalreasoning/vowpal_wabbit,digitalreasoning/vowpal_wabbit,trufanov-nok/vowpal_wabbit,danmelamed/vowpal_wabbit,haipengl/vowpal_wabbit,deaktator/vowpal_wabbit-jmorra,hal3/vowpal_wabbit,haipengl/vowpal_wabbit,elkingtonmcb/vowpal_wabbit,gregsharp/vowpal_wabbit,robin-lai/vowpal_wabbit,pombredanne/vowpal_wabbit,stathwang/vowpal_wabbit,KaiWeiChang/vowpal_wabbit,lmatthieu/myvw,elkingtonmcb/vowpal_wabbit,lhoang29/vowpal_wabbit,zachmayer/vowpal_wabbit,pombredanne/vowpal_wabbit,martinpopel/vowpal_wabbit,jon-morra-zefr/vowpal_wabbit,zzzbit/vowpal_wabbit,martinpopel/vowpal_wabbit,byzhang/vowpal_wabbit,VerveWireless/vowpal_wabbit,marcovzla/vowpal_wabbit,zachmayer/vowpal_wabbit,KaiWeiChang/vowpal_wabbit,pombredanne/vowpal_wabbit,chenmoshushi/vowpal_wabbit,emjotde/vowpal_wabbit,hhexiy/vowpal_wabbit,jmorra/vowpal_wabbit,martinbel/vowpal_wabbit,martinbel/vowpal_wabbit,martinbel/vowpal_wabbit,swjo207/vowpal_wabbit,gregsharp/vowpal_wabbit,tzukuoh/vowpal_wabbit,ml-lab/vowpal_wabbit,zhoususheng/vowpal_wabbit,hhexiy/vowpal_wabbit,stathwang/vowpal_wabbit,obrianjunior/vowpal_wabbit,zzzbit/vowpal_wabbit,chenmoshushi/vowpal_wabbit,hhexiy/vowpal_wabbit,swjo207/vowpal_wabbit,emjotde/vowpal_wabbit,yonglehou/vowpal_wabbit,danmelamed/vowpal_wabbit,jon-morra-zefr/vowpal_wabbit,hal3/vowpal_wabbit,jon-morra-zefr/vowpal_wabbit,martinbel/vowpal_wabbit,deaktator/vowpal_wabbit-jmorra,haipengl/vowpal_wabbit,zachmayer/vowpal_wabbit,yonglehou/vowpal_wabbit,martinbel/vowpal_wabbit,tzukuoh/vowpal_wabbit,yonglehou/vowpal_wabbit,ml-lab/vowpal_wabbit,jmorra/vowpal_wabbit,obrianjunior/vowpal_wabbit,haipengl/vowpal_wabbit,feynman0825/vowpal_wabbit,marcovzla/vowpal_wabbit,deaktator/vowpal_wabbit,raosudha89/vowpal_wabbit,ffyu/vowpal_wabbit,KaiWeiChang/vowpal_wabbit,raosudha89/vowpal_wabbit,martinpopel/vowpal_wabbit,zzzbit/vowpal_wabbit,martinbel/vowpal_wabbit,stathwang/vowpal_wabbit,zachmayer/vowpal_wabbit