JWS C Library
C language utility library
matrix_io.h File Reference

Declarations for I/O operations on a matrix. More...

#include <jwsc/config.h>
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include "jwsc/base/error.h"
#include "jwsc/math/complex.h"
#include "jwsc/matrix/matrix.h"
Include dependency graph for matrix_io.h:

Go to the source code of this file.

Functions

read_matrix

Reads a matrix from a file.

Errorread_matrix_u32 (Matrix_u32 **m_out, const char *fname)
 Reads a 32-bit unsigned integer matrix.
Errorread_matrix_i32 (Matrix_i32 **m_out, const char *fname)
 Reads a 32-bit signed integer matrix.
Errorread_matrix_i64 (Matrix_i64 **m_out, const char *fname)
 Reads a 64-bit signed integer matrix.
Errorread_matrix_f (Matrix_f **m_out, const char *fname)
 Reads a single precision floating point matrix.
Errorread_matrix_d (Matrix_d **m_out, const char *fname)
 Reads a double precision floating point matrix.
Errorread_matrix_cf (Matrix_cf **m_out, const char *fname)
 Reads a single precision complex floating point matrix.
Errorread_matrix_cd (Matrix_cd **m_out, const char *fname)
 Reads a double precision complex floating point matrix.
read_matrix_fp

Reads a matrix from an opened file.

Errorread_matrix_fp_u32 (Matrix_u32 **m_out, FILE *fp)
 Reads a 32-bit unsigned integer matrix.
Errorread_matrix_fp_i32 (Matrix_i32 **m_out, FILE *fp)
 Reads a 32-bit signed integer matrix.
Errorread_matrix_fp_i64 (Matrix_i64 **m_out, FILE *fp)
 Reads a 64-bit signed integer matrix.
Errorread_matrix_fp_f (Matrix_f **m_out, FILE *fp)
 Reads a single precision floating point matrix.
Errorread_matrix_fp_d (Matrix_d **m_out, FILE *fp)
 Reads a double precision floating point matrix.
Errorread_matrix_fp_cf (Matrix_cf **m_out, FILE *fp)
 Reads a single precision complex floating point matrix.
Errorread_matrix_fp_cd (Matrix_cd **m_out, FILE *fp)
 Reads a double precision complex floating point matrix.
write_matrix

Writes a matrix with a header to a file.

Errorwrite_matrix_u32 (const Matrix_u32 *m, const char *fname)
 Writes a 32-bit unsigned integer matrix.
Errorwrite_matrix_i32 (const Matrix_i32 *m, const char *fname)
 Writes a 32-bit signed integer matrix.
Errorwrite_matrix_i64 (const Matrix_i64 *m, const char *fname)
 Writes a 64-bit signed integer matrix.
Errorwrite_matrix_f (const Matrix_f *m, const char *fname)
 Writes a single precision floating point matrix.
Errorwrite_matrix_d (const Matrix_d *m, const char *fname)
 Writes a double precision floating point matrix.
Errorwrite_matrix_cf (const Matrix_cf *m, const char *fname)
 Writes a single precision complex floating point matrix.
Errorwrite_matrix_cd (const Matrix_cd *m, const char *fname)
 Writes a double precision complex floating point matrix.
Errorwrite_matrix_with_header_u32 (const Matrix_u32 *m, const char *fname)
 Writes a 32-bit unsigned integer matrix.
Errorwrite_matrix_with_header_i32 (const Matrix_i32 *m, const char *fname)
 Writes a 32-bit signed integer matrix.
Errorwrite_matrix_with_header_i64 (const Matrix_i64 *m, const char *fname)
 Writes a 64-bit signed integer matrix.
Errorwrite_matrix_with_header_f (const Matrix_f *m, const char *fname)
 Writes a single precision floating point matrix.
Errorwrite_matrix_with_header_d (const Matrix_d *m, const char *fname)
 Writes a double precision floating point matrix.
Errorwrite_matrix_with_header_cf (const Matrix_cf *m, const char *fname)
 Writes a single precision complex floating point matrix.
Errorwrite_matrix_with_header_cd (const Matrix_cd *m, const char *fname)
 Writes a double precision complex floating point matrix.
