偶尔在__qp__中出现Octave lsqlin错误

时间:2017-09-30 08:24:25

标签: octave nonlinear-optimization

我在GNU Octave版本4.2.1中使用lsqlin from the octave-forge package optim 1.5.2

pkg load optim
new_matrix = [1, 1, 1, 1, 1;
              1, 1, 1, 1, 0;
              1, 1, 0, 0, 1;
              1, 0, 1, 0, 0];

zero_con = zeros (5, 1);
one_con = ones (5, 1);


new_belief = [1; .7; .7; .01];

# but fails with
# new_belief[4] = 0.02;

x = lsqlin (new_matrix, new_belief,
            [], [], [], [],
            zero_con, one_con);

一旦我更改new_belief(请参阅代码中的注释),我就会收到错误:

error: __qp__: operator *: nonconformant arguments (op1 is 3x3, op2 is 5x1)
error: called from
    quadprog at line 351 column 32

0 个答案:

没有答案