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

# wnminv(3)

matrix inversion

## NAME

wn\_invert\_mat, wn\_polish\_inverse\_mat, wn\_solve\_system - matrix inversion

## SYNOPSIS

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

wn_invert_mat(int &code,double **mat,int len_i)

wn_polish_inverse_mat(int &code,double **mat_inverse,
double *mat,int len_i,int iterations)

wn_solve_system(int &code,double *solution,
double *rhs,double **mat_inverse,double **mat,
int len,int iterations)
```

## DESCRIPTION

**wn\_invert\_mat** performs an in-place invert of *mat*.

## RESOURCES

Inverting a matrix requires

WORST and AVERAGE CASE:

time = *len\_i*^3\
 stack memory = 1\
 dynamic memory = *len\_i*

where the matrix to be inverted is a *len\_i*\**len\_i* matrix.

## DIAGNOSTICS

*code* == **WN\_SUCCESS**  for successful inversion.\
 *code* == **WN\_SINGULAR**  for singular matrix.

## BUGS

Cannot handle complex numbers, making these useless for many engineering applications.

## SEE ALSO

wnmmlt

## AUTHOR

Will Naylor
