微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在 Julia 中制作 inf 矩阵?

如何解决如何在 Julia 中制作 inf 矩阵?

我想将我的问题的最低边界设置为 -inf 也没有限制,代码来了

@time begin
using COSMO,SparseArrays,Linearalgebra
using NPZ

Matrix10 = npzread("C:/Users/skqkr/Desktop/Semesterarbeit/Chiwan_Q1.npz")
q = Matrix10["p"];
P = sparse(Matrix10["Q"]);
A = sparse(Matrix10["G"]);
h = Matrix10["h"];
l = Matrix10["l"];

# First,we decide to solve the problem with two one-sided constraints using `COSMO.Nonnegatives` as the convex set:
Aa = [-A; A]
ba = [h; -l]
constraint1 = COSMO.Constraint(Aa,ba,COSMO.Nonnegatives);

# Next,we define the settings object,the model and then assemble everything:
settings = COSMO.Settings(verbose=true);
model = COSMO.Model();
assemble!(model,P,q,constraint1,settings = settings);
res = COSMO.optimize!(model);


# Alternatively,we can also use two-sided constraints with `COSMO.Box`:
constraint1 = COSMO.Constraint(A,zeros(3),COSMO.Box(-l,h));

model = COSMO.Model();
assemble!(model,settings = settings);
res_Box = COSMO.optimize!(model);



end

所以我想要

l = Matrix10["l"];

这里 ll 作为一个没有限制的矩阵,所以 qp 的约束将是这种形式。 A*X

我该怎么做才能使极限减去无穷大。

谢谢!!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。