_ uBlas ã®ãã¯ãã«ã¨è¡åããæè»½ã«åæå istringstream ã使ããåºåå½¢å¼ã¨åãå½¢å¼ã®æååãããã¯ãã«ã¨è¡åãçæãããã¨ãåºæ¥ãã #include <boost/numeric/ublas/vector.hpp> #include <boost/numeric/ublas/io.hpp> #include <iostream> int main () { using namespace boost::numeric; using namespace std; ublas::vector<double> v; istringstream is("[3] (0.1, 2, 2)"); is >> v; cout << v << endl; } $./a.out [3](0.1,2,2)
è¡åãªãã¦ãããªã«è©³ããç¡ãã®ã§ã ä¸è§è¡åã¨ã対称è¡åã®è¡¨ç¾ææ®µã¨ãè²ã é¢ç½ãããªã®ã§ããã ã¾ããããããã¾ããã ã ãããé常ã«éè¦ãªåºç¤æè¡ã§ããã expression template ã«ã¤ãã¦è§£èª¬ããã¦ã¿ã¾ãã prod(mat3, prod(mat1, mat2)); prod(mat3, matrix<int>(prod(mat1, mat2))); prod(mat3, prod<matrix<int> >(mat1, mat2)); matrix<int> mat4(prod(mat3, prod(mat1, mat2))); matrix<int> mat4(prod(mat3, matrix<int>(prod(mat1, mat2)))); matrix<int> mat4(prod(mat3, prod<matrix<int> >(mat1, mat2)));
boost::numeric::ublas ç·å½¢ä»£æ°ã©ã¤ãã©ãªã®ä½¿ãæ¹ é£ç«æ¹ç¨å¼ãè§£ãã»éè¡åãæ±ãã DT Specials -> Boost -> boost::numeric::ublas ç·å½¢ä»£æ°ã©ã¤ãã©ãªã®ä½¿ãæ¹ Last update : Jan. 13th, 2005 ã¯ããã« ãã®ææ¸ã¯ï¼ç·å½¢æ¼ç®ã©ã¤ãã©ãª boost::numeric::ublas ã®ä½¿ãæ¹ã®ä¸é¨ãç°¡åã«èª¬æãããã®ã§ãï¼ ã©ãã boost â uBLAS ã«ã¤ãã¦ã¯æ¥æ¬èªã®èª¬ææ¸ãããªãããã§ãï¼é ¼ã¿ã®æ¥æ¬èªè§£èª¬æ¸[2]ã uBLAS ã¯ãã£ã 2 ãã¼ã¸ï¼Web ãããã£ã¦ãç§ã®å¸æã«ãã解説ã¯è¦ãããã¾ããï¼ä»æ¹ããªãã®ã§è±èªã®ãªãªã¸ãã«ããã¥ã¡ã³ãã¨æ ¼éãã¾ããï¼ãã®çµæï¼ãªãã¨ãé£ç«1次æ¹ç¨å¼ãè§£ããã¨ã¨ï¼éè¡åãæ±ãããã¨ã¯ã§ããããã«ãªã£ãã®ã§ï¼ç§ã¨åããããªãæ©ã¿ãæ±ã㦠Web ãå·¡
boost::shared_ptr ã¯åçåé¤å (dynamic deleter) ã¨å¼ã°ããææ³ã«åºã¥ãã¦å®è£ ããã¦ãã¾ãï¼ãã®åçåé¤åã¨ããææ³ã§éè¦ãªã®ã¯ï¼ boost::shared_ptr ãæçµçã«å¼ã³åºãè§£æ¾å¦çã boost::shared_ptr ã®ãã³ãã¬ã¼ã弿°ã®åã«é¢ä¿ãªãï¼ã³ã³ã¹ãã©ã¯ã¿ã«å®éã«æ¸¡ããããã¤ã³ã¿ã®åã§ï¼ã㤠boost::shared_ptr ã®ã³ã³ã¹ãã©ã¯ã¿ã®å¼ã³åºãã®æ®µé㧠決å®ããï¼ã¨ãããã¨ã§ãï¼ ä»¥ä¸ã®ãããªã³ã¼ããï¼åçåé¤åã®å¹æãä¸çªåãããããä¾ã«ãªãã§ãããï¼ class X{ public: ~X() { std::cout << "X::~X" << std::endl; } }; class B{ public: ~B() // virtual ã§ãªããã¨ã«æ³¨æï¼ï¼ { std::cout << "B::~B" <<
æ¦è¦ ãã®ææ¸ã¯ï¼ã¢ã«ã´ãªãºã ï¼ã·ã¼ã±ã³ã¹ï¼ã¡ã¿é¢æ°ã¯ã©ã¹ã®æ¡å¼µå¯è½ãªã³ã³ãã¤ã«æãã¬ã¼ã ã¯ã¼ã¯ã§ããï¼ Boost C++ ãã³ãã¬ã¼ãã¡ã¿ããã°ã©ãã³ã°ã©ã¤ãã©ãª(MPL) ã«ã¤ãã¦è¿°ã¹ã¦ããï¼ ã©ã¤ãã©ãªã¯å®ç°å¢ã§ã®å®éã®å®éã®ä»æ§ã«ååãªï¼å¼·åã§ä½¿ãããããã¼ã«ã»ãããæ§ç¯ããããã«ï¼ ã¸ã§ããªãã¯ããã°ã©ãã³ã°ï¼åã³é¢æ°ããã°ã©ãã³ã°ã®ä¸çããï¼éè¦ãªæ½è±¡åãå°å ¥ãã¦ããï¼ MPL ã¯ï¼C++æ¨æºã©ã¤ãã©ãª[STL94], [ISO98]ã®ä¸é¨ã§ããï¼æ¨æºãã³ãã¬ã¼ãã©ã¤ãã©ãª (STL) ã®å½±é¿ãå¼·ãåãã¦ããï¼ STLã®æ§ã«ï¼MPLã¯ãã®é åã«å°æ¥è²¢ç®ããããã®åå°ã¨ãªããããªï¼å ¬éãããæ¦å¿µã¨å®è£ ã®æ çµã¿ãå®ç¾©ãã¦ããï¼ ã©ã¤ãã©ãªã®åºæ¬çãªæ¦å¿µã¨ã¤ãã£ãªã ã«ããï¼ã¦ã¼ã¶ãä¸ããããã¡ã¿ããã°ã©ãã³ã°ã®åé¡ã«å¯¾ãã¦ï¼ ã¢ãããã¯ãªã¢ããã¼ãã®ä¸çã«å¼ãã¥ãè¾¼ã¾ãããã¨ãªãï¼
C++ ææã§ããªã²ã¼ãã¨é¢æ°ãã¤ã³ã¿ã話é¡ã«ãªã£ã¦ããã§ãããã§ã¯ boost.function ãã boost.function ã¯ããã¨ãããã颿°è¡¨ç¾ãçµ±ä¸ãã¦æ±ããã¨ãããã®ãboost.function ããªããã°ãããªãåä»ãªä½æ¥ãå¼·ããããã ããï¼ç¹ã« boost.bind 㨠boost.lambda ã®è¿å¤ã¯å¶æªãªã®ã§ï¼ã function<bool (int, int)> ã¨æ¸ãã°ãint ã®å¼æ°ã 2 ã¤æã¡ãbool ãè¿ã颿°ãã®ãããªãã®ãã¯ä½ã§ãåãå ¥ããäºãã§ãããå¤ãã³ã³ãã¤ã©ã§ã¯ãbool (int, int)ãã¨æ¸ããªãã®ã§ãä»ã®ææ®µãç¨ããªããã°ãªããªãããå¤ãã³ã³ãã¤ã©ãªãã¦èª°ã使ããªãããã 以ä¸ã¯ã弿°ãå¶æ°ãã©ãããè¿ã颿°ï¼ã®ãããªãã®ï¼ãæ±ã£ãä¾ã #include <algorithm> #include <boost/bind.h
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}