Gaussian Elimination

Apr 18, 2007

Example usage:
To solve Ax=B

|25 5 1| |106.8 |
A = |64 8 1| , B = |177.21|
|144 12 1| |279.21|

exec dbo.gaussianElimination
N'<matrix>
<row values="25,5,1,106.8"/>
<row values="64,8,1,177.21"/>
<row values="144,12,1,279.21"/>
</matrix>', @verbose = 1

Will give this:
inputMatrix
--------------------------------------------------------------------------------
25,5,1,106.8
64,8,1,177.21
144,12,1,279.21

result
--------------------------------------------------------------------------------
x0 = 0.290000
x1 = 19.700000
x2 = 1.050000

testingScenario
--------------------------------------------------------------------------------
set nocount on
declare @x0 float
declare @x1 float
declare @x2 float
set @x0 = 0.290000
set @x1 = 19.700000
set @x2 = 1.050000
select (25 * @x0) + (5 * @x1) + (1 * @x2) --= 106.8
select (64 * @x0) + (8 * @x1) + (1 * @x2) --= 177.21
select (144 * @x0) + (12 * @x1) + (1 * @x2) --= 279.21

Resultant row echelon matrix after solving the augmented input matrix
========================================================================================================================
m n0 n1 n2 n3
------- ----------------------------------------------------- ----------------------------------------------------- ----------------------------------------------------- -----------------------------------------------------
m0 1.0 0.0 0.0 0.28999999999999826
m1 0.0 1.0 0.0 19.700000000000028
m2 0.0 0.0 1.0 1.0499999999998986

View 4 Replies


ADVERTISEMENT

Round Function (Zero Elimination)

Jul 19, 2007

Hi

I use round function

select round(1234.4545,2)
GO

Result
1234.4500

I want last two zero to be eliminate.
Please advise how?

Thanks
Jawad

View 3 Replies View Related

Elimination And Updatinig Duplicate Records?

Jan 9, 2008

We have a procedure that yields a temp table that has duplicate records as follows:








calc_date
minmaxvalue

1/1/2004
1

1/1/2004
2

1/2/2004
1

1/3/2004
1

1/4/2004
2

1/5/2004
2

1/6/2004
2

1/7/2004
1

1/7/2004
2

1/8/2004
2

1/9/2004
1

1/10/2004
1

1/11/2004
2

1/12/2004
1

1/13/2004
1

1/14/2004
1

1/14/2004
2
We now want to go thru the resulting table and do the following:

if there is a duplicate date record, delete the duplicate and update the remaining minmaxvalue to be 3

the resulting ds would look like this








calc_date
minmaxvalue

1/1/2004
3

1/2/2004
1

1/3/2004
1

1/4/2004
2

1/5/2004
2

1/6/2004
2

1/7/2004
3

1/8/2004
2

1/9/2004
1

1/10/2004
1

1/11/2004
2

1/12/2004
1

1/13/2004
1

1/14/2004
3

Any ideas?

View 6 Replies View Related

Playoff Brackets (Single Elimination Tournament)

May 21, 2007

I am looking for Articles or Examples on implementing a Single Elimination Tournament architecture in SQL Server.
Bracketology, Playoff Bracket, Single Elimination Tournament, whatever you want to call it.

I need the solution to be able to support all sizes of brackets (from 8 - 64 teams and everything in between).


Any "starts in the right direction" would be much appreciated.

View 1 Replies View Related

SQL Server 2008 :: Partitioned Views Table Elimination Not Working

Jul 7, 2015

I have some Partitioned Views and on all queries using a table for the in clause, table elimination isn't happening.

Check Constraint is on the oid column

This works as expected, only goes to 2 tables;
SELECT *
FROM view_oap_all
WHERE oid IN ( '05231416529481', '06201479586431' )

This works as expected, only goes to 2 tables;
SELECT *
FROM view_oap_all
WHERE oid IN ( SELECT oid
FROM owners
WHERE oid IN ( '05231416529481', '06201479586431' ) )

This is checking all tables (headingnames are unique), ive tried this for the last 3 hours on many different tables containing the oid column.

Unless I write the oid as in the above queries it just doesn't work.
SELECT *
FROM view_oap_all
WHERE oid IN ( SELECT oid
FROM owners
WHERE headingname = 'TestSystem' )

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved