bugGNU Octave - Bugs: bug #67312, Out of bound error in...

 
 

bug #67312: Out of bound error in __ga_scores__.m

Submitter:  Matt <mdb561>
Submitted:  Sat 12 Jul 2025 08:28:05 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Need Info Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 10.2.0 Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Mon 14 Jul 2025 12:45:12 AM UTC, comment #1: 

We need a small, self-contained, test code that demonstrates the problem.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sat 12 Jul 2025 08:28:05 PM UTC, original submission:  

1) Using the genetic algorithm (GA) package in a vectorized mode (fitness function is vectorized)

2) My problem is using a population size of 200 with 5 input variables. I get an out of bound error originating from line 31 of _ga_scores_, as follows:

error: problem(200,_): out of bound 1 (dimensions are 1x5)
error: called from
    _ga_scores_ at line 31 column 7
    _ga_problem_update_state_at_each_generation_ at line 23 column 5
    _ga_problem_ at line 39 column 3
    ga at line 113 column 6
    ga_vect_nurbs_foil_7pts at line 465 column 4

3) However, when I swap the row/columns at line 31 of the _ga_scores-_ function, the function seems to work and I get a reasonable answer.

##      Scores = (problem.fitnessfcn (Population))(1:nrP, 1);  <<<original version
      Scores = (problem.fitnessfcn (Population))(1,1:nrP);       <<<my altered version

4) FYI, the ga function outputs the population matrix with dimensions of (pop size x number of variables) and the scores vector is output with dimension of (pop size x 1)

5). If I run the problem in a non-vectorized (serial) mode, it runs through with no issues.

Can anyone explain what is going on?  Is there a bug and swapping the dimensions is needed?  Or do I have a matrix somewhere that needs to be transposed?

Matt <mdb561>

 

Attached Files

This item currently has no attached files.

(Note: upload size limit is set to 16MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by nrjank (Updated the item)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by mdb561 (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    History

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-07-14 nrjank StatusNone Need Info

    Back to the top

    Powered by Savane 3.16.
    Corresponding source code