没有合适的资源?快使用搜索试试~ 我知道了~
首页Julia 1.0.0中文文档
Julia 1.0.0中文文档
2星 需积分: 14 11 下载量 14 浏览量
更新于2023-03-16
评论
收藏 3.48MB PDF 举报
整理的Julia的中文文档,希望对大家有用。整理的Julia的中文文档,希望对大家有用。整理的Julia的中文文档,希望对大家有用。整理的Julia的中文文档,希望对大家有用。整理的Julia的中文文档,希望对大家有用。整理的Julia的中文文档,希望对大家有用。整理的Julia的中文文档,希望对大家有用。整理的Julia的中文文档,希望对大家有用。
资源详情
资源评论
资源推荐
The Julia Manual
Introduction
Getting Started
Variables
Integers and Floating-Point Numbers
Mathematical Operations and Elementary Functions
Complex and Rational Numbers
Strings
Functions
Control Flow
Scope of Variables
Types
Methods
Constructors
Conversion and Promotion
Interfaces
Modules
Documentation
Metaprogramming
Multi-dimensional Arrays
Missing Values
Networking and Streams
Parallel Computing
Dates
Running External Programs
Calling C and Fortran Code
Handling Operating System Variation
Environment Variables
Embedding Julia
Profiling
Memory allocation analysis
Stack Traces
Performance Tips
Workflow Tips
Style Guide
Frequently Asked Questions
Noteworthy Differences from other Languages
Unicode Input
Getting Started
Julia installation is straightforward, whether using precompiled binaries or compiling from
source. Download and install Julia by following the instructions at
https://julialang.org/downloads/
.
The easiest way to learn and experiment with Julia is by starting an interactive session (also
known as a read-eval-print loop or "REPL") by double-clicking the Julia executable or running
julia from the command line:
To exit the interactive session, type CTRL-D (press the Control/ ^ key together with the d
key), or type exit() . When run in interactive mode, julia displays a banner and prompts
the user for input. Once the user has entered a complete expression, such as
1 + 2 , and hits
enter, the interactive session evaluates the expression and shows its value. If an expression is
entered into an interactive session with a trailing semicolon, its value is not shown. The variable
ans is bound to the value of the last evaluated expression whether it is shown or not. The
ans variable is only bound in interactive sessions, not when Julia code is run in other ways.
To evaluate expressions written in a source file
file.jl , write include("file.jl") .
To run code in a file non-interactively, you can give it as the first argument to the
julia
command:
As the example implies, the following command-line arguments to julia are interpreted as
command-line arguments to the program
script.jl , passed in the global constant ARGS .
The name of the script itself is passed in as the global
PROGRAM_FILE . Note that ARGS is also
set when a Julia expression is given using the
-e option on the command line (see the julia
help output below) but PROGRAM_FILE will be empty. For example, to just print the arguments
given to a script, you could do this:
Or you could put that code into a script and run it:
io = IOBuffer()
Base.banner(io)
banner = String(take!(io))
import Markdown
Markdown.parse("```\n\$ julia\n\n$(banner)\njulia> 1 + 2\n3\n\njulia>
ans\n3\n```")
$ julia script.jl arg1 arg2...
$ julia -e 'println(PROGRAM_FILE); for x in ARGS; println(x); end' foo bar
foo
bar
Switch Description
-v , --version
Display version information
-h , --help
Print this message
-J , --sysimage
<file>
Start up with the given system image file
-H , --home <dir> Set location of julia executable
--startup-file=
{yes\|no}
Load ~/.julia/config/startup.jl
The -- delimiter can be used to separate command-line arguments intended for the script file
from arguments intended for Julia:
Julia can be started in parallel mode with either the -p or the --machine-file options. -p
n will launch an additional n worker processes, while --machine-file file will launch a
worker for each line in file
file . The machines defined in file must be accessible via a
password-less
ssh login, with Julia installed at the same location as the current host. Each
machine definition takes the form
[count*][user@]host[:port] [bind_addr[:port]] .
user defaults to current user, port to the standard ssh port. count is the number of
workers to spawn on the node, and defaults to 1. The optional
bind-to bind_addr[:port]
specifies the IP address and port that other workers should use to connect to this worker.
If you have code that you want executed whenever Julia is run, you can put it in
~/.julia/config/startup.jl :
There are various ways to run Julia code and provide options, similar to those available for the
perl and ruby programs:
$ echo 'println(PROGRAM_FILE); for x in ARGS; println(x); end' > script.jl
$ julia script.jl foo bar
script.jl
foo
bar
$ julia --color=yes -O -- foo.jl arg1 arg2..
$ echo 'println("Greetings! 你好! 안녕하세요?")' > ~/.julia/config/startup.jl
$ julia
Greetings! 你好! 안녕하세요?
...
julia [switches] -- [programfile] [args...]
--handle-signals=
{yes\|no}
Enable or disable Julia's default signal handlers
--sysimage-
native-code=
{yes\|no}
Use native code from system image if available
--compiled-
modules={yes\|no}
Enable or disable incremental precompilation of modules
-e , --eval
<expr>
Evaluate <expr>
-E , --print
<expr>
Evaluate <expr> and display the result
-L , --load
<file>
Load <file> immediately on all processors
-p , --procs
{N\|auto }
Integer value N launches N additional local worker processes;
auto launches as many workers as the number of local CPU
threads (logical cores)
--machine-file
<file>
Run processes on hosts listed in <file>
-i Interactive mode; REPL runs and isinteractive() is true
-q , --quiet
Quiet startup: no banner, suppress REPL warnings
--banner=
{yes\|no\|auto}
Enable or disable startup banner
--color=
{yes\|no\|auto}
Enable or disable color text
--history-file=
{yes\|no}
Load or save history
--depwarn=
{yes\|no\|error}
Enable or disable syntax and method deprecation warnings
(
error turns warnings into errors)
--warn-overwrite=
{yes\|no}
Enable or disable method overwrite warnings
-C , --cpu-target
<target>
Limit usage of cpu features up to ; set to help to see the
available options
-O , --optimize=
{0,1,2,3}
Set the optimization level (default level is 2 if unspecified or 3 if
used without a level)
-g , -g <level>
Enable / Set the level of debug info generation (default level is 1 if
unspecified or 2 if used without a level)
--inline=
{yes\|no}
Control whether inlining is permitted, including overriding
@inline declarations
--check-bounds=
{yes\|no}
Emit bounds checks always or never (ignoring declarations)
--math-mode=
{ieee,fast}
Disallow or enable unsafe floating point optimizations (overrides
@fastmath declaration)
--code-coverage=
{none\|user\|all}
Count executions of source lines
--code-coverage equivalent to --code-coverage=user
--track-
allocation=
{none\|user\|all}
Count bytes allocated by each source line
--track-
allocation
equivalent to --track-allocation=user
Resources
A curated list of useful learning resources to help new users get started can be found on the
learning
page of the main Julia web site.
剩余341页未读,继续阅读
王贼臣
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
- MW全能培训汽轮机调节保安系统PPT教学课件.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论2