/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
void ScCalcConfig::setOpenCLConfigToDefault()
{ // Keep in order of opcode value, is that clearest? (Random order, // at least, would make no sense at all.) staticconst OpCodeSet pDefaultOpenCLSubsetOpCodes(new o3tl::sorted_vector<OpCode>({
ocAdd,
ocSub,
ocNegSub,
ocMul,
ocDiv,
ocPow,
ocRandom,
ocSin,
ocCos,
ocTan,
ocArcTan,
ocExp,
ocLn,
ocSqrt,
ocStdNormDist,
ocSNormInv,
ocRound,
ocPower,
ocSumProduct,
ocMin,
ocMax,
ocSum,
ocProduct,
ocAverage,
ocCount,
ocVar,
ocNormDist,
ocVLookup,
ocCorrel,
ocCovar,
ocPearson,
ocSlope,
ocSumIfs}));
// Note that these defaults better be kept in sync with those in // officecfg/registry/schema/org/openoffice/Office/Calc.xcs. // Crazy.
mbOpenCLSubsetOnly = true;
mbOpenCLAutoSelect = true;
mnOpenCLMinimumFormulaGroupSize = 100;
mpOpenCLSubsetOpCodes = pDefaultOpenCLSubsetOpCodes;
}
for (auto i = rOpCodes->begin(); i != rOpCodes->end(); ++i)
{ if (i != rOpCodes->begin())
result.append(';');
result.append(pOpCodeMap->getSymbol(*i));
}
while ((semicolon = s.indexOf(';', fromIndex)) >= 0)
{ if (semicolon > fromIndex)
{
OUString element(s.copy(fromIndex, semicolon - fromIndex));
sal_Int32 n = element.toInt32(); if (n > 0 || (n == 0 && element == "0"))
result->insert(static_cast<OpCode>(n)); else
{ auto opcode(rHashMap.find(element)); if (opcode != rHashMap.end())
result->insert(opcode->second); else
SAL_WARN("sc.opencl", "Unrecognized OpCode " << element << " in OpCode set string");
}
}
fromIndex = semicolon+1;
} // HACK: Both unary and binary minus have the same string but different opcodes. if( result->find( ocSub ) != result->end())
result->insert( ocNegSub );
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.