Show Menu
Cheatography

Programierparadigmen KIT Cheat Sheet (DRAFT) by

A CheatSheet for the CS course at KIT Karlsruhe, Germany

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Haskell Functions

map
map (+1) [1..5]
filter
filter even [1..5]
take
take
2 [-2..10]
drop
drop 1 [0,1..5]
head
head [1..5] = 1
tail
tail [1..5] = [4..5]
all
all even [2,4,6]
any
iterate
repeat
zip
zip [1..5] [5..9]
elem
elem 4 [1..5]
[(a,b) | a <- [1..5], b<-­[5..9]]
(+1) 5
=6
(\x ->4) 6
=6
(\x y ->x+y)
2 3
=5
 

Church Encoding

CTrue
\t. \f.  t
CFalse
\t. \f.  f
C2
\s. \x. s (s x)
CNot
\a.  a CFalse CTrue
CAnd
\a. \b. a a b
COr
\a. \b. a b a
CEven
\n. n not CTrue
`
 

MPI

MPI_co­mm_­siz­ze(­wrld, &out)
get size
MPI_co­mm_­ran­k(wrld, &out)
get rank
MPI_Sc­att­er(­data, amount, type, &l­ocal, , amount,..)
MPI_reduce
a0=a0+­a1+a2
MPI_al­lreduce
a0=sum(); a1=sum­()...
MPI_sc­att­erV­(data, [amoun­ts],...
Variable amounts
MPI_ga­the­rV(­data, [amoun­ts],...
Variable amounts
MPI_Re­duc­eSc­atter
Reduce to root then scatter to all
MPI_Al­ltoall
Transpose Data matrix
MPI_al­lGather
a=b=c