Skip to content

Initializer for Vec::zeros()#2307

Closed
rohitgirdhar wants to merge 1 commit intoopencv:masterfrom
rohitgirdhar:vec_initializers
Closed

Initializer for Vec::zeros()#2307
rohitgirdhar wants to merge 1 commit intoopencv:masterfrom
rohitgirdhar:vec_initializers

Conversation

@rohitgirdhar
Copy link
Copy Markdown
Contributor

Added zeros() initializer for Vec (Task #3380)
Passed all tests (release/bin/opencv_test_*)
Tested feature by:

main() {
  Vec3f a = Vec3f::zeros();
  cout << a << endl;
}

PS: I'm a noob, and this is my first PR. Feel free to pick nits. And will appreciate any guidance. Thanks!

@kirill-korniakov
Copy link
Copy Markdown

Well, this could be convenient, but it can be implemented with all method. So, I'm not sure if we really need such method. Large API is sometimes hard to maintain. So, I would not take this new method.

@SpecLad, what is your opinion?

@SpecLad
Copy link
Copy Markdown

SpecLad commented Feb 11, 2014

I concur. zeros() is actually longer to write than all(0).

@rohitgirdhar rohitgirdhar deleted the vec_initializers branch February 11, 2014 12:50
@rohitgirdhar
Copy link
Copy Markdown
Contributor Author

Hi @kirill-kornyakov / @SpecLad
The task http://code.opencv.org/issues/3380 also talks about assigning Matx<_tp, n, 1> to Vec<_tp, n> ... is there some way to do that? or can I implement that operator?

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.

3 participants