STK++ 1.0
STK_AAModelFactory.h
Go to the documentation of this file.
00001 /*--------------------------------------------------------------------*/
00002 /*     Copyright (C) 2004  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::AAModels
00027  * Purpose:  Interface base class for AA models.
00028  * Author:   Serge Iovleff, serge.iovleff@stkpp.org
00029  *
00030  **/
00031 
00037 #ifndef STK_AAMODELFACTORY_H
00038 #define STK_AAMODELFACTORY_H
00039 
00040 #include "STK_IAAModel.h"
00041 
00042 namespace STK
00043 {
00051 class AAModelFactory : public IAAModel
00052 {
00053   public:
00057     AAModelFactory( Matrix const* p_data);
00058 
00060     virtual ~AAModelFactory();
00061 
00065     inline bool isCentered() const { return isCentered_;}
00069     inline bool isStandardized() const { return isStandardized_;}
00070 
00074     inline Point const& mean() const { return mean_;}
00078     inline Point const& std() const { return std_;}
00079 
00090     virtual bool run( Integer const& dim);
00091 
00103     virtual bool run( Vector const& weights, Integer const& dim);
00104 
00106     void center();
00110     void center( Vector const& weights);
00112     void standardize();
00116     void standardize( Vector const& weights);
00117 
00118   protected:
00120     Point mean_;
00122     Point std_;
00124     bool isCentered_;
00126     bool isStandardized_;
00127 };
00128 
00129 } // namespace STK
00130 
00131 #endif //STK_AAMODELFACTORY_H