Lesson 4 Fixed vs. Dynamic size

来源:互联网 发布:大数据开发云盘 编辑:程序博客网 时间:2024/05/22 06:18
Matrix4f mymatrix;

really amounts to just doing

float mymatrix[16];

so this really has zero runtime cost. By contrast, the array of a dynamic-size matrix is always allocated on the heap, so doing

MatrixXf mymatrix(rows,columns);

amounts to doing

float *mymatrix = new float[rows*columns];

0 0
原创粉丝点击