Menu

#369 Cannot apply a vector componentwise to a matrix

v1.1.x
fixed
None
v1.1.0
Bug Fix
2018-11-11
2018-08-21
Erik Hänel
No

Such an expression is not possible, because it will apply the vector only to the first dimension:

matop _targetTable(:,:) /= numTestCases(:,1) / 100;

Analysis:

A similiar fix was already done, however, it was not implemented completely: the fix implemented the expected behavior for scalar values, so one has to extend that to work on vectors as well. This can be done by changing

else if (vIndices[j].vI.size() == 1 && vIndices[j].vJ.size() == 1)

to

else if (vIndices[j].vI.size() >= 1 && vIndices[j].vJ.size() == 1)

and similar.

Implementation:

  • Implementation: The fix was implemented as proposed by the analysis.
  • Revision: [r382]
  • Implementation test: The erroneous equation was tested and is now evaluated as expected

Documentation:

  • ChangesLog: updated
  • Comments: The changed function is commented sufficiently
  • Documentation articles: Not needed - bug fix.
  • Language files: Not needed - bug fix.

Tests:

This fix was tested in the automatic SW tests. Occured deviations were resolved in [r412].

Related

Commit: [r382]
Commit: [r412]

Discussion

  • Erik Hänel

    Erik Hänel - 2018-08-21
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2018-08-22
    • summary: Cannot apply a vector componentwise to a vector --> Cannot apply a vector componentwise to a matrix
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,3 @@
     Such an expression is not possible, because it will apply the vector only to the first dimension:
    
    
    -    matop _targetTable(:,:) /= nNumTestCases / 100;
    +    matop _targetTable(:,:) /= numTestCases(:,1) / 100;
    
     
  • Erik Hänel

    Erik Hänel - 2018-08-22
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,20 @@
     Such an expression is not possible, because it will apply the vector only to the first dimension:
    
         matop _targetTable(:,:) /= numTestCases(:,1) / 100;
    +
    +###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 succesful*)
    +
    +###Documentation:
    +* ChangesLog: (*Have you updated the changes log?*)
    +* Comments: (*Have you written comments in the code, which describe your change?*)
    +* Documentation articles: (*Have you updated the documentation articles?*)
    +* Language files: (*Have you updated the language files?*)
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2018-08-22
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,7 +3,17 @@
         matop _targetTable(:,:) /= numTestCases(:,1) / 100;
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +A similiar fix was already done, however, it was not implemented completely: the fix implemented the expected behavior for scalar values, so one has to extend that to work on vectors as well. This can be done by changing
    +
    
    +    :::C++
    +    else if (vIndices[j].vI.size() == 1 && vIndices[j].vJ.size() == 1)
    +    
    +to
    +
    +    :::C++
    +    else if (vIndices[j].vI.size() >= 1 && vIndices[j].vJ.size() == 1)
    +    
    +and similar.
    
     ###Implementation:
    
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2018-08-22
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -16,15 +16,15 @@
     and similar.
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*) 
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was succesful*)
    +* Implementation: The fix was implemented as proposed by the analysis.
    +* Revision: [r382]
    +* Implementation test: The erroneous equation was tested and is now evaluated as expected
    
     ###Documentation:
    -* ChangesLog: (*Have you updated the changes log?*)
    -* Comments: (*Have you written comments in the code, which describe your change?*)
    -* Documentation articles: (*Have you updated the documentation articles?*)
    -* Language files: (*Have you updated the language files?*)
    +* ChangesLog: updated
    +* Comments: The changed function is commented sufficiently
    +* Documentation articles: Not needed - bug fix.
    +* Language files: Not needed - bug fix.
    
     ###Tests:
     (*Describe, which tests you performed and their outcome*)
    
    • status: implementing --> testing
     

    Related

    Commit: [r382]

  • Erik Hänel

    Erik Hänel - 2018-11-11
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -27,4 +27,4 @@
    
     * Language files: Not needed - bug fix.
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +This fix was tested in the automatic SW tests. Occured deviations were resolved in [r412].
    
    • status: testing --> fixed
     

    Related

    Commit: [r412]

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB