Symbolic Calculus for High-Performance Computing: From Scratch Using C++23Substitution Construction Conclusion Typing equations What we would like to type 1 symbol a; 2 symbol w; 3 symbol t; 4 symbol phi; 5 6 formula f = a ∗ sin(w ∗ t + phi ); 7 8 double y = f(a = 5.0, w = 2 from the syntax 1 symbol a; 2 symbol w; 3 symbol t; 4 symbol phi; The idea a, ω, t, ϕ should all have a unique type The problem How to produce a different type everytime a new symbol is created? The as default template parameter 1 template2 struct symbol {}; The result 1 symbol x; 2 symbol y; 3 4 std :: cout << std :: is_same_v << std :: endl; 0 码力 | 70 页 | 1.80 MB | 6 月前3
User’s Guide for Free Pascal, Version 3.2.2Searching and replacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 6.7 The symbol browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6.8 Running programs errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 5 CONTENTS C.5 Symbol handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 C.6 Code generator All unused code is left out. This can lead to substantially smaller binaries. -dxxx Define the symbol name xxx. This can be used to conditionally compile parts of your code. -D Generate a DEF file (for0 码力 | 217 页 | 756.57 KB | 1 年前3
MoonBit月兔编程语言 现代编程思想 第十二课 案例:自动微分 我们以符号微分定义表达式构建的⼀种语义 1. enum Symbol { 2. Constant(Double) 3. Var(Int) // x0, x1, x2, ... 4. Add(Symbol, Symbol) 5. Mul(Symbol, Symbol) 6. } derive(Debug) 7. 8. // 定义简单构造器,并重载运算符 9. fn Symbol::constant(d : Double) -> Symbol { Constant(d) } 10. fn Symbol::var(i : Int) -> Symbol { Var(i) } 11. fn Symbol::op_add(f1 : Symbol, f2 : Symbol) -> Symbol { Add(f1, f2) } 12. fn Symbol::op_mul(f1 : Symbol, f2 : Symbol) -> -> Symbol { Mul(f1, f2) } 13. 14. // 计算函数值 15. fn Symbol::compute(f : Symbol, input : Array[Double]) -> Double { ... } 15 符号微分 利⽤函数求导法则,我们计算函数的(偏)导数 如果 为常值函数 ⽉兔实现 1. fn differentiate(self : Symbol0 码力 | 30 页 | 3.24 MB | 1 年前3
Nim 2.0.8 Manualthe same as the dynamic type, it is a super-type or subtype of the dynamic type. An identi�er is a symbol declared as a name for a variable, type, procedure, etc. The region of the program over which a declaration loses its keyword property and becomes an ordinary identi�er. Examples String literals Terminal symbol in the grammar: STR_LIT . String literals can be delimited by matching double quotes, and can contain operations may interpret the �rst binary zero as a terminator. Triple quoted string literals Terminal symbol in the grammar: TRIPLESTR_LIT . String literals can also be delimited by three double quotes """0 码力 | 132 页 | 5.73 MB | 1 年前3
Programmer’s Guide for Free Pascal, Version 3.2.2C like operators . . . . . . . . . . . . . . . . . . . 18 1.2.11 $DEFINE or $DEFINEC : Define a symbol . . . . . . . . . . . . . . . . . . 19 1.2.12 $ELSE : Switch conditional compilation . . . . . use of scoped enumeration types . . . . . . . . . 39 1.2.71 $SETC : Define and assign a value to a symbol . . . . . . . . . . . . . . . . 40 1.2.72 $S : Stack checking . . . . . . . . . . . . . . . . . $TYPEDADDRESS : Typed address operator (@) . . . . . . . . . . . 41 1.2.76 $UNDEF or $UNDEFC : Undefine a symbol . . . . . . . . . . . . . . . . . . 41 1.2.77 $V or $VARSTRINGCHECKS : Var-string checking . .0 码力 | 187 页 | 531.58 KB | 1 年前3
Julia 1.12.0 DEV Documentationbackslashed LaTeX symbol name followed by tab. For example, the variable name δ can be entered by typing \delta-tab, or even α̂⁽²⁾ by \alpha-tab-\hat- tab-\^(2)-tab. (If you find a symbol somewhere, e.g code, that you don't know how to type, the REPL help will tell you: just type ? and then paste the symbol.) Julia will even let you shadow existing exported constants and functions with local ones (although operator_precedence(:+=), Base.operator_precedence(:(=)) # (Note the necessary parens on `:(=)`) �→ (0, 1, 1) A symbol representing the operator associativity can also be found by calling the built-in function Base.0 码力 | 2009 页 | 6.72 MB | 1 年前3
Julia 1.11.0 DEV Documentationbackslashed LaTeX symbol name followed by tab. For example, the variable name δ can be entered by typing \delta-tab, or even α̂⁽²⁾ by \alpha-tab-\hat- tab-\^(2)-tab. (If you find a symbol somewhere, e.g code, that you don't know how to type, the REPL help will tell you: just type ? and then paste the symbol.) Julia will even let you shadow existing exported constants and functions with local ones (although operator_precedence(:+=), Base.operator_precedence(:(=)) # (Note the necessary parens on `:(=)`) �→ (0, 1, 1) A symbol representing the operator associativity can also be found by calling the built-in function Base.0 码力 | 2007 页 | 6.71 MB | 1 年前3
Julia 1.11.0 beta1 Documentationbackslashed LaTeX symbol name followed by tab. For example, the variable name δ can be entered by typing \delta-tab, or even α̂⁽²⁾ by \alpha-tab-\hat- tab-\^(2)-tab. (If you find a symbol somewhere, e.g code, that you don't know how to type, the REPL help will tell you: just type ? and then paste the symbol.) Julia will even let you shadow existing exported constants and functions with local ones (although operator_precedence(:+=), Base.operator_precedence(:(=)) # (Note the necessary parens on `:(=)`) �→ (0, 1, 1) A symbol representing the operator associativity can also be found by calling the built-in function Base.0 码力 | 1997 页 | 6.68 MB | 1 年前3
Julia 1.11.0-rc4 Documentationbackslashed LaTeX symbol name followed by tab. For example, the variable name δ can be entered by typing \delta-tab, or even α̂⁽²⁾ by \alpha-tab-\hat- tab-\^(2)-tab. (If you find a symbol somewhere, e.g code, that you don't know how to type, the REPL help will tell you: just type ? and then paste the symbol.) Julia will even let you shadow existing exported constants and functions with local ones (although operator_precedence(:+=), Base.operator_precedence(:(=)) # (Note the necessary parens on `:(=)`) �→ (0, 1, 1) A symbol representing the operator associativity can also be found by calling the built-in function Base.0 码力 | 1985 页 | 6.67 MB | 11 月前3
Julia 1.11.0 Documentationbackslashed LaTeX symbol name followed by tab. For example, the variable name δ can be entered by typing \delta-tab, or even α̂⁽²⁾ by \alpha-tab-\hat- tab-\^(2)-tab. (If you find a symbol somewhere, e.g code, that you don't know how to type, the REPL help will tell you: just type ? and then paste the symbol.) Julia will even let you shadow existing exported constants and functions with local ones (although operator_precedence(:+=), Base.operator_precedence(:(=)) # (Note the necessary parens on `:(=)`) �→ (0, 1, 1) A symbol representing the operator associativity can also be found by calling the built-in function Base.0 码力 | 1987 页 | 6.67 MB | 11 月前3
共 676 条
- 1
- 2
- 3
- 4
- 5
- 6
- 68













