Skip to content

Commit 7552952

Browse files
committedSep 21, 2024·
zap TS::inte which is identical to cumusumover
1 parent 60de047 commit 7552952

File tree

4 files changed

+5
-39
lines changed

4 files changed

+5
-39
lines changed
 

‎Changes

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- removed TS::inte which is identical to cumusumover
2+
13
0.84 2024-05-27
24
- effect_code exception if only one unique value
35
- fix for Distr so M_PI found - thanks @shawnlaffan

‎Kmeans/kmeans.pd

+2-5
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,14 @@ Takes data pdl dim [obs x var] and centroid pdl dim [cluster x var] and returns
204204

205205
=for usage
206206

207-
perldl> $centroid = ones 2, 3
208-
perldl> $centroid(0,) .= 0
209-
perldl> p $centroid
207+
perldl> p $centroid = xvals 2, 3
210208
[
211209
[0 1]
212210
[0 1]
213211
[0 1]
214212
]
215213

216-
perldl> $b = qsort( random 4, 3 )
217-
perldl> p $b
214+
perldl> p $b = qsort( random 4, 3 )
218215
[
219216
[0.022774068 0.032513883 0.13890034 0.30942479]
220217
[ 0.16943853 0.50262636 0.56251531 0.7152271]

‎TS/ts.pd

+1-33
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,8 @@ pp_def('diff',
163163
Inplace => 1,
164164
GenericTypes => [U,L,Q,F,D],
165165
Code => '
166-
167166
long tr;
168-
169167
/* do it in reverse so inplace works */
170-
171168
for (tr = $SIZE(t) - 1; tr >= 0; tr --) {
172169
if (tr) {
173170
$dx(t=>tr) = $x(t=>tr) - $x(t=>tr-1);
@@ -176,40 +173,11 @@ for (tr = $SIZE(t) - 1; tr >= 0; tr --) {
176173
$dx(t=>tr) = $x(t=>tr);
177174
}
178175
}
179-
180-
',
181-
Doc => '
182-
=for ref
183-
184-
Differencing. DX(t) = X(t) - X(t-1), DX(0) = X(0). Can be done inplace.
185-
186-
=cut
187-
188176
',
189-
);
190-
191-
pp_def('inte',
192-
Pars => 'x(n); [o]ix(n)',
193-
Inplace => 1,
194-
GenericTypes => [L,Q,F,D],
195-
Code => '
196-
197-
$GENERIC(x) tmp;
198-
tmp = 0;
199-
200-
loop(n) %{
201-
tmp += $x();
202-
$ix() = tmp;
203-
%}
204-
205-
',
206177
Doc => '
207178
=for ref
208179

209-
Integration. Opposite of differencing. IX(t) = X(t) + X(t-1), IX(0) = X(0). Can be done inplace.
210-
211-
=cut
212-
180+
Differencing. DX(t) = X(t) - X(t-1), DX(0) = X(0). Can be done inplace.
213181
',
214182
);
215183

‎t/stats_ts.t

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ sub tapprox {
5454
{
5555
my $a = sequence 5;
5656
is( tapprox( sum( $a->diff - pdl(0, 1, 1, 1, 1) ), 0 ), 1, "difference data on $a - DX(t) = X(t) - X(t-1)");
57-
is( tapprox( sum( $a->diff->inte - $a ), 0 ), 1, "add data on $a - IX(t) = X(t) + X(t-1)");
5857
}
5958

6059
{

0 commit comments

Comments
 (0)
Please sign in to comment.