简体   繁体   English

尽管安装了优化软件包,但Octave中未提供linprog

[英]linprog not provided in Octave although optim package installed

I try to use Octave's optim package as a replacement (as far as possible) for Matlab. 我尝试使用Octave的优化包作为Matlab的替代品(尽可能)。 I installed both distros Octave MinGW and Octave MSVC . 我安装了两个发行版Octave MinGWOctave MSVC

pkg install parallel-2.2.0.tar.gz gives me the following error in case of using the MSVC version sh.exe: ./configure: /bin/sh: bad interpreter: No such file or directory . 在使用MSVC版本sh.exe: ./configure: /bin/sh: bad interpreter: No such file or directory情况下, pkg install parallel-2.2.0.tar.gz给我以下错误sh.exe: ./configure: /bin/sh: bad interpreter: No such file or directory So I tried the MinGW version. 所以我尝试了MinGW版本。 After installing all packages ( general , struct , miscellaneous , parallel and optim ) being required and typing help linprog I ended up with: 在安装了所有必需的软件包generalstructmiscellaneousparalleloptim )并输入help linprog我最终得到了:

error: help: Octave does not currently provide linprog.  Linear programming problems
may be solved using `glpk'.  Try `help glpk' for more info.

Please read `http://www.octave.org/missing.html' to learn how you can
contribute missing functionality.

What needs to be done to use this function as documented here ? 需要做要使用此功能,如记录什么位置

Update1 UPDATE1

I tried version 3.8.1 as suggested by carandraug but the installation of parallel will abort with sclose.cc:37:24: fatal error: sys/socket.h: No such file or directory . 我尝试按照carandraug的建议尝试版本3.8.1 ,但parallel安装将因sclose.cc:37:24而中止sclose.cc:37:24: fatal error: sys/socket.h: No such file or directory I may add another update after fixing this. 解决此问题后,我可能会添加其他更新。 By the way I hope the Octave developer will choose an Eclipse IDE as the default Developer-GUI in the future so something that many, many people can contribute to without starting from scratch. 顺便说一句,我希望Octave开发人员将来会选择Eclipse IDE作为默认的Developer-GUI,这样许多人都可以为此做出贡献而无需从头开始。

Update2 UPDATE2

The above linked packages are newer than those being shipped with Octave 8.3.1 so I simply switched to the src folder and ran build_packages . 上面链接的软件包比Octave 8.3.1随附的软件包更新,因此我只是切换到src文件夹并运行build_packages

I just posted this answer on a separate question: 我只是将这个答案发布在另一个问题上:

The problem is that you didn't load the optim package. 问题是您没有加载优化软件包。 When you type pkg list you can find which ones are loaded by an asterisk in front of their names. 键入pkg list您可以在名称前找到一个由星号加载的名称。 Load a package with pkg load optim . pkg load optim装入包装。

Having to load a packages is that thing that many users coming from Matlab find strange but if you compare with other languages, such as Python, Perl, or C++, would you expect them to import , use , or #include every libraries available in the system by default? 必须加载软件包的事实使得许多来自Matlab的用户感到奇怪,但是如果与其他语言(例如Python,Perl或C ++)进行比较,您会希望它们importuse#include系统默认? See Octave's FAQ for more details. 有关更多详细信息,请参见Octave的FAQ

If you want a package to be loaded automatically by default, the recommended action is to add the line pkg load optim to your ~/.octaverc file. 如果希望默认情况下自动加载软件包,建议的操作是将pkg load optim行添加到~/.octaverc文件中。

Finally, you have just started with Octave, you should probably have installed Octave 3.8.1. 最后,您刚刚开始使用Octave,可能应该已经安装了Octave 3.8.1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM