STK++ 1.0
STK_Stat_Bivariate.h
Go to the documentation of this file.
00001 /*--------------------------------------------------------------------*/
00002 /*     Copyright (C) 2004-2011  Serge Iovleff
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU Lesser General Public License as
00006     published by the Free Software Foundation; either version 2 of the
00007     License, or (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU Lesser General Public License for more details.
00013 
00014     You should have received a copy of the GNU Lesser General Public
00015     License along with this program; if not, write to the
00016     Free Software Foundation, Inc.,
00017     59 Temple Place,
00018     Suite 330,
00019     Boston, MA 02111-1307
00020     USA
00021 
00022     Contact : Serge.Iovleff@stkpp.org
00023 */
00024 
00025 /*
00026  * Project:  stkpp::StatDesc
00027  * Purpose:  Compute elementary statistics for two variables.
00028  * Author:   Serge Iovleff, serge.iovleff@stkpp.org
00029  **/
00030 
00035 #ifndef STK_STAT_BIVARIATE_H
00036 #define STK_STAT_BIVARIATE_H
00037 
00038 #include "../../Sdk/include/STK_ITContainer1D.h"
00039 
00040 #include "../include/STK_Stat_Univariate.h"
00041 
00042 namespace STK
00043 {
00044 namespace Stat
00045 {
00046 
00056 template < class XTYPE, class YTYPE, class TContainer1D >
00057 class Bivariate
00058 {
00059   protected:
00061     Univariate<XTYPE, TContainer1D>    xStat_;
00063     Univariate<YTYPE, TContainer1D>    yStat_;
00064 
00065   public:
00071     Bivariate( ITContainer1D<XTYPE, TContainer1D> const& X
00072              , ITContainer1D<YTYPE, TContainer1D> const& Y
00073              )
00074              : xStat_(X)
00075              , yStat_(Y)
00076     {}
00077 
00081     Bivariate( const Bivariate& stat)
00082               : xStat_(stat.xStat_)
00083               , yStat_(stat.yStat_)
00084     { ;}
00085     
00087     virtual ~Bivariate() { ;}
00088   
00093     Bivariate& operator=( const Bivariate& stat)
00094     {
00095       xStat_ = stat.xStat_;
00096       yStat_ = stat.yStat_;
00097       return *this;
00098     }
00099 
00104     void setData( TContainer1D const& X,  TContainer1D const& Y)
00105     {
00106       xStat_.setData(X);
00107       yStat_.setData(Y);
00108     }
00109 
00111     inline Univariate<XTYPE, TContainer1D> xStat() const {return xStat_;}
00113     inline Univariate<YTYPE, TContainer1D> yStat() const {return yStat_;}
00114  };
00115   
00116   
00117 }  // namespace Stat
00118 
00119 }  // namespace STK
00120 
00121 #endif /*STK_STAT_BIVARIATE_H*/