
C++
文章平均质量分 52
DavyHwang
这个作者很懒,什么都没留下…
展开
-
Simply Beep in console program
If I wana beep in my console program, I just need use "BOOL MessageBeep(UNIT nType)", which is illustrated as follows.#include int main(){ for ( UINT i=0; i<100; i++ ) { Message原创 2012-10-16 18:09:04 · 904 阅读 · 0 评论 -
分别写一个宏和一个函数来获取数组元素个数
#include using std::cout;using std::endl;#define CNT( a ) sizeof(a)/sizeof(*a)templateint fCNT( T* a ){ int nCnt = 0; T* p = a; while ( 0 != *p++ ) nCnt++; return nCnt+1;}int main(){原创 2012-07-07 22:28:59 · 4600 阅读 · 0 评论 -
C++ vector 之 erase 多个元素的两种常用方法
这是一个古老的话题,今天拿来再炒一下,原因是我又用错了。查阅各种 comments 以及根据我自己的使用经验,当在 vector 中 查找并连续删除 其中多个元素时,我发现主要有两种方法:// ------ Sample 1: for ( vector::iterator it = m_vecIDSet.begin(); it != m_vecIDSet.end();原创 2013-03-12 15:40:23 · 12693 阅读 · 4 评论 -
Solve an LP problem in C++ using Gurobi
Recently, I used Gurobi to solve an flow-based LP problem, in which the c++ interfaces were called in my project.原创 2013-02-14 14:50:38 · 3674 阅读 · 0 评论 -
C++嵌套调用 用Python 脚本写的 基于Gurobi 的解数学模型的经验记录
这篇blog是把我曾经 用 C++ 调用 由python 脚本 写的基于 Gurobi optimizer 的 程序 与 经验分享出来。我当初开始试着解决问题时,搜索了整个网络,国语写成的资料,最多涉及到2个主题。 没有一个符合我的要求的。木有办法,只好去参考原版的 Gurobi Manual 与 python 27 的 tutorial, 然后一步步地做实验探索。而且查阅 Google Group 的帖子,去借鉴别人的经验。虽然这个过程走了很多的弯路,最后终于把自己的问题解决了!原创 2013-03-27 21:09:39 · 7442 阅读 · 18 评论