write_matrix_fp

Writes a matrix to an opened file.

Errorwrite_matrix_fp_u32 (const Matrix_u32 *m, FILE *fp)
 Writes a 32-bit unsigned integer matrix.
Errorwrite_matrix_fp_i32 (const Matrix_i32 *m, FILE *fp)
 Writes a 32-bit signed integer matrix.
Errorwrite_matrix_fp_i64 (const Matrix_i64 *m, FILE *fp)
 Writes a 64-bit signed integer matrix.
Errorwrite_matrix_fp_f (const Matrix_f *m, FILE *fp)
 Writes a single precision floating point matrix.
Errorwrite_matrix_fp_d (const Matrix_d *m, FILE *fp)
 Writes a double precision floating point matrix.
Errorwrite_matrix_fp_cf (const Matrix_cf *m, FILE *fp)
 Writes a single precision complex floating point matrix.
Errorwrite_matrix_fp_cd (const Matrix_cd *m, FILE *fp)
 Writes a double precision complex floating point matrix.
read_matrix_with_header

Reads a matrix with a header from a file.

Errorread_matrix_with_header_u32 (Matrix_u32 **m_out, const char *fname)
 Reads a 32-bit unsigned integer matrix.
Errorread_matrix_with_header_i32 (Matrix_i32 **m_out, const char *fname)
 Reads a 32-bit signed integer matrix.
Errorread_matrix_with_header_i64 (Matrix_i64 **m_out, const char *fname)
 Reads a 64-bit signed integer matrix.
Errorread_matrix_with_header_f (Matrix_f **m_out, const char *fname)
 Reads a single precision floating point matrix.
Errorread_matrix_with_header_d (Matrix_d **m_out, const char *fname)
 Reads a double precision floating point matrix.
Errorread_matrix_with_header_cf (Matrix_cf **m_out, const char *fname)
 Reads a single precision complex floating point matrix.
Errorread_matrix_with_header_cd (Matrix_cd **m_out, const char *fname)
 Reads a double precision complex floating point matrix.
read_matrix_with_header_fp

Reads a matrix with a header from an opened file.

Errorread_matrix_with_header_fp_u32 (Matrix_u32 **m_out, FILE *fp)
 Reads a 32-bit unsigned integer matrix.
Errorread_matrix_with_header_fp_i32 (Matrix_i32 **m_out, FILE *fp)
 Reads a 32-bit signed integer matrix.
Errorread_matrix_with_header_fp_i64 (Matrix_i64 **m_out, FILE *fp)
 Reads a 64-bit signed integer matrix.
Errorread_matrix_with_header_fp_f (Matrix_f **m_out, FILE *fp)
 Reads a single precision floating point matrix.
Errorread_matrix_with_header_fp_d (Matrix_d **m_out, FILE *fp)
 Reads a double precision floating point matrix.
Errorread_matrix_with_header_fp_cf (Matrix_cf **m_out, FILE *fp)
 Reads a single precision complex floating point matrix.
Errorread_matrix_with_header_fp_cd (Matrix_cd **m_out, FILE *fp)
 Reads a double precision complex floating point matrix.
write_matrix_with_header_fp

Writes a matrix with a header to an opened file.

Errorwrite_matrix_with_header_fp_u32 (const Matrix_u32 *m, FILE *fp)
 Writes a 32-bit unsigned integer matrix.
Errorwrite_matrix_with_header_fp_i32 (const Matrix_i32 *m, FILE *fp)
 Writes a 32-bit signed integer matrix.
Errorwrite_matrix_with_header_fp_i64 (const Matrix_i64 *m, FILE *fp)
 Writes a 64-bit signed integer matrix.
Errorwrite_matrix_with_header_fp_f (const Matrix_f *m, FILE *fp)
 Writes a single precision floating point matrix.
Errorwrite_matrix_with_header_fp_d (const Matrix_d *m, FILE *fp)
 Writes a double precision floating point matrix.
Errorwrite_matrix_with_header_fp_cf (const Matrix_cf *m, FILE *fp)
 Writes a single precision complex floating point matrix.
