// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i < 5; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(12, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(12, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
fLibre = pDoc->GetValue(ScAddress(13, i, 0));
fExcel = pDocRes->GetValue(ScAddress(13, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
fLibre = pDoc->GetValue(ScAddress(14, i, 0));
fExcel = pDocRes->GetValue(ScAddress(14, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i < 5; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i < 5; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
fLibre = pDoc->GetValue(ScAddress(3, i, 0));
fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i < 7; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testCompilerPrecision)
{
initTestEnv(u"ods/opencl/compiler/precision.ods");
ScDocument* pDoc = getScDoc();
ScDocument* pDocRes = getScDoc2(); // Check that values with and without opencl are the same/similar enough.
enableOpenCL();
pDoc->CalcAll();
disableOpenCL();
pDoc->CalcAll();
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i < 3; ++i)
{ double fOpenCL = pDoc->GetValue(ScAddress(0, i, 0)); double fNormal = pDocRes->GetValue(ScAddress(0, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fNormal, fOpenCL, fabs(1e-14*fOpenCL));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 0; i < 5; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
for (SCROW i = 6; i < 14; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
for (SCROW i = 15; i < 18; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
for (SCROW i = 19; i < 22; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
for (SCROW i = 23; i < 25; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); //double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); // There seems to be a bug in LibreOffice beta
ASSERT_DOUBLES_EQUAL(/*fExcel*/ 60.0, fLibre);
}
for (SCROW i = 25; i < 27; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
for (SCROW i = 28; i < 35; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
// workaround for a Calc beta bug
ASSERT_DOUBLES_EQUAL(25.0, pDoc->GetValue(ScAddress(2, 35, 0)));
ASSERT_DOUBLES_EQUAL(24.0, pDoc->GetValue(ScAddress(2, 36, 0)));
for (SCROW i = 38; i < 43; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
for (SCROW i = 5; i < 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(5, i, 1)); double fExcel = pDocRes->GetValue(ScAddress(5, i, 1));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
for (SCROW i = 5; i < 10; ++i)
{ for (SCCOL j = 6; j < 11; ++j)
{ double fLibre = pDoc->GetValue(ScAddress(j, i, 1)); double fExcel = pDocRes->GetValue(ScAddress(j, i, 1));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre,
fabs(fExcel*0.0001));
}
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2,i,0)); double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(6,i,1)); double fExcel = pDocRes->GetValue(ScAddress(6,i,1));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2,i,2)); double fExcel = pDocRes->GetValue(ScAddress(2,i,2));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(6,i,3)); double fExcel = pDocRes->GetValue(ScAddress(6,i,3));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 0; i <= 9; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,4)); double fExcel = pDocRes->GetValue(ScAddress(3,i,4));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 0; i <= 9; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,5)); double fExcel = pDocRes->GetValue(ScAddress(3,i,5));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 0; i < 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(5,i,6)); double fExcel = pDocRes->GetValue(ScAddress(5,i,6));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 9; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,7)); double fExcel = pDocRes->GetValue(ScAddress(3,i,7));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,8)); double fExcel = pDocRes->GetValue(ScAddress(3,i,8));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 9; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,9)); double fExcel = pDocRes->GetValue(ScAddress(3,i,9));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2,i,10)); double fExcel = pDocRes->GetValue(ScAddress(2,i,10));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(7,i,11)); double fExcel = pDocRes->GetValue(ScAddress(7,i,11));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(5,i,12)); double fExcel = pDocRes->GetValue(ScAddress(5,i,12));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 0; i <= 12; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(6,i,13)); double fExcel = pDocRes->GetValue(ScAddress(6,i,13));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,14)); double fExcel = pDocRes->GetValue(ScAddress(3,i,14));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(6,i,15)); double fExcel = pDocRes->GetValue(ScAddress(6,i,15));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(6,i,16)); double fExcel = pDocRes->GetValue(ScAddress(6,i,16));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 5; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(6,i,17)); double fExcel = pDocRes->GetValue(ScAddress(6,i,17));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 0; i <= 10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,18)); double fExcel = pDocRes->GetValue(ScAddress(3,i,18));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 0; i <= 18; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,19)); double fExcel = pDocRes->GetValue(ScAddress(3,i,19));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 20; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
CPPUNIT_TEST_FIXTURE(ScOpenCLTest1, testStatisticalFormulaFisher)
{
initTestEnv(u"xls/opencl/statistical/Fisher.xls");
ScDocument* pDoc = getScDoc();
ScDocument* pDocRes = getScDoc2();
pDoc->CalcAll();
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
for (SCROW i = 1; i <=10; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(4, i, 0)); double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 0; i <= 9; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,0)); double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 20; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,0)); double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 20; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(4,i,0)); double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre,
fExcel == 0?1e-4:fabs(1e-4*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 9; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2,i,0)); double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 9; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2,i,0)); double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 9; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(4,i,0)); double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2,i,0)); double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 9; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(2,i,0)); double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,0)); double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,0)); double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(4,i,0)); double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,0)); double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 1; i <= 19; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 0; i <= 9; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,0)); double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
// Check the results of formula cells in the shared formula range. for (SCROW i = 0; i <= 9; ++i)
{ double fLibre = pDoc->GetValue(ScAddress(3,i,0)); double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
}
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.