Basically, I have an MIP completely defined, everything is working, until I attempt to solve via GLPK, when it gives me the following error: UndefVarError: floatmax not defined
I tried defining floatmax as anything, but to no avail. I'm completely stuck. Here's an image of my code and the problem:
1
It looks like you have an old version of Compat installed. Try running Pkg.update(). floatmax is defined on Julia 0.6 beginning with Compat 1.1.0. I fixed the version requirements here: https://github.com/JuliaOpt/GLPKMathProgInterface.jl/pull/55.
The problem is that you are working under Julia 0.6 and floatmax is internally used by the GLPKMathProgInterface.jl package.
Possible solutions are:
Swithch to Julia 1.0 (recommended)
Install an older version of GLPKMathProgInterface.jl before it was ported to Julia 1.0; release v0.4.2 should be ok
Manually add the following definition in the source file GLPKMathProgInterface.jl before include section:
floatmax(::Type{Float64}) = prevfloat(Float64(Inf))
(I have not run it as I do not have Julia 0.6 any more, but it should work; the risk is that even if you fix this some more fixes like this might be needed - so option 3 is not really recommended, but it might work so I am giving it)
Related
My goal is to analyse simple point patterns on linear networks with respect to Euclidean distance instead of shortest-path distance implemented in linearK and related functions of spatstat and its sub packages. Browsing through the web I found the promising named function linearKEuclid() and related functions here.
Unfortunately, I could not bring those functions to live on my Win machine, e.g. I run in errors like this
Error in xysegMcircle(Y$x, Y$y, D, df$x0, df$y0, df$x1, df$y1) :
object 'C_circMseg' not found
or
Error in tapply(stuff$sinalpha, list(ii, jj), harmonicsum) :
object 'harmonicsum' not found
There is always something missing. For me, this means simply copying missing functions from the web, if available, does not help.
Probably, a reason for this is that the functions are merely written for internal purposes and under internal development, see, for instance, here under "Details".
However, I am hoping for some recommendation making the fascinating code around linearKEuclid() runnable on my machine. Maybe, there are some chances that someone draws my attention to a downloadable developer version or something comparable. Many thanks in advance!
I understand your confusion and it is unnecessarily complicated to get this to work at the moment since problems with another package on CRAN prevents spatstat and subpackages to be updated at the moment. Indeed you need to install a development version of spatstat.linnet and its dependencies. This is most easily done if you have the package remotes installed (and necessary tools to compile packages from source which would be RTools on Windows):
First run (in sequence):
remotes::install_github("spatstat/spatstat.random")
remotes::install_github("spatstat/spatstat.sparse")
remotes::install_github("baddstats/spatstat.explore")
remotes::install_github("baddstats/spatstat.model")
remotes::install_github("spatstat/spatstat.linnet")
Now the function should work (you may have to restart R if an old version of spatstat.linnet was already loaded when you updated). Try e.g. the example from the help file:
library(spatstat.linnet)
X <- rpoislpp(5, simplenet)
K <- linearKEuclid(X)
I used Julia 1.7
The command
dfc = DataFrame(XLSX.readtable("data.xlsx","sheet1")...) worked good
After migrating to Julia 1.8 the same command stopped working and generated the following error message:
ERROR: MethodError: no method matching iterate(::XLSX.DataTable)
Closest candidates are:
iterate(!Matched::Union{LinRange, StepRangeLen}) at range.jl:872
iterate(!Matched::Union{LinRange, StepRangeLen}, !Matched::Integer) at range.jl:872
iterate(!Matched::T) where T<:Union{Base.KeySet{<:Any, <:Dict}, Base.ValueIterator{<:Dict}} at dict.jl:712
what has changed with that command with the new release?
Looking forward to some information
This has nothing to do with the Julia version you are using, and everything with the XLSX.jl version you are using. The XLSX documentation actually has a while section devoted to this here. The relevant bit for you is that readtable now returns a Tables.jl compatible table and so can passed into the DataFrame constructor directly, so instead of
DataFrame(XLSX.readtable(myfile, sheet)...)
You do
DataFrame(XLSX.readtable(myfile, sheet))
(note the lack of the splatting operator)
Note that these kinds of issues are expected when you move between breaking releases of a package according to Semver, so either between major releases (version 1.x to version 2.x) or between minor releases pre 1.0 (eg 0.5.x to 0.6.x). If you want to avoid these issues you should work with project specific environments so that the Manifest records the versions of all packages you are using and they don't change unless you manually do ] up for that specific environment.
On a new computer I was trying to run Unfold and UnfoldMakie. See this error in both cases.
Like something wrong with the MutableArithmetics library.
Any idea how to manage it?
Also get this after update of MakieCore package:
Versions:
Julia 1.8.0.
Unfold v0.3.11
UnfoldMakie v0.1.4
It seems as a solution:
These packages work in the julia envv1.7, but do not work in v1.8.
In VScode you can change it here:
Finally figured out the problem:
First, I created a new environment/project.
https://pkgdocs.julialang.org/v1/environments/
Second, activated it in the notebook.
Third, installed problematic libraries through this code:
import Pkg
p = "Unfold"
Pkg.add(p)
Pkg.build(p)
I have a problem with using packages in Julia. It has worked before, and I'm not really sure why this has changed or how to troubleshoot.
I have a folder
/my_path/julia/packages
with Julia packages. For example, there is a folder
/my_path/julia/packages/FFTW/
with the FFTW package.
Further, I have changed the depot path to point at this directory by assigning JULIA_DEPOT_PATH before starting julia, so that
Base.DEPOT_PATH = ["/my_path/julia/"]
However, if I run
julia> using FFTW
I get the following error message:
ERROR: ArgumentError: Package FFTW not found in current path:
- Run `import Pkg; Pkg.add("FFTW")` to install the FFTW package.
Any idea how I can troubleshoot or fix this?
Manipulating Base.DEPOT_PATH does not seem like a good idea.
The code proposed by #cmc will does not work (at least on Julia 1.3.1):
julia> Base.DEPOT_PATH = ["/some/path"]
ERROR: cannot assign variables in other modules
There is a workaround:
Base.DEPOT_PATH[1] = "/some/path"
However, the correct way is to assign the JULIA_DEPOT_PATH system variable before starting Julia, Windows:
set JULIA_DEPOT_PATH=c:\some\path
or
set JULIA_DEPOT_PATH=c:\some\path1;c:\some\path2
Linux/OSX:
export JULIA_DEPOT_PATH=/some/path
or
export JULIA_DEPOT_PATH=/some/path1:/some/path2
Unless you have a specific reason to do so (and if this is the case I'd be interested to hear it!), you don't need to fiddle with the DEPOT_PATH or LOAD_PATH variables: using Julia's package manager should be enough to cover your needs most of the time.
In this specific instance, have you tried to do what the error message suggests?
julia> import Pkg
julia> Pkg.add("FFTW")
LOAD_PATH, not DEPOT_PATH, will modify code loading.
You want to do something like push!(LOAD_PATH, /my_path/julia/packages).
I will echo #ffevotte and strongly suggest to not modify LOAD_PATH unless necessary. The benefits of organizing dependencies into Pkg environments far outweigh the small overhead of declaring them explicitly through Pkg.add.
I'm new here.
I've the same matter as this one but only using QtOctave; beside oct2mat pkg hasn't never been loaded on my pc.
Typing:
pkg unload oct2mat
octave returns:
error: package oct2mat is not installed
error: \share\octave\3.6.2\m\pkg\pkg.m at line 2170, column 9
Using plot function directly in Octave it works properly, very stange!
Can enybody help me?
Thanks in advance.
Addendum to #vinukn's answer, as it might be too cryptic.
Try this:
>>> graphics_toolkit
ans = fltk
>>> agts = available_graphics_toolkits
agts =
{
[1,1] = fltk
[1,2] = gnuplot
}
>>> graphics_toolkit(agts{2}) % This sets the graphics toolkit.
>>> plot([1 2 3 4])
That is, the default was FLTK, and I've set Gnuplot. Try each, they look slightly different to each other.
This is on my default installation of Octave 3.6.2 on Windows Vista, with QtOctave. (I've tried the most recent build of Octave, with built-in GUI, but after starting it never drew in its windows, so it was unusable at this stage, which is a shame as there are probably a handful of lines of code that need to be changed to make it work... Will wait until that is fixed. In the meantime, Gnuplot doesn't freeze.)
Also, here is a list of keys to use in the Gnuplot window. Especially note:
Right-click to draw a zoom box.
a to autoscale (back to default zoom).
p to go back to the most recent previous zoom.
Don't use QtOctave. It has been deprecated for a reason. See the GUI section in Octave FAQ to understand why the GUI doesn't work. It is specially true for things such as plots and dialog windows.
Take special note on the fact that QtOctave and others are specially sensitive to new versions of Octave. You are using Octave 3.6.2 while QtOctave was abandoned back in 3.2.X. Your options are (by order of what I recommend):
use Octave on its own, no QtOctave;
build from development sources to use the experimental GUI;
fix QtOctave (I actually don't recommend this one at all. Its website has been closed, and it would be too much work which would be better spent helping the Octave developers with the native GUI);
Actually,the reason behind this problem is default graphics toolkit fltk or qt. Qtoctave works with pipe, fltk does nt support pipe, ie fltk works inside octave. Pipe does nt support both text and image(gui) same time. The solution is change default toolkit to gnuplot.