{{ message }}

Instantly share code, notes, and snippets.

# Jack Dunn JackDunnNZ

Created Aug 23, 2022
View 2.0.13.orig.f
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
 c c newGLMnet (5/12/14) c c c Elastic net with squared-error loss c c dense predictor matrix: c c call elnet(ka,parm,no,ni,x,y,w,jd,vp,cl,ne,nx,nlam,flmin,ulam,thr,isd, c intr,maxit,lmu,a0,ca,ia,nin,rsq,alm,nlp,jerr)
Created Dec 3, 2020
View glmnet.diff
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
 --- /Users/jack/Downloads/glm/glmnet5dpclean.f.txt +++ /Users/jack/Downloads/glm/glmnet5.f90.txt @@ -1,9 +1,6 @@ - mortran 2.0 (version of 7/04/75 mod 7/4/87 (ajc)) - subroutine get_int_parms(sml,eps,big,mnlam,rsqmax,pmin,exmx,itrace -*) - implicit double precision(a-h,o-z) - data sml0,eps0,big0,mnlam0,rsqmax0,pmin0,exmx0,itrace0 /1.0d-5,1. -*0d-6,9.9d35,5,0.999,1.0d-9,250.0,0/ + subroutine get_int_parms(sml,eps,big,mnlam,rsqmax,pmin,exmx)
Created Nov 2, 2016
Gurobi 7.0 solution pool proof of concept via Gurobi.jl
View test.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
 using Gurobi, JuMP # New versions of getvalue, getobjectivevalue for solution pool "Get the variable values for the solnumberth solution in the pool" function grb_get_xn(m::JuMP.Model, solnumber::Int) g = getrawsolver(m) Gurobi.set_int_param!(g, "SolutionNumber", solnumber - 1) Gurobi.get_dblattrarray(g, "Xn", 1, Gurobi.num_vars(g)) end
Last active May 5, 2016
Example of constructing a model with OpenSolver API
View SimpleLP.bas
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
 Option Explicit Function Test() Dim Sheet as Worksheet Set Sheet = ThisWorkbook.Sheets("Sheet1") OpenSolver.ResetModel Sheet OpenSolver.SetDecisionVariables Sheet.Range("D4:F4"), Sheet OpenSolver.SetObjectiveFunctionCell Sheet.Range("H6"), Sheet OpenSolver.AddConstraint Sheet.Range("H8:H9"), RelationLE, Sheet.Range("J8:J9"), sheet:=Sheet
Created Mar 28, 2016
Userstyle to add 80-character ruler for Google Apps Script Editor. Use with Stylish
View user.css
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
 .CodeMirror-lines > div > div:last-child { width: 80ch; background-color: rgba(211,211,211, 0.2); }
Created Sep 12, 2015
Ipopt duals via .nl
View Output from wantsol=4
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
 Ipopt 3.12.0: Optimal Solution Found constraint dual value _scon[1] 22089.391601562464 _scon[2] 22089.39160156247
Last active Sep 10, 2015
Latex optimization example
View example.tex
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
 \$\begin{array}{rlllllllll} \min& \sum\limits_{j=1}^7 x_j \\ {\rm s.t.} &x_1 + & & & x_4 + & x_5 + & x_6 + & x_7 & \geq & d_1 \\ &x_1 + & x_2 & & & x_5 + & x_6 + & x_7 & \geq & d_2 \\ &x_1 + & x_2 + & x_3 & & & x_6 + & x_7 & \geq & d_3 \\ &x_1 + & x_2 + & x_3 + & x_4 + & & & x_7 & \geq & d_4 \\ &x_1 + & x_2 + & x_3 + & x_4 + & x_5 & & & \geq & d_5 \\ & & x_2 + & x_3 + & x_4 + & x_5 + & x_6 & & \geq & d_6 \\ & & & x_3 + & x_4 + & x_5 + & x_6 + & x_7 & \geq & d_7 \\ & x_j \geq 0 & & & & & & & &
Created Jul 7, 2015
Building variable range incrementally using OpenSolver API
View gist:d29684f1a97a64ccd946
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
 Sub Test() Set TestSheet = Sheets("Test") OpenSolver.ResetModel TestSheet AddVariables Range("A2"), TestSheet AddVariables Range("B3"), TestSheet End Sub Sub AddVariables(VariableRange As Range, Sheet As Worksheet) Dim CurrentVariables As Range Set CurrentVariables = OpenSolver.GetDecisionVariablesWithDefault(Sheet)
Last active Aug 29, 2015
OpenSolver API example