Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/readoperator.jl @ 803:b874c26ea7d1 operator_storage_array_of_table
Remove pad_tuple()
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 27 Jul 2021 21:35:58 +0200 |
parents | 04e549669b10 |
children | 98e0e0f3c5a8 |
comparison
equal
deleted
inserted
replaced
802:f0532b9289b7 | 803:b874c26ea7d1 |
---|---|
103 function parse_rational(str) | 103 function parse_rational(str) |
104 expr = Meta.parse(replace(str, "/"=>"//")) | 104 expr = Meta.parse(replace(str, "/"=>"//")) |
105 return eval(:(Rational($expr))) | 105 return eval(:(Rational($expr))) |
106 end | 106 end |
107 | 107 |
108 function pad_tuple(t::NTuple{N, T}, n::Integer) where {N,T} | |
109 if N >= n | |
110 return t | |
111 else | |
112 return pad_tuple((t..., zero(T)), n) | |
113 end | |
114 end | |
115 | |
116 sbp_operators_path() = (@__DIR__) * "/operators/" | 108 sbp_operators_path() = (@__DIR__) * "/operators/" |
117 export sbp_operators_path | 109 export sbp_operators_path |