Discover the world's scientific knowledge
With 135+ million publication pages, 20+ million researchers and 1+ million questions, this is where everyone can access science
You can use AND, OR, NOT, "" and () to specify your search.
Dear C++ experts,
I'm a beginner with C++ and I've programmed my first numerical game for training. Here, a random number was chosen between 1-15 and the gamer has three chances to guess the right number. After each attempts, the program tells you that the guess number is greater or smaller than the goal.
Would you please evaluate my code and tell me about the efficiency of my program.
Hi, everyone I’m a beginner to C++ and raspberrypi, Here I’m working on a project to capture the real time images using Raspberrypi CSI camera and to perform simple image processing operation in C++ using CImg library.
That is, to detect the bright spot in an image (such as LED light glow) and if detects the bright spot, output should be given as ‘1’ and if not (when the LED is off ) output should be given as ‘0’.
Note: The image processing has to be done only in the specific portion of an image (i.e focus only on the led section of an image and neglecting remaining portion of an image which is out of interest, such that it saves processing time and improves performance)
But firstly I don’t know how to get pixel intensity values of a gray scale image using CImg library such that we can compare the values obtained in the pixel to the threshold value and problem could be solved ( this is my algorithm for the above operation but any other simpler methods for the above processing ,your suggestions are always welcome )
Could you help me in a C++ code or algorithm to perform the above task.
As i have created a network with nodes & sensors, i need to know how to calculate the energy level of each node? how i need to code in "C language" for calculating the energy of each node which is present in the network?
One of the most challenging aspects of developing the previous version of ForTrilinos was devising a reference-counting scheme to ensure safe type finalization in Fortran and corresponding object destruction in C++. It's interesting to see that the SWIG-generated file forepetra.f90 on the new develop branch contains an Epetra_Object derived type with a type(c_ptr) component. Will that component become associated with the C++ object that the Fortran object shadows? Given that there's no final subroutine on the type, is there a strategy to avoid memory leaks and dangling pointers? How will the C++ code get notified when the Fortran object goes out of scope so that C++ knows its safe to destroy the object? How will the Fortran code get notified if C++ destroys the object?
What will happen with an expression such as
type(Epetra_Object) :: a,b,c
a = f(b) + g(c)
where f and g are functions that have Epetra_Object results containing c_ptr components that presumably are associated with C++ objects that were instantiated at the direction of Fortran inside each function. After the above assignment completes, the Fortran code no longer has a name associated with the two function results so the Fortran program has no way to direct C++ to destroy the corresponding C++ objects.
I am trying to set up a trajectory optimization tool and for that obviously need planetary data (right now I am restricting myself to planets, other bodies might be added later). The idea is that I can draw position and velocity information from this library based on an epoch/ date. I could of course just create a list for all planets with starting times and just propagate the respective values, but this would likely lead to inaccuracies.
Any idea how to accomplish what I need? Thanks in advance and I am using C++. :-)
I am working on a project about algorithms on graphs. I need a C/C++ code for Edmonds's blossom algorithm to compute a matching with maximum total weight in a weighted graph ( it also always be a complete graph in fact). If someone has worked on this topic, please can you provide the C/C++ code or related information?
e.g the M/M/1 has a single Server for service so we calculate area under the curve with the multiplication of numbers in the queue to the difference of event time, but in case of M/M/∞ there is no queue so how we will calculate the area under the curve.