RotationInterfaces.icc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // $Id:$
00003 // ---------------------------------------------------------------------------
00004 //
00005 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
00006 // 
00007 // This contains the definitions of the inline member functions of the
00008 // Hep4RotationInterface and Hep3RotationInterface classes, and of the 
00009 // HepRep3x3 and HepRep4x4 structs.
00010 //
00011 
00012 namespace CLHEP {
00013 
00014 //-*********
00015 // HepRep3x3 
00016 //-*********
00017 
00018 inline HepRep3x3::HepRep3x3() : 
00019           xx_(1.0), xy_(0.0), xz_(0.0)
00020         , yx_(0.0), yy_(1.0), yz_(0.0)
00021         , zx_(0.0), zy_(0.0), zz_(1.0)
00022 {}
00023 
00024 inline HepRep3x3::HepRep3x3(  double xx, double xy, double xz
00025                    , double yx, double yy, double yz
00026                    , double zx, double zy, double zz
00027                    ) :
00028           xx_(xx), xy_(xy), xz_(xz)
00029         , yx_(yx), yy_(yy), yz_(yz)
00030         , zx_(zx), zy_(zy), zz_(zz)
00031 {}
00032 
00033 inline HepRep3x3::HepRep3x3( const double * array ) {
00034   const double * a = array; 
00035   double * r = &xx_;
00036   for ( int i = 0; i < 9; i++ ) { *r++ = *a++; }
00037 }
00038 
00039 inline void HepRep3x3::setToIdentity() {
00040           xx_ = 1.0; xy_ = 0.0; xz_ = 0.0;
00041           yx_ = 0.0; yy_ = 1.0; yz_ = 0.0;
00042           zx_ = 0.0; zy_ = 0.0; zz_ = 1.0;
00043 }
00044 
00045 inline void HepRep3x3::getArray( double * array ) const {
00046   double * a = array; 
00047   const double * r = &xx_;
00048   for ( int i = 0; i < 9; i++ ) { *a++ = *r++; }
00049 }
00050 
00051  
00052 //-*********
00053 // HepRep4x4 
00054 //-*********
00055 
00056 inline HepRep4x4::HepRep4x4() :
00057           xx_(1.0), xy_(0.0), xz_(0.0), xt_(0.0)
00058         , yx_(0.0), yy_(1.0), yz_(0.0), yt_(0.0)
00059         , zx_(0.0), zy_(0.0), zz_(1.0), zt_(0.0)
00060         , tx_(0.0), ty_(0.0), tz_(0.0), tt_(1.0)
00061 {}
00062 
00063 inline HepRep4x4::HepRep4x4(  
00064                      double xx, double xy, double xz, double xt
00065                    , double yx, double yy, double yz, double yt
00066                    , double zx, double zy, double zz, double zt
00067                    , double tx, double ty, double tz, double tt
00068                    ) :
00069           xx_(xx), xy_(xy), xz_(xz), xt_(xt)
00070         , yx_(yx), yy_(yy), yz_(yz), yt_(yt)
00071         , zx_(zx), zy_(zy), zz_(zz), zt_(zt)
00072         , tx_(tx), ty_(ty), tz_(tz), tt_(tt)
00073 {}
00074 
00075 inline HepRep4x4::HepRep4x4( const HepRep4x4Symmetric & rep ) :
00076           xx_(rep.xx_), xy_(rep.xy_), xz_(rep.xz_), xt_(rep.xt_)
00077         , yx_(rep.xy_), yy_(rep.yy_), yz_(rep.yz_), yt_(rep.yt_)
00078         , zx_(rep.xz_), zy_(rep.yz_), zz_(rep.zz_), zt_(rep.zt_)
00079         , tx_(rep.xt_), ty_(rep.yt_), tz_(rep.zt_), tt_(rep.tt_)
00080 {}
00081 
00082 inline HepRep4x4::HepRep4x4( const double * array ) {
00083   const double * a = array; 
00084   double * r = &xx_;
00085   for ( int i = 0; i < 16; i++ ) { *r++ = *a++; }
00086 }
00087 
00088 inline void HepRep4x4::setToIdentity() {
00089           xx_ = 1.0; xy_ = 0.0; xz_ = 0.0; xt_ = 0.0;
00090           yx_ = 0.0; yy_ = 1.0; yz_ = 0.0; yt_ = 0.0;
00091           zx_ = 0.0; zy_ = 0.0; zz_ = 1.0; zt_ = 0.0;
00092           tx_ = 0.0; ty_ = 0.0; tz_ = 0.0; tt_ = 1.0;
00093 }
00094 
00095 inline void HepRep4x4::getArray( double * array ) const {
00096   double * a = array; 
00097   const double * r = &xx_;
00098   for ( int i = 0; i < 16; i++ ) { *a++ = *r++; }
00099 }
00100 
00101 inline bool HepRep4x4::operator == (const HepRep4x4 & r) const {
00102   return( xx_ == r.xx_ && xy_ == r.xy_ && xz_ == r.xz_ && xt_ == r.xt_ &&
00103           yx_ == r.yx_ && yy_ == r.yy_ && yz_ == r.yz_ && yt_ == r.yt_ &&
00104           zx_ == r.zx_ && zy_ == r.zy_ && zz_ == r.zz_ && zt_ == r.zt_ &&
00105           tx_ == r.tx_ && ty_ == r.ty_ && tz_ == r.tz_ && tt_ == r.tt_ );
00106 }
00107 
00108 inline bool HepRep4x4::operator != (const HepRep4x4 & r) const {
00109   return !(operator== (r));
00110 }
00111 
00112 //-******************
00113 // HepRep4x4Symmetric
00114 //-******************
00115 
00116 inline HepRep4x4Symmetric::HepRep4x4Symmetric() :
00117           xx_(1.0), xy_(0.0), xz_(0.0), xt_(0.0)
00118         ,           yy_(1.0), yz_(0.0), yt_(0.0)
00119         ,                     zz_(1.0), zt_(0.0)
00120         ,                               tt_(1.0)
00121 {}
00122 
00123 inline HepRep4x4Symmetric::HepRep4x4Symmetric 
00124         ( double xx, double xy, double xz, double xt
00125                       , double yy, double yz, double yt
00126                                     , double zz, double zt
00127                                                   , double tt ) :
00128           xx_(xx), xy_(xy), xz_(xz), xt_(xt)
00129                  , yy_(yy), yz_(yz), yt_(yt)
00130                           , zz_(zz), zt_(zt)
00131                                    , tt_(tt)
00132 {}
00133 
00134 inline HepRep4x4Symmetric::HepRep4x4Symmetric( const double * array ) {
00135   const double * a = array; 
00136   double * r = &xx_;
00137   for ( int i = 0; i < 10; i++ ) { *r++ = *a++; }
00138 }
00139 
00140 inline void HepRep4x4Symmetric::setToIdentity() {
00141           xx_ = 1.0; xy_ = 0.0; xz_ = 0.0; xt_ = 0.0;
00142                      yy_ = 1.0; yz_ = 0.0; yt_ = 0.0;
00143                                 zz_ = 1.0; zt_ = 0.0;
00144                                            tt_ = 1.0;
00145 }
00146 
00147 inline void HepRep4x4Symmetric::getArray( double * array ) const {
00148   double * a = array; 
00149   const double * r = &xx_;
00150   for ( int i = 0; i < 10; i++ ) { *a++ = *r++; }
00151 }
00152 
00153 }  // namespace CLHEP

Generated on Mon May 27 17:50:34 2013 for Geant4 by  doxygen 1.4.7