Kaydet (Commit) 0b08d062 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

vector with reserve() is slightly faster than deque here.

Change-Id: I9c2203662daa586e3fdbc9650b6ff61365c5bc60
üst 7460ddb0
...@@ -141,10 +141,13 @@ class CompareMatrixElemFunc : std::unary_function<MatrixImplType::element_block_ ...@@ -141,10 +141,13 @@ class CompareMatrixElemFunc : std::unary_function<MatrixImplType::element_block_
static _Comp maComp; static _Comp maComp;
MatrixImplType maNewMat; MatrixImplType maNewMat;
std::deque<bool> maNewMatValues; std::vector<bool> maNewMatValues;
public: public:
CompareMatrixElemFunc( size_t nRow, size_t nCol ) : CompareMatrixElemFunc( size_t nRow, size_t nCol ) :
maNewMat(nRow, nCol, false) {} maNewMat(nRow, nCol, false)
{
maNewMatValues.reserve(nRow*nCol);
}
void operator() (const MatrixImplType::element_block_node_type& node) void operator() (const MatrixImplType::element_block_node_type& node)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment