How to use eigen library to compute lower triangular of input matrix without changing columns order?
for example for matrix:
A=[1 2 3;4 5 6 ;7 8 9]
I want the result to be:
1 0 0
4 0 0
7 0 0
How to use eigen library to compute lower triangular of input matrix without changing columns order?
for example for matrix:
A=[1 2 3;4 5 6 ;7 8 9]
I want the result to be:
1 0 0
4 0 0
7 0 0
Your text and your example don't match. I'll go through the three possible ways I understood your question. First, we'll set up the matrix:
If you wanted the actual lower triangular matrix, you would use:
or similar. The result is:
Note the 5,8,9 which are missing from your example. If you just wanted the left-most column, you would use:
which gives
If (as the second part of your example shows) you want
mat * [1, 0, 0]
then you could either do the matrix multiplication (not recommended) or just construct the result:which gives the same result as your example: