I was asked about this today. In practice, I rarely use 2-dimensional array, instead I use vector of vectors.
To allocate a 2-d array on the stack,[......]
I was asked about this today. In practice, I rarely use 2-dimensional array, instead I use vector of vectors.
To allocate a 2-d array on the stack,[......]
PCA,全称是Principal component analysis,中文叫做主成分分析,是一种常用的数据处理手段。
直观的说,PCA是一种降维的手法。比如现在我们有1000个数据点,每个数据点是一个128维的向量,存储上可以是一个1000×128维的数组。经过PCA处理,我们仍然得到100[......]
This is a question I posted on StackOverflow: fstream issue under 64-bits cygwin, glad to get help from Nemo on Stackflow, all credits goes to him.[......]
STL里Map的Operator[]和其它的Container不太一样。
因为Map的Operator[]可以提供这种操作:
map<string,string> testMap; testMap["a"] = "b"; |
所以Map的Operator[]返回的是T&,而不是const T&
如果需要得到[......]
回到C++下,随着代码量增加,遇到维护问题了。
找到一个Google的UnitTest框架,GoogleTest
有很详细的Sample,推荐一下 :]
编译的时候需要先编译出libgtest.a和gtest_main.o,自己的testXX.cpp文件需要和ligtest.a, gtes[......]