Errorwrite_matrix_with_header_fp_cd (const Matrix_cd *m, FILE *fp)
 Writes a double precision complex floating point matrix.

Detailed Description

Declarations for I/O operations on a matrix.

Author:
Joseph Schlecht
License:
Creative Commons BY-NC-SA 3.0

Definition in file matrix_io.h.


Function Documentation

Error* read_matrix_u32 ( Matrix_u32 **  m_out,
const char *  fname 
)

Reads a 32-bit unsigned integer matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 181 of file matrix_io.c.

Error* read_matrix_i32 ( Matrix_i32 **  m_out,
const char *  fname 
)

Reads a 32-bit signed integer matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 229 of file matrix_io.c.

Error* read_matrix_i64 ( Matrix_i64 **  m_out,
const char *  fname 
)

Reads a 64-bit signed integer matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 277 of file matrix_io.c.

Error* read_matrix_f ( Matrix_f **  m_out,
const char *  fname 
)

Reads a single precision floating point matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 325 of file matrix_io.c.

Error* read_matrix_d ( Matrix_d **  m_out,
const char *  fname 
)

Reads a double precision floating point matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 373 of file matrix_io.c.

Error* read_matrix_cf ( Matrix_cf **  m_out,
const char *  fname 
)

Reads a single precision complex floating point matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 421 of file matrix_io.c.

Error* read_matrix_cd ( Matrix_cd **  m_out,
const char *  fname 
)

Reads a double precision complex floating point matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 469 of file matrix_io.c.

Error* read_matrix_fp_u32 ( Matrix_u32 **  m_out,
FILE *  fp 
)

Reads a 32-bit unsigned integer matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 529 of file matrix_io.c.

Error* read_matrix_fp_i32 ( Matrix_i32 **  m_out,
FILE *  fp 
)

Reads a 32-bit signed integer matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 646 of file matrix_io.c.

Error* read_matrix_fp_i64 ( Matrix_i64 **  m_out,
FILE *  fp 
)

Reads a 64-bit signed integer matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 762 of file matrix_io.c.

Error* read_matrix_fp_f ( Matrix_f **  m_out,
FILE *  fp 
)

Reads a single precision floating point matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 878 of file matrix_io.c.

Error* read_matrix_fp_d ( Matrix_d **  m_out,
FILE *  fp 
)

Reads a double precision floating point matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 994 of file matrix_io.c.

Error* read_matrix_fp_cf ( Matrix_cf **  m_out,
FILE *  fp 
)

Reads a single precision complex floating point matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 1110 of file matrix_io.c.

Error* read_matrix_fp_cd ( Matrix_cd **  m_out,
FILE *  fp 
)

Reads a double precision complex floating point matrix.

Format of the matrix in the file is expected to be sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment.
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 1229 of file matrix_io.c.

Error* write_matrix_u32 ( const Matrix_u32 m,
const char *  fname 
)

Writes a 32-bit unsigned integer matrix.

Format of the matrix written is sequential lines containing rows of the Matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1355 of file matrix_io.c.

Error* write_matrix_i32 ( const Matrix_i32 m,
const char *  fname 
)

Writes a 32-bit signed integer matrix.

Format of the matrix written is sequential lines containing rows of the Matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1396 of file matrix_io.c.

Error* write_matrix_i64 ( const Matrix_i64 m,
const char *  fname 
)

Writes a 64-bit signed integer matrix.

Format of the matrix written is sequential lines containing rows of the Matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1437 of file matrix_io.c.

Error* write_matrix_f ( const Matrix_f m,
const char *  fname 
)

Writes a single precision floating point matrix.

Format of the matrix written is sequential lines containing rows of the Matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1478 of file matrix_io.c.

Error* write_matrix_d ( const Matrix_d m,
const char *  fname 
)

Writes a double precision floating point matrix.

Format of the matrix written is sequential lines containing rows of the Matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1519 of file matrix_io.c.

Error* write_matrix_cf ( const Matrix_cf m,
const char *  fname 
)

Writes a single precision complex floating point matrix.

