Modern C++ Tutorial: C++11/14/17/20 On the FlyModern C++ Tutorial: C++11/14/17/20 On the Fly Changkun Ou (hi[at]changkun.de) Last update: May 7, 2023 Notice The content in this PDF file may outdated, please check our website or GitHub repository repository for the latest book updates. License This work was written by Ou Changkun and licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. https://creativecommons conditions between processes in atomic operations. In principle, each thread can correspond to a cluster node, and communication between threads is almost equivalent to communication between cluster nodes. Weakening0 码力 | 92 页 | 1.79 MB | 1 年前3
Irksome C++anything but the proper names.” ― Ursula K. Le Guin (1929-2018) • “[Y]ou won't get your names right the first bme. [Y]ou may well be tempted to leave it — aUer all it's only a name. [But h]umans0 码力 | 15 页 | 3.03 MB | 6 月前3
Leveraging a Functional Approach for More Testable and Maintainable ROS 2 Codeare 2 nodes in the system ○ Node 1 acts as a service client and sends requests to Node 2What is ROS 2? ● In this ROS 2 example, there are 2 nodes in the system ○ Node 1 acts as a service client and requests to Node 2 ○ Node 2 acts as a service server, receives requests from Node 1, and sends back responsesWhat is ROS 2? ● In this ROS 2 example, there are 2 nodes in the system ○ Node 1 acts as as a service client and sends requests to Node 2 ○ Node 2 acts as a service server, receives requests from Node 1, and sends back responses ■ Node 2 also uses parameters at run-time to change its behaviorWhat0 码力 | 200 页 | 1.77 MB | 6 月前3
Rethinking Task Based Concurrency and Parallelism for Low Latency C++Setting a Signal Order of updates: ● Begin at the leaf node ● Set node to one (on) ● Traverse tree upward from leaf to the root and increment each node by one0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Setting a Signal Signal Order of updates: ● Begin at the leaf node ● Set node to one (on) ● Traverse tree upward from leaf to the root and increment each node by one Signal to set0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 Setting a Signal Order of updates: ● Begin at the leaf node ● Set node to one (on) ● Traverse tree upward from leaf to the root and increment each node by one0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 Setting a Signal0 码力 | 142 页 | 2.80 MB | 6 月前3
Hello 算法 1.0.0b1 C++版‧「指令空间」用于保存编译后的程序指令,在实际统计中一般忽略不计。 Figure 2‑9. 算法使用的相关空间 /* 结构体 */ struct Node { 2. 复杂度分析 hello‑algo.com 28 int val; Node *next; Node(int x) : val(x), next(nullptr) {} }; /* 函数 */ int func() { // do } int algorithm(int n) { // 输入数据 const int a = 0; // 暂存数据(常量) int b = 0; // 暂存数据(变量) Node* node = new Node(0); // 暂存数据(对象) int c = func(); // 栈帧空间(调用函数) return a + b + c; // 输出数据 } 2.3.2. 推算方法 constant(int n) { // 常量、变量、对象占用 O(1) 空间 const int a = 0; int b = 0; vectornums(10000); ListNode node(0); // 循环中的变量占用 O(1) 空间 for (int i = 0; i < n; i++) { int c = 0; } // 循环中的函数占用 O(1) 空间 for (int 0 码力 | 187 页 | 14.71 MB | 1 年前3
Hello 算法 1.0.0b2 C++版‧「指令空间」用于保存编译后的程序指令,在实际统计中一般忽略不计。 Figure 2‑9. 算法使用的相关空间 /* 结构体 */ struct Node { 2. 复杂度分析 hello‑algo.com 28 int val; Node *next; Node(int x) : val(x), next(nullptr) {} }; /* 函数 */ int func() { // do } int algorithm(int n) { // 输入数据 const int a = 0; // 暂存数据(常量) int b = 0; // 暂存数据(变量) Node* node = new Node(0); // 暂存数据(对象) int c = func(); // 栈帧空间(调用函数) return a + b + c; // 输出数据 } 2.3.2. 推算方法 constant(int n) { // 常量、变量、对象占用 O(1) 空间 const int a = 0; int b = 0; vectornums(10000); ListNode node(0); // 循环中的变量占用 O(1) 空间 for (int i = 0; i < n; i++) { int c = 0; } // 循环中的函数占用 O(1) 空间 for (int 0 码力 | 197 页 | 15.72 MB | 1 年前3
POCOAS in C++: A Portable Abstraction for Distributed Data Structuressend and receive calls Node 0 Node 1 Send MSG(1) Receive MSG(0)How do I program one? - Message Passing - processes issue matching send and receive calls Node 0 Node 1 Send MSG(1) Receive 1How do I program one? - Message Passing - processes issue matching send and receive calls Node 0 Node 1 Send MSG(1) Receive MSG(0) // Calculate data auto values = algorithm(1.0f, 3, data); 1How do I program one? - Message Passing - processes issue matching send and receive calls Node 0 Node 1 Send MSG(1) Receive MSG(0) // Calculate data auto values = algorithm(1.0f, 3, data);0 码力 | 128 页 | 2.03 MB | 6 月前3
Data Structures That Make Video Games Go Roundlevel starts of as the root node. ● A node in the tree can represent a game entity or a quadrant itself. ● Any time a quadrant has more than 4 entities, the node subdivides into 4 more nodes multiple quadrants, include them as a child node in each quadrant. How to construct a quadtree for a level?● Our level starts of as the root node. ● A node in the tree can represent a game entity quadrant has more than 4 entities, the node subdivides into 4 more nodes. ● If an entity intersects with multiple quadrants, include them as a child node in each quadrant. How to construct a quadtree0 码力 | 196 页 | 3.03 MB | 6 月前3
Hello 算法 1.1.0 C++ 版在分析一段程序的空间复杂度时,我们通常统计暂存数据、栈帧空间和输出数据三部分,如图 2‑15 所示。 图 2‑15 算法使用的相关空间 相关代码如下: /* 结构体 */ struct Node { int val; Node *next; Node(int x) : val(x), next(nullptr) {} }; /* 函数 */ int func() { // 执行某些操作... return } int algorithm(int n) { // 输入数据 const int a = 0; // 暂存数据(常量) int b = 0; // 暂存数据(变量) Node* node = new Node(0); // 暂存数据(对象) int c = func(); // 栈帧空间(调用函数) return a + b + c; // 输出数据 } 第 2 章 复杂度分析 constant(int n) { // 常量、变量、对象占用 O(1) 空间 const int a = 0; int b = 0; vectornums(10000); ListNode node(0); // 循环中的变量占用 O(1) 空间 for (int i = 0; i < n; i++) { 第 2 章 复杂度分析 hello‑algo.com 45 int c = 0; 0 码力 | 379 页 | 18.47 MB | 1 年前3
Hello 算法 1.0.0 C++版在分析一段程序的空间复杂度时,我们通常统计暂存数据、栈帧空间和输出数据三部分,如图 2‑15 所示。 图 2‑15 算法使用的相关空间 相关代码如下: /* 结构体 */ struct Node { int val; Node *next; Node(int x) : val(x), next(nullptr) {} }; /* 函数 */ int func() { // 执行某些操作... return } int algorithm(int n) { // 输入数据 const int a = 0; // 暂存数据(常量) int b = 0; // 暂存数据(变量) Node* node = new Node(0); // 暂存数据(对象) int c = func(); // 栈帧空间(调用函数) 第 2 章 复杂度分析 hello‑algo.com 43 return a + constant(int n) { // 常量、变量、对象占用 O(1) 空间 const int a = 0; int b = 0; vectornums(10000); ListNode node(0); // 循环中的变量占用 O(1) 空间 for (int i = 0; i < n; i++) { 第 2 章 复杂度分析 hello‑algo.com 45 int c = 0; 0 码力 | 378 页 | 17.59 MB | 1 年前3
共 120 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12













