vector Questions
4
Solved
I am working to implement a code which was written in MATLAB into C++.
In MATLAB you can slice an Array with another array, like A(B), which results in a new array of the elements of A at the index...
3
Solved
How to properly resize a vector of unique_ptr vectors in one line without gcc giving a compilation error regarding a deleted function?
vector<vector<unique_ptr<A> >> a;
a.resize(...
Manipular asked 27/11, 2015 at 8:27
4
Solved
I'm writing a ray tracer in java and I'm trying to implement refraction, but I'm getting confused by the information I'm finding on the subject. If I have a 3D vector for the incoming ray of light,...
Broddy asked 20/4, 2015 at 21:15
5
Solved
I simply wanna erase the specified element in the range-based loop:
vector<int> vec = { 3, 4, 5, 6, 7, 8 };
for (auto & i:vec)
{
if (i>5)
vec.erase(&i);
}
what's wrong?
1
Is there a way to extract the launcher icon of an apk file, even if it is an adaptive icon (vector drawable)?
I couldn't find a single batch or python script to achieve this.
There are many script...
6
Solved
If I have the following vector {10 10 10 20 20 20 30 30}
and I want a function to return the position of the integer that = X or directly the smaller element after X , like for example if I am sear...
Titos asked 15/11, 2012 at 14:11
2
Solved
I am implementing a small demo application which encrypts using AES CTR with OpenSSL is it possible to test the algorithm using different modes of operation test vectors for example testing the ECB...
Footy asked 6/7, 2010 at 16:57
3
Solved
How do I generate a vector of 100 64-bit integer values in the range from 1 to 20, allowing duplicates?
6
Solved
how do you test whether a vector contains repetitive elements in R?
3
Solved
I have a class member that looks like this
class Controller {
protected:
// other stuff
std::vector<Task<event_t, stackDepth>> taskHandlers;
//some more stuf
}
The Task class is ...
Fluviatile asked 6/7, 2020 at 7:49
4
Solved
Does it works correctly (does nothing) when I use
vector<T> v;
v.erase(v.end());
I want to use something like
v.erase(std::find(...));
Should I if is it v.end() or not?
There is no info ...
Paley asked 6/3, 2012 at 19:1
5
How to check if a template argument is a std::vector<T>::iterator?
For void type, we have std::is_void. Is there something like that for std::vector<T>::iterator?
23
7
Solved
7
In other words: how to check that all elements of one vector are present in another one, whereby the same element cannot be matched more than once. The question is very simple and yet, I could not ...
3
Solved
I'm looking for a method that consumes a Vec and returns one element, without the overhead of restoring Vec's invariants the way remove and swap_remove do:
fn take<T>(vec: Vec<T>, inde...
Functional asked 21/8, 2017 at 19:2
4
Solved
I have this:
vector<Object*> myVec;
and adding my objects to it like this:
Object *obj1 = new Object;
myVec.push_back(obj1);
Let's assume that I have 100 objects in this way and pointer...
9
Solved
I have a problem that I would like to merge a large number of images using ImageMagick's convert.exe, but under Windows I have a 8192 byte long command line limit.
My solution to this is to split...
Ummersen asked 28/7, 2011 at 14:57
2
Solved
In my code I have a std::unordered_set and I need to move the data into a std::vector. I'm using the std::unordered_set while getting the data to ensure only unique values are stored prior to conve...
14
Solved
I would like to copy the contents of a vector to one long string with a custom delimiter. So far, I've tried:
// .h
string getLabeledPointsString(const string delimiter=",");
// .cpp
string Gestur...
5
Solved
As many of you know, there are quite a few websites that sell royalty free graphics. Some sites sell vector graphics (svg) or give you the option to download them as such.
I don't have a graphics...
Estancia asked 19/5, 2011 at 20:11
3
Solved
I have a matrix:
t = torch.rand(2,3)
print(t)
>>>tensor([[0.5164, 0.3651, 0.0882],
[0.4488, 0.9824, 0.4067]])
I'm following this introduction to norms and want to try it in PyTorch.
It s...
3
Solved
I read an answer here showing how to read an entire stream into a std::string with the following one (two) liner:
std::istreambuf_iterator<char> eos;
std::string s(std::istreambuf_iterator&...
3
Solved
I've this sample program of a step that I want to implement on my application. I want to push_back the int elements on the string separately, into a vector. How can I?
#include <iostream>
#...
Dormeuse asked 18/1, 2009 at 17:11
6
Solved
I have a vector that stores pointers to many objects instantiated dynamically, and I'm trying to iterate through the vector and remove certain elements (remove from vector and destroy object), but ...
Runyan asked 13/6, 2009 at 19:27
1 Next >
© 2022 - 2024 — McMap. All rights reserved.