plot.sparseness: Plot sparseness structure of matrix

Description Usage Arguments Value Author(s) See Also Examples

Description

This function plots the sparseness structure of a matrix in the format that is required by ipoptr.

Usage

1
plot.sparseness( x, pch='.', asp=1, xaxs='i', yaxs='i', ... )

Arguments

x

list of vectors with indices. Each element of the list corresponds to a row in the matrix. Each index corresponds to a non-zero element in the matrix.

pch

plotting ‘character’. See points for possible values.

asp

aspect ratio, default = 1.

xaxs, yaxs

style of axis interval calculation, default = 'i' (do not extend the axis). See par for more information.

...

further graphical parameters that will be passed to plot.

Value

A list with the non-zero x and y indices is returned.

Author(s)

Jelmer Ypma

See Also

ipoptr print.sparseness make.sparse

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library('ipoptr')

# use different plotting symbol for small matrices
plot.sparseness( make.sparse(diag(5)), pch='x' )

# plot large matrix example
s <- make.sparse( lower.tri( matrix( 1, 500, 500), diag=TRUE ) )
plot.sparseness( s )

# plot another large matrix
s <- do.call( "cbind", lapply( 1:5, function(i) { diag(5) %x% matrix(1, nrow=5, ncol=20) } ) )
s <- do.call( "rbind", lapply( 1:10,  function(i) { s } ) )
s <- cbind( matrix( 1, nrow=nrow(s), ncol=40 ), s )
plot.sparseness( make.sparse( s ) )

jyypma/ipoptr documentation built on May 20, 2019, 6:28 a.m.