[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63538] nchoosek random errors for some inputs
From: |
Hans |
Subject: |
[Octave-bug-tracker] [bug #63538] nchoosek random errors for some inputs |
Date: |
Sat, 17 Dec 2022 05:41:51 -0500 (EST) |
Follow-up Comment #1, bug #63538 (project octave):
in version 7.3.0 / nchoosek.m
an additional command after line 166 is a possible solution:
162 elseif (k > n)
163 C = v(zeros (0, k)); # return 0xk object for Matlab compatibility
164 elseif (k == 2)
165 ## Can do it without transpose.
166 x = repelem (v(1:n-1), [n-1:-1:1]).';
ADD x = x(:);
167 y = cat (1, cellslices (v(:), 2:n, n*ones (1, n-1)){:});
168 C = [x, y];
169 elseif (k < n)
170 v = v(:).';
171 C = v(k:n);
172 l = 1:n-k+1;
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63538>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63538] nchoosek random errors for some inputs, anonymous, 2022/12/16
- [Octave-bug-tracker] [bug #63538] nchoosek random errors for some inputs,
Hans <=
- [Octave-bug-tracker] [bug #63538] nchoosek random errors for some inputs, anonymous, 2022/12/17
- [Octave-bug-tracker] [bug #63538] nchoosek random errors for some inputs, Steve, 2022/12/17
- [Octave-bug-tracker] [bug #63538] nchoosek random errors for some inputs, Arun Giridhar, 2022/12/17
- [Octave-bug-tracker] [bug #63538] nchoosek random errors for some inputs, Arun Giridhar, 2022/12/17
- [Octave-bug-tracker] [bug #63538] nchoosek random errors for some inputs, Nicholas Jankowski, 2022/12/17
- [Octave-bug-tracker] [bug #63538] nchoosek random errors for some inputs, Rik, 2022/12/19