RangStatistik.h
Go to the documentation of this file.00001 #ifndef RANG_STATISTK_H
00002 #define RANG_STATISTK_H
00003 #if _MSC_VER > 1000
00004 #pragma once
00005 #endif // _MSC_VER > 1000
00006 #include <iostream>
00007 #include <fstream>
00008 #include <string>
00010 #include <assert.h>
00011 #include <algorithm>
00012
00013 #include "typedefs.h"
00014
00015 namespace nCenterFocus
00016 {
00017
00018 std::string getMacaulayCompilantObjectName(const std::string &strref) ;
00019
00033 class BaseRankStatistic
00034 {
00035
00036 public:
00037
00038 static const std::string fullRankStatisticString;
00039 static const std::string subRankStatisticString;
00040
00043 BaseRankStatistic( std::string name,
00044 int _requestedMinSuccessiveVanishedFocalValues,
00045 int _maxFocalValuesToCompute,
00046 int _maxRank );
00047
00048 BaseRankStatistic( const BaseRankStatistic& );
00049 BaseRankStatistic& operator=( const BaseRankStatistic& ) ;
00050
00051 virtual ~BaseRankStatistic();
00052
00055 void clear();
00056
00059 void addRankStatistic(int successiveVanishedFocalValues,int jacobianRank);
00067
00068 int getSmallesLoggedNumOfVanishedFocalValues() const;
00069
00071 int getHighestLoggedNumOfVanishedFocalValues() const;
00072
00074 int getHighestLoggedJacobianRank() const;
00075
00077 long64 getOccurenceWithGivenNumOfVanishedFocalValues(int successiveVanishedNum) const;
00078
00079 int getNumOfOccuredJacobianRank(int successiveVanishedNum, int jacobianRank) const;
00085 void print(std::ostream &f) const;
00086
00087 std::string getValueAsString() const;
00091 private:
00092 BaseRankStatistic();
00093
00094
00095
00099
00100 long64 getJacobianRankCounter (int index) const;
00101
00103 long64& getJacobianRankCounterRef (int index) ;
00104
00106 int getRankStatisticIndex(int successiveVanishedNum, int jacobianRank) const;
00107
00114 std::string name_m;
00115
00116 int maxRank;
00117 int maxFocalValuesToCompute;
00118 int minSuccessiveZeroFocalValues;
00119
00127
00128 long64* jacobianRankCounters_m;
00129
00130
00132 long64* exactVanishedFocalValuesStatistic_m;
00133
00134
00135
00136 int arrayLength;
00137
00139
00140 void init();
00141
00144 inline void testbounds(int maxbound) const;
00146 };
00147
00148
00149
00151 class RankAndLiftStatistic
00152 {
00153
00154 private:
00155
00156 RankAndLiftStatistic();
00157
00158 std::string name_m;
00159
00161 std::pair < BaseRankStatistic , BaseRankStatistic > rankStatisticPair_m;
00162
00163
00164
00165
00166 public:
00167 RankAndLiftStatistic( std::string name,
00168 int _requestedMinSuccessiveVanishedFocalValues,
00169 int _maxFocalValuesToCompute,
00170 int _maxRank
00171 );
00172
00173 virtual ~RankAndLiftStatistic();
00174
00175
00176 void clear();
00177
00178
00181 void addRankStatistic(int successiveVanishedFocalValues, int jacobianRank, bool liftTestPassed);
00188 void print(std::ostream &f) const;
00190 };
00191
00192 };
00193 #endif