thirdmonkey
08-19-2003, 05:05 PM
I looked at all the messages with "Mat" in them. I did not find an answer to my problem. I hope I don't have to use Kevin Dolan's Matrix classes.
What I am trying to do is to call my function with a matrix, and have it remove a row from the matrix. For example:
Starting with 10 rows...
Mat_DP NDotMatrix(10,3)
then if I want to remove the "6th" row,
NDotMatrix[5][0] = NDotMatrix[9][0];
NDotMatrix[5][1] = NDotMatrix[9][1];
NDotMatrix[5][2] = NDotMatrix[9][2];
NDotMatrix.nrows = 9;
Now I have 9 rows, and the bad row is gone. My order is messed up, but I don't care.
Will this work?
Am I causing a memory leak?
I could not be first guy who wants to shrink the size of his matrix without copying it to a new one.
Thanks in Advance,
TM
What I am trying to do is to call my function with a matrix, and have it remove a row from the matrix. For example:
Starting with 10 rows...
Mat_DP NDotMatrix(10,3)
then if I want to remove the "6th" row,
NDotMatrix[5][0] = NDotMatrix[9][0];
NDotMatrix[5][1] = NDotMatrix[9][1];
NDotMatrix[5][2] = NDotMatrix[9][2];
NDotMatrix.nrows = 9;
Now I have 9 rows, and the bad row is gone. My order is messed up, but I don't care.
Will this work?
Am I causing a memory leak?
I could not be first guy who wants to shrink the size of his matrix without copying it to a new one.
Thanks in Advance,
TM