⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prototype.hpp

📁 模糊聚類分析源碼。包含教學文件
💻 HPP
字号:
/*    Context       : Fuzzy Clustering Algorithms  Author        : Frank Hoeppner, see also AUTHORS file   Description   : header of class Prototype                    History       : see source file  Comment       :     This file was generated automatically. DO NOT EDIT.  Copyright     : Copyright (C) 1999-2000 Frank Hoeppner    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*//*  The University of Applied Sciences Oldenburg/Ostfriesland/Wilhelmshaven  hereby disclaims all copyright interests in the program package `fc'   (tool package for fuzzy cluster analysis) written by Frank Hoeppner.    Prof. Haass, President of Vice, 2000-Mar-10*/#ifndef Prototype_HEADER#define Prototype_HEADER/* configuration include */#ifdef HAVE_CONFIG_H/*//FILETREE_IFDEF HAVE_CONFIG_H*/#include "config.h"/*//FILETREE_ENDIF*/#endif// necessary includes#include "ddl.hpp"#include "ustream-s.hpp"#include <list>//#define INLINE inline// global types, constants, definitions#define CLUSTER_PROTOTYPE 0#define CLUSTER_NOISE 1#define CLUSTER_AMBIGUITY 2#define KEYWORD_PROTO_WEIGHT "(weight"#define DEFAULT_PROTO_WEIGHT 0#define KEYWORD_PROTOTYPE "(prototype"#define KEYWORD_PROTO_CENTER "(center"#define KEYWORD_PROTO_NORMMAT "(norm-matrix"#define KEYWORD_PROTO_COVMAT "(cov-matrix"#define KEYWORD_PROTO_COVDET "(cov-det"#define DEFAULT_PROTO_COVDET 1.0 // corresponds to identity matrix#define KEYWORD_PROTO_APRIORI "(a-priori"#define DEFAULT_PROTO_APRIORI 1#define KEYWORD_PROTO_COEFF "(coefficient"#define KEYWORD_PROTO_RANGE "(range"// UNSUPERVISED_OPERATIONS#define FC_USO_UNTOUCHED 0#define FC_USO_MODIFIED  1#define FC_USO_EXTRACT   2#define FC_USO_DELETE    3#define FC_USO_INSERT    4#define KEYWORD_PROTO_OPERATION "(operation"#define DEFAULT_PROTO_OPERATION FC_USO_UNTOUCHED#define KEYWORD_PROTO_LINE "(line"#define KEYWORD_PROTO_HIERARCHY "(encloses"// class definitionclass Prototype    {    public:        Prototype();    template <class FEAT> void operator=(const FEAT& a_feat)      { center().adjust(a_feat.datum().rows(),a_feat.datum().cols());        matrix_set(center(),a_feat.datum());        start().adjust(a_feat.start().rows(),a_feat.start().cols());        matrix_set(start(),a_feat.start());        delta().adjust(a_feat.delta().rows(),a_feat.delta().cols());        matrix_set(delta(),a_feat.delta());        list< FEAT >::const_iterator i(a_feat.hierarchy().begin());        hierarchy().clear();        while (i!=a_feat.hierarchy().end())          {          Prototype p;          p = (*i);          hierarchy().push_back(p);          ++i;          } }    bool consistent(int,int,int&) const;    template <class ALGORITHM> void apply(ALGORITHM*,int) const;    real_type select(const Selector&) const;    real_type diff(const Prototype&) const;    void read(istream& is);    void write(ostream& os) const;    inline int type() const { return m_type; }    inline int& type() { return m_type; }    inline real_type total_pow_membxweight() const { return m_total_pow_membxweight; }    inline real_type& total_pow_membxweight() { return m_total_pow_membxweight; }    inline const tuple_type& center() const { return m_center; }    inline tuple_type& center() { return m_center; }    inline const matrix_type& normmatrix() const { return m_normmatrix; }    inline matrix_type& normmatrix() { return m_normmatrix; }    inline const matrix_type& covmatrix() const { return m_covmatrix; }    inline matrix_type& covmatrix() { return m_covmatrix; }    inline TData covdet() const { return m_covdet; }    inline TData& covdet() { return m_covdet; }    inline TData apriori() const { return m_apriori; }    inline TData& apriori() { return m_apriori; }    inline const matrix_type& coefficient() const { return m_coefficient; }    inline matrix_type& coefficient() { return m_coefficient; }    inline const tuple_type& range() const { return m_range; }    inline tuple_type& range() { return m_range; }    inline int unsupervised_operation() const { return m_operation; }    inline int& unsupervised_operation() { return m_operation; }    inline const tuple_type& start() const { return m_start; }    inline tuple_type& start() { return m_start; }    inline const tuple_type& delta() const { return m_delta; }    inline tuple_type& delta() { return m_delta; }    inline const list< Prototype >& hierarchy() const { return m_hierarchy; }    inline list< Prototype >& hierarchy() { return m_hierarchy; }    inline const string& unrecognized() const { return m_unrecognized; }    inline string& unrecognized() { return m_unrecognized; }    int m_type;    Prototype *m_prot_near_iter,*m_prot_far_iter;    int m_prot_near_no,m_prot_far_no;  protected:            real_type m_total_pow_membxweight; // w*u^m    tuple_type m_center;    matrix_type m_normmatrix;    matrix_type m_covmatrix;    TData m_covdet;    TData m_apriori;    matrix_type m_coefficient;    tuple_type m_range;    string m_unrecognized;  private:            int m_operation;    tuple_type m_start;    tuple_type m_delta;    list< Prototype > m_hierarchy;      };// class related functions and definitions/* inline implementation */template <class ALGORITHM>voidPrototype::apply  (  ALGORITHM* ap_alg,  int a_level  )  const  {  (*ap_alg)(*this,a_level);  list< Prototype >::const_iterator i;  for (i=m_hierarchy.begin();i!=m_hierarchy.end();++i)    {     (*i).apply(ap_alg,a_level+1);    }  }inline ostream& operator<<(ostream& os,const Prototype& a_prot)  { a_prot.write(os); return os; }inline istream& operator>>(istream& is,Prototype& a_prot)  { a_prot.read(is); return is; }#endif // Prototype_HEADER

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -