Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:03:33

0001 // -*- C++ -*-
0002 // $Id: RotationInterfaces.icc,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
0003 // ---------------------------------------------------------------------------
0004 //
0005 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
0006 // 
0007 // This contains the definitions of the inline member functions of the
0008 // Hep4RotationInterface and Hep3RotationInterface classes, and of the 
0009 // HepRep3x3 and HepRep4x4 structs.
0010 //
0011 
0012 namespace CLHEP {
0013 
0014 //-*********
0015 // HepRep3x3 
0016 //-*********
0017 
0018 inline HepRep3x3::HepRep3x3() : 
0019       xx_(1.0), xy_(0.0), xz_(0.0)
0020     , yx_(0.0), yy_(1.0), yz_(0.0)
0021     , zx_(0.0), zy_(0.0), zz_(1.0)
0022 {}
0023 
0024 inline HepRep3x3::HepRep3x3(  double xx, double xy, double xz
0025                    , double yx, double yy, double yz
0026                    , double zx, double zy, double zz
0027                    ) :
0028       xx_(xx), xy_(xy), xz_(xz)
0029     , yx_(yx), yy_(yy), yz_(yz)
0030     , zx_(zx), zy_(zy), zz_(zz)
0031 {}
0032 
0033 inline HepRep3x3::HepRep3x3( const double * array ) {
0034   const double * a = array; 
0035   double * r = &xx_;
0036   for ( int i = 0; i < 9; i++ ) { *r++ = *a++; }
0037 }
0038 
0039 inline void HepRep3x3::setToIdentity() {
0040       xx_ = 1.0; xy_ = 0.0; xz_ = 0.0;
0041       yx_ = 0.0; yy_ = 1.0; yz_ = 0.0;
0042       zx_ = 0.0; zy_ = 0.0; zz_ = 1.0;
0043 }
0044 
0045 inline void HepRep3x3::getArray( double * array ) const {
0046   double * a = array; 
0047   const double * r = &xx_;
0048   for ( int i = 0; i < 9; i++ ) { *a++ = *r++; }
0049 }
0050 
0051  
0052 //-*********
0053 // HepRep4x4 
0054 //-*********
0055 
0056 inline HepRep4x4::HepRep4x4() :
0057       xx_(1.0), xy_(0.0), xz_(0.0), xt_(0.0)
0058     , yx_(0.0), yy_(1.0), yz_(0.0), yt_(0.0)
0059     , zx_(0.0), zy_(0.0), zz_(1.0), zt_(0.0)
0060     , tx_(0.0), ty_(0.0), tz_(0.0), tt_(1.0)
0061 {}
0062 
0063 inline HepRep4x4::HepRep4x4(  
0064              double xx, double xy, double xz, double xt
0065                    , double yx, double yy, double yz, double yt
0066                    , double zx, double zy, double zz, double zt
0067                    , double tx, double ty, double tz, double tt
0068                    ) :
0069       xx_(xx), xy_(xy), xz_(xz), xt_(xt)
0070     , yx_(yx), yy_(yy), yz_(yz), yt_(yt)
0071     , zx_(zx), zy_(zy), zz_(zz), zt_(zt)
0072     , tx_(tx), ty_(ty), tz_(tz), tt_(tt)
0073 {}
0074 
0075 inline HepRep4x4::HepRep4x4( const HepRep4x4Symmetric & rep ) :
0076       xx_(rep.xx_), xy_(rep.xy_), xz_(rep.xz_), xt_(rep.xt_)
0077     , yx_(rep.xy_), yy_(rep.yy_), yz_(rep.yz_), yt_(rep.yt_)
0078     , zx_(rep.xz_), zy_(rep.yz_), zz_(rep.zz_), zt_(rep.zt_)
0079     , tx_(rep.xt_), ty_(rep.yt_), tz_(rep.zt_), tt_(rep.tt_)
0080 {}
0081 
0082 inline HepRep4x4::HepRep4x4( const double * array ) {
0083   const double * a = array; 
0084   double * r = &xx_;
0085   for ( int i = 0; i < 16; i++ ) { *r++ = *a++; }
0086 }
0087 
0088 inline void HepRep4x4::setToIdentity() {
0089       xx_ = 1.0; xy_ = 0.0; xz_ = 0.0; xt_ = 0.0;
0090       yx_ = 0.0; yy_ = 1.0; yz_ = 0.0; yt_ = 0.0;
0091       zx_ = 0.0; zy_ = 0.0; zz_ = 1.0; zt_ = 0.0;
0092       tx_ = 0.0; ty_ = 0.0; tz_ = 0.0; tt_ = 1.0;
0093 }
0094 
0095 inline void HepRep4x4::getArray( double * array ) const {
0096   double * a = array; 
0097   const double * r = &xx_;
0098   for ( int i = 0; i < 16; i++ ) { *a++ = *r++; }
0099 }
0100 
0101 inline bool HepRep4x4::operator == (const HepRep4x4 & r) const {
0102   return( xx_ == r.xx_ && xy_ == r.xy_ && xz_ == r.xz_ && xt_ == r.xt_ &&
0103           yx_ == r.yx_ && yy_ == r.yy_ && yz_ == r.yz_ && yt_ == r.yt_ &&
0104           zx_ == r.zx_ && zy_ == r.zy_ && zz_ == r.zz_ && zt_ == r.zt_ &&
0105           tx_ == r.tx_ && ty_ == r.ty_ && tz_ == r.tz_ && tt_ == r.tt_ );
0106 }
0107 
0108 inline bool HepRep4x4::operator != (const HepRep4x4 & r) const {
0109   return !(operator== (r));
0110 }
0111 
0112 //-******************
0113 // HepRep4x4Symmetric
0114 //-******************
0115 
0116 inline HepRep4x4Symmetric::HepRep4x4Symmetric() :
0117       xx_(1.0), xy_(0.0), xz_(0.0), xt_(0.0)
0118     ,           yy_(1.0), yz_(0.0), yt_(0.0)
0119     ,                     zz_(1.0), zt_(0.0)
0120     ,                               tt_(1.0)
0121 {}
0122 
0123 inline HepRep4x4Symmetric::HepRep4x4Symmetric 
0124         ( double xx, double xy, double xz, double xt
0125                       , double yy, double yz, double yt
0126                                     , double zz, double zt
0127                                                   , double tt ) :
0128       xx_(xx), xy_(xy), xz_(xz), xt_(xt)
0129          , yy_(yy), yz_(yz), yt_(yt)
0130               , zz_(zz), zt_(zt)
0131                    , tt_(tt)
0132 {}
0133 
0134 inline HepRep4x4Symmetric::HepRep4x4Symmetric( const double * array ) {
0135   const double * a = array; 
0136   double * r = &xx_;
0137   for ( int i = 0; i < 10; i++ ) { *r++ = *a++; }
0138 }
0139 
0140 inline void HepRep4x4Symmetric::setToIdentity() {
0141       xx_ = 1.0; xy_ = 0.0; xz_ = 0.0; xt_ = 0.0;
0142                  yy_ = 1.0; yz_ = 0.0; yt_ = 0.0;
0143                             zz_ = 1.0; zt_ = 0.0;
0144                                        tt_ = 1.0;
0145 }
0146 
0147 inline void HepRep4x4Symmetric::getArray( double * array ) const {
0148   double * a = array; 
0149   const double * r = &xx_;
0150   for ( int i = 0; i < 10; i++ ) { *a++ = *r++; }
0151 }
0152 
0153 }  // namespace CLHEP