Skip to content

Commit

Permalink
pass in right type to [o] Par - PDLPorters/pdl#511
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Dec 29, 2024
1 parent 1c5025c commit 5453696
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Cluster.pd
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,14 @@ pp_def
Doc => ('K-Means clustering algorithm. The "ctrMethodFlag" determines how
clusters centroids are to be computed; see getclustercentroids() for details.
Because the C library code reads from the C<clusterids> if and only if
C<npass> is 0, before writing to it, it would be inconvenient to
set it to C<[io]>. However for efficiency reasons, as of 2.096, PDL
will not convert it (force a read-back on the conversion) for you
if you pass in the wrongly-typed data. This means that you should
be careful to pass in C<long> data of the right size if you set C<npass>
to 0.
See also: kmedoids().
'),
);
Expand Down
2 changes: 1 addition & 1 deletion t/030_kcluster.t
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ PDL::Cluster::kcluster(
$mask2,
$weight2,
0,
($clusters=$initialid->copy),
($clusters=$initialid->long),
($error=null),
($nfound=null),
$params{dist},
Expand Down

0 comments on commit 5453696

Please sign in to comment.