 GraphBLAS: Building a C++ Matrix API for Graph AlgorithmsMonoids: Binary Operators with an Identity - Monoids are mathematical objects, consisting of: - A commutative binary operator - A type T - A mathematical identity 113[DISTRIBUTION STATEMENT A] This Monoids: Binary Operators with an Identity - Monoids are mathematical objects, consisting of: - A commutative binary operator - A type T - A mathematical identity 114[DISTRIBUTION STATEMENT A] This Monoids: Binary Operators with an Identity 115 - Monoids are mathematical objects, consisting of: - A commutative binary operator - A type T - A mathematical identity[DISTRIBUTION STATEMENT A] This material0 码力 | 172 页 | 7.40 MB | 6 月前3 GraphBLAS: Building a C++ Matrix API for Graph AlgorithmsMonoids: Binary Operators with an Identity - Monoids are mathematical objects, consisting of: - A commutative binary operator - A type T - A mathematical identity 113[DISTRIBUTION STATEMENT A] This Monoids: Binary Operators with an Identity - Monoids are mathematical objects, consisting of: - A commutative binary operator - A type T - A mathematical identity 114[DISTRIBUTION STATEMENT A] This Monoids: Binary Operators with an Identity 115 - Monoids are mathematical objects, consisting of: - A commutative binary operator - A type T - A mathematical identity[DISTRIBUTION STATEMENT A] This material0 码力 | 172 页 | 7.40 MB | 6 月前3
 Reflection Is Not Contemplation'*';“You can observe a lot by just implementing identity” – Yogi BerraNotion of Identity/Copying/Cloning is Crucial Allow me a little soapbox • Identity fundamental concept in Computer Science • Different objects central topic in C++ • Alias analysis, self-assignment, self-move, double deletion, … • “Identity Function:” can insert in any (sub)expression without changing meaning constexpr auto r = ^int; '*';Identity Function Example Allow me a little soapbox • We had to add && because C++98 couldn’t implement identity • The year was 2008 and this was C++0x: template Reflection Is Not Contemplation'*';“You can observe a lot by just implementing identity” – Yogi BerraNotion of Identity/Copying/Cloning is Crucial Allow me a little soapbox • Identity fundamental concept in Computer Science • Different objects central topic in C++ • Alias analysis, self-assignment, self-move, double deletion, … • “Identity Function:” can insert in any (sub)expression without changing meaning constexpr auto r = ^int; '*';Identity Function Example Allow me a little soapbox • We had to add && because C++98 couldn’t implement identity • The year was 2008 and this was C++0x: template- T&& identity(T&& x) 0 码力 | 45 页 | 2.45 MB | 6 月前3
 MuPDF 1.23.0 Documentation0xff); // Do the actual rendering. dev = fz_new_draw_device(ctx, fz_identity, data->pix); fz_run_display_list(ctx, list, dev, fz_identity, bbox, NULL); fz_close_device(ctx, dev); } fz_always(ctx) fz_drop_device(ctx = fz_new_list_device(ctx, list); // Run the page to that device. fz_run_page(ctx, page, dev, fz_identity, NULL); // Close the device neatly, so everything is flushed to␣ ˓→the list. fz_close_device(ctx createAnnotation("Stamp") annot.setRect([10, 600, 200, 700]) annot.setAppearance(null, null, mupdf.Matrix.identity, [ 0, 0, 100, 100 ], ˓→{}, "0 1 0 rg 10 10 50 50 re f") annot = page.createAnnotation("Stamp")0 码力 | 245 页 | 817.74 KB | 8 月前3 MuPDF 1.23.0 Documentation0xff); // Do the actual rendering. dev = fz_new_draw_device(ctx, fz_identity, data->pix); fz_run_display_list(ctx, list, dev, fz_identity, bbox, NULL); fz_close_device(ctx, dev); } fz_always(ctx) fz_drop_device(ctx = fz_new_list_device(ctx, list); // Run the page to that device. fz_run_page(ctx, page, dev, fz_identity, NULL); // Close the device neatly, so everything is flushed to␣ ˓→the list. fz_close_device(ctx createAnnotation("Stamp") annot.setRect([10, 600, 200, 700]) annot.setAppearance(null, null, mupdf.Matrix.identity, [ 0, 0, 100, 100 ], ˓→{}, "0 1 0 rg 10 10 50 50 re f") annot = page.createAnnotation("Stamp")0 码力 | 245 页 | 817.74 KB | 8 月前3
 Template Metaprogramming: Type TraitsMetafunctions • Simple regular function: identity 14 int int_identity(int x) { return x; } assert(42 == int_identity(42));Value Metafunctions • Simple regular function: identity • Simple metafunction: identity 14 int int_identity(int x) { return x; } assert(42 == int_identity(42)); template regular function: identity • Simple metafunction: identity 14 int int_identity(int x) { return x; } assert(42 == int_identity(42)); template0 码力 | 403 页 | 5.30 MB | 6 月前3 Template Metaprogramming: Type TraitsMetafunctions • Simple regular function: identity 14 int int_identity(int x) { return x; } assert(42 == int_identity(42));Value Metafunctions • Simple regular function: identity • Simple metafunction: identity 14 int int_identity(int x) { return x; } assert(42 == int_identity(42)); template regular function: identity • Simple metafunction: identity 14 int int_identity(int x) { return x; } assert(42 == int_identity(42)); template0 码力 | 403 页 | 5.30 MB | 6 月前3
 MuPDF 1.25.0 Documentation0xff); // Do the actual rendering. dev = fz_new_draw_device(ctx, fz_identity, data->pix); fz_run_display_list(ctx, list, dev, fz_identity, bbox, NULL); fz_close_device(ctx, dev); } fz_always(ctx) fz_drop_device(ctx MuPDF Documentation, Release 1.25.0 (continued from previous page) fz_run_page(ctx, page, dev, fz_identity, NULL); // Close the device neatly, so everything is flushed to␣ ˓→the list. fz_close_device(ctx createAnnotation("Stamp") annot.setRect([10, 600, 200, 700]) annot.setAppearance(null, null, mupdf.Matrix.identity, [ 0, 0, 100, 100 ], ˓→{}, "0 1 0 rg 10 10 50 50 re f") annot = page.createAnnotation("Stamp")0 码力 | 259 页 | 1.11 MB | 8 月前3 MuPDF 1.25.0 Documentation0xff); // Do the actual rendering. dev = fz_new_draw_device(ctx, fz_identity, data->pix); fz_run_display_list(ctx, list, dev, fz_identity, bbox, NULL); fz_close_device(ctx, dev); } fz_always(ctx) fz_drop_device(ctx MuPDF Documentation, Release 1.25.0 (continued from previous page) fz_run_page(ctx, page, dev, fz_identity, NULL); // Close the device neatly, so everything is flushed to␣ ˓→the list. fz_close_device(ctx createAnnotation("Stamp") annot.setRect([10, 600, 200, 700]) annot.setAppearance(null, null, mupdf.Matrix.identity, [ 0, 0, 100, 100 ], ˓→{}, "0 1 0 rg 10 10 50 50 re f") annot = page.createAnnotation("Stamp")0 码力 | 259 页 | 1.11 MB | 8 月前3
 MuPDF 1.24.0 Documentation0xff); // Do the actual rendering. dev = fz_new_draw_device(ctx, fz_identity, data->pix); fz_run_display_list(ctx, list, dev, fz_identity, bbox, NULL); fz_close_device(ctx, dev); } fz_always(ctx) fz_drop_device(ctx MuPDF Documentation, Release 1.24.0 (continued from previous page) fz_run_page(ctx, page, dev, fz_identity, NULL); // Close the device neatly, so everything is flushed to␣ ˓→the list. fz_close_device(ctx createAnnotation("Stamp") annot.setRect([10, 600, 200, 700]) annot.setAppearance(null, null, mupdf.Matrix.identity, [ 0, 0, 100, 100 ], ˓→{}, "0 1 0 rg 10 10 50 50 re f") annot = page.createAnnotation("Stamp")0 码力 | 249 页 | 830.15 KB | 8 月前3 MuPDF 1.24.0 Documentation0xff); // Do the actual rendering. dev = fz_new_draw_device(ctx, fz_identity, data->pix); fz_run_display_list(ctx, list, dev, fz_identity, bbox, NULL); fz_close_device(ctx, dev); } fz_always(ctx) fz_drop_device(ctx MuPDF Documentation, Release 1.24.0 (continued from previous page) fz_run_page(ctx, page, dev, fz_identity, NULL); // Close the device neatly, so everything is flushed to␣ ˓→the list. fz_close_device(ctx createAnnotation("Stamp") annot.setRect([10, 600, 200, 700]) annot.setAppearance(null, null, mupdf.Matrix.identity, [ 0, 0, 100, 100 ], ˓→{}, "0 1 0 rg 10 10 50 50 re f") annot = page.createAnnotation("Stamp")0 码力 | 249 页 | 830.15 KB | 8 月前3
 Calling Functions A TutorialWidget( int ); }; int main() { f( 42 ); // Call 'f()' with a single 'int' argument } // Exact/identity match // Trivial conversions // Standard conversions // User-defined conversions // Default arguments Parameter) 49 For a single argument, the compiler chooses the best available option: 1. Exact/identity match 2. Trivial conversion 3. Promotion 4. Promotion + trivial conversion 5. Standard conversion double ); // (2) int main() { int i = 42; f( i ); } // Calls (1) (identity match, rank 1) Identity match (rank 1) Standard conversion (rank 3)Ranking 51 void f( int& ); // (1)0 码力 | 111 页 | 5.11 MB | 6 月前3 Calling Functions A TutorialWidget( int ); }; int main() { f( 42 ); // Call 'f()' with a single 'int' argument } // Exact/identity match // Trivial conversions // Standard conversions // User-defined conversions // Default arguments Parameter) 49 For a single argument, the compiler chooses the best available option: 1. Exact/identity match 2. Trivial conversion 3. Promotion 4. Promotion + trivial conversion 5. Standard conversion double ); // (2) int main() { int i = 42; f( i ); } // Calls (1) (identity match, rank 1) Identity match (rank 1) Standard conversion (rank 3)Ranking 51 void f( int& ); // (1)0 码力 | 111 页 | 5.11 MB | 6 月前3
 Unity for Human Beings5; z ++) { Instantiate(CubePrefab, new Vector3(x, 0, z), Quaternion.identity); } } } public void Start() { generateCubeSquare(); 1.08f) { Instantiate(CubePrefab, new Vector3(x, 0, z), Quaternion.identity); } } } public void Start() { generateCubeSquare(); CubePrefabList) { Instantiate(item, new Vector3(x, 0, z), Quaternion.identity); } } } } public void Start() {0 码力 | 239 页 | 27.39 MB | 10 月前3 Unity for Human Beings5; z ++) { Instantiate(CubePrefab, new Vector3(x, 0, z), Quaternion.identity); } } } public void Start() { generateCubeSquare(); 1.08f) { Instantiate(CubePrefab, new Vector3(x, 0, z), Quaternion.identity); } } } public void Start() { generateCubeSquare(); CubePrefabList) { Instantiate(item, new Vector3(x, 0, z), Quaternion.identity); } } } } public void Start() {0 码力 | 239 页 | 27.39 MB | 10 月前3
 Neighborhoods Banding Together: Reasoning Globally about Programsclaim usable( x ); claim usable( result ); } fits a specific function Function interface int Identity( const int x ) interface { claim usable( x ); implementation; claim x == result; claim usable( Indirect caller’s interfaceint Identity( const int x ) interface { claim usable( x ); implementation; claim x == result; claim usable( x ); claim usable( result ); } Identity function interface int Nondecreasing( result ); } Nondecreasing interface adapterint Identity( const int x ) implementation { return x; } Nondecreasing -> Identity “Nondecreasing fronting Identity” int Nondecreasing( const int x ) interface0 码力 | 49 页 | 1.03 MB | 6 月前3 Neighborhoods Banding Together: Reasoning Globally about Programsclaim usable( x ); claim usable( result ); } fits a specific function Function interface int Identity( const int x ) interface { claim usable( x ); implementation; claim x == result; claim usable( Indirect caller’s interfaceint Identity( const int x ) interface { claim usable( x ); implementation; claim x == result; claim usable( x ); claim usable( result ); } Identity function interface int Nondecreasing( result ); } Nondecreasing interface adapterint Identity( const int x ) implementation { return x; } Nondecreasing -> Identity “Nondecreasing fronting Identity” int Nondecreasing( const int x ) interface0 码力 | 49 页 | 1.03 MB | 6 月前3
 julia 1.10.10operators are supported on all primitive numeric types: Expression Name Description +x unary plus the identity operation -x unary minus maps values to their additive inverses x + y binary plus performs addition numbers: julia> float(3//4) 0.75 Conversion from rational to floating-point respects the following identity for any integral values of a and b, except when a==0 && b <= 0: julia> a = 1; b = 2; julia> isequal(float(a//b) finite-length strings S together with the string concatenation operator * forms a free monoid (S, *). The identity element of this set is the empty string, "". Whenever a free monoid is not commutative, the operation0 码力 | 1692 页 | 6.34 MB | 3 月前3 julia 1.10.10operators are supported on all primitive numeric types: Expression Name Description +x unary plus the identity operation -x unary minus maps values to their additive inverses x + y binary plus performs addition numbers: julia> float(3//4) 0.75 Conversion from rational to floating-point respects the following identity for any integral values of a and b, except when a==0 && b <= 0: julia> a = 1; b = 2; julia> isequal(float(a//b) finite-length strings S together with the string concatenation operator * forms a free monoid (S, *). The identity element of this set is the empty string, "". Whenever a free monoid is not commutative, the operation0 码力 | 1692 页 | 6.34 MB | 3 月前3
共 115 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12














