Skip to content

Instantly share code, notes, and snippets.

WARNING: Stepsize is 0.000000000000000e+00
################# qpOASES -- QP NO. 1 ##################
Iter | StepLength | Info | nFX
----------+------------------+------------------+---------
0 | 0.000000e+00 | REM BND 0 | 20
1 | 9.750226e-01 | REM BND 13 | 19
2 | 9.006699e-01 | REM BND 14 | 18
@ghorn
ghorn / gist:724f24b48dc8b9dd6105fe3bdd9b732a
Created May 9, 2018 22:27
SBV interpolation wrap stand-along example
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Data.List ( intercalate )
import qualified Data.Vector as V
import qualified Data.Vector.Storable as SV
import qualified Data.Vector.Storable.Mutable as SVM
import Data.SBV
import Data.SBV.Tools.CodeGen
@ghorn
ghorn / bug.py
Created July 5, 2017 22:25
switch dimension mismatch
from casadi import *
x = MX.sym('x')
c = MX.sym('c')
z0 = conditional(c, [0, 1], 3)
#z0 = conditional(c, [x, x], 3) # works
f = z0 + x
#f = z0 # works
@ghorn
ghorn / gist:b4a94b16c803480c6a14da21a1aae17c
Created July 5, 2017 22:24
switch dimension mismatch
from casadi import *
x = MX.sym('x')
c = MX.sym('c')
z0 = conditional(c, [0, 1], 3)
#z0 = conditional(c, [x, x], 3) # works
f = z0 + x
#f = z0 # works
# check for inequalities
for k in range(arg['lbx'].shape[0]):
lbx = arg['lbx'].cat[k]
ubx = arg['ubx'].cat[k]
if lbx == ubx:
pass
elif lbx == -np.inf and ubx == np.inf:
pass
else:
raise ValueError('x index %d is an inequality (%.3g, %.3g)' % (k, lbx, ubx))
@ghorn
ghorn / HackPlotLib.hs
Created November 15, 2015 18:32
work in progress simple matlab-like plotting API with multiple backends
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- | Some plotting utilities.
module HackPlotLib
( Plotter
-- * plotting functions
, figure, figure'
, plot, plot', plot3, plot3'
proc wall num mean mean
time time evals proc time wall time
eval_f 0.368 [s] 0.112 [s] 6 61.27 [ms] 18.62 [ms]
eval_grad_f 1.256 [s] 0.937 [s] 7 179.38 [ms] 133.85 [ms]
eval_g 0.360 [s] 0.109 [s] 6 60.02 [ms] 18.09 [ms]
eval_jac_g 5.360 [s] 5.052 [s] 8 670.00 [ms] 631.47 [ms]
eval_h 2.749 [s] 2.749 [s] 6 458.21 [ms] 458.11 [ms]
main loop 10.373 [s] 9.221 [s]
jit + serial:
proc wall num proc time wall time
time time evals per eval per eval
eval_f 0.002 [s] 0.002 [s] 15 0.10 [ms] 0.10 [ms]
eval_grad_f 0.002 [s] 0.002 [s] 16 0.11 [ms] 0.11 [ms]
eval_g 0.002 [s] 0.002 [s] 15 0.11 [ms] 0.11 [ms]
eval_jac_g 0.006 [s] 0.006 [s] 17 0.36 [ms] 0.36 [ms]
eval_h 0.306 [s] 0.306 [s] 15 20.39 [ms] 20.41 [ms]
main loop 0.329 [s] 0.330 [s]
callback function 0.000 [s] 0.000 [s]
callback preparation 0.000 [s] 0.000 [s]
cbits/autogen/casadi_wrap_classes.cpp: In function ‘casadi::CodeGenerator* casadi__CodeGenerator__CONSTRUCTOR__0(std::string**)’:
cbits/autogen/casadi_wrap_classes.cpp:1331:59:
error: use of deleted function ‘casadi::CodeGenerator::CodeGenerator(casadi::CodeGenerator&&)’
casadi::CodeGenerator ret = casadi::CodeGenerator();
^
In file included from /home/greghorn/casadi_install/include/casadi/core/core.hpp:46:0:
0,
from /home/greghorn/casadi_install/include/casadi/casadi.hpp:29,
This is Ipopt version 3.11.9, running with linear solver ma86.
Number of nonzeros in equality constraint Jacobian...: 0
Number of nonzeros in inequality constraint Jacobian.: 0
Number of nonzeros in Lagrangian Hessian.............: 786
Total number of variables............................: 109
variables with only lower bounds: 0
variables with lower and upper bounds: 0
variables with only upper bounds: 0