This file contains hidden or 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
type Compose f g a = f (g a) | |
type Apply f a = f a | |
-- This one fails with "Compose has 3 arguments but you gave it 2". | |
-- All the others work. | |
x0 :: Apply (Compose f g) a | |
x0 = undefined | |
x1 :: (Compose f g) a | |
x1 = undefined |
This file contains hidden or 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
$ grep -n10 "std::vector<(casadi::SXElement)>" ~/casadi-2.2.0/build/swig/json/casadi.json | |
44434- "methodDocslink": "", | |
44435- "methodKind": "Normal" | |
44436- }, | |
44437- { | |
44438- "methodDocs": "", | |
44439- "methodName": "mul_no_alloc", | |
44440- "methodParams": [ | |
44441- "r.q(const).casadi::Matrix<(casadi::SXElement)>", | |
44442- "r.q(const).casadi::Matrix<(casadi::SXElement)>", |
This file contains hidden or 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
ghorn@cowabunga:~/casadi-2.2.0-rc1$ grep -r '_core' * | |
casadi/CMakeLists.txt: if(NOT "${name}" STREQUAL "casadi_core") | |
casadi/CMakeLists.txt: target_link_libraries(${name} casadi_core) | |
casadi/core/matrix/matrix.hpp:#ifdef casadi_core_implementation | |
casadi/core/matrix/generic_matrix.hpp:#ifdef casadi_core_implementation | |
casadi/core/matrix/generic_matrix.hpp:#ifdef casadi_core_implementation | |
casadi/core/matrix/submatrix.hpp:#ifdef casadi_core_implementation | |
casadi/core/matrix/nonzeros.hpp:#ifdef casadi_core_implementation | |
casadi/core/CMakeLists.txt:casadi_library(casadi_core ${CASADI_SRCS} ${RUNTIME_EMBEDDED_SRC}) | |
casadi/core/CMakeLists.txt:set_property(GLOBAL APPEND PROPERTY CASADI_SWIG_MODULES casadi_core) |
This file contains hidden or 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
{-# OPTIONS_GHC -Wall #-} | |
{-# Language DeriveGeneric #-} | |
{-# Language DeriveFunctor #-} | |
module Main where | |
import GHC.Generics ( Generic ) | |
import Data.Vector ( Vector ) | |
import qualified Data.Vector as V |
This file contains hidden or 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
from casadi import * | |
x0 = MX.sym('x',10,1); | |
u = MX.sym('u',10,1); | |
f = MXFunction([x0,u],[x0]) | |
f.setOption('name','f') | |
f.init() | |
h = MX.sym('h',1,1); |
This file contains hidden or 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
-- multiple shooting | |
data MsPoint x u a = MsPoint (x a) (u a) | |
data MsTraj x u n a = MsTraj (Vec n (MsPoint x u a)) (x a) |
This file contains hidden or 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
-- put these two files in a directory and the compile with | |
-- ghc -fforce-recomp -O2 -prof -fprof-auto-calls Woo.hs | |
-- Vectorize.hs | |
{-# OPTIONS_GHC -Wall #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Vectorize | |
( GVectorize(..) |
This file contains hidden or 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
ghorn@adler:~$ cat .xmonad/xmonad.hs | |
{-# OPTIONS_GHC -Wall #-} | |
module Main ( main ) where | |
import XMonad | |
import qualified XMonad.StackSet as SS | |
import XMonad.Util.EZConfig ( additionalKeys ) | |
import XMonad.Prompt.Shell ( shellPrompt ) | |
import XMonad.Prompt ( defaultXPConfig ) |
This file contains hidden or 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
ghorn@adler:~$ cat .xsession | |
# .xsesssion | |
# nicer looking cursor | |
xsetroot -cursor_name left_ptr | |
# background image | |
xloadimage -onroot -fullscreen ~/Dropbox/desktop_backgrounds/trex_aviators.jpg | |
# key repeat delay to 250ms, repeat rate to 35Hz |
This file contains hidden or 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
from casadi import * | |
##### lets integrate something 100 timesteps with 3 different methods ##### | |
# this is whate we want to integrate | |
def dynamics_fun(x): | |
xdot = # some complicated shit | |
return xdot | |
## 1: inline everything, standard approach to AD afaik | |
def rk4(x0, h): |