Assigning a row of a matrix to a vector


AkamaiOkole
09-13-2004, 01:46 AM
Hi!

Say I have a 10x10 Mat_DP named M and a Vec_DP of dimension 10 named V.

I want to assign the 5th row of the matrix to the vector V, something like:

V = M[4]

but the above code does not work. Is there a way to do this without write a loop to copy the data element by element?

Sorry for such elementary questions.

AO

P.S. I don't know if this matters but I am using the TNT classes as my vector and matrix classes.

Kevin Dolan
09-16-2004, 06:52 AM
It does matter. Your question is essentially one about the TNT vector and matrix classes, and not about NR software. I would check the documentation for those classes. They probably have some mechanism for doing what you want.


Kevin Dolan