# ORL Lab 2 Solved

30.00 \$

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . ` zip` solution files instantly, after Payment

## Description

Rate this product
1. You can use arrays, pointers, vectors, list, NumPy arrays etc.
2. You canâ€™t use any inbuilt linear algebra or linear programming algorithms (not even addition of matrices). You can use other inbuilt algorithms if you need.
3. Do not use platform dependent libraries such as conio.h.
4. Any code that you reuse; make a function for it such as reading or printing arrays and matrices {if you have a print matrix function you can very easily check output at different steps}

Some mistakes from lab1:

Donâ€™t mix GS and combination generator functions. Keep them separate.

1. For every Â iterative algorithm you have to have an abs error bound epsilon. No of iterations( with sufficient large value atleast 1000 ; not 20 or 50) can be a secondary check for divergence.
2. The error bound has to be checked for each component of x.
err[i]=x1[i]-x0[i] and then check if abs(err[i])>epsilon for any i=1,2,…n Â Â Â if false : convergence else: iterate
1. The submatrices will be generated by combination ( more specifically by combination of column indices; so it is just combination of sequence 0,1,2,…n ) not permutations.
1. Avoid type Â Â Â Â Â Â  conversions.
2. Be very careful with commas in python ex: a=[],b=c
3. Variable length arrays are not supported in C++, some compilers may provide Â some partial functionalities but donâ€™t use them. Use fixed size arrays or dynamic memory allocation (pointers and vectors) .

What to do in lab 2:

1. fix mistakes from lab1
2. write additional code for lab 2

(optional but still do it) 3. Implement Gauss elimination with partial pivoting (just the forward elimination step). Instead of back substitution pass your matrix to Gauss Seidel. [ to generate row echelon form of your submatrices]

Functions that you may need to write to better organize your code:

1. a GE function (which will create a temp [m][m+1] aux matrix and call forward elimination Â )
2. utility functions to swap rows and max in a row (may not need depending on your language)
3. write a function to do forward substitution ( this can also test whether the system is solvable or not) ( solvable system can also diverge in Gauss â€“Seidel)

• Lab2-6gt6dh.zip