提交 df62df7e 编写于 作者: Y Yu Yang

Partially follow comments

上级 15318aeb
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
*/ */
inline void resize(int rowCnt) { inline void resize(int rowCnt) {
if (preallocatedBuf_) { if (preallocatedBuf_) {
CHECK(preallocatedBuf_->getSize() < rowCnt * width_ * sizeof(real)); CHECK(preallocatedBuf_->getSize() >= rowCnt * width_ * sizeof(real));
} else { } else {
rowStore_.resize(rowCnt * width_); rowStore_.resize(rowCnt * width_);
} }
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
*/ */
inline size_t getRowCount() const { inline size_t getRowCount() const {
if (preallocatedBuf_) { if (preallocatedBuf_) {
return preallocatedBuf_->getSize() / sizeof(float) / width_; return preallocatedBuf_->getSize() / sizeof(real) / width_;
} else { } else {
return rowStore_.size() / width_; return rowStore_.size() / width_;
} }
...@@ -117,7 +117,7 @@ public: ...@@ -117,7 +117,7 @@ public:
* @brief get is this buffer can automatically grow or not. * @brief get is this buffer can automatically grow or not.
* @return ture if can automacitally grow. * @return ture if can automacitally grow.
*/ */
inline bool isAutoGrowth() const { return preallocatedBuf_ == nullptr; } inline bool isAutoGrowth() const { return !preallocatedBuf_; }
/** /**
* @brief return the width of matrix. a.k.a length of row. * @brief return the width of matrix. a.k.a length of row.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册