Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I derive a function that would store non-zero elements of a lower triangular matrix into a sequence by row-order? Let's say I have

How do I derive a function that would store non-zero elements of a lower triangular matrix into a sequence by row-order?

Let's say I have an n x n matrix where n = 5.

image text in transcribed

I already have the max number of non-zero elements, which is determined by the formula:

image text in transcribed

How do I figure out the formula, k, or f(i,j) where i represents the row and j represents the column, that would assign matrix element a[i,j] to its appropriate position in an array by order of row?

ex. a formula that would take a21 in the matrix above and generate the number 5, as it is the fifth matrix element by row-order.

EDIT: I am looking for a non-code expression for this formula, i.e. a mathematical formula similar to f(i,j) = (i-1)+3j that would find out the array position for each one of the matrix indices.

a1o 0 0 0 a22 0 0 10 - 20 21 22 a30 a31 332 333 40 41 42 43 44

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago