logo资料库

julia语言与并行计算ppt.pdf

第1页 / 共44页
第2页 / 共44页
第3页 / 共44页
第4页 / 共44页
第5页 / 共44页
第6页 / 共44页
第7页 / 共44页
第8页 / 共44页
资料共44页,剩余部分请下载后查看
JULIA语言与并行计算 张常有 changyou@iscas.ac.cn 张先轶 traits.zhang@gmail.com 中国科学院软件研究所并行实验室 Julia是一个新的开源的高级编程语言,提供丰富的数据类 型和精度,高效支持外部函数调用和分布式并行运行。
大纲  认识Julia  外部函数调用  并行计算  云服务平台
认识Julia  Hello world! println(“Hello world!”)  免费开源的编程语言  MIT License(2009-)  Library-Friendly:C/Fortran/…shared libraries  http://julialang.org/downloads/
两种运行模式  两种运行模式  交互式  命令行
基本程序结构  顺序结构 A = rand(5,5) B = rand(5,5) C = A + B println(“C=”, C )
基本程序结构  选择结构 x=1; y=2 if x < y println("x is less than y") elseif x > y println("x is greater than y") else println("x is equal to y") end
基本程序结构  循环结构 i=0 while i <=5 print(i+=1) end println(";") for i = 1:5 print(i) end;println(";") for i in [1,4,0] print(i) end;println(";") for s in ["foo","bar","baz"] println(s) end
预定义的整型和浮点型 Type Signed? Bits Int8 Uint8 Int16 Uint16 Int32 Uint32 Int64 Uint64 Int128 Uint128 Bool Char ✓ ✓ ✓ ✓ ✓ N/A N/A 8 8 16 16 32 32 64 64 128 128 8 32  Julia 中,类型被省略, 则可以是任意(Any) 类型。主动添加类型 说明会显著提高性能 和系统稳定性。 Type Precision Bits Float32 single Float64 double 32 64
分享到:
收藏