@@ -524,43 +524,43 @@ class FDouble : public Field {
524
524
FDouble (const FDouble& other) : val(other.val) {}
525
525
526
526
Field& operator =(const Field& other) override {
527
- const auto & od = dynamic_cast <const FDouble&>(other);
527
+ const auto & od = static_cast <const FDouble&>(other);
528
528
val = od.val ;
529
529
return *this ;
530
530
}
531
531
532
532
Field& operator +=(const Field& other) override {
533
- const auto & od = dynamic_cast <const FDouble&>(other);
533
+ const auto & od = static_cast <const FDouble&>(other);
534
534
val += od.val ;
535
535
return *this ;
536
536
}
537
537
538
538
std::unique_ptr<Field> add (const Field& other) override {
539
- const auto & od = dynamic_cast <const FDouble&>(other);
539
+ const auto & od = static_cast <const FDouble&>(other);
540
540
return std::make_unique<FDouble>(val + od.val );
541
541
}
542
542
543
543
Field& operator -=(const Field& other) override {
544
- const auto & od = dynamic_cast <const FDouble&>(other);
544
+ const auto & od = static_cast <const FDouble&>(other);
545
545
val -= od.val ;
546
546
return *this ;
547
547
}
548
548
549
549
Field& operator *=(const Field& other) override {
550
- const auto & od = dynamic_cast <const FDouble&>(other);
550
+ const auto & od = static_cast <const FDouble&>(other);
551
551
val *= od.val ;
552
552
return *this ;
553
553
}
554
554
555
555
Field& operator /=(const Field& other) override {
556
- const auto & od = dynamic_cast <const FDouble&>(other);
556
+ const auto & od = static_cast <const FDouble&>(other);
557
557
if (od.val == 0 ) throw std::runtime_error (" Division by zero" );
558
558
val /= od.val ;
559
559
return *this ;
560
560
}
561
561
562
562
bool operator ==(const Field& other) const override {
563
- const auto & od = dynamic_cast <const FDouble&>(other);
563
+ const auto & od = static_cast <const FDouble&>(other);
564
564
return od.val == val;
565
565
}
566
566
@@ -621,8 +621,8 @@ class FGenDouble : public FieldGen {
621
621
}
622
622
623
623
bool larger_than (const Field& a, const Field& b) const override {
624
- const auto & ad = dynamic_cast <const FDouble&>(a);
625
- const auto & bd = dynamic_cast <const FDouble&>(b);
624
+ const auto & ad = static_cast <const FDouble&>(a);
625
+ const auto & bd = static_cast <const FDouble&>(b);
626
626
return ad.val > bd.val ;
627
627
}
628
628
@@ -637,43 +637,43 @@ class FMpz : public Field {
637
637
FMpz (const FMpz& other) : val(other.val) {}
638
638
639
639
Field& operator =(const Field& other) override {
640
- const auto & od = dynamic_cast <const FMpz&>(other);
640
+ const auto & od = static_cast <const FMpz&>(other);
641
641
val = od.val ;
642
642
return *this ;
643
643
}
644
644
645
645
Field& operator +=(const Field& other) override {
646
- const auto & od = dynamic_cast <const FMpz&>(other);
646
+ const auto & od = static_cast <const FMpz&>(other);
647
647
val += od.val ;
648
648
return *this ;
649
649
}
650
650
651
651
std::unique_ptr<Field> add (const Field& other) override {
652
- const auto & od = dynamic_cast <const FMpz&>(other);
652
+ const auto & od = static_cast <const FMpz&>(other);
653
653
return std::make_unique<FMpz>(val + od.val );
654
654
}
655
655
656
656
Field& operator -=(const Field& other) override {
657
- const auto & od = dynamic_cast <const FMpz&>(other);
657
+ const auto & od = static_cast <const FMpz&>(other);
658
658
val -= od.val ;
659
659
return *this ;
660
660
}
661
661
662
662
Field& operator *=(const Field& other) override {
663
- const auto & od = dynamic_cast <const FMpz&>(other);
663
+ const auto & od = static_cast <const FMpz&>(other);
664
664
val *= od.val ;
665
665
return *this ;
666
666
}
667
667
668
668
Field& operator /=(const Field& other) override {
669
- const auto & od = dynamic_cast <const FMpz&>(other);
669
+ const auto & od = static_cast <const FMpz&>(other);
670
670
if (od.val == 0 ) throw std::runtime_error (" Division by zero" );
671
671
val /= od.val ;
672
672
return *this ;
673
673
}
674
674
675
675
bool operator ==(const Field& other) const override {
676
- const auto & od = dynamic_cast <const FMpz&>(other);
676
+ const auto & od = static_cast <const FMpz&>(other);
677
677
return od.val == val;
678
678
}
679
679
@@ -722,8 +722,8 @@ class FGenMpz : public FieldGen {
722
722
}
723
723
724
724
bool larger_than (const Field& a, const Field& b) const override {
725
- const auto & ad = dynamic_cast <const FMpz&>(a);
726
- const auto & bd = dynamic_cast <const FMpz&>(b);
725
+ const auto & ad = static_cast <const FMpz&>(a);
726
+ const auto & bd = static_cast <const FMpz&>(b);
727
727
return ad.val > bd.val ;
728
728
}
729
729
0 commit comments