remove obsolete spartsetable.h

This commit is contained in:
Laurent Perron
2019-01-05 08:48:47 +01:00
parent 1b47822ff0
commit 475b7932af
4 changed files with 0 additions and 84 deletions

View File

@@ -30,7 +30,6 @@ BASE_DEPS = \
$(SRC_DIR)/ortools/base/recordio.h \
$(SRC_DIR)/ortools/base/small_map.h \
$(SRC_DIR)/ortools/base/small_ordered_set.h \
$(SRC_DIR)/ortools/base/sparsetable.h \
$(SRC_DIR)/ortools/base/status.h \
$(SRC_DIR)/ortools/base/statusor.h \
$(SRC_DIR)/ortools/base/stl_util.h \
@@ -3534,4 +3533,3 @@ $(GEN_DIR)/ortools/constraint_solver/solver_parameters.pb.h: \
$(OBJ_DIR)/constraint_solver/solver_parameters.pb.$O: \
$(GEN_DIR)/ortools/constraint_solver/solver_parameters.pb.cc | $(OBJ_DIR)/constraint_solver
$(CCC) $(CFLAGS) -c $(GEN_PATH)$Sortools$Sconstraint_solver$Ssolver_parameters.pb.cc $(OBJ_OUT)$(OBJ_DIR)$Sconstraint_solver$Ssolver_parameters.pb.$O

View File

@@ -255,16 +255,6 @@ cc_library(
],
)
cc_library(
name = "sparsetable",
hdrs = [
"sparsetable.h",
],
deps = [
":base",
],
)
cc_library(
name = "accurate_sum",
hdrs = [

View File

@@ -1,71 +0,0 @@
// Copyright 2010-2018 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef OR_TOOLS_BASE_SPARSETABLE_H_
#define OR_TOOLS_BASE_SPARSETABLE_H_
#include <vector>
#include "ortools/base/logging.h"
namespace operations_research {
// This class implements a simple block-based sparse std::vector.
template <class T>
class sparsetable {
public:
sparsetable() : size_(0) {}
void resize(int new_size) {
CHECK_GE(new_size, 0);
size_ = new_size;
const int reduced_size = (size_ + kBlockSize - 1) / kBlockSize;
if (reduced_size != elements_.size()) {
elements_.resize(reduced_size);
masks_.resize(reduced_size, 0U);
}
}
const T& get(int index) const {
DCHECK_GE(index, 0);
DCHECK_LT(index, size_);
DCHECK(test(index));
return elements_[index / kBlockSize][index % kBlockSize];
}
void set(int index, const T& elem) {
const int offset = index / kBlockSize;
const int pos = index % kBlockSize;
if (elements_[offset].size() == 0) {
elements_[offset].resize(kBlockSize);
}
elements_[offset][index % kBlockSize] = elem;
masks_[offset] |= (1U << pos);
}
bool test(int index) const {
const int offset = index / kBlockSize;
const int pos = index % kBlockSize;
return ((masks_[offset] & (1U << pos)) != 0);
}
int size() const { return size_; }
private:
static const int kBlockSize = 32;
int size_;
std::vector<std::vector<T> > elements_;
std::vector<uint32> masks_;
};
} // namespace operations_research
#endif // OR_TOOLS_BASE_SPARSETABLE_H_

View File

@@ -81,7 +81,6 @@ cc_library(
# "//ortools/base:int_type_indexed_bitmap",
"//ortools/base:int_type_indexed_vector",
"//ortools/base:recordio",
"//ortools/base:sparsetable",
"//ortools/base:strings",
# "//ortools/thread",
# "//ortools/util/coding:prefixvarint",