Menu

#514 Errors in 'matop'

v1.1.x
fixed
critical (96)
v1.1.1
Bug Fix
2020-03-31
2020-02-08
Erik Hänel
No

Two issues appear, when using the matop command:

matop rand(0,1)*one(5) ## will throw an error
matop diagonalize(matfc({1,2,3},{3,1,2},{2,3,1}))(:,1:3) ## will return a row vector instead of a (3x3) matrix

Analysis:

The first issue is that the contents of the rand() parenthesis is pre-evaluated and returned as a single matrix. This won't work with a two-argument function. Change that to return the arguments separately by evaluating each argument separately.

The second issue is related to a wrong usage of the Indices class method Indices::setRange(). This method won't work with invalid indices.

Implementation:

  • Implementation: The fixes were implemented as proposed by the analysis.
  • Revision: [r686]
  • Implementation test: The erronous operations were executed and the correct results were obtained.

Documentation:

  • [x] ChangesLog updated
  • [x] Code changes commented
  • Documentation articles:
    • [ ] corresponding documentation articles updated
    • [ ] new documentation articles created
    • [x] not needed
  • Language files:
    • [ ] corresponding language files updated
    • [x] not needed

Tests:

This fix was added to the automatic tests. No deviations detected. Bug fix implemented successfully.

Related

Commit: [r686]

Discussion

  • Erik Hänel

    Erik Hänel - 2020-02-08
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,5 @@
     Two issues appear, when using the `matop` command:
    
    
    +    :::octave
         matop rand(0,1)*one(5) ## will throw an error
         matop diagonalize(matfc({1,2,3},{3,1,2},{2,3,1}))(:,1:3) ## will return a row vector instead of a (3x3) matrix
    
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2020-02-08
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,3 +3,25 @@
         :::octave
         matop rand(0,1)*one(5) ## will throw an error
         matop diagonalize(matfc({1,2,3},{3,1,2},{2,3,1}))(:,1:3) ## will return a row vector instead of a (3x3) matrix
    
    +    
    +###Analysis:
    +(*Describe, what's the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you've changed*) 
    +* Revision: [rXXX]
    +* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +
    +###Documentation:
    +* [ ] ChangesLog updated
    +* [ ] Code changes commented
    +* **Documentation articles:**
    +    * [ ] corresponding documentation articles updated
    +    * [ ] new documentation articles created
    +    * [ ] not needed
    +* **Language files:**
    +    * [ ] corresponding language files updated
    +    * [ ] not needed
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2020-02-08
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,7 +5,9 @@
         matop diagonalize(matfc({1,2,3},{3,1,2},{2,3,1}))(:,1:3) ## will return a row vector instead of a (3x3) matrix
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +The first issue is that the contents of the `rand()` parenthesis is pre-evaluated and returned as a single matrix. This won't work with a two-argument function. Change that to return the arguments separately by evaluating each argument separately.
    +
    +The second issue is related to a wrong usage of the `Indices` class method `Indices::setRange()`. This method won't work with invalid indices.
    
     ###Implementation:
    
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2020-02-08
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -10,20 +10,20 @@
     The second issue is related to a wrong usage of the `Indices` class method `Indices::setRange()`. This method won't work with invalid indices.
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*) 
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +* Implementation: The fixes were implemented as proposed by the analysis.
    +* Revision: [r686]
    +* Implementation test: The erronous operations were executed and the correct results were obtained.
    
     ###Documentation:
    -* [ ] ChangesLog updated
    -* [ ] Code changes commented
    +* [x] ChangesLog updated
    +* [x] Code changes commented
    
     * **Documentation articles:**
         * [ ] corresponding documentation articles updated
         * [ ] new documentation articles created
    -    * [ ] not needed
    +    * [x] not needed
     * **Language files:**
         * [ ] corresponding language files updated
    -    * [ ] not needed
    +    * [x] not needed
    
     ###Tests:
     (*Describe, which tests you performed and their outcome*)
    
    • status: implementing --> testing
     

    Related

    Commit: [r686]

  • Erik Hänel

    Erik Hänel - 2020-03-31
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -26,4 +26,4 @@
    
         * [x] not needed
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +This fix was added to the automatic tests. No deviations detected. Bug fix implemented successfully.
    
    • status: testing --> fixed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB