Julia 中文文档
简介 科学计算对性能一直有着最高的需求,但目前各领域的专家却大量使用较慢的动态语言来开展他们 的日常工作。偏爱动态语言有很多很好的理由,因此我们不会舍弃动态的特性。幸运的是,现代编 程语言设计与编译器技术可以大大消除性能折衷(trade-off),并提供有足够生产力的单一环境进行 原型设计,而且能高效地部署性能密集型应用程序。Julia 语言在这其中扮演了这样一个角色:它是 一门灵活的动态语言,适合 的运作方式后,写出和 C 一样快的代码对你而言就是小菜一碟。 Julia 拥有可选类型标注和多重派发这两个特性,同时还拥有很棒的性能。这些都得归功于使用 LLVM 实现的类型推导和即时编译(JIT)技术。Julia 是一门支持过程式、函数式和面向对象的多范式语言。 它像 R、MATLAB 和 Python 一样简单,在高级数值计算方面有丰富的表现力,并且支持通用编程。为 了实现这个目标,Julia a=b 中的 b 指的是外部作用域内的 b,而不是后续参数中的 b。 9.14. 函数参数中的 DO 结构 77 9.14 函数参数中的 Do 结构 把函数作为参数传递给其他函数是一种强大的技术,但它的语法并不总是很方便。当函数参数占据 多行时,这样的调用便特别难以编写。例如,考虑在具有多种情况的函数上调用 map: map(x->begin if x < 0 && iseven(x)0 码力 | 1238 页 | 4.59 MB | 1 年前3Julia v1.2.0 Documentation
pseudo-code might look like: function matmul(a::AbstractMatrix, b::AbstractMatrix) op = (ai, bi) -> ai * bi + ai * bi ## this is insufficient because it assumes `one(eltype(a))` is constructable: # R = that `+` calls `promote_type` ## but this is not true for some types, such as Bool: # R = promote_type(ai, bi) # this is wrong, since depending on the return value # of type-inference is very brittle (as p-norm is defined as 998 CHAPTER 81. LINEAR ALGEBRA ∥A∥p = � n � i=1 |ai|p �1/p with ai the entries of A, |ai| the norm of ai, and n the length of A. Since the p-norm is computed using the norms of0 码力 | 1250 页 | 4.29 MB | 1 年前3Julia v1.1.1 Documentation
pseudo-code might look like: function matmul(a::AbstractMatrix, b::AbstractMatrix) op = (ai, bi) -> ai * bi + ai * bi ## this is insufficient because it assumes `one(eltype(a))` is constructable: # R = that `+` calls `promote_type` ## but this is not true for some types, such as Bool: # R = promote_type(ai, bi) # this is wrong, since depending on the return value # of type-inference is very brittle (as the corresponding length. The p-norm is defined as ∥A∥p = � n � i=1 |ai|p �1/p with ai the entries of A, |ai| the norm of ai, and n the length of A. Since the p-norm is computed using the norms of0 码力 | 1216 页 | 4.21 MB | 1 年前3Julia 1.1.0 Documentation
pseudo-code might look like: function matmul(a::AbstractMatrix, b::AbstractMatrix) op = (ai, bi) -> ai * bi + ai * bi ## this is insufficient because it assumes `one(eltype(a))` is constructable: # R = that `+` calls `promote_type` ## but this is not true for some types, such as Bool: # R = promote_type(ai, bi) # this is wrong, since depending on the return value # of type-inference is very brittle (as the corresponding length. The p-norm is defined as ∥A∥p = � n � i=1 |ai|p �1/p with ai the entries of A, |ai| the norm of ai, and n the length of A. Since the p-norm is computed using the norms of0 码力 | 1214 页 | 4.21 MB | 1 年前3Julia 1.2.0 DEV Documentation
pseudo-code might look like: function matmul(a::AbstractMatrix, b::AbstractMatrix) op = (ai, bi) -> ai * bi + ai * bi ## this is insufficient because it assumes `one(eltype(a))` is constructable: # R = that `+` calls `promote_type` ## but this is not true for some types, such as Bool: # R = promote_type(ai, bi) # this is wrong, since depending on the return value # of type-inference is very brittle (as p-norm is defined as 1000 CHAPTER 82. LINEAR ALGEBRA ∥A∥p = � n � i=1 |ai|p �1/p with ai the entries of A, |ai| the norm of ai, and n the length of A. Since the p-norm is computed using the norms of0 码力 | 1252 页 | 4.28 MB | 1 年前3Julia v1.4.2 Documentation
pseudo-code might look like: function matmul(a::AbstractMatrix, b::AbstractMatrix) op = (ai, bi) -> ai * bi + ai * bi ## this is insufficient because it assumes `one(eltype(a))` is constructable: # R `+` calls `promote_type` ## but this is not true for some types, such as Bool: # R = promote_type(ai, bi) # this is wrong, since depending on the return value # of type-inference is very brittle (as the corresponding length. The p-norm is defined as ∥A∥p = � n � i=1 |ai|p �1/p with ai the entries of A, |ai| the norm of ai, and n the length of A. Since the p-norm is computed using the norms of0 码力 | 1314 页 | 4.29 MB | 1 年前3Julia v1.3.1 Documentation
pseudo-code might look like: function matmul(a::AbstractMatrix, b::AbstractMatrix) op = (ai, bi) -> ai * bi + ai * bi ## this is insufficient because it assumes `one(eltype(a))` is constructable: # R = that `+` calls `promote_type` ## but this is not true for some types, such as Bool: # R = promote_type(ai, bi) # this is wrong, since depending on the return value # of type-inference is very brittle (as the corresponding length. The p-norm is defined as ∥A∥p = � n � i=1 |ai|p �1/p with ai the entries of A, |ai| the norm of ai, and n the length of A. Since the p-norm is computed using the norms of0 码力 | 1276 页 | 4.36 MB | 1 年前3Julia v1.5.4 Documentation
pseudo-code might look like: function matmul(a::AbstractMatrix, b::AbstractMatrix) op = (ai, bi) -> ai * bi + ai * bi ## this is insufficient because it assumes `one(eltype(a))` is constructable: # R `+` calls `promote_type` ## but this is not true for some types, such as Bool: # R = promote_type(ai, bi) # this is wrong, since depending on the return value # of type-inference is very brittle (as the corresponding length. The p-norm is defined as ∥A∥p = � n � i=1 |ai|p �1/p with ai the entries of A, |ai| the norm of ai, and n the length of A. Since the p-norm is computed using the norms of0 码力 | 1337 页 | 4.41 MB | 1 年前3Julia v1.6.6 Documentation
pseudo-code might look like: function matmul(a::AbstractMatrix, b::AbstractMatrix) op = (ai, bi) -> ai * bi + ai * bi ## this is insufficient because it assumes `one(eltype(a))` is constructable: # R ## but this is not true for some types, such as Bool: CHAPTER 12. METHODS 138 # R = promote_type(ai, bi) # this is wrong, since depending on the return value # of type-inference is very brittle (as the corresponding length. The p-norm is defined as ∥A∥p = � n � i=1 |ai|p �1/p with ai the entries of A, |ai| the norm of ai, and n the length of A. Since the p-norm is computed using the norms of0 码力 | 1324 页 | 4.54 MB | 1 年前3Julia 1.6.5 Documentation
pseudo-code might look like: function matmul(a::AbstractMatrix, b::AbstractMatrix) op = (ai, bi) -> ai * bi + ai * bi ## this is insufficient because it assumes `one(eltype(a))` is constructable: # R ## but this is not true for some types, such as Bool: CHAPTER 12. METHODS 138 # R = promote_type(ai, bi) # this is wrong, since depending on the return value # of type-inference is very brittle (as the corresponding length. The p-norm is defined as ∥A∥p = � n � i=1 |ai|p �1/p with ai the entries of A, |ai| the norm of ai, and n the length of A. Since the p-norm is computed using the norms of0 码力 | 1325 页 | 4.54 MB | 1 年前3
共 87 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9