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

Convert vectors, arrays, matrices to Eigen #24

Open
zur-quin opened this issue May 24, 2023 · 0 comments
Open

Convert vectors, arrays, matrices to Eigen #24

zur-quin opened this issue May 24, 2023 · 0 comments

Comments

@zur-quin
Copy link
Collaborator

  • For all mathematical vectors, arrays, matrices, and other multidimensional data we need to switch to the corresponding Eigen::VectorXd, Eigen::MatrixXd, Eigen::Vector3d, or similar object (depending on situation).
  • This applies to all multidimensional data that mathematical operations need to be performed on, and does not apply to lists of things. For now, continue using std::vector<> as a way to manage a dynamic sized list of objects. For example, the std::vector<chrono::ChBody> vector initialized in main should continue using an std::vector<>. Similarly, the velocity history vector which keeps track of the 6-dimensional velocity of the body at timestep t should continue using std::vector<Eigen::VectorXd> (where the size of X in the Eigen type vector is 6 and the std::vector index keeps track of the timestep t).
  • Note, Project Chrono has typedefs for many of the Eigen types. For consistency in this project use the bare Eigen type names instead of the typedefs included from Project Chrono when possible. For example, Eigen::MatrixXd should be used in place of chrono::ChMatrix (even though they are the same in the end).
  • Primarily, the reason for this change is efficiency. Eigen has many built in functions for mathematical operations on vectors and matrices that are incredibly efficient.
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

No branches or pull requests

1 participant