vector Questions
2
Solved
I need the detailed information about coordinate(withNormalizedOffset:) method.
The information provided in the Apple's docs are very minimal.
This method is all about picking a specific point i...
Dunn asked 12/2, 2019 at 13:41
3
Solved
I have a SVG image on my HTML page and its showing a very thin border around it (visible as a horizontal line on bottom).
I have tried to remove the border.
I have referenced the SVG as an external...
2
I tried:
#include <vector>
int main () {
std::vector<int> v;
int size = v.size;
}
but got the error:
cannot convert 'std::vector<int>::size' from type 'std::vector<int&g...
Derivation asked 2/7, 2015 at 23:53
1
I have the following code:
#include <iostream>
#include <vector>
struct C {
int a;
C() : a(0) {}
C(int a) : a(a) {}
};
std::ostream &operator<<(std::ostream &os, con...
Matriculation asked 14/4, 2023 at 9:35
2
Solved
When I tried to do:
d = {1:2, 3:10, 6:300, 2:1, 4:5}
I get the error:
syntax: { } vector syntax is discontinued
How to initialize a dictionary in Julia?
Bryanbryana asked 7/2, 2017 at 9:50
1
Solved
I often find myself wanting to align the x-axis labels on my plots differently based on their location, with values on the left left-aligned and values on the right, right-aligned. However, element...
6
Solved
I have a numeric matrix with 25 columns and 23 rows, and a vector of length 25. How can I multiply each row of the matrix by the vector without using a for loop?
The result should be a 25x23 matri...
Colcothar asked 4/9, 2010 at 18:51
6
Solved
Is there something similar in Python that I would use for a container that's like a vector and a list?
Any links would be helpful too.
Gothurd asked 9/1, 2011 at 0:58
3
Solved
While iterating over a vector in c++, I noticed there is a begin() function in the standard library, and also a begin() as a member function of the vector class. What, if any, is the difference bet...
2
Solved
I have a user provided String like "Mon,Tue,Wed,Thu,Fri". Please note that this value is user provided input. User may provide something like "Mon,Tue,Wed" and so on.
I want to get this as vector ...
5
I want to remove the elements from a vector the amount of time it occurs in my other vector. Like if I would substracting them. Given that every element in my vector of elements I want to remove is...
3
Solved
I would like to store an array of dense_vector in my document but this does not work as it does for other data types eg.
PUT my_index
{
"mappings": {
"properties": {
"my_vectors": {
"type": "d...
Radome asked 22/4, 2020 at 22:43
3
Solved
So I have a Vec<Vec<T>> where the first vector groups by hours of day and the inner vector by days of week. I would like to transpose somehow the vectors to have it first by days then b...
4
Solved
I have let my_vec = (0..25).collect::<Vec<_>>() and I would like to split my_vec into iterators of groups of 10:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
[10, 11, 12, 13, 14, 15, 16, 17, 18, 19...
5
Solved
In C++11, one can use initializer lists to initialize parameters in functions. What is the purpose of it? Can't the same be done with const vectors? What is the difference of the two programs below...
Crosley asked 3/1, 2015 at 9:30
4
Solved
Is there a sorted container in the STL?
What I mean is following: I have an std::vector<Foo>, where Foo is a custom made class. I also have a comparator of some sort which will compare the ...
Koetke asked 23/3, 2013 at 1:49
2
Solved
I cannot find a consistent method for finding the signed distance between a point and a plane. How can I calculate this given a plane defined as a point and a normal?
struct Plane
{
Vec3 point;
...
5
Solved
Considering template metaprogramming techniques if I have
std::vector<int> v;
v.push_back(42.42f);
this works, mainly because the constructor being used it's not marked explicit, in other ...
2
Solved
imagine you got 2 vectors:
vector<int> ar1, a2;
ar1 = {1,1,2,3,3,4,5,5,6};
ar2 = {1,2,3,4,5,6};
how to do something like this in a good way (using C++) ?
b = ar1 - ar2
// b = {1,3,5}
4
Solved
I would like to have a concept requiring an arbitrary vector as the return type:
template<typename T>
concept HasVector = requires (T t) {
{ T.vec() } -> std::same_as<std::vector<in...
Calcifuge asked 25/7, 2021 at 20:7
3
Solved
I have a vector of data in the form ‘aaa_9999_1’ where the first part is an alpha-location code, the second is the four digit year, and the final is a unique point identifier. E.g., there are multi...
4
Solved
I have looked at find and binary_search, but find doesn't take advantage of the fact that the vector is sorted, and binary_search only returns a true or false, not where it found the value. Is ther...
5
Solved
Could someone tell what is the correct way to work with a vector of arrays?
I declared a vector of arrays (vector<float[4]>) but got error: conversion from 'int' to non-scalar type 'float [...
4
Solved
If I have a container std::vector<T*> items, I can create an IndirectIterator which wraps std::vector<T*>::iterator and allows iterating over T's rather than T*'s.
Can I specialise ite...
Glennisglennon asked 1/9, 2012 at 11:53
5
Solved
This is a simple and complex question at the same time.
This compiles:
int Test;
vector<int> TEST;
TEST.push_back(Test);
cout << TEST.size();
This does not compile:
fstream Test;
v...
Kaiserslautern asked 27/3, 2012 at 12:7
© 2022 - 2024 — McMap. All rights reserved.