---
name: "wnspmat"
section: "3"
platform: "linux"
package: "libwn-dev"
version: "6.0-17"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/wnspmat"
---

# wnspmat(3)

sparse matrix data structures and operations

## NAME

wnspmat - sparse matrix data structures and operations

## SYNOPSIS

```
#include <wn/wnspmat.h>

typedef struct wn_sparse_matrix_struct
{
int len_i,len_j;
wn_sll *i_lists,*j_lists; /* list of entries */

wn_memgp group;
} *wn_sparse_matrix;

typedef struct wn_sparse_matrix_entry_struct
{
double value;

int i,j;

ptr baggage;
} *wn_sparse_matrix_entry;
```

## DESCRIPTION

The include file \<wn/wnspmat.h\> defines the sparse matrix structures above.  Sparse matrix subroutines provide the following types of sparse matrix operations:

\- creation\
 \- input and output\
 \- various optimization algorithms

*len\_i* refers to the number of rows or height of the sparse matrix; *len\_j* refers to the number of columns or width of the sparse matrix.

Other man pages refer to sparse matrix entry row i, column j as "*sparse\_matrix*\[i\]\[j\]".  This array indexing cannot be performed on sparse matrices in C, although it makes a nice shorthand for use in man pages.

## EXAMPLES

Look in */usr/doc/libwn6/examples* for examples of sparse matrix code.

## BUGS

Much of this code is not extensively tested.

## SEE ALSO

wnmat

## AUTHOR

Will Naylor
