Skip to content

Instantly share code, notes, and snippets.

View mateuszbaran's full-sized avatar

Mateusz Baran mateuszbaran

View GitHub Profile
"""
ziptuples(a, b)
Zips tuples `a` and `b` in a fast, type-stable way. If they have different
lengths, the result is trimmed to the length of the shorter tuple.
"""
@generated function ziptuples(a::NTuple{N,Any}, b::NTuple{M,Any}) where {N,M}
ex = Expr(:tuple)
for i = 1:min(N, M)
using LinearAlgebra
using BenchmarkTools
using StaticArrays
using UnsafeArrays
function rv(ar, n)
total = 0.0
for i in 1:n
a = reshape(view(ar, (i-1)*4+1:i*4), (2,2))
total += dot(a, a)
abstract type Manifold
end
# Retraction type should be a part of the type of manifold,
# either by different concrete types or a single type with a type parameter
# that selects the retraction type.
retr(M::Manifold, v, x, t=1) = error("Not implemented")
retr!(M::Manifold, y, v, x, t=1) = error("Not implemented")
# just a reasonable default
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mateuszbaran
mateuszbaran / projekt1.md
Last active March 23, 2020 10:02
Inteligencja obliczeniowa projekt 1

Projekt 1

Projekty można realizować w parach lub samodzielnie. Każda para musi mieć unikalny w obrębie roku zestaw (zestaw danych, algorytm, optymalizowany parametr). Proszę o przesłanie list z wybranymi tematami najpóźniej do 8 marca, w przeciwnym razie 9 marca przygotuję losowy przydział tematów.

Projekty należy oddawać na własnych zajęciach 17 lub 19 marca. Nieusprawiedliwiona nieobecność będzie musiała być odrobiona przez realizację projektu poprawkowego (będzie inny temat), oddawanego pod koniec semestru.

  1. Jeden z zestawów danych:
@mateuszbaran
mateuszbaran / zajecia3.ipynb
Created March 10, 2020 09:15
Laboratorium 3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mateuszbaran
mateuszbaran / zajecia2_rozw.ipynb
Created March 10, 2020 13:52
Laboratorium 2 rozwiązania
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mateuszbaran
mateuszbaran / results.txt
Last active August 25, 2020 13:10
StaticArrays.jl PR 814 benchmarks
how to read:
* mat-mat: matrix-matrix multiplication
* mat-mat!: in-place matrix-matrix multiplication
* mat-vec: matrix-vector multiplication
* mat-vec!: in-place matrix-vector multiplication
* the number (2/4/10/16): size of matrix
* transpo/adjoint/up-tri/lo-tri etc: structure of the matrix; ident means no wrapper
julia> versioninfo()
Julia Version 1.5.0
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-9700KF CPU @ 3.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
JULIA_EDITOR = "/usr/share/code/code"