~max-mcginley/third-order-lie-map/generator

« back to all changes in this revision

Viewing changes to LieOperator.hh

  • Committer: Max McGinley
  • Date: 2015-08-18 17:13:46 UTC
  • Revision ID: max.mcginley@stfc.ac.uk-20150818171346-ou729otm1b9zmnvo
RK4 method added to integrated interaction 4th order hamiltonian. Relative error around 5e-4 for 10mm x,y and 1Mev px, py. Added missing global and particle generation header files. 2 lattices uploaded for use in tests etc. Documentation to follow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
 
64
64
class LieOperator {
65
65
public:
66
 
        LieOperator(lie_polynomial pol) : f4(pol) {thirdOrderMap = NULL;};
 
66
        LieOperator(lie_polynomial pol);
67
67
        LieOperator(const LieOperator& copy) : f4(copy.f4) {if (copy.thirdOrderMap != NULL) thirdOrderMap = new PolynomialMap(*copy.thirdOrderMap); else thirdOrderMap = NULL;};
68
68
        
69
69
        //Computes the overall map exp(:f4:)*M = (1 + :f4:)*M to 3rd order and sets thirdOrderMap to the resulting map, if not already set
70
70
        PolynomialMap applyTransformToMatrix(Matrix<double> mat);
71
71
        
72
72
        lie_polynomial getPolynomial() const {return f4;} 
73
 
        PolynomialMap getMap() const {return *thirdOrderMap;}
 
73
        PolynomialMap getMap() const {if (thirdOrderMap == NULL) throw LieOperatorException("LieOperator::getMap is NULL"); return *thirdOrderMap;}
74
74
        
75
75
        FRIEND_TEST(LieOperatorTest, Symplecticity);
76
76
        FRIEND_TEST(LieOperatorTest, Differentiate);