Kaydet (Commit) 8e148863 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

sc: Implement ScVectorRefMatrix.

This is a ScMatrix implementation that operates directly on
formula::DoubleVectorRefToken, saving tremendous amount of copying data back
and forth.

Change-Id: I027e6cb668ef40eb474773a0ce8d0eeefc1ab71c
üst 02226081
This diff is collapsed.
......@@ -11,6 +11,7 @@
#ifndef INCLUDED_SC_SOURCE_CORE_INC_ARRAYSUMFUNCTOR_HXX
#define INCLUDED_SC_SOURCE_CORE_INC_ARRAYSUMFUNCTOR_HXX
#include <cstdint>
#include <tools/cpuid.hxx>
#if defined(LO_SSE2_AVAILABLE)
......
......@@ -369,14 +369,23 @@ bool FormulaGroupInterpreterSoftware::interpret(ScDocument& rDoc, const ScAddres
case formula::svDoubleVectorRef:
{
const formula::DoubleVectorRefToken* p2 = static_cast<const formula::DoubleVectorRefToken*>(p);
const std::vector<formula::VectorRefArray>& rArrays = p2->GetArrays();
size_t nColSize = rArrays.size();
size_t nRowStart = p2->IsStartFixed() ? 0 : i;
size_t nRowEnd = p2->GetRefRowSize() - 1;
if (!p2->IsEndFixed())
nRowEnd += i;
ScMatrixRef pMat;
if (getenv("SC_ALLOW_SOFTWARE_INTERPRETER") != nullptr)
{
assert(nRowStart <= nRowEnd);
pMat.reset(new ScVectorRefMatrix(p2, nRowStart, nRowEnd - nRowStart + 1));
}
else
{
const std::vector<formula::VectorRefArray>& rArrays = p2->GetArrays();
size_t nColSize = rArrays.size();
size_t nRowSize = nRowEnd - nRowStart + 1;
ScMatrixRef pMat(new ScFullMatrix(nColSize, nRowSize));
pMat.reset(new ScFullMatrix(nColSize, nRowSize));
size_t nDataRowEnd = p2->GetArrayLength() - 1;
if (nRowStart > nDataRowEnd)
......@@ -416,6 +425,7 @@ bool FormulaGroupInterpreterSoftware::interpret(ScDocument& rDoc, const ScAddres
fillMatrix(*pMat, nCol, pNums, nRowSize);
}
}
}
if (p2->IsStartFixed() && p2->IsEndFixed())
{
......
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