Tensor Network Theory Library  Beta release 1.2.1
A library of routines for performing TNT-based operations
 All Data Structures Functions Variables Groups Pages
tntUpdate.c
1 /*
2 Authors: Sarah Al-Assam, Stephen Clark and Dieter Jaksch
3 Date: $LastChangedDate: 2015-05-14 13:43:34 +0100 (Thu, 14 May 2015) $
4 (c) University of Oxford 2014
5 */
6 
13 /*-------------------------------------------*/
14 
15 #include "../headers/tnt_int.h"
16 #include "../headers/dec_public.h"
17 #include "../headers/dec_io.h"
18 
26 #ifdef MAKINGPUBLICDOCS
27 void tntIntParamsUpdate(const char *fname,
28  unsigned posn,
29  int varA,
30  int varB,
31  int varC,
32  int varD,
33  int varE)
34 {}
42 void tntIntParamsNamedUpdate(const char *fname,
43  unsigned posn,
44  int varA,
45  const char *varnameA,
46  int varB,
47  const char *varnameB,
48  int varC,
49  const char *varnameC,
50  int varD,
51  const char *varnameD,
52  int varE,
53  const char *varnameE)
55 #else
56 void tntIntParamsUpdateStatic(const char *fname,
57  unsigned posn,
58  int varA,
59  const char *varnameA,
60  int varB,
61  const char *varnameB,
62  int varC,
63  const char *varnameC,
64  int varD,
65  const char *varnameD,
66  int varE,
67  const char *varnameE)
68 #endif
69 {
70  int vars[TNT_MAX_NUMIO] = {varA,varB,varC,varD,varE};
71  const char *varnames[TNT_MAX_NUMIO] = {varnameA,varnameB,varnameC,varnameD,varnameE};
72  unsigned numint = _tnt_find_num_unique(varnames);
73  TNT_ERR_RET_DEFS
74 
75  ret = _tnt_update_intparams(fname, posn, numint, varnames, vars);
76  TNT_PUB_N_ERR_CHK("tntIntParamsUpdate") /* NO_COVERAGE */
77 
78 }
79 
87 #ifdef MAKINGPUBLICDOCS
88 void tntDoubleParamsUpdate(const char *fname,
89  unsigned posn,
90  double varA,
91  double varB,
92  double varC,
93  double varD,
94  double varE)
95 {}
103 void tntDoubleParamsNamedUpdate(const char *fname,
104  unsigned posn,
105  double varA,
106  const char *varnameA,
107  double varB,
108  const char *varnameB,
109  double varC,
110  const char *varnameC,
111  double varD,
112  const char *varnameD,
113  double varE,
114  const char *varnameE)
115 #else
116 void tntDoubleParamsUpdateStatic(const char *fname,
117  unsigned posn,
118  double varA,
119  const char *varnameA,
120  double varB,
121  const char *varnameB,
122  double varC,
123  const char *varnameC,
124  double varD,
125  const char *varnameD,
126  double varE,
127  const char *varnameE)
128 #endif
129 {
130  double vars[TNT_MAX_NUMIO] = {varA,varB,varC,varD,varE};
131  const char *varnames[TNT_MAX_NUMIO] = {varnameA,varnameB,varnameC,varnameD,varnameE};
132  unsigned numdbl = _tnt_find_num_unique(varnames);
133  TNT_ERR_RET_DEFS
134 
135  ret = _tnt_update_dblparams(fname, posn, numdbl, varnames, vars);
136  TNT_PUB_N_ERR_CHK("tntDoubleParamsUpdate") /* NO_COVERAGE */
137 
138 }
139 
140 
148 #ifdef MAKINGPUBLICDOCS
149 void tntComplexParamsUpdate(const char *savepref,
150  unsigned posn,
151  tntComplex varA,
152  tntComplex varB,
153  tntComplex varC,
154  tntComplex varD,
155  tntComplex varE)
156 {}
165 void tntComplexParamsNamedUpdate(const char *fname,
166  unsigned posn,
167  tntComplex varA,
168  const char *varnameA,
169  tntComplex varB,
170  const char *varnameB,
171  tntComplex varC,
172  const char *varnameC,
173  tntComplex varD,
174  const char *varnameD,
175  tntComplex varE,
176  const char *varnameE)
177 #else
178 void tntComplexParamsUpdateStatic(const char *fname,
179  unsigned posn,
180  tntComplex varA,
181  const char *varnameA,
182  tntComplex varB,
183  const char *varnameB,
184  tntComplex varC,
185  const char *varnameC,
186  tntComplex varD,
187  const char *varnameD,
188  tntComplex varE,
189  const char *varnameE)
190 #endif
191 {
192  tntComplex vars[TNT_MAX_NUMIO] = {varA,varB,varC,varD,varE};
193  const char *varnames[TNT_MAX_NUMIO] = {varnameA,varnameB,varnameC,varnameD,varnameE};
194  unsigned numcmp = _tnt_find_num_unique(varnames);
195  TNT_ERR_RET_DEFS
196 
197  ret = _tnt_update_cmpparams(fname, posn, numcmp, varnames, vars);
198  TNT_PUB_N_ERR_CHK("tntComplexParamsUpdate") /* NO_COVERAGE */
199 }
200 
201 
213 #ifdef MAKINGPUBLICDOCS
214 void tntIntArraysUpdate(const char *fname,
215  unsigned posn,
216  tntIntArray arrA,
217  tntIntArray arrB,
218  tntIntArray arrC,
219  tntIntArray arrD,
220  tntIntArray arrE)
221 {}
233 void tntIntArraysNamedUpdate(const char *fname,
234  unsigned posn,
235  tntIntArray arrA,
236  const char *varnameA,
237  tntIntArray arrB,
238  const char *varnameB,
239  tntIntArray arrC,
240  const char *varnameC,
241  tntIntArray arrD,
242  const char *varnameD,
243  tntIntArray arrE,
244  const char *varnameE)
246 #else
247 void tntIntArraysUpdateStatic(const char *fname,
248  unsigned posn,
249  tntIntArray arrA,
250  const char *varnameA,
251  tntIntArray arrB,
252  const char *varnameB,
253  tntIntArray arrC,
254  const char *varnameC,
255  tntIntArray arrD,
256  const char *varnameD,
257  tntIntArray arrE,
258  const char *varnameE)
259 #endif
260 {
261  tntIntArray arrs[TNT_MAX_NUMIO] = {arrA,arrB,arrC,arrD,arrE};
262  const char *varnames[TNT_MAX_NUMIO] = {varnameA,varnameB,varnameC,varnameD,varnameE};
263  unsigned numint = _tnt_find_num_unique(varnames);
264  TNT_ERR_RET_DEFS
265 
266  ret = _tnt_update_intarrs(fname, posn, numint, varnames, arrs);
267  TNT_PUB_N_ERR_CHK("tntIntArraysUpdate") /* NO_COVERAGE */
268 
269 }
270 
271 #ifdef MAKINGPUBLICDOCS
272 
283 void tntDoubleArraysUpdate(const char *fname,
284  unsigned posn,
285  tntDoubleArray arrA,
286  tntDoubleArray arrB,
287  tntDoubleArray arrC,
288  tntDoubleArray arrD,
289  tntDoubleArray arrE)
290 {}
302 void tntDoubleArraysNamedUpdate(const char *fname,
303  unsigned posn,
304  tntDoubleArray arrA,
305  const char *varnameA,
306  tntDoubleArray arrB,
307  const char *varnameB,
308  tntDoubleArray arrC,
309  const char *varnameC,
310  tntDoubleArray arrD,
311  const char *varnameD,
312  tntDoubleArray arrE,
313  const char *varnameE)
314 #else
315 void tntDoubleArraysUpdateStatic(const char *fname,
316  unsigned posn,
317  tntDoubleArray arrA,
318  const char *varnameA,
319  tntDoubleArray arrB,
320  const char *varnameB,
321  tntDoubleArray arrC,
322  const char *varnameC,
323  tntDoubleArray arrD,
324  const char *varnameD,
325  tntDoubleArray arrE,
326  const char *varnameE)
327 #endif
328 {
329  tntDoubleArray arrs[TNT_MAX_NUMIO] = {arrA,arrB,arrC,arrD,arrE};
330  const char *varnames[TNT_MAX_NUMIO] = {varnameA,varnameB,varnameC,varnameD,varnameE};
331  unsigned numdbl = _tnt_find_num_unique(varnames);
332  TNT_ERR_RET_DEFS
333 
334  ret = _tnt_update_dblarrs(fname, posn, numdbl, varnames, arrs);
335  TNT_PUB_N_ERR_CHK("tntDoubleArraysUpdate") /* NO_COVERAGE */
336 
337 }
338 
339 
340 #ifdef MAKINGPUBLICDOCS
341 
352 void tntComplexArraysUpdate(const char *fname,
353  unsigned posn,
354  tntComplexArray arrA,
355  tntComplexArray arrB,
356  tntComplexArray arrC,
357  tntComplexArray arrD,
358  tntComplexArray arrE)
359 {}
371 void tntComplexArraysNamedUpdate(const char *fname,
372  unsigned posn,
373  tntComplexArray arrA,
374  const char *varnameA,
375  tntComplexArray arrB,
376  const char *varnameB,
377  tntComplexArray arrC,
378  const char *varnameC,
379  tntComplexArray arrD,
380  const char *varnameD,
381  tntComplexArray arrE,
382  const char *varnameE)
383 #else
384 void tntComplexArraysUpdateStatic(const char *fname,
385  unsigned posn,
386  tntComplexArray arrA,
387  const char *varnameA,
388  tntComplexArray arrB,
389  const char *varnameB,
390  tntComplexArray arrC,
391  const char *varnameC,
392  tntComplexArray arrD,
393  const char *varnameD,
394  tntComplexArray arrE,
395  const char *varnameE)
396 #endif
397 {
398  tntComplexArray arrs[TNT_MAX_NUMIO] = {arrA,arrB,arrC,arrD,arrE};
399  const char *varnames[TNT_MAX_NUMIO] = {varnameA,varnameB,varnameC,varnameD,varnameE};
400  unsigned numcmp = _tnt_find_num_unique(varnames);
401  TNT_ERR_RET_DEFS
402 
403  ret = _tnt_update_cmparrs(fname, posn, numcmp, varnames, arrs);
404  TNT_PUB_N_ERR_CHK("tntComplexArraysUpdate") /* NO_COVERAGE */
405 }
void tntDoubleArraysUpdate(const char *fname, unsigned posn, tntDoubleArray arrA, tntDoubleArray arrB, tntDoubleArray arrC, tntDoubleArray arrD, tntDoubleArray arrE)
Definition: tntUpdate.c:283
void tntIntArraysNamedUpdate(const char *fname, unsigned posn, tntIntArray arrA, const char *varnameA, tntIntArray arrB, const char *varnameB, tntIntArray arrC, const char *varnameC, tntIntArray arrD, const char *varnameD, tntIntArray arrE, const char *varnameE)
Definition: tntUpdate.c:233
void tntDoubleParamsNamedUpdate(const char *fname, unsigned posn, double varA, const char *varnameA, double varB, const char *varnameB, double varC, const char *varnameC, double varD, const char *varnameD, double varE, const char *varnameE)
Definition: tntUpdate.c:103
void tntDoubleArraysNamedUpdate(const char *fname, unsigned posn, tntDoubleArray arrA, const char *varnameA, tntDoubleArray arrB, const char *varnameB, tntDoubleArray arrC, const char *varnameC, tntDoubleArray arrD, const char *varnameD, tntDoubleArray arrE, const char *varnameE)
Definition: tntUpdate.c:302
void tntDoubleParamsUpdate(const char *fname, unsigned posn, double varA, double varB, double varC, double varD, double varE)
Definition: tntUpdate.c:88
void tntIntParamsNamedUpdate(const char *fname, unsigned posn, int varA, const char *varnameA, int varB, const char *varnameB, int varC, const char *varnameC, int varD, const char *varnameD, int varE, const char *varnameE)
Definition: tntUpdate.c:42
Definition: tnt.h:65
void tntIntParamsUpdate(const char *fname, unsigned posn, int varA, int varB, int varC, int varD, int varE)
Definition: tntUpdate.c:27
void tntIntArraysUpdate(const char *fname, unsigned posn, tntIntArray arrA, tntIntArray arrB, tntIntArray arrC, tntIntArray arrD, tntIntArray arrE)
Definition: tntUpdate.c:214
void tntComplexParamsNamedUpdate(const char *fname, unsigned posn, tntComplex varA, const char *varnameA, tntComplex varB, const char *varnameB, tntComplex varC, const char *varnameC, tntComplex varD, const char *varnameD, tntComplex varE, const char *varnameE)
Definition: tntUpdate.c:165
void tntComplexParamsUpdate(const char *savepref, unsigned posn, tntComplex varA, tntComplex varB, tntComplex varC, tntComplex varD, tntComplex varE)
Definition: tntUpdate.c:149
void tntComplexArraysNamedUpdate(const char *fname, unsigned posn, tntComplexArray arrA, const char *varnameA, tntComplexArray arrB, const char *varnameB, tntComplexArray arrC, const char *varnameC, tntComplexArray arrD, const char *varnameD, tntComplexArray arrE, const char *varnameE)
Definition: tntUpdate.c:371
void tntComplexArraysUpdate(const char *fname, unsigned posn, tntComplexArray arrA, tntComplexArray arrB, tntComplexArray arrC, tntComplexArray arrD, tntComplexArray arrE)
Definition: tntUpdate.c:352