@@ -508,6 +508,96 @@ namespace core
508508
509509
510510
511+ NO_DISCARD auto static constexpr BxToMoments ()
512+ {
513+ // Bx is primal dual dual
514+ // moments are primal primal primal
515+ // operation is thus Pdd to Ppp
516+ [[maybe_unused]] auto constexpr iShift = dualToPrimal ();
517+
518+ if constexpr (dimension == 1 )
519+ {
520+ constexpr WeightPoint<dimension> P1{Point<int , dimension>{0 }, 1 .};
521+ return std::array<WeightPoint<dimension>, 1 >{P1};
522+ }
523+ if constexpr (dimension == 2 )
524+ {
525+ constexpr WeightPoint<dimension> P1{Point<int , dimension>{0 , 0 }, 0.5 };
526+ constexpr WeightPoint<dimension> P2{Point<int , dimension>{0 , iShift}, 0.5 };
527+ return std::array<WeightPoint<dimension>, 2 >{P1, P2};
528+ }
529+ else if constexpr (dimension == 3 )
530+ {
531+ constexpr WeightPoint<dimension> P1{Point<int , dimension>{0 , 0 , 0 }, 0.5 };
532+ constexpr WeightPoint<dimension> P2{Point<int , dimension>{0 , iShift, iShift}, 0.5 };
533+ return std::array<WeightPoint<dimension>, 2 >{P1, P2};
534+ }
535+ }
536+
537+
538+
539+
540+ NO_DISCARD auto static constexpr ByToMoments ()
541+ {
542+ // Bx is dual primal dual
543+ // moments are primal primal primal
544+ // operation is thus Dpd to Ppp
545+
546+ auto constexpr iShift = dualToPrimal ();
547+
548+ if constexpr (dimension == 1 )
549+ {
550+ constexpr WeightPoint<dimension> P1{Point<int , dimension>{0 }, 0.5 };
551+ constexpr WeightPoint<dimension> P2{Point<int , dimension>{iShift}, 0.5 };
552+ return std::array<WeightPoint<dimension>, 2 >{P1, P2};
553+ }
554+ if constexpr (dimension == 2 )
555+ {
556+ constexpr WeightPoint<dimension> P1{Point<int , dimension>{0 , 0 }, 0.5 };
557+ constexpr WeightPoint<dimension> P2{Point<int , dimension>{iShift, 0 }, 0.5 };
558+ return std::array<WeightPoint<dimension>, 2 >{P1, P2};
559+ }
560+ else if constexpr (dimension == 3 )
561+ {
562+ constexpr WeightPoint<dimension> P1{Point<int , dimension>{0 , 0 , 0 }, 0.5 };
563+ constexpr WeightPoint<dimension> P2{Point<int , dimension>{iShift, 0 , iShift}, 0.5 };
564+ return std::array<WeightPoint<dimension>, 2 >{P1, P2};
565+ }
566+ }
567+
568+
569+
570+
571+ NO_DISCARD auto static constexpr BzToMoments ()
572+ {
573+ // Bx is dual dual primal
574+ // moments are primal primal primal
575+ // operation is thus Ddp to Ppp
576+
577+ auto constexpr iShift = dualToPrimal ();
578+
579+ if constexpr (dimension == 1 )
580+ {
581+ constexpr WeightPoint<dimension> P1{Point<int , dimension>{0 }, 0.5 };
582+ constexpr WeightPoint<dimension> P2{Point<int , dimension>{iShift}, 0.5 };
583+ return std::array<WeightPoint<dimension>, 2 >{P1, P2};
584+ }
585+ if constexpr (dimension == 2 )
586+ {
587+ constexpr WeightPoint<dimension> P1{Point<int , dimension>{0 , 0 }, 0.5 };
588+ constexpr WeightPoint<dimension> P2{Point<int , dimension>{iShift, iShift}, 0.5 };
589+ return std::array<WeightPoint<dimension>, 2 >{P1, P2};
590+ }
591+ else if constexpr (dimension == 3 )
592+ {
593+ constexpr WeightPoint<dimension> P1{Point<int , dimension>{0 , 0 , 0 }, 0.5 };
594+ constexpr WeightPoint<dimension> P2{Point<int , dimension>{iShift, iShift, 0 }, 0.5 };
595+ return std::array<WeightPoint<dimension>, 2 >{P1, P2};
596+ }
597+ }
598+
599+
600+
511601
512602 NO_DISCARD auto static constexpr ExToMoments ()
513603 {
0 commit comments