# Matrix in Mehrotra format

 0 I'm working with the PCx code and can't figure out how the Mehrotra format for matrix work. The code describing the data structure are typedef struct { int NumRows, NumCols, Nonzeros; int *pBeginRow; int *pEndRow; int *Row; double *Value; } sparseMatrix;  asked 12 Feb '13, 07:00 raniere 3●1 accept rate: 0%

 3 I have not seen the code, so this is an educated guess. That data structure looks like a compressed row format with an extra array (pEndRow) for convenience and to minimize re-allocations due to fill-in. See here for a simple explanation of the basic compressed row/column format. It may be that the end pointer points to the last nonzero in that row at any given point, but that some space is left between that number and the next row start. This approach leaves some empty space in the data structure to account for fill-in (i.e., when factorization add non-zeros to the matrix). answered 12 Feb '13, 09:40 Leo 606●1●3 accept rate: 12%
 3 The two most common schemes for storing sparse matrices are "Compressed Row Storage (CRS)" and "Compressed Column Storage (CCS)." This struct looks like it would be right for compressed row storage, except for the "int *Row", which would normally be "int *Col" Whatever scheme you use there has to be some to way to implicitly or explicitly identify the row and column of each entry, and there's no place here to do that. One possibility is that the author was just sloppy in writing "int *Row" instead of "int *Col" It's also possible that this structure is only being used for symmetric matrices, and the author is using the fact that A(i,j)=A(j,i). My advice would be to read up on CRS/CCS to understand how this scheme is commonly used and then examine the code that refers to this structure and verify what's going on. Or, you could contact the author of the code. answered 12 Feb '13, 09:31 Brian Borchers 1.1k●1●5 accept rate: 17%
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags: