jagomart
digital resources
picture1_Csl Manual


 160x       Filetype PDF       File size 1.19 MB       Source: marty.in2p3.fr


File: Csl Manual
csl c symbolic computation library user manual gregoire uhlrich may 31 2022 csl user manual 2 contents 1 introduction 15 2 c basics 17 2 1 c 101 17 2 ...

icon picture PDF Filetype PDF | Posted on 06 Feb 2023 | 2 years ago
Partial capture of text on file.
                     CSL
           C++Symbolic computation Library
                  User Manual
                  Grégoire Uhlrich
                   May 31, 2022
          CSL User Manual
                                      2
                Contents
                1 Introduction                                                                                 15
                2 C++basics                                                                                    17
                    2.1   C++101 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       17
                          2.1.1   History, philosophy . . . . . . . . . . . . . . . . . . . . . . . . . . .    17
                          2.1.2   Compile-time vs. run-time . . . . . . . . . . . . . . . . . . . . . . .      18
                          2.1.3   Type system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    18
                    2.2   Constness in C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       20
                    2.3   References, pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   20
                    2.4   Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     23
                    2.5   Enumerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     24
                    2.6   The auto keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     26
                    2.7   Lambda functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     27
                    2.8   The standard library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     29
                          2.8.1   I/O streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    29
                          2.8.2   Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  30
                          2.8.3   Containers, C++ vector . . . . . . . . . . . . . . . . . . . . . . . .       31
                          2.8.4   Smart pointers    . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  34
                          2.8.5   Optional variables . . . . . . . . . . . . . . . . . . . . . . . . . . . .   35
                    2.9   Lists in C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     36
                    2.10 Polymorphism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      37
                3 CSL basics                                                                                   41
                    3.1   Philosophy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   41
                    3.2   Symbolic computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       42
                          3.2.1   Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  42
                          3.2.2   Internal representation of an expression . . . . . . . . . . . . . . . .     42
                          3.2.3   The Expr type . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      43
                          3.2.4   Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    46
                    3.3   Using CSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    47
                    3.4   CSL type system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    47
                          3.4.1   Type system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    47
                          3.4.2   Primary type system . . . . . . . . . . . . . . . . . . . . . . . . . .      49
                          3.4.3   When CSL type system is not enough . . . . . . . . . . . . . . . . .         50
                    3.5   CSL builder functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    51
                    3.6   CSL error system    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  51
                    3.7   Loops with CSL expressions      . . . . . . . . . . . . . . . . . . . . . . . . . .  52
                    3.8   Canonical forms of expressions . . . . . . . . . . . . . . . . . . . . . . . . .     52
                    3.9   Automatic ordering of expressions . . . . . . . . . . . . . . . . . . . . . . .      54
                                                                3
                CSL User Manual                                                                       CONTENTS
                    3.10 How to learn CSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      56
                          3.10.1 The manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      56
                          3.10.2 The documentation . . . . . . . . . . . . . . . . . . . . . . . . . . .       56
                          3.10.3 The code, for the brave . . . . . . . . . . . . . . . . . . . . . . . . .     57
                4 CSL good manners                                                                             59
                    4.1   Resource safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    59
                    4.2   Memory allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      60
                    4.3   C++goodmanners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         61
                          4.3.1   Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  61
                          4.3.2   C++vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       62
                    4.4   CSL good manners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     66
                          4.4.1   The Expr type . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      66
                          4.4.2   Avoidable allocations . . . . . . . . . . . . . . . . . . . . . . . . . .    66
                          4.4.3   Heavy interface functions . . . . . . . . . . . . . . . . . . . . . . . .    67
                5 Numbers                                                                                      69
                    5.1   Integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  69
                    5.2   Float . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  70
                    5.3   IntFraction   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  71
                    5.4   Complex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    72
                    5.5   NumericalEval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    72
                6 Scalar literals                                                                              75
                    6.1   Complex literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   75
                    6.2   Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   75
                    6.3   Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   77
                    6.4   Imaginary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    79
                    6.5   IntFactorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   79
                    6.6   Arbitrary   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  80
                    6.7   CSL global variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   82
                7 Mathematical operations                                                                      85
                    7.1   Sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    85
                    7.2   Prod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   88
                    7.3   Pow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    89
                    7.4   Subtraction and division . . . . . . . . . . . . . . . . . . . . . . . . . . . .     90
                8 Mathematical functions                                                                       91
                    8.1   Common mathematical functions . . . . . . . . . . . . . . . . . . . . . . .          92
                    8.2   Other functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    94
                          8.2.1   Angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    94
                          8.2.2   Factorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  95
                          8.2.3   DiracDelta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   96
                9 Operators                                                                                    99
                    9.1   Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  99
                    9.2   RealPart, ImaginaryPart . . . . . . . . . . . . . . . . . . . . . . . . . . . .      99
                    9.3   Derivative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
                    9.4   Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
                                                                4
The words contained in this file might help you see if this file matches what you are looking for:

...Csl c symbolic computation library user manual gregoire uhlrich may contents introduction basics history philosophy compile time vs run type system constness in references pointers namespaces enumerations the auto keyword lambda functions standard i o streams strings containers vector smart optional variables lists polymorphism principle internal representation of an expression expr limitations using primary when is not enough builder error loops with expressions canonical forms automatic ordering how to learn documentation code for brave good manners resource safety memory allocation goodmanners vectors avoidable allocations heavy interface numbers integer float intfraction complex numericaleval scalar literals constant variable imaginary intfactorial arbitrary global mathematical operations sum prod pow subtraction and division common other angle factorial diracdelta operators realpart imaginarypart derivative integrals...

no reviews yet
Please Login to review.