Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding support for dynamic data types #2

Merged
merged 2 commits into from
Aug 25, 2018

Conversation

randi120
Copy link

@randi120 randi120 commented Jan 7, 2017

@tehrengruber nice script. I needed dynamic size support (#1).
I tested it with basic types:

    Matrix<double, 1, 2> t; t.fill(1);
    Matrix<uint, 2, 2> t2; t2.fill(2);
    MatrixXd t3;  t3.setOnes(3,3);
    Vector3f t4; t4.fill(4);
    Vector3i t5; t5.fill(5);
    VectorXd t6(6); t6.fill(6);

Should be working.
(lines 56-58 should have some check for validity)

@tehrengruber
Copy link
Owner

First of all thanks for sharing this. I'm too busy right now to review this in detail, but one thing I (might) have spotted was that your check whether the given Eigen type is of fixed size or dynamic is not very robust. You might get an expression template that has a different memory layout than that of simple matrices/vectors. In that case we should fall back to the LLDB's default printer. I didn't check this but I assume that since expressions like
auto a = Eigen::VectorXd::Ones(10).dot(Eigen::VectorXd::Ones(10))
are not supported currently (stay tuned for https://github.com/tehrengruber/Defrustrator which will support this) your code will fail and should as such fall back correctly to the default printer.

@tehrengruber tehrengruber merged commit e5d5cb2 into tehrengruber:master Aug 25, 2018
@tehrengruber
Copy link
Owner

Since all ways to determine what type of Eigen object we have (e.g. an expression template) I can come up with are not really maintainable I'll accept your pull request. Thanks for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants