| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeProxMatrixWeightsStrategy.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00028 #ifndef TeProxMatrixWeightsStrategy_H
    00029 #define TeProxMatrixWeightsStrategy_H
    00030
    00031 #include "TeProxMatrixImplementation.h"
    00032 #include <vector>
    00033
    00034
    00035 struct TL_DLL TeProxMatrixWeightsParams
    00036 {
    00037 public:
    00038            TeGPMWeightsStrategy             strategy_;
    00039            bool                                                              norm_;
    00040            double                                                            a_;
    00041            double                                                            b_;
    00042            double                                                            c_;
    00043            double                                                            factor_;
    00044            double                                                            dist_ratio_;
    00045            double                                                            max_local_dist_;
    00046
    00047            TeProxMatrixWeightsParams():
    00048                       strategy_(TeNoWeightsStrategy), norm_(false), a_(1.),
    00049                       b_(1.), c_(1.), factor_(1.), dist_ratio_(0.), max_local_dist_(0.)
    00050                       {}
    00051
    00052            TeProxMatrixWeightsParams(bool norm, const TeGPMWeightsStrategy& type):
    00053                       strategy_(type), norm_(norm), a_(1.), b_(1.), c_(1.),
    00054                       factor_(1.), dist_ratio_(0.), max_local_dist_(0.)
    00055                       {}
    00056
    00057            bool operator== (const TeProxMatrixWeightsParams& other) const
    00058            {
    00059                       return ((strategy_==other.strategy_) && (norm_==other.norm_) &&
    00060                                  (a_==other.a_) && (b_==other.b_) && (c_==other.c_) &&
    00061                                  (factor_==other.factor_) && (dist_ratio_==other.dist_ratio_) &&
    00062                                  (max_local_dist_==other.max_local_dist_));
    00063            }
    00064 };
    00065
    00066
    00068 class TL_DLL TeProxMatrixWeightsStrategy
    00069 {
    00070 protected:
    00071            TeProxMatrixWeightsParams params_;
    00072
    00074            TeProxMatrixWeightsStrategy(bool norm = false, const TeGPMWeightsStrategy& type=TeNoWeightsStrategy ):
    00075                       params_(norm, type)
    00076             { }
    00077
    00078 public:
    00080            virtual bool ComputeWeigths (TeProxMatrixImplementation* ) =0;
    00081
    00083            virtual ~TeProxMatrixWeightsStrategy() {}
    00084
    00086            virtual bool operator== (const TeProxMatrixWeightsStrategy& w) const {return (params_==w.params_);}
    00087
    00089            TeProxMatrixWeightsParams& weightsParams() { return params_; }
    00090 };
    00091
    00093 class TL_DLL TeProxMatrixNoWeightsStrategy : public TeProxMatrixWeightsStrategy
    00094 {
    00095 public:
    00097            TeProxMatrixNoWeightsStrategy (bool norm = true) : TeProxMatrixWeightsStrategy(norm, TeNoWeightsStrategy)
    00098            { }
    00099
    00101            virtual bool ComputeWeigths (TeProxMatrixImplementation* imp);
    00102
    00104            ~TeProxMatrixNoWeightsStrategy() {}
    00105 };
    00106
    00107
    00111 class TL_DLL TeProxMatrixInverseDistanceStrategy : public TeProxMatrixWeightsStrategy
    00112 {
    00113 public:
    00115            TeProxMatrixInverseDistanceStrategy  (double a = 1.0, double b = 1.0, double c = 1.0, double factor = 1.0, bool norm = true) :
    00116              TeProxMatrixWeightsStrategy (norm, TeInverseDistanceStrategy)
    00117            { params_.a_ = a; params_.b_ = b; params_.c_ = c; params_.factor_ = factor;}
    00118
    00120            virtual bool ComputeWeigths (TeProxMatrixImplementation* imp);
    00121
    00123            ~TeProxMatrixInverseDistanceStrategy() {}
    00124 };
    00125
    00126
    00130 class TL_DLL TeProxMatrixSquaredInverseDistanceStrategy : public TeProxMatrixWeightsStrategy
    00131 {
    00132 public:
    00134            TeProxMatrixSquaredInverseDistanceStrategy  (double a = 1.0, double b = 1.0, double c = 1.0, double factor = 1.0, bool norm = true) :
    00135              TeProxMatrixWeightsStrategy (norm, TeSquaredInverseDistStrategy)
    00136            { params_.a_ = a; params_.b_ = b; params_.c_ = c; params_.factor_ = factor;}
    00137
    00139            virtual bool ComputeWeigths (TeProxMatrixImplementation* imp);
    00140
    00142            ~TeProxMatrixSquaredInverseDistanceStrategy() {}
    00143 };
    00144
    00145
    00149 class TL_DLL TeProxMatrixConnectionStrenghtStrategy : public TeProxMatrixWeightsStrategy
    00150 {
    00151 public:
    00153            TeProxMatrixConnectionStrenghtStrategy  (double dist_ratio = 1.0, double max_local_distance = 0.0, double factor = 1.0, bool norm = true)
    00154                       : TeProxMatrixWeightsStrategy (norm, TeConnectionStrenghtStrategy )
    00155            {
    00156                       params_.dist_ratio_ = dist_ratio;
    00157                       params_.max_local_dist_ = max_local_distance;
    00158                       params_.factor_ = factor;
    00159            }
    00160
    00162            virtual bool ComputeWeigths (TeProxMatrixImplementation* imp);
    00163
    00165            ~TeProxMatrixConnectionStrenghtStrategy() {}
    00166 };
    00167
    00168 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines