Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
How the glClearBufferData is implemented internally? Does it uses CPU (sequential clearing) or GPU (parallel clearing)? If I have big buffer (several megabytes), what is the best way (in terms of time complexity) to clear it? Maybe customized rendering pass, that sets to buffer desired value in fragment shader, would be more efficient? If there is no single solution, please, advise me some materials. Help me please ! :)
As with most OpenGL functions, the implementation is provided the freedom to implement it in whatever way it feels is best for the hardware. You aren't permitted to know about those details.
If you need to clear a buffer to a specific value, just call the function and let the implementation do its job.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Develop an algorithm that can be used to determine whether a Stack object S has exactly one element.
I am not a programmer, I choose this course as an elective to see if I would be interested. I don't know where to begin with this question.
You most likely want to check the documentation of C++ on stacks. This took no time to find:
http://www.cplusplus.com/reference/stack/stack/size/
Your function has to return stack.size() == 1. If the question is asking to develop an algorithm based on the size in memory the stack size allocates then it's slightly more involved.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I'm working with different sizes of Z3 bitvecs and I was working on a way to ease the workload. I'm going to get the info from an object before z3 expression was created so it's not actually a vital problem but I wondered why z3 bitvecs doesn't carry runtime size information.
You can surely query the sort of every z3 AST term, and then get the size for bvs; so, yes, they do carry size information along with pretty much everything you need to know.
The relevant calls are:
get_sort
bv_size
The API documentation has myriad other calls for scrutinizing different parts of terms, see here.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I need to use an algorithm for stereo processing images (or frames – as I intend to use it for a real-time application written in C/C++) and I was thinking about: Census transform algorithm and matching cost calculation based on Mutual Information as my best options, but as far as I know, Census transform doesn’t give quite as accurate results as Mutual Information, and Mutual Information is more expensive.
Which one would be more suitable for my case?
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Why are most data compression algorithms created with C++ or Java. Why not use javascript or even ruby? Is it dependent on the file type you are trying to compress such as text,video or even audio files?
If you need to compress data, it is probably because you have a lot of data; as such, the performance of such algorithms is pretty important, and other things being equal, a compiled language typically performs better on the kind of low-level data manipulation such algorithms employ than an interpreted one.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Should a thread-safe mechanism be added when a class is developed and it is known that this class will be used in multi-threaded environment (not always however) or leave it to the user?
As a general rule, it's more flexible to leave it to the user. For example, consider a map-type container. Suppose the application needs to atomically move something from one map to another map. In this case, the user needs to lock both maps before the insert-erase sequence.
Having such a scenario be automatically taken care of somehow by your class would probably be inelegant, because it's naturally something that happens across objects, and because there may be many such scenarios, each slightly different.