Format of the matrix written is sequential lines containing rows of the Matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1560 of file matrix_io.c.

Error* write_matrix_cd ( const Matrix_cd m,
const char *  fname 
)

Writes a double precision complex floating point matrix.

Format of the matrix written is sequential lines containing rows of the Matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1601 of file matrix_io.c.

Error* write_matrix_fp_u32 ( const Matrix_u32 m,
FILE *  fp 
)

Writes a 32-bit unsigned integer matrix.

Format of the matrix written is sequential lines containing rows of the matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1654 of file matrix_io.c.

Error* write_matrix_fp_i32 ( const Matrix_i32 m,
FILE *  fp 
)

Writes a 32-bit signed integer matrix.

Format of the matrix written is sequential lines containing rows of the matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1690 of file matrix_io.c.

Error* write_matrix_fp_i64 ( const Matrix_i64 m,
FILE *  fp 
)

Writes a 64-bit signed integer matrix.

Format of the matrix written is sequential lines containing rows of the matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1726 of file matrix_io.c.

Error* write_matrix_fp_f ( const Matrix_f m,
FILE *  fp 
)

Writes a single precision floating point matrix.

Format of the matrix written is sequential lines containing rows of the matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1762 of file matrix_io.c.

Error* write_matrix_fp_d ( const Matrix_d m,
FILE *  fp 
)

Writes a double precision floating point matrix.

Format of the matrix written is sequential lines containing rows of the matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1798 of file matrix_io.c.

Error* write_matrix_fp_cf ( const Matrix_cf m,
FILE *  fp 
)

Writes a single precision complex floating point matrix.

Format of the matrix written is sequential lines containing rows of the matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1834 of file matrix_io.c.

Error* write_matrix_fp_cd ( const Matrix_cd m,
FILE *  fp 
)

Writes a double precision complex floating point matrix.

Format of the matrix written is sequential lines containing rows of the matrix.

 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 1871 of file matrix_io.c.

Error* read_matrix_with_header_u32 ( Matrix_u32 **  m_out,
const char *  fname 
)

Reads a 32-bit unsigned integer matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 1927 of file matrix_io.c.

Error* read_matrix_with_header_i32 ( Matrix_i32 **  m_out,
const char *  fname 
)

Reads a 32-bit signed integer matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 1977 of file matrix_io.c.

Error* read_matrix_with_header_i64 ( Matrix_i64 **  m_out,
const char *  fname 
)

Reads a 64-bit signed integer matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2027 of file matrix_io.c.

Error* read_matrix_with_header_f ( Matrix_f **  m_out,
const char *  fname 
)

Reads a single precision floating point matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2077 of file matrix_io.c.

Error* read_matrix_with_header_d ( Matrix_d **  m_out,
const char *  fname 
)

Reads a double precision floating point matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2127 of file matrix_io.c.

Error* read_matrix_with_header_cf ( Matrix_cf **  m_out,
const char *  fname 
)

Reads a single precision complex floating point matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2177 of file matrix_io.c.

Error* read_matrix_with_header_cd ( Matrix_cd **  m_out,
const char *  fname 
)

Reads a double precision complex floating point matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2227 of file matrix_io.c.

Error* read_matrix_with_header_fp_u32 ( Matrix_u32 **  m_out,
FILE *  fp 
)

Reads a 32-bit unsigned integer matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2289 of file matrix_io.c.

Error* read_matrix_with_header_fp_i32 ( Matrix_i32 **  m_out,
FILE *  fp 
)

Reads a 32-bit signed integer matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2349 of file matrix_io.c.

Error* read_matrix_with_header_fp_i64 ( Matrix_i64 **  m_out,
FILE *  fp 
)

Reads a 64-bit signed integer matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2409 of file matrix_io.c.

Error* read_matrix_with_header_fp_f ( Matrix_f **  m_out,
FILE *  fp 
)

Reads a single precision floating point matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2469 of file matrix_io.c.

Error* read_matrix_with_header_fp_d ( Matrix_d **  m_out,
FILE *  fp 
)

Reads a double precision floating point matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2529 of file matrix_io.c.

