35,362
questions
-1
votes
0
answers
104
views
Why abs() from stdlib.h appears to be a little slower than just if (a < 0) { a*= -1 }? [closed]
I was developping this function to transform all negative values from a matrix vector<vector<Type>> to positive values:
Version 1:
template <typename T> void abs_matrin(std::vector&...
1
vote
1
answer
73
views
Why are these functions performing so differently?
I made two functions for adding vectors together so that I can add add together sine waves, one of them adds with the + operator and the other uses a lambda function to add them, which makes it easier ...
-3
votes
1
answer
66
views
Parsing numerical data in the form of a stringstream with safeguards? [closed]
i'm currently trying to implement a function in order to parse numerical data coming from an Arduino circuit board (floats coming from potentiometers connected to my PC via a USB connection) but for ...
0
votes
0
answers
9
views
difference for large vector in R
I'm trying to figure out how to calculate the difference between any two numbers in an array containing more than 20000 numbers. I used dist() and got a matrix, but the matrix is too big and in too ...
0
votes
1
answer
28
views
Elastic KNN search num candidates. How are the candidates selected?
I'm trying to understand the "num_candidates" parameter when using KNN search in elastic search.
What I undertand reading some posts/documentation I will list at the end is that ES select &...
-3
votes
0
answers
41
views
Cereal can deserialize json arrays directly? [closed]
I'm using the Cereal library for JSON deserialization, and I've encountered an issue when trying to deserialize a simple JSON array.
If the input is a JSON object with a key-value pair where the value ...
0
votes
0
answers
22
views
Milvus database is not able to load collection
I am running milvusdb in docker, and it has 18K+ records in that database. VM's storage was full, I stopped docker and did system prune to remove unused resources. I remove temp log files.
Docker ...
0
votes
0
answers
8
views
vector fonts OCR Traineddata
what are the best OCR models for recognizing vector fonts, specifically styles like ISOCP.shx? I’ve trained a Tesseract OCR model, but it isn’t very effective with this type of font.
The text is in an ...
0
votes
0
answers
14
views
Raycasters drifting off to far NDC
At the moment I am working with Cesium and OpenBIM Library to set up a viewer that can combine GIS and BIM information.
For this approach, I need to control my BIM viewer by synchronising it with my ...
3
votes
1
answer
72
views
How to understand this AVX addition of two _m256i variables?
here is the code:
#include <immintrin.h>
#include <stdio.h>
#include <memory>
#include <iostream>
__m256i foo();
__m256i foo2();
int main() {
__m256i vec1 = foo();
...
1
vote
1
answer
57
views
Why can't I correctly generate coronal and sagittal sections from a vector of 256 CT images using my C++ code?
Loading 256 CT cross-sectional slices of 512x512, and placing them in a vector<cv::Mat>(256). Now I want to get coronal sections and sagittal sections. I did this:
// Get coronal section slice
...
0
votes
0
answers
10
views
Extruding geometry between two points - ThreeJS
I have been looking for hours on how to do this but I can't seem to figure this one out.
What I want to do is just to extrude a shape between two Vector3 points in ThreeJS. I tried this code below, ...
-7
votes
0
answers
70
views
Copy Assignment Operator with Dynamically Allocated Vector [closed]
When trying to create a deep copy of a dynamically allocated vector, it only copies the first element in the vector, none of the others. What am I missing here?
Vector& Vector::operator=(const ...
1
vote
1
answer
91
views
Find two tangent points for given circle and two points inside the circle , Lua
I have two Points A and B (given with coordinates ax, ay and bx, by).
This two points are inside of given Circle C (given with coordinates cx, cy and radius cr).
How to find points T1 and T2?
Points ...
2
votes
1
answer
102
views
Efficient method to initialize a really large C++ vector with the same values
I was doing this leetcode problem and I had to initialize a very large 2D DP array of size 2^14 x 14 with all entries set to -1 to solve the problem. However I noticed a big performance difference ...