Skip to content

Commit b4cb71b

Browse files
committed
Fixed example [skip ci]
1 parent 025da49 commit b4cb71b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/sparse/example.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
sub sparsevec {
1313
my ($elements, $dim) = @_;
14-
return '{' . join(',', map { $_->{index} . ':' . $_->{value} } @$elements) . '}/' . $dim;
14+
return '{' . join(',', map { ($_->{index} + 1) . ':' . $_->{value} } @$elements) . '}/' . $dim;
1515
}
1616

1717
sub embed {

0 commit comments

Comments
 (0)