Category "c++"

Is there any method to decrease tensorflow lite invoke time in c++?

System information windows 10, x64 TensorFlow version: 2.7.0 Python version: 3.9.5 Bazel version : 3.7.2 5.GCC/Compiler version : 11.2.0 I run a custom CNN tfli

OpenCV output monochrome TIFF group 4 compression

Is there a way to output monochrome TIFF files in OpenCV with group 4 compression? This is the command to do it with imagemagick/graphicsmagick 'gm convert '.$f

Why executing std::setlocale(LC_ALL, "C") at startup?

Cppreference.com says: During program startup, the equivalent of std::setlocale(LC_ALL, "C"); is executed before any user code is run. Calling std::setlocale(

Questions regarding Red-Black Tree Deletion (z has 2 children) (pre-fixDelete)

Code Source - https://github.com/Bibeknam/algorithmtutorprograms/blob/master/data-structures/red-black-trees/RedBlackTree.cpp y = z; int y_original_col

-lglut32 cannot be found

I run my project which uses: #include <C:\Users\R\Desktop\LABO3\zad3\Debug\glut.h> but then when I build it I get this error: --------------------Conf

Expression does not evaluate to a constant

I've just started to learn C++ and I don't understand this error: std::string AFunction(const std::string& str) { size_t s = str.length(); char inP

How can I divide the Eigen::matrix by Eigen::vector?

following is my code. Eigen::Matrix3d first_rotation = firstPoint.q.matrix(); Eigen::Vector3d first_trans= firstPoint.t; for(auto &iter:in_point

BIts Per Sample / Pixel libtiff vs WIC

TIFF *TiffImage; uint16 photo, bps, spp, fillorder; uint32 width,height; unsigned long stripSize; unsigned long imageOffset, result; int stripMax, stripCount; u

Is bitwise complement of (n-1) equals to (-n)

The following code prints the two odd occuring numbers in an array: #include <iostream> using namespace std; int main(){ int n; cin>>n; int

Linear Probing - Collision Troubleshooting when Inserting Element

I'm trying to create a Linear Probing program. So far, I'm stuck trying to create an insertElement function. The idea is that as key values are being inserted i

Printing a matrix in spiral order but getting an additional element

#include<bits/stdc++.h> using namespace std; // Printing a matrix in spiral Order int main() { int n, m; cin>>n>>m; int arr[n][

Passing an array in struct initialization

I would like to create a struct which contains both an int and an array of int. So I define it like struct my_struct { int N ; int arr[30] ; int arr[30][30] ; }

emplace and try_emplace with copy constructor

I have an issue with emplace and try_emplace as they always use the copy constructors when moving an object in. #include <iostream> #include <unordered

SDL2 make pixel array into texture

I trying to render a special image which is just a bunch of pixels with no format. It is a sort of a raw image with 42x 42 pixels. The images are palettes so I

Add a button with functionality in c++ using Visual Studio

I am a newbie to c++ and the IDE I am using is Visual Studio '22. I have written a code to detect a face (eyes and mouth too) and save the roi to a folder on th

Defining an atomic<> as a static variable inside a function

C++11 mandates that static variables inside a function are atomically initialized for the first run of the function. The only way to do that efficiently is doub

c++ build error, redefinition of static variable, undefined element

I writing application using c++ and Qt. I have a problem with building application. I get many error but everything refers to static variable and undefined func

Recomended formating for temporarily inverting data at pointer and then passing pointer to temporarily inverted data

Long story short, I have a pointer to a value that is stored inverted, so when we are calculating a hash to verify data integrety, we need to invert the data th

Sorting vector of blocks C++ SFML

I just wanted to make a little program to sort blocks using selection sort, but it doesn't sort itself. Blocks just keep switching places in some pattern, until

Tiff Windows Imaging Component c++

I am trying to replace libtiff into WIC (since libtiff is not able to pass Black Duck Analysis tool anymore) I have used their example https://docs.microsoft.co