没有学好基础就上阵果然会完蛋
上次内存爆掉之后,花了一个小时设断点调出来了 有两个问题
两个问题
QString *Qnum = new QString[];
上面这种用法是可以通过的,但是到了使用Qnum时就会崩溃掉,这里不太懂……QString
的用法以及 new[]
的用法 这里先标记一下吧
第二个问题是
在一个类里面的 public
下添加了
int *num = new int[];
这里存在的问题同样是 new[] 问题,在后面的时候,我在一个功能里使用了
void CalWindow::sumData()
{
int i = 0;
sum = 0;
for (i;i<9;i++)
{
sum = sum + num[i];
}
Qsum = QString::number(sum, 10);
delete []num;
ui.sumText->append(Qsum);
}
[]delete
这里错了 关于 []new
和 class
的用法问题吧 如何省内存之类的 还是完全不了解 周二之后一定要解决……
C++ 矩阵、线性代数库
恩 解决这个之后 我就可以暂时交差了……
关于C++的线性代数库,搜了一下,Armadillo 号称是效率最高的的库 网上也有各种测评 感觉确实很屌??!
Armadillo is a high quality C++ linear algebra library, aiming towards a good balance between speed and ease of use; its high-level syntax (API) is deliberately similar to Matlab
摘自官网 意思是 他们追求速度和易用性的平衡 以及语法很像Matlab Matlab 我也用过 不知道效率和Matlab是否有一拼?
2016-03-15
Version 6.600 (Catabolic Amalgamator) expanded sum(), mean(), min(),
max() to handle cubes expanded Cube class to handle arbitrarily sized
empty cubes (eg. 0x5x2) added shift() for circular shifts of elements
added sqrtmat() for finding the square root of a matrix fix for
gmm_diag when using Mahalanobis distance2016-03-01
MLPACK has been accepted for Google Summer of Code 2016
2016-01-26
Version 6.500 (Gourmet Electron Jumper) added conv2() for 2D
convolution added stand-alone kmeans() function for clustering data
added trunc() extended conv() to optionally provide central
convolution faster handling of multiply-and-accumulate by accu() when
using Intel MKL, ATLAS or OpenBLAS
近期的三次更新 比较频繁吧 很靠谱
下载了最新(今天是2016.4.4)稳定版 armadillo-6.600.5.tar.gz
只有 5.2M 哦
主要从这里开始看 确实很简单的感觉……?
恩 写到这里 下一篇放一些实践的代码……