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
1f3eed97
Kaydet (Commit)
1f3eed97
authored
Ock 10, 2014
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert custom list implementation ScaDoubleList to std::vector
Change-Id: I98865a54f675ebdb7724327305f9f9a5eeccfeb4
üst
20c4de49
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
40 deletions
+24
-40
analysis.cxx
scaddins/source/analysis/analysis.cxx
+9
-17
analysishelper.cxx
scaddins/source/analysis/analysishelper.cxx
+0
-7
analysishelper.hxx
scaddins/source/analysis/analysishelper.hxx
+9
-10
financial.cxx
scaddins/source/analysis/financial.cxx
+6
-6
No files found.
scaddins/source/analysis/analysis.cxx
Dosyayı görüntüle @
1f3eed97
...
@@ -683,9 +683,10 @@ AnalysisAddIn::getMultinomial( const uno::Reference< beans::XPropertySet >& xOpt
...
@@ -683,9 +683,10 @@ AnalysisAddIn::getMultinomial( const uno::Reference< beans::XPropertySet >& xOpt
double
nZ
=
0
;
double
nZ
=
0
;
double
fRet
=
1.0
;
double
fRet
=
1.0
;
for
(
const
double
*
p
=
aValList
.
First
();
p
;
p
=
aValList
.
Next
()
)
for
(
sal_uInt32
i
=
0
;
i
<
aValList
.
Count
();
++
i
)
{
{
double
n
=
(
*
p
>=
0.0
)
?
rtl
::
math
::
approxFloor
(
*
p
)
:
rtl
::
math
::
approxCeil
(
*
p
);
const
double
d
=
aValList
.
Get
(
i
);
double
n
=
(
d
>=
0.0
)
?
rtl
::
math
::
approxFloor
(
d
)
:
rtl
::
math
::
approxCeil
(
d
);
if
(
n
<
0.0
)
if
(
n
<
0.0
)
throw
lang
::
IllegalArgumentException
();
throw
lang
::
IllegalArgumentException
();
...
@@ -787,15 +788,10 @@ double SAL_CALL AnalysisAddIn::getGcd( const uno::Reference< beans::XPropertySet
...
@@ -787,15 +788,10 @@ double SAL_CALL AnalysisAddIn::getGcd( const uno::Reference< beans::XPropertySet
if
(
aValList
.
Count
()
==
0
)
if
(
aValList
.
Count
()
==
0
)
return
0.0
;
return
0.0
;
const
double
*
p
=
aValList
.
First
();
double
f
=
aValList
.
Get
(
0
);
double
f
=
*
p
;
for
(
sal_uInt32
i
=
1
;
i
<
aValList
.
Count
();
++
i
)
p
=
aValList
.
Next
();
while
(
p
)
{
{
f
=
GetGcd
(
*
p
,
f
);
f
=
GetGcd
(
aValList
.
Get
(
i
),
f
);
p
=
aValList
.
Next
();
}
}
RETURN_FINITE
(
f
);
RETURN_FINITE
(
f
);
...
@@ -812,22 +808,18 @@ double SAL_CALL AnalysisAddIn::getLcm( const uno::Reference< beans::XPropertySet
...
@@ -812,22 +808,18 @@ double SAL_CALL AnalysisAddIn::getLcm( const uno::Reference< beans::XPropertySet
if
(
aValList
.
Count
()
==
0
)
if
(
aValList
.
Count
()
==
0
)
return
0.0
;
return
0.0
;
const
double
*
p
=
aValList
.
First
();
double
f
=
aValList
.
Get
(
0
);
double
f
=
*
p
;
if
(
f
==
0.0
)
if
(
f
==
0.0
)
return
f
;
return
f
;
p
=
aValList
.
Next
();
for
(
sal_uInt32
i
=
1
;
i
<
aValList
.
Count
();
++
i
)
while
(
p
)
{
{
double
fTmp
=
*
p
;
double
fTmp
=
aValList
.
Get
(
i
)
;
if
(
f
==
0.0
)
if
(
f
==
0.0
)
return
f
;
return
f
;
else
else
f
=
fTmp
*
f
/
GetGcd
(
fTmp
,
f
);
f
=
fTmp
*
f
/
GetGcd
(
fTmp
,
f
);
p
=
aValList
.
Next
();
}
}
RETURN_FINITE
(
f
);
RETURN_FINITE
(
f
);
...
...
scaddins/source/analysis/analysishelper.cxx
Dosyayı görüntüle @
1f3eed97
...
@@ -1660,13 +1660,6 @@ void SortedIndividualInt32List::InsertHolidayList(
...
@@ -1660,13 +1660,6 @@ void SortedIndividualInt32List::InsertHolidayList(
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
ScaDoubleList
::~
ScaDoubleList
()
{
for
(
double
*
pDbl
=
const_cast
<
double
*
>
(
First
()
);
pDbl
;
pDbl
=
const_cast
<
double
*
>
(
Next
()
)
)
delete
pDbl
;
}
void
ScaDoubleList
::
Append
(
void
ScaDoubleList
::
Append
(
const
uno
::
Sequence
<
uno
::
Sequence
<
double
>
>&
rValueSeq
)
throw
(
uno
::
RuntimeException
,
lang
::
IllegalArgumentException
)
const
uno
::
Sequence
<
uno
::
Sequence
<
double
>
>&
rValueSeq
)
throw
(
uno
::
RuntimeException
,
lang
::
IllegalArgumentException
)
{
{
...
...
scaddins/source/analysis/analysishelper.hxx
Dosyayı görüntüle @
1f3eed97
...
@@ -331,12 +331,13 @@ public:
...
@@ -331,12 +331,13 @@ public:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
class
ScaDoubleList
:
protected
MyList
class
ScaDoubleList
{
{
private
:
std
::
vector
<
double
>
maVector
;
protected
:
protected
:
inline
void
ListAppend
(
double
fValue
)
{
MyList
::
Append
(
new
double
(
fValue
)
);
}
inline
void
ListAppend
(
double
fValue
)
{
maVector
.
push_back
(
fValue
);
}
using
MyList
::
Append
;
inline
void
Append
(
double
fValue
)
throw
(
css
::
uno
::
RuntimeException
,
css
::
lang
::
IllegalArgumentException
)
inline
void
Append
(
double
fValue
)
throw
(
css
::
uno
::
RuntimeException
,
css
::
lang
::
IllegalArgumentException
)
{
if
(
CheckInsert
(
fValue
)
)
ListAppend
(
fValue
);
}
{
if
(
CheckInsert
(
fValue
)
)
ListAppend
(
fValue
);
}
...
@@ -362,14 +363,12 @@ protected:
...
@@ -362,14 +363,12 @@ protected:
sal_Bool
bIgnoreEmpty
)
throw
(
css
::
uno
::
RuntimeException
,
css
::
lang
::
IllegalArgumentException
);
sal_Bool
bIgnoreEmpty
)
throw
(
css
::
uno
::
RuntimeException
,
css
::
lang
::
IllegalArgumentException
);
public
:
public
:
virtual
~
ScaDoubleList
();
virtual
~
ScaDoubleList
()
{}
using
MyList
::
Count
;
inline
const
double
*
Get
(
sal_uInt32
nIndex
)
const
{
return
static_cast
<
const
double
*
>
(
MyList
::
GetObject
(
nIndex
)
);
}
inline
const
double
*
First
()
{
return
static_cast
<
const
double
*
>
(
MyList
::
First
()
);
}
inline
sal_uInt32
Count
()
const
inline
const
double
*
Next
()
{
return
static_cast
<
const
double
*
>
(
MyList
::
Next
()
);
}
{
return
maVector
.
size
();
}
inline
double
Get
(
sal_uInt32
n
)
const
{
return
maVector
[
n
];
}
void
Append
(
const
css
::
uno
::
Sequence
<
css
::
uno
::
Sequence
<
double
>
>&
rValueArr
)
void
Append
(
const
css
::
uno
::
Sequence
<
css
::
uno
::
Sequence
<
double
>
>&
rValueArr
)
throw
(
css
::
uno
::
RuntimeException
,
css
::
lang
::
IllegalArgumentException
);
throw
(
css
::
uno
::
RuntimeException
,
css
::
lang
::
IllegalArgumentException
);
...
...
scaddins/source/analysis/financial.cxx
Dosyayı görüntüle @
1f3eed97
...
@@ -461,8 +461,8 @@ double SAL_CALL AnalysisAddIn::getOddlyield( const css::uno::Reference< css::bea
...
@@ -461,8 +461,8 @@ double SAL_CALL AnalysisAddIn::getOddlyield( const css::uno::Reference< css::bea
// ============================================================================
// ============================================================================
// XIRR helper functions
// XIRR helper functions
#define V_(i) (
*
rValues.Get(i))
#define V_(i) (rValues.Get(i))
#define D_(i) (
*
rDates.Get(i))
#define D_(i) (rDates.Get(i))
/** Calculates the resulting amount for the passed interest rate and the given XIRR parameters. */
/** Calculates the resulting amount for the passed interest rate and the given XIRR parameters. */
static
double
lcl_sca_XirrResult
(
const
ScaDoubleList
&
rValues
,
const
ScaDoubleList
&
rDates
,
double
fRate
)
static
double
lcl_sca_XirrResult
(
const
ScaDoubleList
&
rValues
,
const
ScaDoubleList
&
rDates
,
double
fRate
)
...
@@ -579,11 +579,11 @@ double SAL_CALL AnalysisAddIn::getXnpv(
...
@@ -579,11 +579,11 @@ double SAL_CALL AnalysisAddIn::getXnpv(
throw
css
::
lang
::
IllegalArgumentException
();
throw
css
::
lang
::
IllegalArgumentException
();
double
fRet
=
0.0
;
double
fRet
=
0.0
;
double
fNull
=
*
aDateList
.
Get
(
0
);
double
fNull
=
aDateList
.
Get
(
0
);
fRate
++
;
fRate
++
;
for
(
sal_Int32
i
=
0
;
i
<
nNum
;
i
++
)
for
(
sal_Int32
i
=
0
;
i
<
nNum
;
i
++
)
fRet
+=
*
aValList
.
Get
(
i
)
/
(
pow
(
fRate
,
(
*
aDateList
.
Get
(
i
)
-
fNull
)
/
365.0
)
);
fRet
+=
aValList
.
Get
(
i
)
/
(
pow
(
fRate
,
(
aDateList
.
Get
(
i
)
-
fNull
)
/
365.0
)
);
RETURN_FINITE
(
fRet
);
RETURN_FINITE
(
fRet
);
}
}
...
@@ -654,8 +654,8 @@ double SAL_CALL AnalysisAddIn::getFvschedule( double fPrinc, const css::uno::Seq
...
@@ -654,8 +654,8 @@ double SAL_CALL AnalysisAddIn::getFvschedule( double fPrinc, const css::uno::Seq
aSchedList
.
Append
(
rSchedule
);
aSchedList
.
Append
(
rSchedule
);
for
(
const
double
*
p
=
aSchedList
.
First
()
;
p
;
p
=
aSchedList
.
Next
()
)
for
(
sal_uInt32
i
=
0
;
i
<
aSchedList
.
Count
();
++
i
)
fPrinc
*=
1.0
+
*
p
;
fPrinc
*=
1.0
+
aSchedList
.
Get
(
i
)
;
RETURN_FINITE
(
fPrinc
);
RETURN_FINITE
(
fPrinc
);
}
}
...
...
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