473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Gauss Jordan function????

12
I need help with writing an inverse() function....anyone got a clue?
Feb 16 '07 #1
4 3919
sicarie
4,677 Expert Mod 4TB
I need help with writing an inverse() function....anyone got a clue?
I take it you're writing a function to calculate the mathematical inverse. If you posted the formula for that, we could help you create an algorithm for programming it.
Feb 16 '07 #2
Hi.
If its a mathematical inverse u are tryin, then this would be the code of the function..

int inverse(number_from_main)
{
int inverse; // can also be float
inverse = 1 / number_from_main ;
return inverse;
}
Feb 16 '07 #3
kaygee
12
Hi.
If its a mathematical inverse u are tryin, then this would be the code of the function..

int inverse(number_from_main)
{
int inverse; // can also be float
inverse = 1 / number_from_main ;
return inverse;
}
5 Description of the Algorithm
Algorithm 5.1: Gauss-Jordan Method (B 2 <n×n)
comment: Create an Augmented Matrix
A = [B I]
for i = 1 to n
8>
>>>>>>>>>>>>>>>>>>>>>>>>>>><>>>>>>>>>>>>>>>>>>>>>> >>>>>>:
comment: Find the pivot
pivot aii
if pivot < 10−8
then
8>
>><>>>:
Matrix is singular
det 0
Return
comment: Perform Row Elimination
comment: Normalise the row by dividing each element by the pivot
for j = 1 to 2n
aij = aij/pivot
for k = 1 to n
8>
>>>>>><>>>>>>>:
if k 6= i
then
8>
>><>>>:
m aki
for j = 1 to 2n
akj = akj − m × aij
for i = 1 to n
8>
<>
:
for j = 1 to n
B−1[i, j] = A[i, j + n]
output (B−1)
Feb 19 '07 #4
sicarie
4,677 Expert Mod 4TB
Kaygee-

You were given an algorithm, one that will translate very easily into computer code. Is there a part you are getting stuck on? What do you not understand?
Feb 19 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: James Fortune | last post by:
I'm doing some computations in order to do capacity planning. Instead of using some function from an Access book to do the weekday calculation, I decided to come up with an alternate method since...
1
by: jimfortune | last post by:
From: http://groups-beta.google.com/group/comp.databases.ms-access/msg/769e67e3d0f97a90?hl=en& Errata: 19 solar years = 2939.6018 days should be 19 solar years = 6939.6018 days Easter...
18
by: jimfortune | last post by:
I have an A97 module called modWorkdayFunctions in: http://www.oakland.edu/~fortune/WorkdayFunctions.zip It allows the counting of workdays taking into consideration up to 11 U.S. holidays. ...
54
by: John | last post by:
Is the following program print the address of the function? void hello() { printf("hello\n"); } void main() { printf("hello function=%d\n", hello); }
3
by: poopsy | last post by:
Hi! I've got an assigment on C++.. Here it is: It first clears the screen and then displays the next 3 lines. a1x + b1y + c1y =d1 a2x + b2y + c2y =d2 a3x + b3y + c3y =d3
1
by: poopsy | last post by:
Hi..plz need help on this maths assignment.. Here it is It first clears the screen and then displays the next 3 lines. a1x + b1y + c1z =d1 a2x + b2y + c2z =d2 a3x + b3y + c3z =d3 The user...
1
by: Killer42 | last post by:
Does anyone know anything about "Gauss-Jordan Eliminations"? We have a thread asking about this in the VB forum, and I've never heard of them. I did find this page on Wikipedia, which includes...
3
by: pragy | last post by:
Hey, can any one help me for writing a program of naive gauss elimintaion technique? It's a technique to solve system of simultaneous linear equations using matrix. thanks
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.