This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "util/HighsHash.h" | |
#include "util/HighsHashTree.h" | |
int main() { | |
std::vector<int> cliqueids = { | |
731180 , | |
730863 , | |
51467 , | |
728644 , | |
179865 , | |
109009 , |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Revise, Random | |
import JuMP, Hypatia, LinearAlgebra | |
ones3by3 = [1, sqrt(2), sqrt(2), 1, sqrt(2), sqrt(2), sqrt(2), sqrt(2), 1]; | |
m = JuMP.Model(()->Hypatia.Optimizer(rescale=false)); | |
JuMP.@constraint(m, ones(9) in JuMP.MOI.HermitianPositiveSemidefiniteConeTriangle(3)) | |
JuMP.optimize!(m); | |
@assert JuMP.backend(m).optimizer.model.optimizer.solver.model.h ≈ ones3by3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MathOptInterface | |
MOI = MathOptInterface | |
MOIF = MOI.FileFormats | |
using DelimitedFiles | |
cblib_dir = "C:\\Users\\lkape\\cblib\\cblib.zib.de\\download\\all" | |
open("cblib.csv", "w") do io | |
for s in readdir(cblib_dir) | |
dest = MOIF.Model(format = MOIF.FORMAT_CBF) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JuMP | |
import Hypatia | |
import Hypatia.PolyUtils | |
using LinearAlgebra | |
n = 2 | |
halfd = 2 | |
k = 3 # number of functions defining nonnegativity domain | |
# try good interpolation points from [-1, 1]^n: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#= | |
analyze natvsext benchmark results | |
see natvsext/README.md | |
=# | |
using Printf | |
using CSV | |
using DataFrames | |
include(joinpath(@__DIR__, "../../examples/Examples.jl")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cf https://math.stackexchange.com/questions/540361/derivative-or-differential-of-symmetric-square-root-of-a-matrix | |
using ForwardDiff | |
using LinearAlgebra | |
using GenericLinearAlgebra | |
d = 3 | |
V = randn(d, d) | |
V = Hermitian(V * V' + I) | |
W = randn(d, d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LinearAlgebra | |
import GenericLinearAlgebra | |
import ForwardDiff | |
import Random | |
Random.seed!(1) | |
d = 5 | |
rand_W = randn(d, d) | |
rand_W = rand_W * rand_W' | |
bad_W = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pkg.add(url = "https://github.com/chriscoey/Hypatia.jl") | |
import Hypatia.Cones | |
cone = Cones.MatrixEpiPerSquare{Float64, Float64}(1, 1) | |
Cones.setup_data(cone) | |
pt = Cones.set_initial_point(zeros(3), cone) | |
Cones.load_point(cone, pt) | |
Cones.is_feas(cone) | |
Cones.grad(cone) | |
Cones.correction(cone, ones(3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# script: | |
import Pkg | |
Pkg.add(url="https://github.com/lkapelevich/SegExample.jl") | |
using SegExample | |
SegExample.foo() | |
# backtrace: | |
(gdb) r | |
Starting program: /home/ptah/julia/usr/bin/julia-debug /home/ptah/.julia/dev/seg.jl | |
[Thread debugging using libthread_db enabled] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# JLD in https://drive.google.com/file/d/1ixztoXBV7qKPW6BQ8VNRPzzbj01Txw2B/view?usp=sharing | |
using JLD, ECOS, MathOptFormat, MathOptInterface | |
const MOI = MathOptInterface | |
const MOIB = MathOptInterface.Bridges | |
const MOIU = MathOptInterface.Utilities | |
model = MathOptFormat.read_from_file(joinpath(cblib_dir, "LogExpCR-n20-m400.cbf.gz")) | |
cache = MOIU.UniversalFallback(MOIU.Model{Float64}()); | |
MOI.copy_to(cache, model); |
NewerOlder