472,331 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,331 software developers and data experts.

Mathematical Programming

Hi there, I have a problem in writing a mathematical function using C++
programming. How to write an input that can insert whole equation?
Example is the input are x² + 3y - 4z³ = 0. In maple, it was
x^2+3*y-4*z^3 = 0, but how to write it in C++ ? How about the
declaration?

Jul 23 '05 #1
3 3006
"gelong" <ge******@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi there, I have a problem in writing a mathematical function using C++
programming. How to write an input that can insert whole equation?
Example is the input are x² + 3y - 4z³ = 0. In maple, it was
x^2+3*y-4*z^3 = 0, but how to write it in C++ ? How about the
declaration?

It's somewhat hard (at least for me) to understand what you're asking:

If your question is how to use C++ mathematical operators, then you can use
+,-,*,/ as usual, e.g., x + y, and for ^ you can use the function pow.

But when you write x² + 3y - 4z³ = 0, then you're writing a mathematical
equation - a concept which C++ doesn't directly "understand". The question
is what do you want to do with "x² + 3y - 4z³ = 0"? Do you want plot it?
search numerically for minimum and maximum? solve it symbolically (say for
x)? Based on your answer, you need to find an appropriate library.

So it might help if you clarify further. For example, you might repost and
say "I'm looking for a library that can plot 3D mathematical functions", or
something like that.
Jul 23 '05 #2
Fri, 28 Jan 2005 20:21:38 -0800|gelong :
Hi there, I have a problem in writing a mathematical function using C++
programming. How to write an input that can insert whole equation? Example
is the input are x² + 3y - 4z³ = 0. In maple, it was x^2+3*y-4*z^3 = 0,
but how to write it in C++ ? How about the declaration?

Hi , maybe somthin like that :
-/+ * multi * ( X * n ) ^ pow as elements of array
struct Node {
int multi; // if not exist =1
int n; // ... 1
int pow; // 1
int sign; // 1 or -1
} ;
Node abc[3];
/*
abc[0] : */
multi=1;n=1;pow=3;sign=1; /* will be 1 * 1 * ( X * 1 ) ^ 3 etc.. */
sry4engl

Jul 23 '05 #3
gelong wrote:
Hi there, I have a problem in writing a mathematical function using C++
programming. How to write an input that can insert whole equation?
Example is the input are x² + 3y - 4z³ = 0. In maple, it was
x^2+3*y-4*z^3 = 0, but how to write it in C++ ? How about the
declaration?

You will have to accept the input as text, parse it and make the
necessary calculations and output.


--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: administrata | last post by:
Hi! I'm programming maths programs. And I got some questions about mathematical signs. 1. Inputing suqare like a * a, It's too long when I do...
1
by: Jerry chapman | last post by:
Does C# have the standart mathematical functions such as sin,cos etc.? Or does one have to use pinvoke>
0
by: Juan R. | last post by:
I have updated some basic requirements for a generic mathematical markup language for scientific requirements at the next link. ...
4
by: Xah Lee | last post by:
i've long time been interested in algorithmic mathematical art. That is, mathematical or algorithmic visual art works that are generated by...
2
by: rameshadari | last post by:
Hello Guys, I am new to SQL Server Database programming. My specific question is:- Is it possible to do some mathematical operations on columns...
4
by: Talbot Katz | last post by:
Greetings Pythoners! I hope you'll indulge an ignorant outsider. I work at a financial software firm, and the tool I currently use for my...
3
by: gelong83 | last post by:
Guyz, I really need help on this. I'm trying to make some mathematical programming. We can input any equation and then the compiler will...
13
by: jacek.strzelczyk | last post by:
Hello, I'm looking for a C library that provides the notation of n- dimensional mathematical functions. Or is there any other way to decode that...
2
by: Madmartigan | last post by:
Hi Operating system is WinXP using SharpDevelop version 1.1.0 and build 2124. I'm new to C# and have a problem trying to get a user to enter 3...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.