Category "c++"

Intel MKL for matrix multiplication when rows are not memory-contiguous

Our hardware is Intel Xeon Phi so we are encouraged to get the most out of it by replacing hand-written linear algebra ops (e.g. square matrix multiplications)

Problem with variables using a namespace at C++

I am trying to write a relativity big code. The main problem, for awhile, is that there is a problem occurring when I define a dictionary. I have a .hh file nam

convert cv::mat to IplImage

Mat m = Mat(4, 4, CV_8UC3); IplImage * iplImage = cvIplImage(m); error: cannot convert ‘_IplImage’ to ‘IplImage*’ {aka ‘_IplImage

How do I make my setfunction run through my if loop?

I am working on a program and I need to make a class about cars. I need to add setFunctions that only allow a car year manufacture of 1930 -2030 as input, anyth

odom and base_link frames are far - localization

I have an imu and gps only and i want use them for localization. I am using robot_localization ekf node. its setting is similar to this. when I view the tf on r

Best QWidget or item to use to display a variable in a box

I would like to ask which QWidget or which Qt GUI item would be best to use to display a variable that will change during the lifecycle of the program, in a box

Still can't use a function defined in a separate .cpp file

I've been searching through questions on this for hours, and it just isn't working for some reason, so sorry if there's already an answer and I just didn't unde

Execute an embeded exe with createprocess c++

I am trying to execute an exe file which is embedded in a buffer. I try to execute this exe file with createProcess (i think that this is possible) but i get th

Friend classes and header files

I am writing a C++ program where I wish to use a friend class in order to access protected members of another class. Here is the header for the class I wish to

Why do I get a heap buffer overflow simply by declaring a shared_ptr member variable?

Just ran into this very strange bug. I'm getting crashes due to memory errors after adding a new shared_ptr instance variable in an existing containing class.

Returning two AVX/AVX2 __m256d types in C++ function calls via registers

I am new to programming with the AVX/AVX2 instructions and am trying to optimize the speed of my code. Following the older expectation that passing by reference

How to concatenate two strings in C++?

I have a private class variable char name[10] to which I would like to add the .txt extension so that I can open the file present in the directory. How do I g

How to set cmake, in order to add txt files into working directory as resource?

CMakeLists.txt cmake_minimum_required(VERSION 3.8) project(untitled) set(CMAKE_CXX_STANDARD 11) set(SOURCE_FILES main.cpp) add_executable(untitled ${SOURCE_F

C++ generate new EC_KEY using OpenSSL 1.1.1n

I'm very new to this OpenSSL stuff and trying to learn my way through it. I want to generate an ec key but its keep failing to generate. I'm currently using Ope

Opengl GLFW3, Cant update vertices of two object at the same time

So i am trying to make a game where I want to update my player and enemy. enemy and player are squares. I have a square class with VAO, VBO, EBO and vertices wh

Latest VSCode 1.66.2 does not stop on failed assertion in C++ CMake debugging session

My VSCode: Version: 1.66.2 Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977 Date: 2022-04-11T07:49:24.808Z Electron: 17.2.0 Chromium: 98.0.4758.109 Node.js: 16.

Why is there no warning from -Wfloat-equal when comparing containers of doubles?

If I use the compiler option -Wfloat-equal with GCC or Clang, equality comparisons of float/double values cause a warning. However, when comparing containers (l

Implement alphanumeric sparse arrays in interpreter

VS2022 C++ wxWidgets I'm writing an interpreter, and I want to implement sparse arrays with alphanumeric subscripts and data. I've been researching AVL, B-Tree

How to delete a heap allocated std:::array

I have this pointer in a class: std::array<std::array<std::array<Item*, XSize>, YSize>, ZSize>* Items; In the constructor: Items = new std::a

LLVM beginner: instrument, string type and metadata

I am a beginner in LLVM, and I wanna get the true value of a given varibale name and line number by using LLVM pass. I have several problems. correctly get the