MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / demo_createInlineCompMatr

Function demo_createInlineCompMatr

examples/isolated/initialising_matrices.cpp:99–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98
99void demo_createInlineCompMatr() {
100
101 // inline literal
102 CompMatr a = createInlineCompMatr(2, {
103 {1,2,3_i,4},
104 {4,5,6,7},
105 {9,8,7,6},
106 {1_i,2_i,0,0}
107 });
108 reportCompMatr(a);
109 destroyCompMatr(a);
110
111 // existing vector (C++ only)
112 vector<vector<qcomp>> elems = {
113 {1,2},
114 {3,4}
115 };
116 CompMatr b = createInlineCompMatr(1, elems);
117 reportCompMatr(b);
118 destroyCompMatr(b);
119
120 // must specify every element (unlike in C) otherwise runtime validation is triggered
121}
122
123
124void demo_setInlineCompMatr() {

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 3

createInlineCompMatrFunction · 0.85
reportCompMatrFunction · 0.85
destroyCompMatrFunction · 0.85

Tested by

no test coverage detected