• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisão8c7c25238ed835851b897abf5e6c76393092faad (tree)
Hora2013-01-22 05:19:05
AutorKatsuhiko Nishimra <ktns.87@gmai...>
CommiterKatsuhiko Nishimra

Mensagem de Log

Call boost::math::factorial in MolDS_base::Factorial if available. #30557

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/branches/automake@1240 1136aad2-a195-0410-b898-f5ea1d11b9d8

Mudança Sumário

Diff

--- a/src/base/MathUtilities.cpp
+++ b/src/base/MathUtilities.cpp
@@ -23,10 +23,13 @@
2323 #include<math.h>
2424 #include<stdexcept>
2525 #include<boost/format.hpp>
26+#include"config.h"
27+#ifdef HAVE_BOOST_MATH_SPECIAL_FUNCTIONS_FACTORIALS_HPP
28+#include<boost/math/special_functions/factorials.hpp>
29+#endif
2630 #include"PrintController.h"
2731 #include"MolDSException.h"
2832 #include"Uncopyable.h"
29-#include"config.h"
3033 #include"../wrappers/Lapack.h"
3134 #include"Enums.h"
3235 #include"MathUtilities.h"
@@ -42,12 +45,16 @@ int Factorial(int n){
4245 ss << "Error in base::MathUtility::Factorial: n<0 \n";
4346 throw MolDSException(ss.str());
4447 }
48+#ifdef HAVE_BOOST_MATH_SPECIAL_FUNCTIONS_FACTORIALS_HPP
49+ return static_cast<int>(boost::math::factorial<double>(n));
50+#else
4551 else if (n>1){
4652 return n*Factorial(n-1);
4753 }
4854 else{
4955 return 1;
5056 }
57+#endif
5158 }
5259
5360 // nCk