libqasm
library for handling cQASM files
cqasm-v1-functions-gen.cpp
Go to the documentation of this file.
1 
6 #include <cmath>
7 #include <complex>
9 
10 namespace cqasm {
11 namespace v1 {
12 
16 namespace functions {
17 
22 static int64_t div_floor(int64_t a, int64_t b) {
23  int64_t res = a / b;
24  int64_t rem = a % b;
25  // Correct division result downwards if up-rounding happened,
26  // (for non-zero remainder of sign different than the divisor).
27  int64_t corr = (rem != 0 && ((rem < 0) != (b < 0)));
28  return res - corr;
29 }
30 
34 static int64_t mod_floor(int64_t a, int64_t b) {
35  int64_t rem = a % b;
36  if (rem != 0 && ((rem < 0) != (b < 0))) {
37  rem += b;
38  }
39  return rem;
40 }
41 
42 
45  auto a = v[0]->as_const_complex()->value;
46  auto b = v[1]->as_const_complex()->value;
47  return tree::make<values::ConstComplex>(a + b);
48 }
49 
52  auto a = v[0]->as_const_real()->value;
53  auto b = v[1]->as_const_real()->value;
54  return tree::make<values::ConstReal>(a + b);
55 }
56 
59  auto a = v[0]->as_const_int()->value;
60  auto b = v[1]->as_const_int()->value;
61  return tree::make<values::ConstInt>(a + b);
62 }
63 
66  auto a = v[0]->as_const_string()->value;
67  auto b = v[1]->as_const_string()->value;
68  return tree::make<values::ConstString>(a + b);
69 }
70 
73  auto a = v[0]->as_const_complex()->value;
74  auto b = v[1]->as_const_complex()->value;
75  return tree::make<values::ConstComplex>(a - b);
76 }
77 
80  auto a = v[0]->as_const_real()->value;
81  auto b = v[1]->as_const_real()->value;
82  return tree::make<values::ConstReal>(a - b);
83 }
84 
87  auto a = v[0]->as_const_int()->value;
88  auto b = v[1]->as_const_int()->value;
89  return tree::make<values::ConstInt>(a - b);
90 }
91 
94  auto a = v[0]->as_const_complex()->value;
95  return tree::make<values::ConstComplex>(-a);
96 }
97 
100  auto a = v[0]->as_const_real()->value;
101  return tree::make<values::ConstReal>(-a);
102 }
103 
106  auto a = v[0]->as_const_int()->value;
107  return tree::make<values::ConstInt>(-a);
108 }
109 
112  auto a = v[0]->as_const_complex()->value;
113  auto b = v[1]->as_const_complex()->value;
114  return tree::make<values::ConstComplex>(a * b);
115 }
116 
119  auto a = v[0]->as_const_real()->value;
120  auto b = v[1]->as_const_real()->value;
121  return tree::make<values::ConstReal>(a * b);
122 }
123 
126  auto a = v[0]->as_const_int()->value;
127  auto b = v[1]->as_const_int()->value;
128  return tree::make<values::ConstInt>(a * b);
129 }
130 
133  auto a = v[0]->as_const_complex()->value;
134  auto b = v[1]->as_const_complex()->value;
135  return tree::make<values::ConstComplex>(a / b);
136 }
137 
140  auto a = v[0]->as_const_real()->value;
141  auto b = v[1]->as_const_real()->value;
142  return tree::make<values::ConstReal>(a / b);
143 }
144 
147  auto a = v[0]->as_const_int()->value;
148  auto b = v[1]->as_const_int()->value;
149  return tree::make<values::ConstInt>(div_floor(a, b));
150 }
151 
154  auto a = v[0]->as_const_int()->value;
155  auto b = v[1]->as_const_int()->value;
156  return tree::make<values::ConstInt>(mod_floor(a, b));
157 }
158 
161  auto a = v[0]->as_const_complex()->value;
162  auto b = v[1]->as_const_complex()->value;
163  return tree::make<values::ConstComplex>(std::pow(a, b));
164 }
165 
168  auto a = v[0]->as_const_real()->value;
169  auto b = v[1]->as_const_real()->value;
170  return tree::make<values::ConstReal>(std::pow(a, b));
171 }
172 
175  auto a = v[0]->as_const_complex()->value;
176  auto b = v[1]->as_const_complex()->value;
177  return tree::make<values::ConstBool>(a == b);
178 }
179 
182  auto a = v[0]->as_const_complex()->value;
183  auto b = v[1]->as_const_complex()->value;
184  return tree::make<values::ConstBool>(a != b);
185 }
186 
189  auto a = v[0]->as_const_real()->value;
190  auto b = v[1]->as_const_real()->value;
191  return tree::make<values::ConstBool>(a == b);
192 }
193 
196  auto a = v[0]->as_const_real()->value;
197  auto b = v[1]->as_const_real()->value;
198  return tree::make<values::ConstBool>(a != b);
199 }
200 
203  auto a = v[0]->as_const_real()->value;
204  auto b = v[1]->as_const_real()->value;
205  return tree::make<values::ConstBool>(a >= b);
206 }
207 
210  auto a = v[0]->as_const_real()->value;
211  auto b = v[1]->as_const_real()->value;
212  return tree::make<values::ConstBool>(a > b);
213 }
214 
217  auto a = v[0]->as_const_real()->value;
218  auto b = v[1]->as_const_real()->value;
219  return tree::make<values::ConstBool>(a <= b);
220 }
221 
224  auto a = v[0]->as_const_real()->value;
225  auto b = v[1]->as_const_real()->value;
226  return tree::make<values::ConstBool>(a < b);
227 }
228 
231  auto a = v[0]->as_const_int()->value;
232  auto b = v[1]->as_const_int()->value;
233  return tree::make<values::ConstBool>(a == b);
234 }
235 
238  auto a = v[0]->as_const_int()->value;
239  auto b = v[1]->as_const_int()->value;
240  return tree::make<values::ConstBool>(a != b);
241 }
242 
245  auto a = v[0]->as_const_int()->value;
246  auto b = v[1]->as_const_int()->value;
247  return tree::make<values::ConstBool>(a >= b);
248 }
249 
252  auto a = v[0]->as_const_int()->value;
253  auto b = v[1]->as_const_int()->value;
254  return tree::make<values::ConstBool>(a > b);
255 }
256 
259  auto a = v[0]->as_const_int()->value;
260  auto b = v[1]->as_const_int()->value;
261  return tree::make<values::ConstBool>(a <= b);
262 }
263 
266  auto a = v[0]->as_const_int()->value;
267  auto b = v[1]->as_const_int()->value;
268  return tree::make<values::ConstBool>(a < b);
269 }
270 
273  auto a = v[0]->as_const_bool()->value;
274  auto b = v[1]->as_const_bool()->value;
275  return tree::make<values::ConstBool>(a == b);
276 }
277 
280  auto a = v[0]->as_const_bool()->value;
281  auto b = v[1]->as_const_bool()->value;
282  return tree::make<values::ConstBool>(a != b);
283 }
284 
287  auto a = v[0]->as_const_bool()->value;
288  auto b = v[1]->as_const_bool()->value;
289  return tree::make<values::ConstBool>(a >= b);
290 }
291 
294  auto a = v[0]->as_const_bool()->value;
295  auto b = v[1]->as_const_bool()->value;
296  return tree::make<values::ConstBool>(a > b);
297 }
298 
301  auto a = v[0]->as_const_bool()->value;
302  auto b = v[1]->as_const_bool()->value;
303  return tree::make<values::ConstBool>(a <= b);
304 }
305 
308  auto a = v[0]->as_const_bool()->value;
309  auto b = v[1]->as_const_bool()->value;
310  return tree::make<values::ConstBool>(a < b);
311 }
312 
315  auto a = v[0]->as_const_int()->value;
316  return tree::make<values::ConstInt>(~a);
317 }
318 
321  auto a = v[0]->as_const_int()->value;
322  auto b = v[1]->as_const_int()->value;
323  return tree::make<values::ConstInt>(a & b);
324 }
325 
328  auto a = v[0]->as_const_int()->value;
329  auto b = v[1]->as_const_int()->value;
330  return tree::make<values::ConstInt>(a ^ b);
331 }
332 
335  auto a = v[0]->as_const_int()->value;
336  auto b = v[1]->as_const_int()->value;
337  return tree::make<values::ConstInt>(a | b);
338 }
339 
342  auto a = v[0]->as_const_int()->value;
343  auto b = v[1]->as_const_int()->value;
344  return tree::make<values::ConstInt>(a << b);
345 }
346 
349  auto a = v[0]->as_const_int()->value;
350  auto b = v[1]->as_const_int()->value;
351  return tree::make<values::ConstInt>(a >> b);
352 }
353 
356  auto a = v[0]->as_const_int()->value;
357  auto b = v[1]->as_const_int()->value;
358  return tree::make<values::ConstInt>((int64_t)(((uint64_t)a) >> b));
359 }
360 
363  auto a = v[0]->as_const_bool()->value;
364  return tree::make<values::ConstBool>(!a);
365 }
366 
369  auto a = v[0]->as_const_bool()->value;
370  auto b = v[1]->as_const_bool()->value;
371  return tree::make<values::ConstBool>(a && b);
372 }
373 
376  auto a = v[0]->as_const_bool()->value;
377  auto b = v[1]->as_const_bool()->value;
378  return tree::make<values::ConstBool>(!a ^ !b);
379 }
380 
383  auto a = v[0]->as_const_bool()->value;
384  auto b = v[1]->as_const_bool()->value;
385  return tree::make<values::ConstBool>(a || b);
386 }
387 
390  auto a = v[0]->as_const_bool()->value;
391  auto b = v[1]->as_const_complex()->value;
392  auto c = v[2]->as_const_complex()->value;
393  return tree::make<values::ConstComplex>(a ? b : c);
394 }
395 
398  auto a = v[0]->as_const_bool()->value;
399  auto b = v[1]->as_const_real()->value;
400  auto c = v[2]->as_const_real()->value;
401  return tree::make<values::ConstReal>(a ? b : c);
402 }
403 
406  auto a = v[0]->as_const_bool()->value;
407  auto b = v[1]->as_const_int()->value;
408  auto c = v[2]->as_const_int()->value;
409  return tree::make<values::ConstInt>(a ? b : c);
410 }
411 
414  auto a = v[0]->as_const_bool()->value;
415  auto b = v[1]->as_const_bool()->value;
416  auto c = v[2]->as_const_bool()->value;
417  return tree::make<values::ConstBool>(a ? b : c);
418 }
419 
422  auto a = v[0]->as_const_complex()->value;
423  return tree::make<values::ConstComplex>(std::sqrt(a));
424 }
425 
428  auto a = v[0]->as_const_complex()->value;
429  return tree::make<values::ConstComplex>(std::exp(a));
430 }
431 
434  auto a = v[0]->as_const_complex()->value;
435  return tree::make<values::ConstComplex>(std::log(a));
436 }
437 
440  auto a = v[0]->as_const_complex()->value;
441  return tree::make<values::ConstComplex>(std::sin(a));
442 }
443 
446  auto a = v[0]->as_const_complex()->value;
447  return tree::make<values::ConstComplex>(std::cos(a));
448 }
449 
452  auto a = v[0]->as_const_complex()->value;
453  return tree::make<values::ConstComplex>(std::tan(a));
454 }
455 
458  auto a = v[0]->as_const_complex()->value;
459  return tree::make<values::ConstComplex>(std::sinh(a));
460 }
461 
464  auto a = v[0]->as_const_complex()->value;
465  return tree::make<values::ConstComplex>(std::cosh(a));
466 }
467 
470  auto a = v[0]->as_const_complex()->value;
471  return tree::make<values::ConstComplex>(std::tanh(a));
472 }
473 
476  auto a = v[0]->as_const_complex()->value;
477  return tree::make<values::ConstComplex>(std::asin(a));
478 }
479 
482  auto a = v[0]->as_const_complex()->value;
483  return tree::make<values::ConstComplex>(std::acos(a));
484 }
485 
488  auto a = v[0]->as_const_complex()->value;
489  return tree::make<values::ConstComplex>(std::atan(a));
490 }
491 
494  auto a = v[0]->as_const_complex()->value;
495  return tree::make<values::ConstComplex>(std::asinh(a));
496 }
497 
500  auto a = v[0]->as_const_complex()->value;
501  return tree::make<values::ConstComplex>(std::acosh(a));
502 }
503 
506  auto a = v[0]->as_const_complex()->value;
507  return tree::make<values::ConstComplex>(std::atanh(a));
508 }
509 
512  auto a = v[0]->as_const_real()->value;
513  return tree::make<values::ConstReal>(std::sqrt(a));
514 }
515 
518  auto a = v[0]->as_const_real()->value;
519  return tree::make<values::ConstReal>(std::exp(a));
520 }
521 
524  auto a = v[0]->as_const_real()->value;
525  return tree::make<values::ConstReal>(std::log(a));
526 }
527 
530  auto a = v[0]->as_const_real()->value;
531  return tree::make<values::ConstReal>(std::sin(a));
532 }
533 
536  auto a = v[0]->as_const_real()->value;
537  return tree::make<values::ConstReal>(std::cos(a));
538 }
539 
542  auto a = v[0]->as_const_real()->value;
543  return tree::make<values::ConstReal>(std::tan(a));
544 }
545 
548  auto a = v[0]->as_const_real()->value;
549  return tree::make<values::ConstReal>(std::sinh(a));
550 }
551 
554  auto a = v[0]->as_const_real()->value;
555  return tree::make<values::ConstReal>(std::cosh(a));
556 }
557 
560  auto a = v[0]->as_const_real()->value;
561  return tree::make<values::ConstReal>(std::tanh(a));
562 }
563 
566  auto a = v[0]->as_const_real()->value;
567  return tree::make<values::ConstReal>(std::asin(a));
568 }
569 
572  auto a = v[0]->as_const_real()->value;
573  return tree::make<values::ConstReal>(std::acos(a));
574 }
575 
578  auto a = v[0]->as_const_real()->value;
579  return tree::make<values::ConstReal>(std::atan(a));
580 }
581 
584  auto a = v[0]->as_const_real()->value;
585  return tree::make<values::ConstReal>(std::asinh(a));
586 }
587 
590  auto a = v[0]->as_const_real()->value;
591  return tree::make<values::ConstReal>(std::acosh(a));
592 }
593 
596  auto a = v[0]->as_const_real()->value;
597  return tree::make<values::ConstReal>(std::atanh(a));
598 }
599 
602  auto a = v[0]->as_const_real()->value;
603  return tree::make<values::ConstReal>(std::abs(a));
604 }
605 
608  auto a = v[0]->as_const_int()->value;
609  return tree::make<values::ConstInt>(std::abs(a));
610 }
611 
614  auto a = v[0]->as_const_real()->value;
615  auto b = v[1]->as_const_real()->value;
616  return tree::make<values::ConstComplex>(primitives::Complex(a, b));
617 }
618 
621  auto a = v[0]->as_const_real()->value;
622  auto b = v[1]->as_const_real()->value;
623  return tree::make<values::ConstComplex>(std::polar<double>(a, b));
624 }
625 
628  auto a = v[0]->as_const_complex()->value;
629  return tree::make<values::ConstReal>(std::real<double>(a));
630 }
631 
634  auto a = v[0]->as_const_complex()->value;
635  return tree::make<values::ConstReal>(std::imag<double>(a));
636 }
637 
640  auto a = v[0]->as_const_complex()->value;
641  return tree::make<values::ConstReal>(std::arg<double>(a));
642 }
643 
646  auto a = v[0]->as_const_complex()->value;
647  return tree::make<values::ConstReal>(std::norm<double>(a));
648 }
649 
652  auto a = v[0]->as_const_complex()->value;
653  return tree::make<values::ConstComplex>(std::conj<double>(a));
654 }
655 
661  table.add("operator+", types::from_spec("cc"), op_add_cc);
662  table.add("operator+", types::from_spec("rr"), op_add_rr);
663  table.add("operator+", types::from_spec("ii"), op_add_ii);
664  table.add("operator+", types::from_spec("ss"), op_add_ss);
665  table.add("operator-", types::from_spec("cc"), op_sub_cc);
666  table.add("operator-", types::from_spec("rr"), op_sub_rr);
667  table.add("operator-", types::from_spec("ii"), op_sub_ii);
668  table.add("operator-", types::from_spec("c"), op_neg_c);
669  table.add("operator-", types::from_spec("r"), op_neg_r);
670  table.add("operator-", types::from_spec("i"), op_neg_i);
671  table.add("operator*", types::from_spec("cc"), op_mul_cc);
672  table.add("operator*", types::from_spec("rr"), op_mul_rr);
673  table.add("operator*", types::from_spec("ii"), op_mul_ii);
674  table.add("operator/", types::from_spec("cc"), op_div_cc);
675  table.add("operator/", types::from_spec("rr"), op_div_rr);
676  table.add("operator//", types::from_spec("ii"), op_int_div_ii);
677  table.add("operator%", types::from_spec("ii"), op_mod_ii);
678  table.add("operator**", types::from_spec("cc"), op_pow_cc);
679  table.add("operator**", types::from_spec("rr"), op_pow_rr);
680  table.add("operator==", types::from_spec("cc"), op_eq_cc);
681  table.add("operator!=", types::from_spec("cc"), op_ne_cc);
682  table.add("operator==", types::from_spec("rr"), op_eq_rr);
683  table.add("operator!=", types::from_spec("rr"), op_ne_rr);
684  table.add("operator>=", types::from_spec("rr"), op_ge_rr);
685  table.add("operator>", types::from_spec("rr"), op_gt_rr);
686  table.add("operator<=", types::from_spec("rr"), op_le_rr);
687  table.add("operator<", types::from_spec("rr"), op_lt_rr);
688  table.add("operator==", types::from_spec("ii"), op_eq_ii);
689  table.add("operator!=", types::from_spec("ii"), op_ne_ii);
690  table.add("operator>=", types::from_spec("ii"), op_ge_ii);
691  table.add("operator>", types::from_spec("ii"), op_gt_ii);
692  table.add("operator<=", types::from_spec("ii"), op_le_ii);
693  table.add("operator<", types::from_spec("ii"), op_lt_ii);
694  table.add("operator==", types::from_spec("bb"), op_eq_bb);
695  table.add("operator!=", types::from_spec("bb"), op_ne_bb);
696  table.add("operator>=", types::from_spec("bb"), op_ge_bb);
697  table.add("operator>", types::from_spec("bb"), op_gt_bb);
698  table.add("operator<=", types::from_spec("bb"), op_le_bb);
699  table.add("operator<", types::from_spec("bb"), op_lt_bb);
700  table.add("operator~", types::from_spec("i"), op_binv_i);
701  table.add("operator&", types::from_spec("ii"), op_band_ii);
702  table.add("operator^", types::from_spec("ii"), op_bxor_ii);
703  table.add("operator|", types::from_spec("ii"), op_bor_ii);
704  table.add("operator<<", types::from_spec("ii"), op_shl_ii);
705  table.add("operator>>", types::from_spec("ii"), op_sra_ii);
706  table.add("operator>>>", types::from_spec("ii"), op_srl_ii);
707  table.add("operator!", types::from_spec("b"), op_linv_b);
708  table.add("operator&&", types::from_spec("bb"), op_land_bb);
709  table.add("operator^^", types::from_spec("bb"), op_lxor_bb);
710  table.add("operator||", types::from_spec("bb"), op_lor_bb);
711  table.add("operator?:", types::from_spec("bcc"), op_tcnd_bcc);
712  table.add("operator?:", types::from_spec("brr"), op_tcnd_brr);
713  table.add("operator?:", types::from_spec("bii"), op_tcnd_bii);
714  table.add("operator?:", types::from_spec("bbb"), op_tcnd_bbb);
715  table.add("sqrt", types::from_spec("c"), fn_sqrt_c);
716  table.add("exp", types::from_spec("c"), fn_exp_c);
717  table.add("log", types::from_spec("c"), fn_log_c);
718  table.add("sin", types::from_spec("c"), fn_sin_c);
719  table.add("cos", types::from_spec("c"), fn_cos_c);
720  table.add("tan", types::from_spec("c"), fn_tan_c);
721  table.add("sinh", types::from_spec("c"), fn_sinh_c);
722  table.add("cosh", types::from_spec("c"), fn_cosh_c);
723  table.add("tanh", types::from_spec("c"), fn_tanh_c);
724  table.add("asin", types::from_spec("c"), fn_asin_c);
725  table.add("acos", types::from_spec("c"), fn_acos_c);
726  table.add("atan", types::from_spec("c"), fn_atan_c);
727  table.add("asinh", types::from_spec("c"), fn_asinh_c);
728  table.add("acosh", types::from_spec("c"), fn_acosh_c);
729  table.add("atanh", types::from_spec("c"), fn_atanh_c);
730  table.add("sqrt", types::from_spec("r"), fn_sqrt_r);
731  table.add("exp", types::from_spec("r"), fn_exp_r);
732  table.add("log", types::from_spec("r"), fn_log_r);
733  table.add("sin", types::from_spec("r"), fn_sin_r);
734  table.add("cos", types::from_spec("r"), fn_cos_r);
735  table.add("tan", types::from_spec("r"), fn_tan_r);
736  table.add("sinh", types::from_spec("r"), fn_sinh_r);
737  table.add("cosh", types::from_spec("r"), fn_cosh_r);
738  table.add("tanh", types::from_spec("r"), fn_tanh_r);
739  table.add("asin", types::from_spec("r"), fn_asin_r);
740  table.add("acos", types::from_spec("r"), fn_acos_r);
741  table.add("atan", types::from_spec("r"), fn_atan_r);
742  table.add("asinh", types::from_spec("r"), fn_asinh_r);
743  table.add("acosh", types::from_spec("r"), fn_acosh_r);
744  table.add("atanh", types::from_spec("r"), fn_atanh_r);
745  table.add("abs", types::from_spec("r"), fn_abs_r);
746  table.add("abs", types::from_spec("i"), fn_abs_i);
747  table.add("complex", types::from_spec("rr"), fn_complex_rr);
748  table.add("polar", types::from_spec("rr"), fn_polar_rr);
749  table.add("real", types::from_spec("c"), fn_real_c);
750  table.add("imag", types::from_spec("c"), fn_imag_c);
751  table.add("arg", types::from_spec("c"), fn_arg_c);
752  table.add("norm", types::from_spec("c"), fn_norm_c);
753  table.add("conj", types::from_spec("c"), fn_conj_c);
754 
755 }
756 
757 } // namespace functions
758 } // namespace v1
759 } // namespace cqasm
values::Value op_ne_rr(const values::Values &v)
values::Value fn_cos_r(const values::Values &v)
values::Value fn_atanh_r(const values::Values &v)
values::Value op_pow_rr(const values::Values &v)
values::Value op_sub_cc(const values::Values &v)
values::Value fn_abs_r(const values::Values &v)
values::Value op_neg_c(const values::Values &v)
values::Value op_bor_ii(const values::Values &v)
std::complex< double > Complex
Complex number primitive used within the semantic trees.
values::Value op_tcnd_bbb(const values::Values &v)
values::Value fn_sin_c(const values::Values &v)
values::Value fn_imag_c(const values::Values &v)
values::Value op_le_rr(const values::Values &v)
values::Value op_sub_ii(const values::Values &v)
values::Value op_pow_cc(const values::Values &v)
values::Value fn_tanh_c(const values::Values &v)
values::Value fn_asin_c(const values::Values &v)
values::Value op_gt_ii(const values::Values &v)
Types from_spec(const std::string &spec)
Constructs a set of types from a shorthand string representation.
Toplevel namespace with entry points for the new API.
values::Value op_add_ii(const values::Values &v)
values::Value op_lt_bb(const values::Values &v)
values::Value op_gt_rr(const values::Values &v)
values::Value fn_acosh_r(const values::Values &v)
Header file generated by func-gen.
values::Value op_add_rr(const values::Values &v)
values::Value op_neg_i(const values::Values &v)
values::Value fn_exp_r(const values::Values &v)
values::Value op_tcnd_bii(const values::Values &v)
values::Value op_ge_ii(const values::Values &v)
values::Value op_ge_rr(const values::Values &v)
values::Value op_add_ss(const values::Values &v)
values::Value op_shl_ii(const values::Values &v)
values::Value op_tcnd_bcc(const values::Values &v)
values::Value op_lxor_bb(const values::Values &v)
values::Value op_neg_r(const values::Values &v)
values::Value op_eq_rr(const values::Values &v)
values::Value op_tcnd_brr(const values::Values &v)
values::Value op_int_div_ii(const values::Values &v)
values::Value fn_asin_r(const values::Values &v)
tree::Any< Node > Values
Zero or more cQASM values.
values::Value op_band_ii(const values::Values &v)
values::Value op_lt_rr(const values::Values &v)
values::Value fn_tan_r(const values::Values &v)
void register_into(resolver::FunctionTable &table)
Registers a bunch of functions usable during constant propagation into the given function table...
values::Value fn_sinh_c(const values::Values &v)
values::Value op_le_ii(const values::Values &v)
Table of all overloads of all constant propagation functions.
values::Value fn_norm_c(const values::Values &v)
values::Value fn_sinh_r(const values::Values &v)
values::Value op_lor_bb(const values::Values &v)
values::Value fn_tan_c(const values::Values &v)
values::Value fn_asinh_r(const values::Values &v)
values::Value op_ne_bb(const values::Values &v)
values::Value fn_sqrt_r(const values::Values &v)
values::Value op_eq_cc(const values::Values &v)
values::Value op_add_cc(const values::Values &v)
values::Value fn_acos_r(const values::Values &v)
Namespace for the "new" cQASM 1.x API.
values::Value fn_atanh_c(const values::Values &v)
values::Value fn_conj_c(const values::Values &v)
values::Value op_mul_rr(const values::Values &v)
values::Value op_mod_ii(const values::Values &v)
values::Value fn_acosh_c(const values::Values &v)
values::Value fn_asinh_c(const values::Values &v)
values::Value op_srl_ii(const values::Values &v)
tree::One< Node > Value
A cQASM value, either known at compile-time or an expression for something only known at runtime...
values::Value op_eq_ii(const values::Values &v)
values::Value fn_abs_i(const values::Values &v)
values::Value fn_real_c(const values::Values &v)
values::Value op_sub_rr(const values::Values &v)
values::Value op_le_bb(const values::Values &v)
values::Value fn_atan_r(const values::Values &v)
void check_const(const Value &value)
Throws an AnalysisError if the given value is not a constant, i.e.
values::Value op_binv_i(const values::Values &v)
values::Value op_linv_b(const values::Values &v)
values::Value op_mul_cc(const values::Values &v)
values::Value fn_tanh_r(const values::Values &v)
values::Value op_ge_bb(const values::Values &v)
values::Value fn_sqrt_c(const values::Values &v)
values::Value op_lt_ii(const values::Values &v)
values::Value fn_cos_c(const values::Values &v)
values::Value op_land_bb(const values::Values &v)
values::Value fn_acos_c(const values::Values &v)
values::Value fn_cosh_r(const values::Values &v)
values::Value fn_log_c(const values::Values &v)
values::Value op_div_rr(const values::Values &v)
values::Value op_ne_cc(const values::Values &v)
values::Value fn_exp_c(const values::Values &v)
values::Value fn_atan_c(const values::Values &v)
values::Value fn_cosh_c(const values::Values &v)
values::Value fn_arg_c(const values::Values &v)
values::Value fn_log_r(const values::Values &v)
values::Value fn_complex_rr(const values::Values &v)
values::Value fn_polar_rr(const values::Values &v)
values::Value op_eq_bb(const values::Values &v)
values::Value op_gt_bb(const values::Values &v)
values::Value op_div_cc(const values::Values &v)
void add(const std::string &name, const types::Types &param_types, const FunctionImpl &impl)
Registers a function.
values::Value op_bxor_ii(const values::Values &v)
values::Value op_ne_ii(const values::Values &v)
values::Value fn_sin_r(const values::Values &v)
values::Value op_sra_ii(const values::Values &v)
values::Value op_mul_ii(const values::Values &v)