modifié : MakefileNoOTB

modifié :         include/ArrayTree/ArrayTreeBuilder.hpp
	modifié :         include/ArrayTree/ArrayTreeBuilder.tpp
	modifié :         include/TreeStats.hpp
	modifié :         include/TreeStats.tpp
	modifié :         src/TreeStats.cpp
This commit is contained in:
Git Merciol 2018-03-14 14:27:59 +01:00
parent 91b8815b26
commit caa6e85da2
6 changed files with 36 additions and 11 deletions

View File

@ -16,11 +16,15 @@ TST_PRG = TestArrayTreeBuilder
TST_SRC = $(patsubst %, $(CPP_DIR)/%.cpp, $(TST_PRG))
TST_OUT = $(patsubst %, $(OUT_DIR)/%, $(TST_PRG))
PRF_PRG = PerfArrayTreeBuilder
PRF_SRC = $(patsubst %, $(CPP_DIR)/%.cpp, $(PRF_PRG))
PRF_OUT = $(patsubst %, $(OUT_DIR)/%, $(PRF_PRG))
## FLAGS ###############################
DFLAGS = -O2 -DNDEBUG -DBOOST_DISABLE_ASSERTS -DNO_OTB -DINTEL_TBB_THREAD
#DFLAGS = -g -DENABLE_LOG -DNO_OTB -DTHREAD_DISABLE -DENABLE_SMART_LOG
IFLAGS = $(DFLAGS) -MMD -I$(HPP_DIR)
LFLAGS = -L$(LIB_DIR) -ltriskele -lstdc++ -lpthread -ltbb -lboost_system -lboost_chrono -lboost_thread -lboost_program_options -lboost_date_time -lboost_serialization -lboost_filesystem -lboost_unit_test_framework -lgdal
LFLAGS = -L$(LIB_DIR) -ltriskele -lstdc++ -lpthread -lboost_system -lboost_chrono -lboost_thread -lboost_program_options -lboost_date_time -lboost_serialization -lboost_filesystem -lboost_unit_test_framework -lgdal -ltbb
CC = g++
## RULES ###############################
@ -35,15 +39,16 @@ $(OUT_DIR)/%: $(CPP_DIR)/*/%.cpp
$(CC) $(IFLAGS) $< -L$(LIB_DIR) $(LFLAGS) -cpp -o $@
## ENTRIES #############################
all: init libtriskele apGenerator test
all: init libtriskele apGenerator test pref
testA: all
$(TST_OUT)
testB: all
# $(APG_OUT) data/nairobi-byte.tif data/result.tif -b 0 -w 4000 -h 4000 --min-tree -A data/areaThresholds.txt # --debug
# $(APG_OUT) data/10m.tif data/result.tif -b 0 --min-tree --max-tree --tos-tree -A data/areaThresholds.txt -S data/sdThresholds.txt -M data/moiThresholds.txt # --debug
$(APG_OUT) data/10m.tif data/result.tif --min-tree --max-tree --tos-tree -A data/areaThresholds.txt -S data/sdThresholds.txt -M data/moiThresholds.txt # --debug
$(APG_OUT) data/10m.tif data/result.tif --min-tree --max-tree --tos-tree --alpha-tree -A data/areaThresholds.txt -S data/sdThresholds.txt -M data/moiThresholds.txt # --debug
perfA: all
$(PRF_OUT) MIN 8 20 1000000
init:
mkdir -p $(OUT_DIR) $(OBJ_DIR) $(LIB_DIR)
@ -58,10 +63,12 @@ wipe: clean
libtriskele: $(LIB_DIR)/libtriskele.a
$(APG_OUT): $(APG_SRC) $(LIB_DIR)/libtriskele.a
apGenerator: $(APG_OUT)
$(TST_OUT): $(TST_SRC) $(LIB_DIR)/libtriskele.a
test: $(TST_OUT)
$(PRF_OUT): $(PRF_SRC) $(LIB_DIR)/libtriskele.a
apGenerator: $(APG_OUT)
test: init $(TST_OUT)
pref: init $(PRF_OUT)
## DEPENDS #############################

View File

@ -38,7 +38,7 @@ namespace otb {
DimImg *newCompId;
WeightT *compWeights;
public:
inline ArrayTreeBuilder (Raster<PixelT> &raster, const GraphWalker &graphWalker,
inline ArrayTreeBuilder (const Raster<PixelT> &raster, const GraphWalker &graphWalker,
const TreeType &treeType, const bool &countingSort = true);
inline ~ArrayTreeBuilder ();

View File

@ -6,7 +6,7 @@ using namespace boost::chrono;
// ========================================
template<typename WeightT, typename PixelT>
inline
ArrayTreeBuilder<WeightT, PixelT>::ArrayTreeBuilder (Raster<PixelT> &raster, const GraphWalker &graphWalker,
ArrayTreeBuilder<WeightT, PixelT>::ArrayTreeBuilder (const Raster<PixelT> &raster, const GraphWalker &graphWalker,
const TreeType &treeType, const bool &countingSort) :
coreCount (boost::thread::hardware_concurrency ()),
raster (raster),

View File

@ -47,9 +47,10 @@ namespace otb {
class TreeStats {
public :
//void reset ();
void reset ();
inline void addDim (const TreeType &treeType, const DimImg& leafCount, const DimImg& compCount);
inline void addTime (const TimeType &timeType, const double &duration);
inline const TreeStatsDouble &getTimeStats (const TimeType &timeType);
// nice ostream
struct CPrintDim {
@ -68,6 +69,7 @@ namespace otb {
};
CPrintTime printTime () const;
friend ostream &operator << (ostream& out, const CPrintTime &cpt) { return cpt.print (out); }
private :
TreeStatsDim leavesStats[TreeTypeCard], compStats[TreeTypeCard];

View File

@ -13,6 +13,11 @@ TreeStats::addTime (const TimeType &timeType, const double &duration) {
timeStats[timeType] (duration);
}
inline const TreeStatsDouble &
TreeStats::getTimeStats (const TimeType &timeType) {
return timeStats [timeType];
}
// ========================================

View File

@ -24,6 +24,17 @@ static string timeTypeLabels [TimeTypeCard] = {
TreeStats globalTreeStats;
// ========================================
void
TreeStats::reset () {
for (unsigned int i = 0; i < TreeTypeCard; ++i) {
leavesStats[i] = TreeStatsDim ();
compStats[i] = TreeStatsDim ();
}
for (unsigned int i = 0; i < TimeTypeCard; ++i)
timeStats[i] = TreeStatsDouble ();
}
// ========================================
using namespace boost::chrono;
inline string