Menu

#32 Crash in ElementMapper.cs for Vectors

1.4.1.0
closed
5
2008-04-16
2008-03-14
No

public IValueSet MapValues(IValueSet inputValues)

....

else if (inputValues is IVectorSet)
{
Vector[] outValues = new Vector[_numberOfRows];

...
outValues[i].XComponent += _mappingMatrix[i,n] * ((IVectorSet) inputValues).GetVector(n).XComponent;

....

outValues[i] fails because it is null. Auto initialisation only works in C# for value types, not for reference types.

Presumably this was tested for scalor (value type) and not for vector types.

fix is to add

outValues[i] = new Vector();

Discussion

  • Adrian Harper

    Adrian Harper - 2008-03-14

    Logged In: YES
    user_id=1686294
    Originator: YES

    Revision 483:
    Fix for problem encountered, will need to check for similar mistakes to this one, so keep case open until that has been done.

     
  • Jan Gregersen

    Jan Gregersen - 2008-04-16
    • status: open --> closed
     
  • Jan Gregersen

    Jan Gregersen - 2008-04-16

    Logged In: YES
    user_id=1262901
    Originator: NO

    This has been fixed by Adrian

     

Log in to post a comment.

MongoDB Logo MongoDB