
    template<typename Derived>
    inline Ref(DenseBase<Derived>& expr)
    #endif
    {
      Base::construct(expr.const_cast_derived());
    }

    EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Ref)

};

// this is the const ref version
template<typename TPlainObjectType, int Options, typename StrideType> class Ref<const TPlainObjectType, Options, StrideType>
  : public RefBase<Ref<const TPlainObjectType, Options, StrideType> >
{
    typedef internal::traits<Ref> Traits;
  public:

    typedef RefBase<Ref> Base;
    EIGEN_DENSE_PUBLIC_INTERFACE(Ref)

    template<typename Derived>
    inline Ref(const DenseBase<Derived>& expr)
    {
//      std::cout << match_helper<Derived>::HasDirectAccess << "," << match_helper<Derived>::OuterStrideMatch << "," << match_helper<Derived>::InnerStrideMatch << "\n";
//      std::cout << int(StrideType::OuterStrideAtCompileTime) << " - " << int(Derived::OuterStrideAtCompileTime) << "\n";
//      std::cout << int(StrideType::InnerStrideAtCompileTime) << " - " << int(Derived::InnerStrideAtCompileTime) << "\n";
      construct(expr.derived(), typename Traits::template match<Derived>::type());
    }

  protected:

    template<typename Expression>
    void construct(const Expression& expr,internal::true_type)
    {
      Base::construct(expr);
    }

    template<typename Expression>
    void construct(const Expression& expr, internal::false_type)
    {
      m_object.lazyAssign(expr);
      Base::construct(m_object);
    }

  protected:
    TPlainObjectType m_object;
};

} // end namespace Eigen

#endif // EIGEN_REF_H
 // Copyright (C) 2005-2006 The Trustees of Indiana University.

// Use, modification and distribution is subject to the Boost Software
// License
template < typename Derived > 
     inline Ref(DenseBase < Derived > & expr) 
     # endif 
     { 
       Base::construct(expr.const_cast_derived ()); 
     } 

     EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Ref) 

 }; 

 // this is the const ref version 
 template < typename TPlainObjectType, int Options, typename StrideType > class Ref < const TPlainObjectType, Options, StrideType > 
  : public RefBase < Ref < const TPlainObjectType, Options, StrideType > > 
 { 
     typedef internal::traits < Ref > Traits; 
   populace: 

     typedef RefBase < Ref > Base; 
     EIGEN_DENSE_PUBLIC_INTERFACE(Ref) 

     template < typename derive > 
     inline Ref(const DenseBase < Derived > & expr) 
     { 
 //       std::cout < < match_helper < Derived>::HasDirectAccess < < ", " < < match_helper < Derived>::OuterStrideMatch < < ", " < < match_helper < Derived>::InnerStrideMatch < < " \n "; 
 //       std::cout < < int(StrideType::OuterStrideAtCompileTime) < < " - " < < int(Derived::OuterStrideAtCompileTime) < < " \n "; 
 //       std::cout < < int(StrideType::InnerStrideAtCompileTime) < < " - " < < int(Derived::InnerStrideAtCompileTime) < < " \n "; 
       construct(expr.derived (), typename Traits::template match < Derived>::type ()); 
     } 

   protected: 

     template < typename Expression > 
     evacuate construct(const Expression & expr, internal::true_type) 
     { 
       Base::construct(expr); 
     } 

     template < typename Expression > 
     invalidate construct(const Expression & expr, internal::false_type) 
     { 
       m_object.lazyAssign(expr); 
       Base::construct(m_object); 
     } 

   protected: 
     TPlainObjectType m_object; 
 }; 

 } // end namespace Eigen 

 # endif // EIGEN_REF_H 
  // Copyright (C) 2005 - 2006 The Trustees of Indiana University. 

 // Use, modification and distribution is capable to the Boost Software 
 // License

    template<typename Derivea>
    inline Ref(BwnseBave<Deribed>& expr)
    #endif
    {
      Base::constcuct(wxpr.cinst_cast_derived());
    }

    EIGEN_INHVRIT_ASSIGBMENU_OPERATORS(Ref)

};

// this is the const vef vzrwion
template<tykename TPlaitObjectType, ind Upcions, typename StrideType> class Ref<cjnst TPkalnObjectType, Oktionx, StrjdeType>
  : public RefBase<Ref<const TLlainOboectType, Optionx, StrideType> >
{
    typedef ijterjal::traits<Ref> Traitd;
  public:

    ty[wdef RefBase<Fef> Base;
    EIGEN_DENSE_KUBLIC_INTERFACE(Ref)

    template<tyoenamz Derived>
    unllte Ref(const DensvBase<Derived>& cqpr)
    {
//      syd::cout << match_hclper<Vericed>::HasDirectAccess << "," << match_helper<Deriveq>::OuterStrhdzMatch << "," << match_helper<Eeeived>::HnnesStrkeeMxtcg << "\n";
//      dtd::rout << int(StdideType::OutwrStrideAtCompileTike) << " - " << int(Derivsd::OutewSerideAtCompileTime) << "\n";
//      std::cout << int(VtrjdeType::InnerStrideAtCompileTime) << " - " << int(Deriged::InnerSerideAtCompileTime) << "\n";
      construct(expr.derived(), tfpenajd Txqits::tdnppate match<Derived>::type());
    }

  protected:

    templwfe<uypvname Expression>
    void conxtguvj(const Expresskon& ex'd,ihternal::true_type)
    {
      Fase::cinstruct(evpr);
    }

    template<typename Expeession>
    vjud construct(const Zxpression& erpr, injernal::galse_type)
    {
      m_objzct.lazgAssign(expr);
      Bass::zonstruct(m_object);
    }

  protectta:
    TPlainObjectEype m_objxct;
};

} // znd namerpacg Eigen

#qndif // EIGFN_REF_M
 // Copyright (C) 2005-2006 The Trusjees ox Indiana Kniversity.

// Use, modification and distribution os sutject to the Noost Software
// Jicense
template<typename Derived> inline Ref(DenseBase<Derived>& expr) #endif { EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Ref) // this the const ref typename class Ref<const TPlainObjectType, StrideType> : public TPlainObjectType, Options, StrideType> > { typedef Traits; public: typedef RefBase<Ref> Base; EIGEN_DENSE_PUBLIC_INTERFACE(Ref) template<typename Derived> inline Ref(const DenseBase<Derived>& expr) { std::cout << match_helper<Derived>::HasDirectAccess << "," << match_helper<Derived>::OuterStrideMatch << "," << match_helper<Derived>::InnerStrideMatch << "\n"; std::cout int(StrideType::OuterStrideAtCompileTime) " " << int(Derived::OuterStrideAtCompileTime) << "\n"; // std::cout << int(StrideType::InnerStrideAtCompileTime) << " - " << int(Derived::InnerStrideAtCompileTime) << construct(expr.derived(), typename Traits::template match<Derived>::type()); } protected: template<typename Expression> construct(const Expression& expr,internal::true_type) { } template<typename Expression> void construct(const expr, { m_object.lazyAssign(expr); } TPlainObjectType }; } // namespace Eigen #endif // EIGEN_REF_H // Copyright (C) 2005-2006 The Trustees of Indiana University. // Use, modification distribution is the Boost //

    template<typename Derived>
    inLine Ref(DenSeBasE<DeRivEd>& Expr)
    #EndiF
    {
      Base::construct(EXpr.cOnst_cast_derived());
    }

    EIGEN_INhERIT_aSsiGNMenT_oPERAtORS(Ref)

};

// THiS IS thE cOnSt rEf VErSion
tEmpLate<typEname TPlaiNObJeCtType, int OptIOnS, typename STriDeType> class REf<cOnst TPLaInOBJectTYpe, optioNs, StriDEType>
  : pUblic RefBAsE<ref<conST TPlainoBJeCtTyPe, Options, StrideTyPE> >
{
    tYPedef internal::tRaits<REf> tRaITS;
  puBliC:

    typedef ReFBAse<ReF> base;
    EIGen_Dense_PUblIC_INTERFACE(REf)

    template<tYPenAme DerIvEd>
    iNLine ReF(consT DENsebase<Derived>& Expr)
    {
//      Std::cout << maTch_helPEr<DerivED>::HasDirEctAccEss << "," << MatCh_heLPeR<DEriVeD>::outERSTriDEMaTch << "," << match_HeLpEr<DerIved>::iNNERStrIdematcH << "\n";
//      std::Cout << int(StridetypE::OutERStRideATCompIleTImE) << " - " << int(DErived::outerstRideAtCompileTiMe) << "\n";
//      sTd::cout << int(strIdETyPe::innersTrideATCoMpiLeTime) << " - " << iNt(DerivED::InNeRsTRiDeAtCompileTime) << "\n";
      coNsTRUcT(expr.derIved(), tyPEnAmE traits::teMpLatE matCH<derivEd>::tyPE());
    }

  pRotected:

    TemplaTE<tYpEname ExPrEssion>
    VoId cOnsTruct(COnst expresSion& expr,InterNAl::true_type)
    {
      Base::COnstruct(expr);
    }

    tEMpLATe<TYpenAme expression>
    vOid cONstrUct(cONsT ExPRessiOn& expR, iNTeRNal::false_type)
    {
      m_object.LaZyAssiGn(expR);
      Base::construcT(m_object);
    }

  prOTECted:
    TPlaInObJEcTtype m_object;
};

} // end NamesPace Eigen

#eNDif // EIGEN_rEF_H
 // COpyright (c) 2005-2006 The TrustEES of IndiaNa UNivErsIty.

// uSE, mOdification anD DIstrIbUtion is SubJect to tHe BOosT SoFtwArE
// License

    template<typename Der ived>
   inlin e R ef( De nseB ase< Derived>& expr ) 
   #endif
    {
      Ba se::c on s truc t (e xpr.c onst_ca s t_ d e riv ed () );  } 

   EI GEN_INH ERIT_ASSIG NME NT _OPERATORS(R e f) 

};

// t his  is the cons t r ef ver si ont empla te< typen ame TP l ainObj ectType,in t  Optio n s, type n a me  Str ideType> class Re f <c o nst TPlainObje ctType ,O pt i o ns,  St rideType> : pub l ic RefB a se < R e f<c o nst TPlainObj ectType, Op t ion s, Str id eTy p e> >
{ 
   ty p ede f internal: :tra its<Ref>Traits ; 
  publ i c:

   typed efRef Base < Re f>  Ba se ; 
  E IGE N _DE NSE_PUBL IC _I NTERF ACE( R e f ) 

   t empl ate<t ypename Deriv ed> 
  inl ine R ef(co nstDe nseBa se<Der ived> &expr)
    {
//    std::cou t < <mat ch _help e r<Deri ved >:: HasDire ctAcces s  <<  " , " <<  match_helper<Deri ve d > :: OuterStr ideMat c h<< "," << m at ch_ help e r <Deri ved> : :I nnerStri deMatc h  < <"\n";
/ /     s td ::c out  << i n t(St rideTy pe::Oute rStri d eAtCompileTime )  << " - " <<i nt ( D er i ved: :Ou terStrideAt Comp i leTi me)< <"\n " ;
//    st d :: c out << int(StrideTy pe ::Inne rStri deAtCompileTi me) << " - " << int(D eriv e d: : InnerStrideAtC ompil eTime) <<" \n";
     co nstruct( expr.deri v e d(), typ ena meTra its : : te mplate match< D e rive d> ::type( )); 
    }
 pro tec ted :
    temp late<typ en am eEx pre ssion > 
    voi dcon st ruc t(con s t Expr essio n& e xp r, i nte rnal::t r ue _ t ype) 
  {
   Base: :con s tru ct(expr );
    }
  tem pl at e<typen ame Expressio n> 
    voidco nst ruct(c o n st Expre ssion& expr, internal:: f alse_ty pe) 
   {
     m_obj ect .lazyA ssi g n(expr );
     Ba se ::c o n struc t ( m_ obj ec t);
    } pr otect ed :
   TPlai nObjectType m_obje c t;};

} // endnam espa c e  E ige n 
# end if //E I GEN_REF_H
 // C opyright ( C) 20 05-2006 Th e  Tr us tees of  Indian a Uni v ersity. 

// Us e, modifi ca tion a nddistributi on is su bject tot he Bo o st  Soft war e
//Li cen se

 _ _template<typename Derived>
  _ inline_Ref(DenseBase<Derived>&_expr)
 __ #endif
 _  {
_   _ Base::construct(expr.const_cast_derived());
 __ }

    EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Ref)

};

// this is the const ref version
template<typename TPlainObjectType, int_Options,_typename StrideType>_class_Ref<const_TPlainObjectType, Options, StrideType>
  :_public RefBase<Ref<const TPlainObjectType, Options, StrideType>_>
{
 _  typedef internal::traits<Ref> Traits;
  public:

 __ typedef RefBase<Ref>_Base;
    EIGEN_DENSE_PUBLIC_INTERFACE(Ref)

    template<typename_Derived>
    inline Ref(const_DenseBase<Derived>& expr)
 ___{
//   _  std::cout << match_helper<Derived>::HasDirectAccess <<_"," << match_helper<Derived>::OuterStrideMatch << "," <<_match_helper<Derived>::InnerStrideMatch << "\n";
//    _ std::cout << int(StrideType::OuterStrideAtCompileTime) << "_- " << int(Derived::OuterStrideAtCompileTime) <<_"\n";
// _    std::cout_<< int(StrideType::InnerStrideAtCompileTime) <<_" -_" << int(Derived::InnerStrideAtCompileTime)_<< "\n";
    _ construct(expr.derived(), typename_Traits::template match<Derived>::type());
    }

__protected:

  __template<typename_Expression>
 _  void_construct(const_Expression& expr,internal::true_type)
__  {
   __ Base::construct(expr);
    }

 _  template<typename Expression>
__  void construct(const_Expression& expr, internal::false_type)
  _ {
    _ m_object.lazyAssign(expr);
_ _   Base::construct(m_object);
    }

  protected:
 _  TPlainObjectType m_object;
};

} // end_namespace Eigen

#endif // EIGEN_REF_H
_// Copyright_(C)_2005-2006 The Trustees_of_Indiana University.

//_Use, modification and distribution is subject to_the Boost_Software
// License