[MOSEK] Mosek求解中遇到的奇葩内存问题

在使用mosek优化库的时候,使用http://docs.mosek.com/7.0/capi/MSK_getxx_.html的

    1. MSKrescodee MSK_getxx ( 
    2. MSKtask_t task, 
    3. MSKsoltypee whichsol, 
    4. MSKrealt * xx);

来读入xx以得到最优解对应的变量值。

我希望使用Eigen::VectorXd xx, 在xx处读入xx.data(),会出现memory.h报错的问题

解决方案:使用double *tmp_x = (double*)calloc(N_ * N_, sizeof(double));和MSK_getxx(task_,MSK_SOL_ITG, tmp_x);

原文地址:https://www.cnblogs.com/duckie/p/4958361.html