Question: How to solve a big system using vectors and not matrix

Hi 

I want to store the matrix m2 representing a system m2*x=b with vectors as given by the command "CompressedSparseForm" and solve the system using those vectors and b without using m2 and b.

Thanks

vectors.mw


 

``

restart; with(LinearAlgebra)

``

``

``

m2 := Matrix([[102, 0, 0, .1, 1], [0, 3, 0, 0, 1], [1, 3.1, 7, 0, 0], [1, 33, 0, .5, 0], [1, 0, 0, 0, 1]], 'datatype = float')

Matrix([[102., 0., 0., .100000000000000, 1.], [0., 3., 0., 0., 1.], [1., 3.10000000000000, 7., 0., 0.], [1., 33., 0., .500000000000000, 0.], [1., 0., 0., 0., 1.]])

(1)

``

cm, rm, values := CompressedSparseForm(m2)

Vector(6, {(1) = 1, (2) = 5, (3) = 8, (4) = 9, (5) = 11, (6) = 14}, datatype = integer[8]), Vector(4, {(1) = ` 1 .. 13 `*Vector[column], (2) = `Data Type: `*integer[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), Vector(4, {(1) = ` 1 .. 13 `*Vector[column], (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

(2)

``

b := `<,>`(1.1, 2, 5, .5, 5)

Vector(5, {(1) = 1.1, (2) = 2, (3) = 5, (4) = .5, (5) = 5})

(3)

``

LinearSolve(m2, b)

Vector(5, {(1) = -.107505070993915, (2) = -1.03583502366464, (3) = 1.18837052062204, (4) = 69.5801217038540, (5) = 5.10750507099392})

(4)

``

NULL b

``

``

``

``


 

Download vectors.mw

Please Wait...