Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
eaddf7df
Kaydet (Commit)
eaddf7df
authored
Ock 28, 2015
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add NORMDIST test
Change-Id: I9c3d5b94d22566d63f49d9dcd73a97df97e9802e
üst
36941076
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
calcoptionsdlg.cxx
sc/source/ui/optdlg/calcoptionsdlg.cxx
+64
-0
No files found.
sc/source/ui/optdlg/calcoptionsdlg.cxx
Dosyayı görüntüle @
eaddf7df
...
...
@@ -506,6 +506,68 @@ struct Round : Area
};
struct
Normdist
:
Area
{
Normdist
()
:
Area
(
"Normdist"
)
{
}
virtual
~
Normdist
()
{
}
virtual
void
addHeader
(
ScDocument
*
pDoc
,
int
nTab
)
const
SAL_OVERRIDE
{
pDoc
->
SetString
(
ScAddress
(
0
,
0
,
nTab
),
"num"
);
pDoc
->
SetString
(
ScAddress
(
1
,
0
,
nTab
),
"avg"
);
pDoc
->
SetString
(
ScAddress
(
2
,
0
,
nTab
),
"stdev"
);
pDoc
->
SetString
(
ScAddress
(
3
,
0
,
nTab
),
"type"
);
pDoc
->
SetString
(
ScAddress
(
4
,
0
,
nTab
),
"NORMDIST(num,avg,stdev,type)"
);
pDoc
->
SetString
(
ScAddress
(
5
,
0
,
nTab
),
"expected"
);
}
virtual
void
addRow
(
ScDocument
*
pDoc
,
int
nRow
,
int
nTab
)
const
SAL_OVERRIDE
{
const
double
nNum
(
comphelper
::
rng
::
uniform_real_distribution
(
0
,
100
));
const
double
nAvg
(
comphelper
::
rng
::
uniform_real_distribution
(
0
,
100
));
const
double
nStDev
(
comphelper
::
rng
::
uniform_real_distribution
(
1
,
10
));
const
int
nType
(
comphelper
::
rng
::
uniform_int_distribution
(
0
,
1
));
pDoc
->
SetValue
(
ScAddress
(
0
,
1
+
nRow
,
nTab
),
nNum
);
pDoc
->
SetValue
(
ScAddress
(
1
,
1
+
nRow
,
nTab
),
nAvg
);
pDoc
->
SetValue
(
ScAddress
(
2
,
1
+
nRow
,
nTab
),
nStDev
);
pDoc
->
SetValue
(
ScAddress
(
3
,
1
+
nRow
,
nTab
),
nType
);
pDoc
->
SetString
(
ScAddress
(
4
,
1
+
nRow
,
nTab
),
"=NORMDIST("
+
ScAddress
(
0
,
1
+
nRow
,
nTab
).
Format
(
SCA_VALID_COL
|
SCA_VALID_ROW
)
+
","
+
ScAddress
(
1
,
1
+
nRow
,
nTab
).
Format
(
SCA_VALID_COL
|
SCA_VALID_ROW
)
+
","
+
ScAddress
(
2
,
1
+
nRow
,
nTab
).
Format
(
SCA_VALID_COL
|
SCA_VALID_ROW
)
+
","
+
ScAddress
(
3
,
1
+
nRow
,
nTab
).
Format
(
SCA_VALID_COL
|
SCA_VALID_ROW
)
+
")"
);
if
(
nType
==
1
)
pDoc
->
SetValue
(
ScAddress
(
5
,
1
+
nRow
,
nTab
),
ScInterpreter
::
integralPhi
((
nNum
-
nAvg
)
/
nStDev
));
else
pDoc
->
SetValue
(
ScAddress
(
5
,
1
+
nRow
,
nTab
),
ScInterpreter
::
phi
((
nNum
-
nAvg
)
/
nStDev
)
/
nStDev
);
pDoc
->
SetString
(
ScAddress
(
6
,
1
+
nRow
,
nTab
),
"=IF(ABS("
+
ScAddress
(
4
,
1
+
nRow
,
nTab
).
Format
(
SCA_VALID_COL
|
SCA_VALID_ROW
)
+
"-"
+
ScAddress
(
5
,
1
+
nRow
,
nTab
).
Format
(
SCA_VALID_COL
|
SCA_VALID_ROW
)
+
")<=3e-10"
",0,1)"
);
}
virtual
OUString
getSummaryFormula
(
ScDocument
*
pDoc
,
int
nTab
)
const
SAL_OVERRIDE
{
return
"=SUM("
+
ScRange
(
ScAddress
(
6
,
1
,
nTab
),
ScAddress
(
6
,
1
+
mnRows
-
1
,
nTab
)).
Format
(
SCA_VALID
|
SCA_TAB_3D
|
SCA_VALID_COL
|
SCA_VALID_ROW
|
SCA_VALID_TAB
,
pDoc
)
+
")"
;
}
};
struct
Reduction
:
Op
{
int
mnNum
;
...
...
@@ -682,6 +744,8 @@ IMPL_LINK( ScCalcOptionsDialog, TestClickHdl, PushButton*, )
xTestDocument
->
addTest
(
Round
());
xTestDocument
->
addTest
(
Normdist
());
xTestDocument
->
addTest
(
Reduction
(
"Sum"
,
"SUM"
,
100
,
0
,
-
1000
,
1000
,
3e-10
,
[]
(
double
nAccum
,
double
nArg
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment