特征动态矩阵大小

时间:2016-02-12 16:50:51

标签: eigen

说一个人有以下代码:

cout<< sizeof(Eigen::Matrix<double, -1, -1 , 0 , 10, 10>)<<endl;
cout<< sizeof(Eigen::Matrix<double, -1, -1>)<<endl;

第一行输出3664字节,第二行输出24字节。

我试图理解为什么指定最大尺寸导致这个?

计算机体系结构是x64。

1 个答案:

答案 0 :(得分:1)

hm, you probably did a copy-paste mistake, because, as expected, I obtain:

BSRecords breakfastRecord = new BSRecords { BS = brkBS.ToString(), 
                                            Carbs = brkCarb.ToString(),
                                            Notes = brkftNoteTxt.Text, 
                                            Date = dateTxt.Text };

Indeed, as explain in the documentation of Eigen::Matrix, specifying the maximum sizes at compile time amounts, in your case, to the following structure:

816
24