Error* read_matrix_with_header_fp_cf ( Matrix_cf **  m_out,
FILE *  fp 
)

Reads a single precision complex floating point matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 1 2 3
 4 5 6 4 5 6
 7 8 9 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2589 of file matrix_io.c.

Error* read_matrix_with_header_fp_cd ( Matrix_cd **  m_out,
FILE *  fp 
)

Reads a double precision complex floating point matrix.

Format of the matrix in the file is expected to a line containing the number of rows and columns followed by sequential lines containing rows of the matrix. Blank lines and lines beginning with '#' prior to the first row of the matrix are skipped. For example,

 # Comment
 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
m_outResult parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used.
fpFile to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned and *m_out is freed and set to NULL.
  • ERROR_IO Either there was a problem reading the file, or the matrix in the file is not formatted properly.

Definition at line 2650 of file matrix_io.c.

Error* write_matrix_with_header_u32 ( const Matrix_u32 m,
const char *  fname 
)

Writes a 32-bit unsigned integer matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 2717 of file matrix_io.c.

Error* write_matrix_with_header_i32 ( const Matrix_i32 m,
const char *  fname 
)

Writes a 32-bit signed integer matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 2754 of file matrix_io.c.

Error* write_matrix_with_header_i64 ( const Matrix_i64 m,
const char *  fname 
)

Writes a 64-bit signed integer matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 2791 of file matrix_io.c.

Error* write_matrix_with_header_f ( const Matrix_f m,
const char *  fname 
)

Writes a single precision floating point matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 2828 of file matrix_io.c.

Error* write_matrix_with_header_d ( const Matrix_d m,
const char *  fname 
)

Writes a double precision floating point matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 2865 of file matrix_io.c.

Error* write_matrix_with_header_cf ( const Matrix_cf m,
const char *  fname 
)

Writes a single precision complex floating point matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 1 2 3
 4 5 6 4 5 6
 7 8 9 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 2902 of file matrix_io.c.

Error* write_matrix_with_header_cd ( const Matrix_cd m,
const char *  fname 
)

Writes a double precision complex floating point matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 1 2 3 
 4 5 6 4 5 6
 7 8 9 7 8 9
Parameters:
mMatrix to write.
fnameName of the file to read the matrix from.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 2939 of file matrix_io.c.

Error* write_matrix_with_header_fp_u32 ( const Matrix_u32 m,
FILE *  fp 
)

Writes a 32-bit unsigned integer matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 2988 of file matrix_io.c.

Error* write_matrix_with_header_fp_i32 ( const Matrix_i32 m,
FILE *  fp 
)

Writes a 32-bit signed integer matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 3027 of file matrix_io.c.

Error* write_matrix_with_header_fp_i64 ( const Matrix_i64 m,
FILE *  fp 
)

Writes a 64-bit signed integer matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 3066 of file matrix_io.c.

Error* write_matrix_with_header_fp_f ( const Matrix_f m,
FILE *  fp 
)

Writes a single precision floating point matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 3105 of file matrix_io.c.

Error* write_matrix_with_header_fp_d ( const Matrix_d m,
FILE *  fp 
)

Writes a double precision floating point matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 
 4 5 6 
 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 3144 of file matrix_io.c.

Error* write_matrix_with_header_fp_cf ( const Matrix_cf m,
FILE *  fp 
)

Writes a single precision complex floating point matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 1 2 3
 4 5 6 4 5 6
 7 8 9 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 3183 of file matrix_io.c.

Error* write_matrix_with_header_fp_cd ( const Matrix_cd m,
FILE *  fp 
)

Writes a double precision complex floating point matrix.

Format of the matrix written is a line containing the number of elements followed by sequential lines containg rows of the matrix. For example,

 num_rows=3 num_cols=3
 1 2 3 1 2 3
 4 5 6 4 5 6
 7 8 9 7 8 9
Parameters:
mMatrix to write.
fpFile to write the matrix to.
Returns:
On success, NULL is returned; otherwise an Error is returned.
  • ERROR_IO There was a problem writing to the file.

Definition at line 3223 of file matrix_io.c.