@@ -359,20 +359,22 @@ namespace cadabra {
359359 return -(Adjform::value_type)data->begin ().number_of_children ();
360360 }
361361
362- AdjformEx::rational_type AdjformEx::zero = 0 ;
362+ AdjformEx::integer_type AdjformEx::zero = 0 ;
363363
364364 AdjformEx::AdjformEx ()
365365 {
366366
367367 }
368368
369- AdjformEx::AdjformEx (const Adjform& adjform, const AdjformEx::rational_type & value, const Ex& prefactor)
369+ AdjformEx::AdjformEx (const Adjform& adjform, const AdjformEx::integer_type & value, const Ex& prefactor)
370370 : prefactor(prefactor)
371371 {
372+ sizeof (mpq_class);
373+ sizeof (int64_t );
372374 set (adjform, value);
373375 }
374376
375- AdjformEx::AdjformEx (const Adjform& adjform, const rational_type & value, Ex::iterator prefactor)
377+ AdjformEx::AdjformEx (const Adjform& adjform, const integer_type & value, Ex::iterator prefactor)
376378 : prefactor(prefactor)
377379 {
378380 set (adjform, value);
@@ -412,7 +414,7 @@ namespace cadabra {
412414 one (tensor_begin->multiplier );
413415 }
414416
415- AdjformEx::rational_type AdjformEx::compare (const AdjformEx& other) const
417+ AdjformEx::integer_type AdjformEx::compare (const AdjformEx& other) const
416418 {
417419 // Early failure checks
418420 if (data.empty () || data.size () != other.data .size ())
@@ -421,7 +423,7 @@ namespace cadabra {
421423 // Find the numeric factor between the first two terms, then loop over all
422424 // other terms checking that the factor is the same. If not, return 0
423425 auto a_it = data.begin (), b_it = other.data .begin (), a_end = data.end ();
424- rational_type factor = a_it->second / b_it->second ;
426+ integer_type factor = a_it->second / b_it->second ;
425427 while (a_it != a_end) {
426428 if (a_it->first != b_it->first )
427429 return 0 ;
@@ -438,13 +440,13 @@ namespace cadabra {
438440 add (kv.first , kv.second );
439441 }
440442
441- void AdjformEx::combine (const AdjformEx& other, AdjformEx::rational_type factor)
443+ void AdjformEx::combine (const AdjformEx& other, AdjformEx::integer_type factor)
442444 {
443445 for (const auto & kv : other.data )
444446 add (kv.first , kv.second * factor);
445447 }
446448
447- void AdjformEx::multiply (const AdjformEx::rational_type & k)
449+ void AdjformEx::multiply (const AdjformEx::integer_type & k)
448450 {
449451 for (auto & kv : data)
450452 kv.second *= k;
@@ -519,33 +521,33 @@ namespace cadabra {
519521 return tensor;
520522 }
521523
522- const AdjformEx::rational_type & AdjformEx::get (const Adjform& adjform) const
524+ const AdjformEx::integer_type & AdjformEx::get (const Adjform& adjform) const
523525 {
524526 auto pos = data.find (adjform);
525527 return (pos == data.end ()) ? zero : pos->second ;
526528 }
527529
528- void AdjformEx::set (const Adjform& term, const AdjformEx::rational_type & value)
530+ void AdjformEx::set (const Adjform& term, const AdjformEx::integer_type & value)
529531 {
530532 if (!term.empty ())
531533 set_ (term, value);
532534 }
533535
534- void AdjformEx::set_ (const Adjform& term, const AdjformEx::rational_type & value)
536+ void AdjformEx::set_ (const Adjform& term, const AdjformEx::integer_type & value)
535537 {
536538 if (value != 0 )
537539 data[term] = value;
538540 else
539541 data.erase (term);
540542 }
541543
542- void AdjformEx::add (const Adjform& term, const AdjformEx::rational_type & value)
544+ void AdjformEx::add (const Adjform& term, const AdjformEx::integer_type & value)
543545 {
544546 if (!term.empty ())
545547 add_ (term, value);
546548 }
547549
548- void AdjformEx::add_ (const Adjform& term, const AdjformEx::rational_type & value)
550+ void AdjformEx::add_ (const Adjform& term, const AdjformEx::integer_type & value)
549551 {
550552 auto elem = data.find (term);
551553 if (elem == data.end () && value != 0 ) {
0 commit comments