Commit 83263463 authored by Fernando Silva Coira's avatar Fernando Silva Coira

Initial commit

parents
Pipeline #78 canceled with stages

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

cmake_minimum_required(VERSION 2.8.4)
project(knTreap)
#projects
#set(CMAKE_BUILD_TYPE "Debug")
add_subdirectory(./CPlusPlus)
cmake_minimum_required(VERSION 2.8.4)
project(kntreapCPP)
set(PROJECT_VENDOR "Fernando Silva")
set(CMAKE_PROJECT_NAME "kn-treap")
set(PROJECT_CONTACT "fernando.silva@udc.es")
set(CMAKE_INSTALL_PREFIX /home/fsilva/software)
set(CMAKE_COMPILER_IS_GNUCXX)
# Set output folder
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
include_directories(./include/)
set(SOURCES
src/HierarchyStructure/QNodeHS.cpp
src/HierarchyStructure/HierarchyStructure.cpp
src/kn-treap/util/QNodeN.cpp
src/kn-treap/util/PathEntry.cpp
src/kn-treap/util/BufferPathEntry.cpp
src/kn-treap/util/SummaryQueue.cpp
src/rtree/GetObjectsQueryBasic.cpp
src/rtree/Statistic/QueryStrategy/GetObjectsQueryCell.cpp
src/k2-treap/max/k2-treap-max.cpp
src/kn-treap/kn-treap-base.cpp
src/kn-treap/sum/kn-treap-sum.cpp
src/kn-treap/sum/kn-treap-sum-mm.cpp
src/k2-treap/max/util/basic.cpp
src/k2-treap/max/util/bitrankw32int.cpp
src/k2-treap/max/util/BST.cpp
src/k2-treap/max/util/CellSequence.cpp
src/k2-treap/max/util/directcodes.cpp
src/k2-treap/max/util/PriorityQueue.cpp
src/k2-treap/max/util/query.cpp
src/k2-treap/max/util/Queue.cpp
src/k2-treap/max/util/spk2tree.cpp)
# Flags
set(CMAKE_CXX_FLAGS " -Wall -m64")
set(CMAKE_CXX_FLAGS_RELEASE " -std=c++0x -Wall -O9")
set(CMAKE_CXX_FLAGS_DEBUG " -std=c++0x -O9 ")
#set(CMAKE_CXX_FLAGS_DEBUG " -std=c++0x -g3 -DDEBUG")
#set(CMAKE_CXX_FLAGS_DEBUG " -std=c++0x -pg ")
# set default compilation and show details for debug build
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_VERBOSE_MAKEFILE ON)
endif (NOT CMAKE_BUILD_TYPE)
# Create the library
add_library(kntreap STATIC ${SOURCES})
install(TARGETS kntreap DESTINATION lib)
install(DIRECTORY "includes" DESTINATION includes/libkntreap)
#Add libraries
# Add libcds
set(LIBCDS_DIR "./libs/libcds2/")
include_directories(${LIBCDS_DIR})
include_directories(${LIBCDS_DIR}includes/)
add_subdirectory(${LIBCDS_DIR})
# Add libspatialindex
set(LIBSPTATIALINDEX_DIR "./libs/spatialindex/")
include_directories(${LIBSPTATIALINDEX_DIR})
include_directories(${LIBSPTATIALINDEX_DIR}include/)
include_directories(${LIBSPTATIALINDEX_DIR}include/spatialindex)
add_subdirectory(${LIBSPTATIALINDEX_DIR})
#Add libUtils
set(LIBUTILS_DIR "./libs/libUtils/")
include_directories(${LIBUTILS_DIR})
include_directories(${LIBUTILS_DIR}include/)
add_subdirectory(${LIBUTILS_DIR})
# Executables k2-treap
add_executable(EncodeK2Treap ./src/exec/k2-treap/encodeK2Treap.cpp)
add_executable(GetMaxMinTopKCellByCell ./src/exec/Statistic/statisticRTreeMaxTopKCellByCell.cpp)
# Executables kn-treap
add_executable(EncodeknTreapDW ./src/encodeDW.cpp)
add_executable(EncodeknTreapMMDW ./src/encodeMMDW.cpp)
add_executable(TestQueriesknTreapsDW ./src/testQueriesDW.cpp)
add_executable(TestQueriesknTreapsMMDW ./src/testQueriesMMDW.cpp)
# Target libraries k2-treap
target_link_libraries(EncodeK2Treap LINK_PUBLIC kntreap spatialindex)
target_link_libraries(GetMaxMinTopKCellByCell LINK_PUBLIC kntreap cds spatialindex)
# Target libraries kn-treap
target_link_libraries(EncodeknTreapDW LINK_PUBLIC kntreap cds utils)
target_link_libraries(EncodeknTreapMMDW LINK_PUBLIC kntreap cds utils)
target_link_libraries(TestQueriesknTreapsDW LINK_PUBLIC kntreap cds utils)
target_link_libraries(TestQueriesknTreapsMMDW LINK_PUBLIC kntreap cds utils)
/*
* Created by Fernando Silva on 13/04/16.
*
* Copyright (C) 2016-current-year, Fernando Silva, all rights reserved.
*
* Author's contact: Fernando Silva <fernando.silva@udc.es>
* Databases Lab, University of A Coruña. Campus de Elviña s/n. Spain
*
* Class to represent the hierarchies of a DataWareHouse
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef KNTREAP_HIERARCHYSTRUCTURE_HS_H_
#define KNTREAP_HIERARCHYSTRUCTURE_HS_H_
#include <fstream>
#include <list>
#include <map>
#include <HierarchyStructure/QNodeHS.h>
namespace hierarchy_structure_static {
class HierarchyStructure {
public:
HierarchyStructure() {};
HierarchyStructure(uint numdimensions, std::list <std::string> dimFiles,
std::list <std::string> bitmapFiles);
HierarchyStructure(uint numdimensions, std::list <std::string> dimFiles);
virtual ~HierarchyStructure();
int* createDataWarehouse(std::ifstream &dataFile);
uint getNumdimensions();
void getPosition(std::string **keys, uint *startPos);
void getPositions(std::string **keys, uint *startPos, uint *endPos);
uint getTotalItems();
uint *getRealSizes();