This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Correct Way to Construct Mixed Constant/Dynamic Matrix

Tags: None
(comma "," separated)
twood
Registered Member
Posts
17
Karma
0
Hello,
I am using a Matrix<double, 3, dynamic> to store 3-vectors as columns. What is the best way to construct these? Currently I am using:
Code: Select all
Matrix<double, 3, dynamic> matrix(3, N);

because trying:
Code: Select all
Matrix<double, 3, dynamic> matrix(N);

gives an error of "YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX". I could not find an example in the documentation. It seems rather redundant to have to specify the number of rows twice. I also tried using "NoChange", but this gives an error of "FLOATING_POINT_ARGUMENT_PASSED_INTEGER_WAS_EXPECTED".
jitseniesen
Registered Member
Posts
204
Karma
2
Code: Select all
Matrix<double, 3, dynamic> matrix(3, N);
is indeed the correct way. I agree that this is redundant. I assume it was thought that the alternative leads to code that is not as clear.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]