So I'm trying to make a derivative calculator that can do simple polynomial calculations in a very specific way. If you read the cout line you'll understand rather quickly.
I get an error at line 33 and 37 saying error: request for member '_cstr' in 'constant', which is of non-class type 'char' and the same line with 'degree' instead of constant.
I have First derivative function implemented in C++. More details [URL] ...
In programming, I'm dealing with a lot of variables. x, y, z & x', y', z' & x'', y'', z'' These are only for one device. The problem is how can I deal with velocities and accelerations the way I did with positions? This is the code
while (1) { /* Perform a synchronous call to copy the most current device state. This synchronous scheduler call ensures that the device state is obtained in a thread-safe manner. */ hdScheduleSynchronous(copyDeviceDataCallback, ¤tData, HD_MIN_SCHEDULER_PRIORITY);
I'm trying also to store x_Velocity in vector. Every time I deal with whether array or vector, the first two points of x position are affected because I'm calling the function for the velocity.
I don't know why this doesn't work. It doesn't return any errors, but it does the polynomial equation wrong. I tried using "^" instead of "pow" and it still does it wrong. I'm getting results like "-897123897" instead of "3". This is the code:
Code: #include <stdio.h> #include <conio.h> #include <math.h> int main() [code]....
I wanna write a class for polynomials, but there are some bugs in my code. I want to identify a polynomial with two arrays of the same length, one that contains the exponents of the nonzero monomials, and the other that contains the coefficients itself.
for example: (shematically) 3x^2 +5x^100 shoud be identified by array1=(2,100) and array2=(3,5)
the size of that polynomial should be Dim=2.
it should be possible to change the size dynamically.
Code:
#ifndef poly #define poly #include<cassert> class poly {
[Code] ....
PROBLEM1 the destructor isnt working: virtual ~poly() {delete [] start;delete [] koef;} //destruktor Error: This declaration has no Storage class or typ specifier. Error: Expected an identifier.
PROBLEM2 the constructor isnt working: poly::poly(int x=0) Error: Expected an identifier Error: Expected a ) Error: Expected a ;.
I want to extract polynomial coefficient out of a string recieved by input, for example if i enter 4x^3+2x^4+3 , the resulting out put be : 2 , 4 , 0 , 0 , 3
I'm try to write a program which define a polynomial using a linked list.
1) I fill every node of the list which list is as long as the value of the max power of the polynomial. 2) I print it out the resulting polynomial. 3) I want to re-scan the poly in search for the polynomials with the same index and sum them each other for having only one element with the same index, for instance, if I enter P(x) = 1 + x + x^2 + 3*x^2 + x^3, I want to obtain: P(x) = 1 + x + (1 + 3)*x^2 + x^3.
I called this function SeekForSameIndex().
But with this example I have 4x^2 + 4x^2 + x^3, losing the firsts members of the expression, I'm behind this problem for days and I do not understand where's the mistake.
Here my code:
#include <stdio.h> #include <stdlib.h> struct SPoly { int coeff; unsigned int index;
Implementing and manipulating a Polynomial ADT using a linked list.
So far I have:
poly_ADT.h Code: typedef struct nodeT{ int coef; int powr; struct nodeT *next; } node;
[Code]...
I need to create a function that creates the polynomial using input first.
poly *poly_create (num,...) ;return a new polynomial with num terms terms are listed in order of lowest ordered-term to highest. i.e., to initialize poly 15x^6 + -9x^4 + 3x^2 call poly_create(3, 3,2, -9,4, 15,6 );
Once I do that I need to implement various functions that can manipulate the polynomial itself but I'm having trouble just with creating the polynomial itself, how to do that using a linked list and nodes?
The program will ask for the user to enter a value for x, then compute the following polynomial: 3x^5 + 2x^4 - 5x^3 - x^2 + 7x - 6.However, when I double check it with my calculator I get a wrong answer for random values of x. To simplify my problem I'm using only integers.
Code:
#include <stdio.h> int main(void) { int x, polynomial; }
What works: Adding two pointers. The output is correctly produced.
The problem in particular occurs in main when p1 and p2 are attempted to be multiplied. The code attempts to release the memory upon multiplication but I receive a run-time error.
The output for the difference of the two polynomial objects is incorrect. It is displaying addresses.
I am starting to learn C++.Designing class CPolynom to work with polynomials. The polynomial coefficients are memorialized in the field of real double precision numbers. Implement the following functions:
-Constructor, which defines the order of the polynomial CPolynom(int order) -method to add the appropriate grade Coef(int exp, duble coef) -method of addition, subtraction, multiplication and division two polynomials -method to add a field coefficient -method for nala