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

Function demo_setInlineCompMatr

examples/isolated/initialising_matrices.cpp:124–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122
123
124void demo_setInlineCompMatr() {
125
126 // inline literal; identical to setCompMatr() for consistencty with C API
127 CompMatr a = createCompMatr(1);
128 setInlineCompMatr(a, 1, {{.3,.4},{.6,.7}});
129 reportCompMatr(a);
130 destroyCompMatr(a);
131
132 // we must specify all elements (only necessary in C++)
133 CompMatr b = createCompMatr(3);
134 setInlineCompMatr(b, 3, {
135 {1,2,3,4,5,6,7,8},
136 {8_i,7_i,6_i,5_i,0,0,0,0},
137 {0,0,0,0,9,9,9,9},
138 {8,7,6,5,4,3,2,1},
139 {3,3,3,3,3,3,3,3},
140 {0,0,0,0,1_i,1_i,1_i,1_i},
141 {9,8,7,6,5,4,3,2},
142 {-1,-2,-3,-4,4,3,2,1}
143 });
144 reportCompMatr(b);
145 destroyCompMatr(b);
146}
147
148
149void demo_setCompMatr() {

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 4

createCompMatrFunction · 0.85
setInlineCompMatrFunction · 0.85
reportCompMatrFunction · 0.85
destroyCompMatrFunction · 0.85

Tested by

no test coverage detected