22 #include "Eigen/Dense" 25 namespace perception {
31 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
37 size_t width() {
return width_; }
43 void Reserve(
const size_t reserve_height,
const size_t reserve_width) {
44 max_height_ = std::max(reserve_height, max_height_);
45 max_width_ = std::max(reserve_width, max_width_);
46 mat_.resize(max_height_, max_width_);
53 void Resize(
const size_t resize_height,
const size_t resize_width) {
54 height_ = resize_height;
55 width_ = resize_width;
56 if (resize_height <= max_height_ && resize_width <= max_width_) {
59 max_height_ = std::max(resize_height, max_height_);
60 max_width_ = std::max(resize_width, max_width_);
61 mat_.resize(max_height_, max_width_);
65 std::ostringstream oss;
66 for (
size_t row = 0; row < height_; ++row) {
67 for (
size_t col = 0; col < width_; ++col) {
68 oss << mat_(row, col) <<
"\t";
75 inline const T&
operator()(
const size_t row,
const size_t col)
const {
76 return mat_(row, col);
79 inline T&
operator()(
const size_t row,
const size_t col) {
80 return mat_(row, col);
84 Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> mat_;
85 size_t max_height_ = 1000;
86 size_t max_width_ = 1000;
Definition: secure_matrix.h:29
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
void Reserve(const size_t reserve_height, const size_t reserve_width)
Definition: secure_matrix.h:43
const T & operator()(const size_t row, const size_t col) const
Definition: secure_matrix.h:75
SecureMat()
Definition: secure_matrix.h:34
size_t width()
Definition: secure_matrix.h:37
T & operator()(const size_t row, const size_t col)
Definition: secure_matrix.h:79
void Resize(const size_t resize_height, const size_t resize_width)
Definition: secure_matrix.h:53
size_t height()
Definition: secure_matrix.h:36
std::string ToString() const
Definition: secure_matrix.h:64