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

Partial support of the sparse matrices in roboptim-core-manifold. #7

Merged
merged 2 commits into from
May 21, 2015

Conversation

fdarricau
Copy link
Contributor

The goal is to make it possible for roboptim-core-manifold users to define and use all the tools of the project in a sparse environment.

The support is still partial because the jacobian on the tangent space can't be filled right now on libmanifolds side. No more assumptions done, the call to Dispatcher::applyDiff will simply fail (throwing an std::string) in Sparse mode. Note that this function is obviously never called when the user do not need to compute the jacobian on the tangent space of the manifold.

}
for (int i = 0; i < jac.rows(); ++i)
{
std::cout << jac.row(i) << std::endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why print to std::cout like this rather than doing the usual std::cout << output->str () << std::endl; at the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in the update

@bchretien
Copy link
Member

Do you explicitly check for the assumption you're making?

"the manifold is " << descWrap.manifold().name() << "\n" <<
"Is the manifold elementary ? : " <<
(descWrap.manifold().isElementary() ? "yes" : "no" ) << "\n" <<
"the manifold dimension is " << descWrap.manifold().representationDim() << "\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note (even though that's not the focus of this PR): for better printing, RobOptim provides some handy indentation support. Also, to be even pickier, whitespace before punctuation is not valid in English.

@fdarricau
Copy link
Contributor Author

Ok about the exception throwing and type checking. I updated the pull request taking considering that.
It could be possible to do the manifold type checking once and storing the value in a separate field of the FunctionOnManifold, but I don't think it is really needed as the error throwing is supposed to be temporary.

iendl << "Is the manifold elementary? " <<
(descWrap.manifold().isElementary() ? "yes" : "no" ) <<
iendl << "the manifold dimension is " << descWrap.manifold().representationDim()
<< decindent << iendl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove the iendl here (last line): the last CR is the responsibility of the function calling the print method (e.g. std::cout << my_object << std::endl). Here you would sometimes add trailing whitespaces for no reason.

@fdarricau fdarricau force-pushed the sparse-support branch 3 times, most recently from a451fe3 to 6d4858d Compare May 19, 2015 04:12
throw std::runtime_error (error->str());
}
{
std::stringstream* error = new std::stringstream;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason for using the heap here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason. Thanks for reporting it. It will be fixed in the next PR.

Warning: Underlying manifolds library does not support Sparse-based
manifolds. The manifold_jacobian function therefore only partially
supports Sparse inputs.
@fdarricau
Copy link
Contributor Author

Merging into master.

fdarricau pushed a commit that referenced this pull request May 21, 2015
Support of the sparse matrices in roboptim-core-manifold.
@fdarricau fdarricau merged commit e0608b7 into master May 21, 2015
@fdarricau fdarricau deleted the sparse-support branch May 21, 2015 11:43
@bchretien
Copy link
Member

👍

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