17 return os << x.
val.
i.
x;
19 return os << Rational(x.
val.
h.
x, 2);
20 case ValueType::FINAL: {
41 is >> x.
type >> upp >> low;
50 std::sort(
begin(),
end(), [](
auto&
a,
auto&
b) {
return a.type <
b.type; });
54 return std::adjacent_find(
begin(),
end(), [](
auto&
a,
auto&
b) {
55 return a.type >=
b.type;
60std::pair<std::string_view, String>
fix_legacy(std::string_view key,
61 std::string_view val) {
62 if (key ==
"ElectronState") {
63 if (val ==
"X")
return {
"ElecStateLabel",
"X"};
64 if (val ==
"a")
return {
"ElecStateLabel",
"a"};
65 if (val ==
"b")
return {
"ElecStateLabel",
"b"};
66 if (val ==
"c")
return {
"ElecStateLabel",
"c"};
67 if (val ==
"A")
return {
"ElecStateLabel",
"A"};
68 if (val ==
"'")
return {
"ElecStateLabel",
"'"};
69 if (val ==
"B")
return {
"ElecStateLabel",
"B"};
70 if (val ==
"88")
return {
"ElecStateLabel",
"X"};
71 if (val ==
"97")
return {
"ElecStateLabel",
"a"};
72 if (val ==
"98")
return {
"ElecStateLabel",
"b"};
73 if (val ==
"99")
return {
"ElecStateLabel",
"c"};
74 if (val ==
"65")
return {
"ElecStateLabel",
"A"};
75 if (val ==
"39")
return {
"ElecStateLabel",
"'"};
76 if (val ==
"66")
return {
"ElecStateLabel",
"B"};
80 if (key ==
"parity") {
81 if (val ==
"-")
return {key,
"-"};
82 if (val ==
"+")
return {key,
"+"};
83 if (val ==
"-1")
return {key,
"-"};
84 if (val ==
"1")
return {key,
"+"};
88 if (key ==
"Hund")
return {
"config", val};
90 if (key ==
"kronigParity") {
91 if (val ==
"e")
return {key,
"e"};
92 if (val ==
"f")
return {key,
"f"};
93 if (val ==
"101")
return {key,
"e"};
94 if (val ==
"102")
return {key,
"f"};
109 n % 3,
"Must have multiple of three items, got ", n,
" in:\n", s)
110 for (Index i = 0; i < n; i += 3)
values.emplace_back(
Value(items<3>(s, i)));
114 auto key_type =
items(s, i);
115 if (key_type ==
"ALL")
return;
116 if (key_type ==
"NONE")
return;
118 if (key_type ==
"TR") {
124 items(s, i) not_eq
"UP",
"Bad legacy quantum numbers in:\n", s)
128 for (; i < n; i += 2) {
129 auto key =
items(s, i);
138 auto t = toTypeOrThrow(k);
140 std::find_if(
begin(),
end(), [t](
auto& x) {
152 if (key_type ==
"EN") {
156 for (; i < n; i += 2) {
158 auto t = toTypeOrThrow(key);
161 auto valptr = std::find_if(
162 begin(),
end(), [t](
auto& x) {
return x.type == t; });
163 valptr->set(val,
true);
164 valptr->set(val,
false);
167 value.
set(val,
true);
168 value.
set(val,
false);
183 "Uneven count of items for legacy upper quantum number list: ",
187 "Uneven count of items for legacy lower quantum number list: ",
190 for (Index i = 0; i < nu; i += 2) {
192 auto key = toTypeOrThrow(k);
195 std::find_if(
begin(),
end(), [key](
auto&
a) {
return a.type == key; });
199 begin(),
end(), [key](
auto&
a) {
return a.type == key; });
205 for (Index i = 0; i < nl; i += 2) {
207 auto key = toTypeOrThrow(k);
210 std::find_if(
begin(),
end(), [key](
auto&
a) {
return a.type == key; });
214 begin(),
end(), [key](
auto&
a) {
return a.type == key; });
217 ptr->set(val,
false);
229 std::string_view x) {
230 auto eq = x.find(
'=');
231 std::pair<std::string_view, std::string_view> out{
strip(x.substr(0, eq)),
232 strip(x.substr(eq + 1))};
234 if (x.size() > 1 and
'F' == out.first.front() and
'#' == out.first[1])
235 out.first = out.first.substr(0, 1);
244 while (not upp.empty()) {
245 auto sep = upp.find(
';');
247 auto type = toTypeOrThrow(t);
252 " already exist, this is a problem, there should be only one per level!")
255 if (sep == upp.npos)
break;
256 upp = upp.substr(sep + 1);
260 while (not low.empty()) {
261 auto sep = low.find(
';');
263 auto type = toTypeOrThrow(t);
265 Value val = out[type];
272 if (sep == low.npos)
break;
273 low = low.substr(sep + 1);
282 "The quantum number list: [",
284 "] contains copies of types")
291 auto this_val = cbegin();
292 auto that_val = that.cbegin();
293 while (that_val not_eq that.cend() and this_val not_eq cend()) {
294 if (that_val->type < this_val->type)
296 else if (this_val->type < that_val->type)
305 CheckMatch status = {CheckValue::Full, CheckValue::Full};
307 for (Type
const t : enumtyps::TypeTypes) {
308 const bool ahas = has(t), bhas = other.has(t);
311 const LevelMatch levels = operator[](t).level_match(other[t]);
312 if (not levels.
upp) status.
upp = CheckValue::Miss;
313 if (not levels.
low) status.
low = CheckValue::Miss;
314 }
else if (ahas and not bhas) {
315 status =
update(status, CheckValue::BinA);
316 }
else if (not ahas and bhas) {
317 status =
update(status, CheckValue::AinB);
325 std::find_if(cbegin(), cend(), [t](
auto& x) {
return x.type == t; });
336 return *std::find_if(
begin(),
end(), [t](
auto& x) {
return x.type == t; });
344 return *std::find_if(
345 begin(),
end(), [t =
v.type](
auto& x) { return x.type == t; });
351 begin(),
end(), [t =
v.type](
auto& x) { return x.type == t; }) =
v;
361 for (Index i = 0; i < vl.
values.nelem(); i++) {
369 for (
auto& x : vl.
values) is >> x;
375 std::ostringstream os;
378 for (
auto& qn :
val) {
387 std::ostringstream os;
390 for (
auto& x :
val) {
398 for (
auto& x :
val) {
399 os <<
' ' << x.str_upp();
419 is >> spec >> gs.
val;
428 if (l.has(Type::K))
return false;
429 if (l.has(Type::Lambda))
return false;
430 if (l.has(Type::N))
return false;
431 if (l.has(Type::Omega))
return false;
432 if (l.has(Type::S))
return false;
433 if (l.has(Type::Sigma))
return false;
434 if (l.has(Type::SpinComponentLabel))
return false;
435 if (l.has(Type::asSym))
return false;
436 if (l.has(Type::elecInv))
return false;
437 if (l.has(Type::elecRefl))
return false;
438 if (l.has(Type::elecSym))
return false;
439 if (l.has(Type::kronigParity))
return false;
440 if (l.has(Type::l))
return false;
441 if (l.has(Type::l1))
return false;
442 if (l.has(Type::l10))
return false;
443 if (l.has(Type::l11))
return false;
444 if (l.has(Type::l12))
return false;
445 if (l.has(Type::l2))
return false;
446 if (l.has(Type::l3))
return false;
447 if (l.has(Type::l4))
return false;
448 if (l.has(Type::l5))
return false;
449 if (l.has(Type::l6))
return false;
450 if (l.has(Type::l7))
return false;
451 if (l.has(Type::l8))
return false;
452 if (l.has(Type::l9))
return false;
453 if (l.has(Type::sym))
return false;
454 if (l.has(Type::v))
return false;
455 if (l.has(Type::vibRefl))
return false;
458 if (l.has(Type::K))
return false;
459 if (l.has(Type::Lambda))
return false;
460 if (l.has(Type::Omega))
return false;
461 if (l.has(Type::Sigma))
return false;
462 if (l.has(Type::SpinComponentLabel))
return false;
463 if (l.has(Type::asSym))
return false;
464 if (l.has(Type::elecRefl))
return false;
465 if (l.has(Type::kronigParity))
return false;
466 if (l.has(Type::l))
return false;
467 if (l.has(Type::l1))
return false;
468 if (l.has(Type::l10))
return false;
469 if (l.has(Type::l11))
return false;
470 if (l.has(Type::l12))
return false;
471 if (l.has(Type::l2))
return false;
472 if (l.has(Type::l3))
return false;
473 if (l.has(Type::l4))
return false;
474 if (l.has(Type::l5))
return false;
475 if (l.has(Type::l6))
return false;
476 if (l.has(Type::l7))
return false;
477 if (l.has(Type::l8))
return false;
478 if (l.has(Type::l9))
return false;
479 if (l.has(Type::sym))
return false;
480 if (l.has(Type::v))
return false;
481 if (l.has(Type::vibRefl))
return false;
484 if (l.has(Type::F10))
return false;
485 if (l.has(Type::F11))
return false;
486 if (l.has(Type::F12))
return false;
487 if (l.has(Type::F2))
return false;
488 if (l.has(Type::F3))
return false;
489 if (l.has(Type::F4))
return false;
490 if (l.has(Type::F5))
return false;
491 if (l.has(Type::F6))
return false;
492 if (l.has(Type::F7))
return false;
493 if (l.has(Type::F8))
return false;
494 if (l.has(Type::F9))
return false;
495 if (l.has(Type::K))
return false;
496 if (l.has(Type::Ka))
return false;
497 if (l.has(Type::Kc))
return false;
498 if (l.has(Type::Lambda))
return false;
499 if (l.has(Type::N))
return false;
500 if (l.has(Type::Omega))
return false;
501 if (l.has(Type::S))
return false;
502 if (l.has(Type::Sigma))
return false;
503 if (l.has(Type::SpinComponentLabel))
return false;
504 if (l.has(Type::elecInv))
return false;
505 if (l.has(Type::elecRefl))
return false;
506 if (l.has(Type::elecSym))
return false;
507 if (l.has(Type::l))
return false;
508 if (l.has(Type::l1))
return false;
509 if (l.has(Type::l10))
return false;
510 if (l.has(Type::l11))
return false;
511 if (l.has(Type::l12))
return false;
512 if (l.has(Type::l2))
return false;
513 if (l.has(Type::l3))
return false;
514 if (l.has(Type::l4))
return false;
515 if (l.has(Type::l5))
return false;
516 if (l.has(Type::l6))
return false;
517 if (l.has(Type::l7))
return false;
518 if (l.has(Type::l8))
return false;
519 if (l.has(Type::l9))
return false;
520 if (l.has(Type::rotSym))
return false;
521 if (l.has(Type::rovibSym))
return false;
522 if (l.has(Type::sym))
return false;
523 if (l.has(Type::v1))
return false;
524 if (l.has(Type::v10))
return false;
525 if (l.has(Type::v11))
return false;
526 if (l.has(Type::v12))
return false;
527 if (l.has(Type::v2))
return false;
528 if (l.has(Type::v3))
return false;
529 if (l.has(Type::v4))
return false;
530 if (l.has(Type::v5))
return false;
531 if (l.has(Type::v6))
return false;
532 if (l.has(Type::v7))
return false;
533 if (l.has(Type::v8))
return false;
534 if (l.has(Type::v9))
return false;
535 if (l.has(Type::vibInv))
return false;
536 if (l.has(Type::vibRefl))
return false;
537 if (l.has(Type::vibSym))
return false;
540 if (l.has(Type::F10))
return false;
541 if (l.has(Type::F11))
return false;
542 if (l.has(Type::F12))
return false;
543 if (l.has(Type::F2))
return false;
544 if (l.has(Type::F3))
return false;
545 if (l.has(Type::F4))
return false;
546 if (l.has(Type::F5))
return false;
547 if (l.has(Type::F6))
return false;
548 if (l.has(Type::F7))
return false;
549 if (l.has(Type::F8))
return false;
550 if (l.has(Type::F9))
return false;
551 if (l.has(Type::K))
return false;
552 if (l.has(Type::Ka))
return false;
553 if (l.has(Type::Kc))
return false;
554 if (l.has(Type::N))
return false;
555 if (l.has(Type::SpinComponentLabel))
return false;
556 if (l.has(Type::elecSym))
return false;
557 if (l.has(Type::l))
return false;
558 if (l.has(Type::l1))
return false;
559 if (l.has(Type::l10))
return false;
560 if (l.has(Type::l11))
return false;
561 if (l.has(Type::l12))
return false;
562 if (l.has(Type::l2))
return false;
563 if (l.has(Type::l3))
return false;
564 if (l.has(Type::l4))
return false;
565 if (l.has(Type::l5))
return false;
566 if (l.has(Type::l6))
return false;
567 if (l.has(Type::l7))
return false;
568 if (l.has(Type::l8))
return false;
569 if (l.has(Type::l9))
return false;
570 if (l.has(Type::rotSym))
return false;
571 if (l.has(Type::rovibSym))
return false;
572 if (l.has(Type::sym))
return false;
573 if (l.has(Type::v1))
return false;
574 if (l.has(Type::v10))
return false;
575 if (l.has(Type::v11))
return false;
576 if (l.has(Type::v12))
return false;
577 if (l.has(Type::v2))
return false;
578 if (l.has(Type::v3))
return false;
579 if (l.has(Type::v4))
return false;
580 if (l.has(Type::v5))
return false;
581 if (l.has(Type::v6))
return false;
582 if (l.has(Type::v7))
return false;
583 if (l.has(Type::v8))
return false;
584 if (l.has(Type::v9))
return false;
585 if (l.has(Type::vibInv))
return false;
586 if (l.has(Type::vibRefl))
return false;
587 if (l.has(Type::vibSym))
return false;
590 if (l.has(Type::F10))
return false;
591 if (l.has(Type::F11))
return false;
592 if (l.has(Type::F12))
return false;
593 if (l.has(Type::F2))
return false;
594 if (l.has(Type::F3))
return false;
595 if (l.has(Type::F4))
return false;
596 if (l.has(Type::F5))
return false;
597 if (l.has(Type::F6))
return false;
598 if (l.has(Type::F7))
return false;
599 if (l.has(Type::F8))
return false;
600 if (l.has(Type::F9))
return false;
601 if (l.has(Type::K))
return false;
602 if (l.has(Type::Ka))
return false;
603 if (l.has(Type::Kc))
return false;
604 if (l.has(Type::Omega))
return false;
605 if (l.has(Type::Sigma))
return false;
606 if (l.has(Type::elecSym))
return false;
607 if (l.has(Type::l))
return false;
608 if (l.has(Type::l1))
return false;
609 if (l.has(Type::l10))
return false;
610 if (l.has(Type::l11))
return false;
611 if (l.has(Type::l12))
return false;
612 if (l.has(Type::l2))
return false;
613 if (l.has(Type::l3))
return false;
614 if (l.has(Type::l4))
return false;
615 if (l.has(Type::l5))
return false;
616 if (l.has(Type::l6))
return false;
617 if (l.has(Type::l7))
return false;
618 if (l.has(Type::l8))
return false;
619 if (l.has(Type::l9))
return false;
620 if (l.has(Type::rotSym))
return false;
621 if (l.has(Type::rovibSym))
return false;
622 if (l.has(Type::sym))
return false;
623 if (l.has(Type::v1))
return false;
624 if (l.has(Type::v10))
return false;
625 if (l.has(Type::v11))
return false;
626 if (l.has(Type::v12))
return false;
627 if (l.has(Type::v2))
return false;
628 if (l.has(Type::v3))
return false;
629 if (l.has(Type::v4))
return false;
630 if (l.has(Type::v5))
return false;
631 if (l.has(Type::v6))
return false;
632 if (l.has(Type::v7))
return false;
633 if (l.has(Type::v8))
return false;
634 if (l.has(Type::v9))
return false;
635 if (l.has(Type::vibInv))
return false;
636 if (l.has(Type::vibRefl))
return false;
637 if (l.has(Type::vibSym))
return false;
640 if (l.has(Type::K))
return false;
641 if (l.has(Type::Ka))
return false;
642 if (l.has(Type::Kc))
return false;
643 if (l.has(Type::Lambda))
return false;
644 if (l.has(Type::N))
return false;
645 if (l.has(Type::Omega))
return false;
646 if (l.has(Type::S))
return false;
647 if (l.has(Type::Sigma))
return false;
648 if (l.has(Type::SpinComponentLabel))
return false;
649 if (l.has(Type::elecInv))
return false;
650 if (l.has(Type::elecRefl))
return false;
651 if (l.has(Type::elecSym))
return false;
652 if (l.has(Type::rotSym))
return false;
653 if (l.has(Type::rovibSym))
return false;
654 if (l.has(Type::sym))
return false;
655 if (l.has(Type::v))
return false;
658 if (l.has(Type::K))
return false;
659 if (l.has(Type::Ka))
return false;
660 if (l.has(Type::Kc))
return false;
661 if (l.has(Type::Omega))
return false;
662 if (l.has(Type::Sigma))
return false;
663 if (l.has(Type::SpinComponentLabel))
return false;
664 if (l.has(Type::elecSym))
return false;
665 if (l.has(Type::rotSym))
return false;
666 if (l.has(Type::rovibSym))
return false;
667 if (l.has(Type::sym))
return false;
668 if (l.has(Type::v))
return false;
669 if (l.has(Type::vibSym))
return false;
672 if (l.has(Type::F10))
return false;
673 if (l.has(Type::F11))
return false;
674 if (l.has(Type::F12))
return false;
675 if (l.has(Type::F3))
return false;
676 if (l.has(Type::F4))
return false;
677 if (l.has(Type::F5))
return false;
678 if (l.has(Type::F6))
return false;
679 if (l.has(Type::F7))
return false;
680 if (l.has(Type::F8))
return false;
681 if (l.has(Type::F9))
return false;
682 if (l.has(Type::K))
return false;
683 if (l.has(Type::Ka))
return false;
684 if (l.has(Type::Kc))
return false;
685 if (l.has(Type::Lambda))
return false;
686 if (l.has(Type::N))
return false;
687 if (l.has(Type::Omega))
return false;
688 if (l.has(Type::S))
return false;
689 if (l.has(Type::Sigma))
return false;
690 if (l.has(Type::SpinComponentLabel))
return false;
691 if (l.has(Type::elecInv))
return false;
692 if (l.has(Type::elecRefl))
return false;
693 if (l.has(Type::elecSym))
return false;
694 if (l.has(Type::l))
return false;
695 if (l.has(Type::l1))
return false;
696 if (l.has(Type::l10))
return false;
697 if (l.has(Type::l11))
return false;
698 if (l.has(Type::l12))
return false;
699 if (l.has(Type::l3))
return false;
700 if (l.has(Type::l4))
return false;
701 if (l.has(Type::l5))
return false;
702 if (l.has(Type::l6))
return false;
703 if (l.has(Type::l7))
return false;
704 if (l.has(Type::l8))
return false;
705 if (l.has(Type::l9))
return false;
706 if (l.has(Type::rotSym))
return false;
707 if (l.has(Type::rovibSym))
return false;
708 if (l.has(Type::sym))
return false;
709 if (l.has(Type::v))
return false;
710 if (l.has(Type::v10))
return false;
711 if (l.has(Type::v11))
return false;
712 if (l.has(Type::v12))
return false;
713 if (l.has(Type::v4))
return false;
714 if (l.has(Type::v5))
return false;
715 if (l.has(Type::v6))
return false;
716 if (l.has(Type::v7))
return false;
717 if (l.has(Type::v8))
return false;
718 if (l.has(Type::v9))
return false;
719 if (l.has(Type::vibInv))
return false;
720 if (l.has(Type::vibRefl))
return false;
721 if (l.has(Type::vibSym))
return false;
724 if (l.has(Type::F10))
return false;
725 if (l.has(Type::F11))
return false;
726 if (l.has(Type::F12))
return false;
727 if (l.has(Type::F3))
return false;
728 if (l.has(Type::F4))
return false;
729 if (l.has(Type::F5))
return false;
730 if (l.has(Type::F6))
return false;
731 if (l.has(Type::F7))
return false;
732 if (l.has(Type::F8))
return false;
733 if (l.has(Type::F9))
return false;
734 if (l.has(Type::K))
return false;
735 if (l.has(Type::Ka))
return false;
736 if (l.has(Type::Kc))
return false;
737 if (l.has(Type::Omega))
return false;
738 if (l.has(Type::Sigma))
return false;
739 if (l.has(Type::SpinComponentLabel))
return false;
740 if (l.has(Type::elecSym))
return false;
741 if (l.has(Type::l))
return false;
742 if (l.has(Type::l1))
return false;
743 if (l.has(Type::l10))
return false;
744 if (l.has(Type::l11))
return false;
745 if (l.has(Type::l12))
return false;
746 if (l.has(Type::l3))
return false;
747 if (l.has(Type::l4))
return false;
748 if (l.has(Type::l5))
return false;
749 if (l.has(Type::l6))
return false;
750 if (l.has(Type::l7))
return false;
751 if (l.has(Type::l8))
return false;
752 if (l.has(Type::l9))
return false;
753 if (l.has(Type::rotSym))
return false;
754 if (l.has(Type::rovibSym))
return false;
755 if (l.has(Type::sym))
return false;
756 if (l.has(Type::v))
return false;
757 if (l.has(Type::v10))
return false;
758 if (l.has(Type::v11))
return false;
759 if (l.has(Type::v12))
return false;
760 if (l.has(Type::v4))
return false;
761 if (l.has(Type::v5))
return false;
762 if (l.has(Type::v6))
return false;
763 if (l.has(Type::v7))
return false;
764 if (l.has(Type::v8))
return false;
765 if (l.has(Type::v9))
return false;
766 if (l.has(Type::vibInv))
return false;
767 if (l.has(Type::vibRefl))
return false;
768 if (l.has(Type::vibSym))
return false;
771 if (l.has(Type::F10))
return false;
772 if (l.has(Type::F11))
return false;
773 if (l.has(Type::F12))
return false;
774 if (l.has(Type::F3))
return false;
775 if (l.has(Type::F4))
return false;
776 if (l.has(Type::F5))
return false;
777 if (l.has(Type::F6))
return false;
778 if (l.has(Type::F7))
return false;
779 if (l.has(Type::F8))
return false;
780 if (l.has(Type::F9))
return false;
781 if (l.has(Type::K))
return false;
782 if (l.has(Type::Lambda))
return false;
783 if (l.has(Type::N))
return false;
784 if (l.has(Type::Omega))
return false;
785 if (l.has(Type::S))
return false;
786 if (l.has(Type::Sigma))
return false;
787 if (l.has(Type::SpinComponentLabel))
return false;
788 if (l.has(Type::elecInv))
return false;
789 if (l.has(Type::elecRefl))
return false;
790 if (l.has(Type::elecSym))
return false;
791 if (l.has(Type::l))
return false;
792 if (l.has(Type::l1))
return false;
793 if (l.has(Type::l10))
return false;
794 if (l.has(Type::l11))
return false;
795 if (l.has(Type::l12))
return false;
796 if (l.has(Type::l2))
return false;
797 if (l.has(Type::l3))
return false;
798 if (l.has(Type::l4))
return false;
799 if (l.has(Type::l5))
return false;
800 if (l.has(Type::l6))
return false;
801 if (l.has(Type::l7))
return false;
802 if (l.has(Type::l8))
return false;
803 if (l.has(Type::l9))
return false;
804 if (l.has(Type::rotSym))
return false;
805 if (l.has(Type::rovibSym))
return false;
806 if (l.has(Type::sym))
return false;
807 if (l.has(Type::v))
return false;
808 if (l.has(Type::v10))
return false;
809 if (l.has(Type::v11))
return false;
810 if (l.has(Type::v12))
return false;
811 if (l.has(Type::v4))
return false;
812 if (l.has(Type::v5))
return false;
813 if (l.has(Type::v6))
return false;
814 if (l.has(Type::v7))
return false;
815 if (l.has(Type::v8))
return false;
816 if (l.has(Type::v9))
return false;
817 if (l.has(Type::vibInv))
return false;
818 if (l.has(Type::vibRefl))
return false;
819 if (l.has(Type::vibSym))
return false;
822 if (l.has(Type::F10))
return false;
823 if (l.has(Type::F11))
return false;
824 if (l.has(Type::F12))
return false;
825 if (l.has(Type::F3))
return false;
826 if (l.has(Type::F4))
return false;
827 if (l.has(Type::F5))
return false;
828 if (l.has(Type::F6))
return false;
829 if (l.has(Type::F7))
return false;
830 if (l.has(Type::F8))
return false;
831 if (l.has(Type::F9))
return false;
832 if (l.has(Type::K))
return false;
833 if (l.has(Type::Lambda))
return false;
834 if (l.has(Type::Omega))
return false;
835 if (l.has(Type::Sigma))
return false;
836 if (l.has(Type::SpinComponentLabel))
return false;
837 if (l.has(Type::elecInv))
return false;
838 if (l.has(Type::elecRefl))
return false;
839 if (l.has(Type::l))
return false;
840 if (l.has(Type::l1))
return false;
841 if (l.has(Type::l10))
return false;
842 if (l.has(Type::l11))
return false;
843 if (l.has(Type::l12))
return false;
844 if (l.has(Type::l2))
return false;
845 if (l.has(Type::l3))
return false;
846 if (l.has(Type::l4))
return false;
847 if (l.has(Type::l5))
return false;
848 if (l.has(Type::l6))
return false;
849 if (l.has(Type::l7))
return false;
850 if (l.has(Type::l8))
return false;
851 if (l.has(Type::l9))
return false;
852 if (l.has(Type::rotSym))
return false;
853 if (l.has(Type::rovibSym))
return false;
854 if (l.has(Type::sym))
return false;
855 if (l.has(Type::v))
return false;
856 if (l.has(Type::v10))
return false;
857 if (l.has(Type::v11))
return false;
858 if (l.has(Type::v12))
return false;
859 if (l.has(Type::v4))
return false;
860 if (l.has(Type::v5))
return false;
861 if (l.has(Type::v6))
return false;
862 if (l.has(Type::v7))
return false;
863 if (l.has(Type::v8))
return false;
864 if (l.has(Type::v9))
return false;
865 if (l.has(Type::vibInv))
return false;
866 if (l.has(Type::vibRefl))
return false;
867 if (l.has(Type::vibSym))
return false;
870 if (l.has(Type::K))
return false;
871 if (l.has(Type::Ka))
return false;
872 if (l.has(Type::Kc))
return false;
873 if (l.has(Type::Lambda))
return false;
874 if (l.has(Type::N))
return false;
875 if (l.has(Type::Omega))
return false;
876 if (l.has(Type::S))
return false;
877 if (l.has(Type::Sigma))
return false;
878 if (l.has(Type::SpinComponentLabel))
return false;
879 if (l.has(Type::asSym))
return false;
880 if (l.has(Type::elecInv))
return false;
881 if (l.has(Type::elecRefl))
return false;
882 if (l.has(Type::elecSym))
return false;
883 if (l.has(Type::kronigParity))
return false;
884 if (l.has(Type::l))
return false;
885 if (l.has(Type::v))
return false;
886 if (l.has(Type::vibInv))
return false;
887 if (l.has(Type::vibRefl))
return false;
890 if (l.has(Type::K))
return false;
891 if (l.has(Type::Ka))
return false;
892 if (l.has(Type::Kc))
return false;
893 if (l.has(Type::Lambda))
return false;
894 if (l.has(Type::Omega))
return false;
895 if (l.has(Type::Sigma))
return false;
896 if (l.has(Type::SpinComponentLabel))
return false;
897 if (l.has(Type::asSym))
return false;
898 if (l.has(Type::elecRefl))
return false;
899 if (l.has(Type::kronigParity))
return false;
900 if (l.has(Type::l))
return false;
901 if (l.has(Type::v))
return false;
902 if (l.has(Type::vibInv))
return false;
903 if (l.has(Type::vibRefl))
return false;
906 if (l.has(Type::Ka))
return false;
907 if (l.has(Type::Kc))
return false;
908 if (l.has(Type::Lambda))
return false;
909 if (l.has(Type::N))
return false;
910 if (l.has(Type::Omega))
return false;
911 if (l.has(Type::S))
return false;
912 if (l.has(Type::Sigma))
return false;
913 if (l.has(Type::SpinComponentLabel))
return false;
914 if (l.has(Type::asSym))
return false;
915 if (l.has(Type::elecInv))
return false;
916 if (l.has(Type::elecRefl))
return false;
917 if (l.has(Type::elecSym))
return false;
918 if (l.has(Type::kronigParity))
return false;
919 if (l.has(Type::sym))
return false;
920 if (l.has(Type::v))
return false;
921 if (l.has(Type::vibRefl))
return false;
933 type = StateMatchType::Isotopologue;
935 type = StateMatchType::Species;
937 if (
type == StateMatchType::Isotopologue) {
941 bool ug = g.
upp == CheckValue::Full or g.upp == CheckValue::BinA;
942 bool ul = l.upp == CheckValue::Full or l.upp == CheckValue::BinA;
943 bool lg = g.low == CheckValue::Full or g.low == CheckValue::BinA;
944 bool ll = l.low == CheckValue::Full or l.low == CheckValue::BinA;
950 type = StateMatchType::Full;
952 type = StateMatchType::Level;
958 type = StateMatchType::Isotopologue;
960 type = StateMatchType::Species;
962 if (
type == StateMatchType::Isotopologue) {
965 upp = m.upp == CheckValue::Full or m.upp == CheckValue::BinA;
966 low = m.low == CheckValue::Full or m.low == CheckValue::BinA;
968 type = StateMatchType::Full;
970 type = StateMatchType::Level;
978 return (test.upp == CheckValue::Full or test.upp == CheckValue::AinB) and
979 (test.low == CheckValue::Full or test.low == CheckValue::AinB);
988 for (
auto&
v : vl.
val) {
992 for (
auto&
v : vl.
val) {
1004 [](
auto&
a,
auto&
b) { return a.type == b.type; });
1009 for (
auto& value : out.
val) value.qn.upp = value.qn.low;
1015 for (
auto& value : out.
val) value.qn.low = value.qn.upp;
1021 Value _this = *
this;
1035 auto specname =
items(s, 0);
1040 if (n > 1)
val =
ValueList(s.substr(specname.length() + 1));
1041 }
else if (
v == 0 or
v == 1) {
1042 val =
ValueList(s.substr(specname.length() + 1),
true);
1057 bool upp =
true, low =
true;
1060 for (
auto& qn :
val) {
1063 if (g.
val.
has(qn.type)) {
1064 auto&
v = g.
val[qn.type];
1066 upp = upp and
v.str_upp() == qn.str_upp();
1067 low = low and
v.str_low() == qn.str_low();
1071 if (l.
val.
has(qn.type)) {
1072 auto&
v = l.
val[qn.type];
1074 upp = upp and
v.str_upp() == qn.str_upp();
1075 low = low and
v.str_low() == qn.str_low();
1080 "From original key: ",
1083 "With global key: ",
1091 if (not any)
return {
false,
false};
1099 bof << qn.upp.i.x << qn.low.i.x;
1102 bof << qn.upp.h.x << qn.low.h.x;
1108 case ValueType::FINAL: {
1117 bif >> qn.upp.i.x >> qn.low.i.x;
1120 bif >> qn.upp.h.x >> qn.low.h.x;
1126 case ValueType::FINAL: {
1134 for (
auto& qn : values)
1135 if (not qn.good()) {
This can be used to make arrays out of anything.
A list of many quantum numbers. Should always remain sorted.
void set(Value v)
Sets the value if it exists or adds it otherwise.
void finalize()
Should always be called before this object is handed to another user.
CheckMatch check_match(const ValueList &other) const ARTS_NOEXCEPT
Returns upper and lower matching status.
bool has_unique_increasing_types() const
Internal check function. Remember to sort by type before calling this.
void sort_by_type()
Internal sort function. Should be called whenever new items are created.
Array< Value >::iterator begin()
For iterators.
bool has(Types... ts) const ARTS_NOEXCEPT
Returns whether all the Types are part of the list, the types must be sorted.
Value & add(Type t)
Add for manipulation.
const Value & operator[](Type t) const ARTS_NOEXCEPT
Returns the value of the Type (assumes it exist)
bool perpendicular(const ValueList &that) const ARTS_NOEXCEPT
Finds whether two ValueList describe completely different sets of quantum numbers (e....
void add_type_wo_sort(Type)
Add a type without sorting (WARNING, many things might break if you don't sort in the end)
Array< Value >::iterator end()
Binary output file stream class.
unsigned long readString(char *str, unsigned long amount)
unsigned long writeString(const char *str, unsigned long amount=0)
Binary output file stream class.
Helper macros for debugging.
#define ARTS_ASSERT(condition,...)
#define ARTS_USER_ERROR(...)
std::string var_string(Args &&... args)
#define ARTS_USER_ERROR_IF(condition,...)
constexpr ValueType common_value_type(ValueType a, ValueType b) noexcept
Return a common type between a and b.
ValueList from_hitran(std::string_view upp, std::string_view low)
bool vamdcCheck(const ValueList &l, VAMDC type) ARTS_NOEXCEPT
std::ostream & operator<<(std::ostream &os, ValueDescription x)
constexpr ValueDescription value_holder(Rational r_)
Takes a rational and determine which type of quantum number it is, returning this information or thro...
constexpr std::pair< std::string_view, std::string_view > split_hitran_qn(std::string_view x)
Returns some input "ASDASDS=asdAS" as ["ASDASDS", "asdAS"] for Hitran online data.
std::istream & operator>>(std::istream &is, Value &x)
constexpr std::string_view items(std::string_view s, std::size_t i) noexcept
Get a view of a number of space-separated items from the list.
constexpr CheckValue update(CheckValue val, CheckValue res) noexcept
Updates old by what a new check says it should be.
std::pair< std::string_view, String > fix_legacy(std::string_view key, std::string_view val)
Fix legacy catalog, where some values are rationals even though they shouldn't be.
constexpr Index count_items(std::string_view s) noexcept
Count all space-separated items in s.
constexpr std::string_view strip(std::string_view x)
Strips spaces at the beginning and end of x before returning it.
constexpr std::array Isotopologues
A list of all ARTS isotopologues, note how the species enum class input HAS to be sorted.
constexpr bool is_normal_isotopologue(const IsotopeRecord &ir) noexcept
constexpr Index find_species_index(const Species spec, const std::string_view isot) noexcept
Status of comparing two lists that are supposedly of some type.
A logical struct for global quantum numbers with species identifiers.
GlobalState UpperLevel() const
Species::Species Species() const noexcept
bool part_of(const GlobalState &other) const
Checks wheter all of the LHS is part of RHS.
static constexpr Index version
GlobalState LowerLevel() const
Species::IsotopeRecord Isotopologue() const noexcept
bool good() const
Test if there are bad quantum numbers (undefined ones) or if the isotopologue is not a normal target.
Struct that converts to bool automatically but allows checking both energy levels matching status.
A logical struct for local quantum numbers.
void set_unsorted_qns(const Array< Type > &vals)
bool good() const
Test if there are bad quantum numbers (undefined ones)
bool same_types_as(const LocalState &that) const
constexpr StateMatch()=default
static constexpr std::size_t N
constexpr std::string_view val() const noexcept
Returns the value in such a way that no \0 remains in the view.
The values of two levels.
A complete description of a value, its type and value.
A complete quantum number value with type information.
bofstream & write(bofstream &bof) const
String str_upp() const noexcept
Returns the upper quantum number string copy.
bifstream & read(bifstream &bif)
constexpr Rational upp() const noexcept
Returns the upper quantum number rational if it exists or an undefined.
constexpr Rational low() const noexcept
Returns the lower quantum number rational if it exists or an undefined.
constexpr void set(std::string_view s, bool upp)
Set level value.
String str_low() const noexcept
Returns the lower quantum number string copy.
void swap_values(Value &x)
Legacy way to swap the values between two Values.
Struct containing all information needed about one isotope.
String FullName() const noexcept
Species spec
Species type as defined in species.h.