Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

mattri.h File Reference

Double-precision symmetric (lower triangular) matrix module. More...

#include <stdlib.h>
#include <stdio.h>

Include dependency graph for mattri.h:

Include dependency graph

Go to the source code of this file.

Compounds

struct  Mattri_
 Mattri_: a struct storing a lower triangular double matrix. More...


Functions

void init_mattri (Mattri_ *M, unsigned int Size)
 init_mattri(M, Size): Sets up the matrix *M to contain Size rows and columns. More...

void array_mattri (Mattri_ *M, const double *Array)
 array_mattri(M, Array): Assumes that Array contains a lower triangular matrix in row major order and copies its contents into M. More...

void resize_mattri (Mattri_ *M, unsigned int Newsize)
 resize_mattri(M, Newsize): changes the size of *M so that Newsize rows and columns can be stored. More...

void copy_mattri (const Mattri_ *From, Mattri_ *To)
 copy_mattri(From, To): Copies the contents of *From to *To. More...

int read_mattri (FILE *In, Mattri_ *M)
 read_mattri(In, M): reads a matrix from the file In into *M. More...

void write_mattri (FILE *Out, const Mattri_ *M, int Prec)
 write_mattri(Out, M, Linewidth, Width, Prec): lists M to the open stream Out with entries in scientific format, Prec digits precision. More...

void free_mattri (Mattri_ *M)
 free_mattri(M): frees up all storage associated with *M. More...


Detailed Description

Double-precision symmetric (lower triangular) matrix module.

Supports creation, resize, copy, input-output.

Definition in file mattri.h.


Function Documentation

void init_mattri ( Mattri_ * M,
unsigned int Size )
 

init_mattri(M, Size): Sets up the matrix *M to contain Size rows and columns.

If Size==0, it will be set to 1. This must be the first operation performed on a Mattri_ struct. Disaster strikes if *M is initialised more than once.

Referenced by Mattri_::Rlen().

void array_mattri ( Mattri_ * M,
const double * Array )
 

array_mattri(M, Array): Assumes that Array contains a lower triangular matrix in row major order and copies its contents into M.

It is your responsibility to make sure that Array has the right size and the appropriate layout. This routine assumes no responsibility and performs no dim checks. M must have been initialised and set to the desired size before calling this routine. The only support you can expect that nothing is done if either of the parameters is NULL.

Referenced by Mattri_::Rlen().

void resize_mattri ( Mattri_ * M,
unsigned int Newsize )
 

resize_mattri(M, Newsize): changes the size of *M so that Newsize rows and columns can be stored.

Does nothing if the dimensions are the same as before. Newly added rows/cols will be initialised to 0.0. If Newsize==0, then it will be set to 1.

Referenced by Mattri_::Rlen().

void copy_mattri ( const Mattri_ * From,
Mattri_ * To )
 

copy_mattri(From, To): Copies the contents of *From to *To.

*To will be initialised and/or resized if necessary.

Referenced by Mattri_::Rlen().

int read_mattri ( FILE * In,
Mattri_ * M )
 

read_mattri(In, M): reads a matrix from the file In into *M.

Format is the "nice format" produced by write_mattri(). Returns 0 on error, the number of lines processed otherwise.

Referenced by Mattri_::Rlen().

void write_mattri ( FILE * Out,
const Mattri_ * M,
int Prec )
 

write_mattri(Out, M, Linewidth, Width, Prec): lists M to the open stream Out with entries in scientific format, Prec digits precision.

If a row takes up more than 80 chars, then the matrix is cut up nicely.

Referenced by Mattri_::Rlen().

void free_mattri ( Mattri_ * M )
 

free_mattri(M): frees up all storage associated with *M.

*M will be kept, it will be in an invalid empty state. This must be the last operation performed on a Mattri_ struct.

Referenced by Mattri_::Rlen().


Generated at Wed Aug 21 09:33:46 2002 for The Razorback C library: Linear Algebra by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001