forked from zufuliu/notepad4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Julia.jl
1920 lines (1768 loc) · 46.4 KB
/
Julia.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# https://julialang.org/
# 1.9 https://docs.julialang.org/
#! Keywords ===========================================================
# https://docs.julialang.org/en/v1/base/base/#Keywords-1
break
catch const continue
export
finally
global
else elseif
import in isa
local
outer
return
using
var
where
# reserved two-word sequences
abstract type
end
mutable struct
end
primitive type
end
#! Constant
ans
true
false
#! code folding ===========================================================
baremodule
end
begin
end
do
end
for
end
function
end
if
end
let
end
macro
end
module
end
quote
end
struct
end
try
end
while
end
#! Core ===========================================================
# https://docs.julialang.org/en/v1/base/base/
module Core
@kwdef
isa(x, type) -> Bool
ifelse(condition::Bool, x, y)
typeassert(x, type)
typeof(x)
tuple(xs...)
getfield(value, name::Symbol)
setfield!(value, name::Symbol, x)
isdefined(m::Module, s::Symbol)
# Memory layout
fieldtype(T, name::Symbol | index::Int)
# Special Types
Any
DataType
Union{Types...}
Union{}
UnionAll
Tuple{Types...}
Type
TypeVar
NTuple{N,T}
NamedTuple
Vararg{T,N}
Nothing
const nothing
const Cvoid
Expr(head::Symbol, args...)
QuoteNode
LineNumberNode
GlobalRef
Symbol
Symbol(x...) -> Symbol
Module
# Generic Functions
Function
Method
WeakRef
VecElement
applicable(f, args...) -> Bool
invoke(f, argtypes::Type, args...; kwargs...)
# Syntax
eval(m::Module, expr)
# Errors
Exception
throw(e)
# Reflection
nfields(x) -> Int
end
module Base
# functions marked as keyword in the document
new()
ccall((function_name, library), returntype, (argtype1, ...), argvalue1, ...)
# others
include([m::Module,] path::AbstractString)
nameof(t::DataType) -> Symbol
sizeof(T::DataType)
error(message::AbstractString)
rethrow([e])
signed(x)
unsigned(x) -> Unsigned
float(x)
complex(r, [i])
string(n::Integer; base::Integer = 10, pad::Integer = 1)
show(x)
print([io::IO], xs...)
println([io::IO], xs...)
repr(mime, x; context=nothing)
end
module Main end
#! Modules ===========================================================
# https://docs.julialang.org/en/v1/base/base/
module Base
exit(code=0)
atexit(f)
isinteractive() -> Bool
summarysize(obj; exclude=Union{...}, chargeall=Union{...}) -> Int
require(into::Module, module::Symbol)
compilecache(module::PkgId)
__precompile__(isprecompilable::Bool)
include_string(m::Module, code::AbstractString, filename::AbstractString="string")
include_dependency(path::AbstractString)
which(f, types)
methods(f, [types])
@show
isequal(x, y)
isless(x, y)
ntuple(f::Function, n::Integer)
objectid(x)
hash(x[, h::UInt])
finalizer(f, x)
finalize(x)
copy(x)
deepcopy(x)
getproperty(value, name::Symbol)
setproperty!(value, name::Symbol, x)
propertynames(x, private=false)
hasproperty(x, s::Symbol)
@isdefined s -> Bool
convert(T, x)
promote(xs...)
oftype(x, y)
widen(x)
identity(x)
# Properties of Types
supertype(T::DataType)
typejoin(T, S)
typeintersect(T, S)
promote_type(type1, type2)
promote_rule(type1, type2)
isdispatchtuple(T)
# Declared structure
isimmutable(v) -> Bool
isabstracttype(T)
isprimitivetype(T) -> Bool
isstructtype(T) -> Bool
fieldnames(x::DataType)
fieldname(x::DataType, i::Integer)
hasfield(T::Type, name::Symbol)
# Memory layout
isconcretetype(T)
isbits(x)
isbitstype(T)
fieldtypes(T::Type)
fieldcount(t::Type)
fieldoffset(type, i)
datatype_alignment(dt::DataType) -> Int
datatype_haspadding(dt::DataType) -> Bool
datatype_pointerfree(dt::DataType) -> Bool
# Special values
typemin(T)
typemax(T)
floatmin(T)
floatmax(T)
maxintfloat(T=Float64)
eps(::Type{T}) where T<:AbstractFloat
instances(T::Type)
# Special Types
Val{c}()
isnothing(x)
Some{T}
something(x, y...)
Enum{T<:Integer}
@enum EnumName[::BaseType] value1[=x] value2[=y]
# Generic Functions
hasmethod(f, t::Type{<:Tuple}[, kwnames]; world=typemax(UInt)) -> Bool
invokelatest(f, args...; kwargs...)
# Syntax
@eval [mod,] ex
evalfile(path::AbstractString, args::Vector{String}=String[])
esc(e)
@inbounds(blk)
@boundscheck(blk)
@propagate_inbounds
@inline
@noinline
@nospecialize
@specialize
gensym([tag])
@gensym
@goto name
@label name
@polly
@generated f
@pure ex
@deprecate old new [ex=true]
# Missing Values
Missing
const missing = Missing()
coalesce(x, y...)
ismissing(x)
skipmissing(itr)
# System
run(command, args...; wait::Bool = true)
const devnull
success(command)
process_running(p::Process)
process_exited(p::Process)
kill(p::Process, signum=SIGTERM)
ignorestatus(command)
detach(command)
Cmd(cmd::Cmd; ignorestatus, detach, windows_verbatim, windows_hide, env, dir)
setenv(command::Cmd, env; dir="")
withenv(f::Function, kv::Pair...)
pipeline(from, to, ...)
time_ns()
@time
@timev
@timed
@elapsed
@allocated
EnvDict() -> EnvDict
const ENV
@static
# Versioning
VersionNumber
# Events
Timer(callback::Function, delay; interval = 0)
AsyncCondition()
# Reflection
parentmodule(m::Module) -> Module
pathof(m::Module)
moduleroot(m::Module) -> Module
@__MODULE__ -> Module
fullname(m::Module)
names(x::Module; all::Bool = false, imported::Bool = false)
isconst(m::Module, s::Symbol) -> Bool
functionloc(f::Function, types)
# Internals
macroexpand(m::Module, x; recursive=true)
@macroexpand
@macroexpand1
code_lowered(f, types; generated=true, debuginfo=:default)
code_typed(f, types; optimize=true, debuginfo=:default)
precompile(f, args::Tuple{Vararg{Any}})
module Docs
end
module Meta
# Internals
lower(m, x)
@lower [m] x
parse(str, start; greedy=true, raise=true, depwarn=true)
@dump expr
end
module Sys
# System
set_process_title(title::AbstractString)
get_process_title()
end
module Threads
end
module GC
# Internals
gc()
enable(on::Bool)
@preserve x1 x2 ... xn expr
end
end
# Errors
# https://docs.julialang.org/en/v1/base/base/#Errors-1
module Core
ArgumentError(msg)
AssertionError([msg])
BoundsError([a],[i])
DivideError()
DomainError(val)
ErrorException(msg)
InexactError(name::Symbol, T, val)
InterruptException()
LoadError(file::AbstractString, line::Int, error)
MethodError(f, args)
OutOfMemoryError()
ReadOnlyMemoryError()
OverflowError(msg)
StackOverflowError()
SegmentationFault
TypeError(func::Symbol, context::AbstractString, expected::Type, got)
UndefKeywordError(var::Symbol)
UndefRefError()
UndefVarError(var::Symbol)
InitError(mod::Symbol, error)
end
module Base
backtrace()
catch_backtrace()
catch_stack(task=current_task(); [inclue_bt=true])
@assert cond [text]
CapturedException
CompositeException
DimensionMismatch([msg])
EOFError()
InvalidStateException
KeyError(key)
MissingException(msg)
ProcessFailedException
SystemError(prefix::AbstractString, [errno::Int32])
StringIndexError(str, i)
retry(f; delays=ExponentialBackOff(), check=nothing) -> Function
ExponentialBackOff(; n=1, first_delay=0.05, max_delay=10.0, factor=5.0, jitter=0.1)
end
# Collections and Data Structures
# https://docs.julialang.org/en/v1/base/collections/
module Base
iterate(iter [, state]) -> Union{Nothing, Tuple{Any, Any}}
IteratorSize(itertype::Type) -> IteratorSize
IteratorEltype(itertype::Type) -> IteratorEltype
# Constructors and Types
AbstractRange{T}
OrdinalRange{T, S} <: AbstractRange{T}
AbstractUnitRange{T} <: OrdinalRange{T, T}
StepRange{T, S} <: OrdinalRange{T, S}
UnitRange{T<:Real}
LinRange{T}
# General Collections
isempty(collection) -> Bool
empty!(collection) -> collection
length(collection) -> Integer
# Iterable Collections
in(item, collection) -> Bool
eltype(type)
indexin(a, b)
unique(itr)
unique!(f, A::AbstractVector)
allunique(itr) -> Bool
reduce(op, itr; [init])
foldl(op, itr; [init])
foldr(op, itr; [init])
maximum(f, itr)
maximum!(r, A)
minimum(f, itr)
minimum!(r, A)
extrema(itr) -> Tuple
argmax(itr) -> Integer
argmin(itr) -> Integer
findmax(itr) -> (x, index)
findmin(itr) -> (x, index)
findmax!(rval, rind, A) -> (maxval, index)
findmin!(rval, rind, A) -> (minval, index)
sum(f, itr)
sum!(r, A)
prod(f, itr)
prod!(r, A)
any(itr) -> Bool
any!(r, A)
all!(r, A)
count(p, itr) -> Integer
any(p, itr) -> Bool
all(p, itr) -> Bool
foreach(f, c...) -> Nothing
map(f, c...) -> collection
map!(function, destination, collection...)
mapreduce(f, op, itrs...; [init])
mapfoldl(f, op, itr; [init])
mapfoldr(f, op, itr; [init])
first(coll)
last(coll)
front(x::Tuple)::Tuple
tail(x::Tuple)::Tuple
step(r)
collect(collection)
filter(f, a::AbstractArray)
filter!(f, a::AbstractVector)
replace(A, old_new::Pair...; [count::Integer])
replace!(A, old_new::Pair...; [count::Integer])
# Indexable Collections
getindex(collection, key...)
setindex!(collection, value, key...)
firstindex(collection) -> Integer
lastindex(collection) -> Integer
# Dictionaries
AbstractDict{K, V}
Dict([itr])
IdDict([itr])
WeakKeyDict([itr])
ImmutableDict(KV::Pair)
haskey(collection, key) -> Bool
get(collection, key, default)
get!(collection, key, default)
getkey(collection, key, default)
delete!(collection, key)
pop!(collection, key[, default])
keys(iterator)
values(iterator)
pairs(collection)
merge(d::AbstractDict, others::AbstractDict...)
merge!(d::AbstractDict, others::AbstractDict...)
sizehint!(s, n)
keytype(T::Type{<:AbstractArray})
valtype(T::Type{<:AbstractArray})
# Set-Like Collections
AbstractSet{T}
Set([itr])
BitSet([itr])
union(s, itrs...)
union!(s::Union{AbstractSet,AbstractVector}, itrs...)
intersect(s, itrs...)
setdiff(s, itrs...)
symdiff(s, itrs...)
intersect!(s::Union{AbstractSet,AbstractVector}, itrs...)
issubset(a, b)
issetequal(a, b)
# Dequeues
push!(collection, items...) -> collection
pop!(collection) -> item
pushfirst!(collection, items...) -> collection
popfirst!(collection) -> item
insert!(a::Vector, index::Integer, item)
deleteat!(a::Vector, i::Integer)
splice!(a::Vector, index::Integer, [replacement]) -> item
resize!(a::Vector, n::Integer) -> Vector
append!(collection, collection2) -> collection.
prepend!(a::Vector, items) -> collection
# Utility Collections
Pair(x, y)
end
# Mathematics
# https://docs.julialang.org/en/v1/base/math/
module Base
fma(x, y, z)
muladd(x, y, z)
inv(x)
div(x, y)
fld(x, y)
cld(x, y)
mod(x, y)
rem(x, y, RoundDown)
divrem(x, y)
fldmod(x, y)
mod1(x, y)
fldmod1(x, y)
rationalize([T<:Integer=Int,] x; tol::Real=eps(x))
numerator(x)
denominator(x)
range(start[, stop]; length, stop, step=1)
OneTo(n)
StepRangeLen{T,R,S}(ref::R, step::S, len, [offset=1]) where {T,R,S}
cmp(x,y)
xor(x, y)
# Mathematical Functions
isapprox(x, y; rtol::Real=atol>0 ? 0 : √eps, atol::Real=0, nans::Bool=false, norm::Function)
sin(x)
cos(x)
tan(x)
sinh(x)
cosh(x)
tanh(x)
asin(x)
acos(x)
atan(y)
asinh(x)
acosh(x)
atanh(x)
log(x)
log2(x)
log10(x)
log1p(x)
exp(x)
exp2(x)
exp10(x)
expm1(x)
round([T,] x, [r::RoundingMode])
ceil([T,] x)
floor([T,] x)
trunc([T,] x)
unsafe_trunc(T, x)
min(x, y, ...)
abs(x)
abs2(x)
copysign(x, y) -> z
sign(x)
signbit(x)
flipsign(x, y)
sqrt(x)
isqrt(n::Integer)
real(z)
imag(z)
reim(z)
conj(z)
angle(z)
cis(z)
binomial(n::Integer, k::Integer)
factorial(n::Integer)
gcd(x,y)
lcm(x,y)
gcdx(x,y)
ispow2(n::Integer) -> Bool
nextpow(a, x)
prevpow(a, x)
nextprod([k_1, k_2,...], n)
invmod(x,m)
powermod(x::Integer, p::Integer, m)
ndigits(n::Integer; base::Integer=10, pad::Integer=1)
widemul(x, y)
module FastMath
@fastmath expr
end
end
module Base.Math
rem2pi(x, r::RoundingMode)
mod2pi(x)
# Mathematical Functions
sincos(x)
sind(x)
cosd(x)
tand(x)
sinpi(x)
cospi(x)
asind(x)
acosd(x)
atand(y)
atand(y,x)
sec(x)
csc(x)
cot(x)
secd(x)
cscd(x)
cotd(x)
asec(x)
acsc(x)
acot(x)
asecd(x)
acscd(x)
acotd(x)
sech(x)
csch(x)
coth(x)
asech(x)
acsch(x)
acoth(x)
sinc(x)
cosc(x)
cosc(x)
deg2rad(x)
rad2deg(x)
hypot(x, y)
frexp(val)
ldexp(x, n)
modf(x)
clamp(x, lo, hi)
clamp!(array::AbstractArray, lo, hi)
cbrt(x::Real)
@evalpoly(z, c...)
end
module Base.Checked
checked_abs(x)
checked_neg(x)
checked_add(x, y)
checked_sub(x, y)
checked_mul(x, y)
checked_div(x, y)
checked_rem(x, y)
checked_fld(x, y)
checked_mod(x, y)
checked_cld(x, y)
add_with_overflow(x, y) -> (r, f)
sub_with_overflow(x, y) -> (r, f)
mul_with_overflow(x, y) -> (r, f)
end
# Numbers
# https://docs.julialang.org/en/v1/base/numbers/
module Core
# Standard Numeric Types
Number
Real <: Number
AbstractFloat <: Real
Integer <: Real
Signed <: Integer
Int
Unsigned <: Integer
UInt
AbstractIrrational <: Real
# Concrete number types
Float16 <: AbstractFloat
Float32 <: AbstractFloat
Float64 <: AbstractFloat
Bool <: Integer
Int8 <: Signed
UInt8 <: Unsigned
Int16 <: Signed
UInt16 <: Unsigned
Int32 <: Signed
UInt32 <: Unsigned
Int64 <: Signed
UInt64 <: Unsigned
Int128 <: Signed
UInt128 <: Unsigned
end
module Base
# Concrete number types
Complex{T<:Real} <: Number
ComplexF64
ComplexF32
ComplexF16
Rational{T<:Integer} <: Real
Irrational{sym} <: AbstractIrrational
module MPFR
BigFloat <: AbstractFloat
BigInt <: Signed
end
# Data Formats
digits([T<:Integer], n::Integer; base::T = 10, pad::Integer = 1)
digits!(array, n::Integer; base::Integer = 10)
bitstring(n)
parse(type, str; base)
tryparse(type, str; base)
big(x)
module Math
significand(x)
exponent(x) -> Int
end
bswap(n)
hex2bytes(s::Union{AbstractString,AbstractVector{UInt8}})
hex2bytes!(d::AbstractVector{UInt8}, s::Union{String,AbstractVector{UInt8}})
bytes2hex(a::AbstractArray{UInt8}) -> String
# General Number Functions and Constants
one(x)
oneunit(x::T)
zero(x)
const im
const Inf
const Inf64
const Inf32
const Inf16
const NaN
const NaN64
const NaN32
const NaN16
module MathConstants
const pi
const catalan
const eulergamma
const golden
const catalan
end
issubnormal(f) -> Bool
isfinite(f) -> Bool
isinf(f) -> Bool
isnan(f) -> Bool
iszero(x)
isone(x)
nextfloat(x::AbstractFloat, n::Integer)
prevfloat(x::AbstractFloat, n::Integer)
isinteger(x) -> Bool
isreal(x) -> Bool
module Rounding
RoundingMode
const RoundNearest
const RoundNearestTiesAway
const RoundNearestTiesUp
const RoundToZero
const RoundFromZero
const RoundUp
const RoundDown
rounding(T)
setrounding(T, mode)
get_zero_subnormals() -> Bool
set_zero_subnormals(yes::Bool) -> Bool
end
# Integers
count_ones(x::Integer) -> Integer
count_zeros(x::Integer) -> Integer
leading_zeros(x::Integer) -> Integer
leading_ones(x::Integer) -> Integer
trailing_zeros(x::Integer) -> Integer
trailing_ones(x::Integer) -> Integer
isodd(x::Integer) -> Bool
iseven(x::Integer) -> Bool
# BigFloats and BigInts
precision(num::AbstractFloat)
end
# Strings
# https://docs.julialang.org/en/v1/base/strings/
module Core
AbstractChar
Char(c::Union{Number,AbstractChar})
AbstractString
String(s::AbstractString)
IO
end
module Base
codepoint(c::AbstractChar) -> Integer
length(s::AbstractString) -> Int
repeat(s::AbstractString, r::Integer)
repr(x; context=nothing)
SubString(s::AbstractString, i::Integer, j::Integer=lastindex(s))
transcode(T, src)
unsafe_string(p::Ptr{UInt8}, [length::Integer])
ncodeunits(s::AbstractString) -> Int
codeunit(s::AbstractString) -> Type{<:Union{UInt8, UInt16, UInt32}}
codeunits(s::AbstractString)
ascii(s::AbstractString)
Regex
RegexMatch
SubstitutionString(substr)
isvalid(value) -> Bool
match(r::Regex, s::AbstractString[, idx::Integer[, addopts]])
eachmatch(r::Regex, s::AbstractString; overlap::Bool=false)
isless(a::AbstractString, b::AbstractString) -> Bool
cmp(a::AbstractString, b::AbstractString) -> Int
lpad(s, n::Integer, p::Union{AbstractChar,AbstractString}=' ') -> String
rpad(s, n::Integer, p::Union{AbstractChar,AbstractString}=' ') -> String
findfirst(pattern::AbstractString, string::AbstractString)
findnext(pattern::AbstractString, string::AbstractString, start::Integer)
findlast(pattern::AbstractString, string::AbstractString)
findprev(pattern::AbstractString, string::AbstractString, start::Integer)
occursin(needle::Union{AbstractString,Regex,AbstractChar}, haystack::AbstractString)
reverse(s::AbstractString) -> AbstractString
replace(s::AbstractString, pat=>r; [count::Integer])
split(str::AbstractString, dlm; limit::Integer=0, keepempty::Bool=true)
rsplit(s::AbstractString; limit::Integer=0, keepempty::Bool=false)
strip([pred=isspace,] str::AbstractString)
lstrip([pred=isspace,] str::AbstractString)
rstrip([pred=isspace,] str::AbstractString)
startswith(s::AbstractString, prefix::AbstractString)
endswith(s::AbstractString, suffix::AbstractString)
first(s::AbstractString, n::Integer)
last(s::AbstractString, n::Integer)
module Unicode
uppercase(s::AbstractString)
lowercase(s::AbstractString)
titlecase(s::AbstractString; [wordsep::Function], strict::Bool=true) -> String
uppercasefirst(s::AbstractString) -> String
lowercasefirst(s::AbstractString)
textwidth(c)
iscntrl(c::AbstractChar) -> Bool
isdigit(c::AbstractChar) -> Bool
isletter(c::AbstractChar) -> Bool
islowercase(c::AbstractChar) -> Bool
isnumeric(c::AbstractChar) -> Bool
isprint(c::AbstractChar) -> Bool
ispunct(c::AbstractChar) -> Bool
isspace(c::AbstractChar) -> Bool
isuppercase(c::AbstractChar) -> Bool
isxdigit(c::AbstractChar) -> Bool
end
join([io::IO,] strings, delim, [last])
chop(s::AbstractString; head::Integer = 0, tail::Integer = 1)
chomp(s::AbstractString)
thisind(s::AbstractString, i::Integer) -> Int
nextind(str::AbstractString, i::Integer, n::Integer=1) -> Int
prevind(str::AbstractString, i::Integer, n::Integer=1) -> Int
isascii(c::Union{AbstractChar,AbstractString}) -> Bool
escape_string(str::AbstractString[, esc])::AbstractString
unescape_string(str::AbstractString)::AbstractString
end
# Arrays
# https://docs.julialang.org/en/v1/base/arrays/
module Core
# Constructors and Types
AbstractArray{T,N}
DenseArray
Array{T,N} <: AbstractArray{T,N}
UndefInitializer
const undef
end
module Base
# Constructors and Types
AbstractVector{T}
AbstractMatrix{T}
AbstractVecOrMat{T}
Vector{T} <: AbstractVector{T}
Matrix{T} <: AbstractMatrix{T}
VecOrMat{T}
DenseVector{T}
DenseMatrix{T}
DenseVecOrMat{T}
StridedArray{T, N}
StridedVector{T}
SubArray
StridedMatrix{T}
StridedVecOrMat{T}
getindex(type[, elements...])
zeros([T=Float64,] dims...)
ones([T=Float64,] dims...)
BitArray{N} <: AbstractArray{Bool, N}
BitVector
BitMatrix
trues(dims)
falses(dims)
fill(x, dims)
fill!(A, x)
similar(array, [element_type=eltype(array)], [dims=size(array)])
similar(storagetype, axes)
# Basic functions
ndims(A::AbstractArray) -> Integer
size(A::AbstractArray, [dim])
axes(A)
axes(A, d)
length(A::AbstractArray)
eachindex(A...)
IndexStyle(A)
IndexLinear()
IndexCartesian()
conj!(A)
stride(A, k::Integer)
strides(A)
# Broadcast and vectorization
module Broadcast
broadcast(f, As...)
broadcast!(f, dest, As...)
BroadcastStyle
AbstractArrayStyle{N} <: BroadcastStyle
ArrayStyle{MyArrayType}()
DefaultArrayStyle{N}()
broadcastable(x)
combine_axes(As...) -> Tuple
combine_styles(cs...) -> BroadcastStyle
result_style(s1::BroadcastStyle[, s2::BroadcastStyle]) -> BroadcastStyle
end
getindex(A, inds...)
setindex!(A, X, inds...)
copyto!(dest, Rdest::CartesianIndices, src, Rsrc::CartesianIndices) -> dest
isassigned(array, i) -> Bool
Colon()
module IteratorsMD
CartesianIndex(i, j, k...) -> I
CartesianIndex((i, j, k...)) -> I
CartesianIndices(sz::Dims) -> R
CartesianIndices((istart:istop, jstart:jstop, ...)) -> R
end
Dims{N}
LinearIndices(A::AbstractArray)
to_indices(A, I::Tuple)
checkbounds(Bool, A, I...)
checkindex(Bool, inds::AbstractUnitRange, index)
# Views (SubArrays and other view types)
view(A, inds...)
@view A[inds...]
@views expression
parent(A)
parentindices(A)
selectdim(A, d::Integer, i)
reinterpret(type, A)
reshape(A, dims...) -> AbstractArray
dropdims(A; dims)
vec(a::AbstractArray) -> AbstractVector
# Concatenation and permutation
cat(A...; dims=dims)
vcat(A...)
hcat(A...)
hvcat(rows::Tuple{Vararg{Int}}, values...)
vect(X...)
circshift(A, shifts)
circshift!(dest, src, shifts)
circcopy!(dest, src)
findall(A)
findall(f::Function, A)
findfirst(A)
findlast(A)
findnext(A, i)
findprev(A, i)
permutedims(A::AbstractArray, perm)
permutedims!(dest, src, perm)
PermutedDimsArray(A, perm) -> B
promote_shape(s1, s2)
# Array functions
accumulate(op, A; dims::Integer, [init])
accumulate!(op, B, A; [dims], [init])
cumprod(A; dims::Integer)
cumprod!(B, A; dims::Integer)
cumsum(A; dims::Integer)
cumsum!(B, A; dims::Integer)
diff(A::AbstractVector)
repeat(A::AbstractArray, counts::Integer...)
rot180(A)
rotl90(A)
rotr90(A)
mapslices(f, A; dims)
# Combinatorics
invperm(v)
isperm(v) -> Bool
permute!(v, p)
reverse(v [, start=1 [, stop=length(v) ]] )
reverseind(v, i)
reverse!(v [, start=1 [, stop=length(v) ]]) -> v
end
# Tasks