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

[Un]-Bounded Array #7

Open
bassoy opened this issue May 28, 2018 · 4 comments
Open

[Un]-Bounded Array #7

bassoy opened this issue May 28, 2018 · 4 comments
Assignees
Labels
discussion Discussion for future refactoring gsoc Google Summer of Code

Comments

@bassoy
Copy link
Collaborator

bassoy commented May 28, 2018

  • We need a std::vector and std::array conforming storage template classes in order to be able to provide it as a template parameter (define a type requirements for storage containers)
  • Why do we need extra storage template classes like boost::numeric::ublas::unbounded_array and boost::numeric::ublas::bounded_array if std::vector and std::arrayexists?
@bassoy bassoy self-assigned this May 28, 2018
@bassoy bassoy added the discussion Discussion for future refactoring label May 28, 2018
@stefanseefeld
Copy link

The Storage concept is documented in https://www.boost.org/doc/libs/1_67_0/libs/numeric/ublas/doc/storage_concept.html. To cite from https://www.boost.org/doc/libs/1_67_0/libs/numeric/ublas/doc/unbounded_array.html:
"The unbounded array is similar to a std::vector in that in can grow in size beyond any fixed bound. However unbounded_array is aimed at optimal performance. Therefore unbounded_array does not model a Sequence like std::vector does. "

@bassoy
Copy link
Collaborator Author

bassoy commented May 28, 2018

Yes. However, I am not sure of what optimal performance refers to and why unbounded array should not model a sequence container just because the resizing strategy might be different. Also there has been a discussion about this, see CppCoreGuidelines.

@stefanseefeld
Copy link

As far as I understand this is all about std::vector (and other sequences) initializing their elements, which we don't want / need as initialization is done by the tensor class itself.

@bassoy
Copy link
Collaborator Author

bassoy commented May 28, 2018

std::vector and other containers have a default constructor constructing an empty container.
boost::numeric::ublas::tensor has also a default constructor with the same behavior. So boost::numeric::ublas::tensor<float> A; does not allocate memory and does not initialize itself.

@bassoy bassoy added the gsoc Google Summer of Code label Jul 25, 2018
@bassoy bassoy closed this as completed Feb 26, 2019
@bassoy bassoy reopened this Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion for future refactoring gsoc Google Summer of Code
Projects
None yet
Development

No branches or pull requests

2 participants