NAME
fp_read_int_matrix_with_header - Reads data row-wise from a FILE into a new integer matrix
SYNOPSIS
#include "l/l_int_mat_io.h"
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-I/home/kobus/include
-L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
int fp_read_int_matrix_with_header
(
Int_matrix **result_mpp,
FILE *fp
);
DESCRIPTION
This routine reads data in a file pointed to by a FILE object into an
integer matrix whose number of columns is not known to the calling routine.
The data file MUST contain a matrix size header otherwise NOT_FOUND is
returned. The routine then reads <num_rows>*<num_cols> data into the matrix
row wise. The restrictions on formatting are minimal.
The integer matrix *result_mpp is created or resized as necessary.
"fp" points to a FILE object as returned by "kjb_fopen".
The file is scanned from the current position for the presence of a matrix
size header of the form:
#! rows=<num-matrix-rows> cols=<num-matrix-cols>
where <num-matrix-rows>,<num-matrix-cols> are positive integers.
(The "#" is actually the comment char (user settable) and the "!" is actually
the header char, also user settable).
Data is read from the first matrix size header found until the next matrix
or spectra header (if present) is located. The current file position is NOT
reset to the starting after the function returns, so this function can be
used to read multiple matrices from the same file.
RETURNS
NO_ERROR on success and ERROR on failure, with an appropriate error
message being set.
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Lindsay Martin and Kobus Barnard
DOCUMENTER
Lindsay Martin and Kobus Barnard
SEE ALSO
read_int_matrix_from_config_file
,
read_int_matrix
,
fp_read_int_matrix
,
fp_read_raw_int_matrix
,
fp_read_int_matrix_from_matlab_file
,
fp_read_formatted_int_matrix
,
read_int_matrix_by_rows
,
fp_read_int_matrix_by_rows
,
read_int_matrix_by_cols
,
fp_read_int_matrix_by_cols
,
fp_ow_read_formatted_int_matrix
,
fp_ow_read_int_matrix_by_rows
,
fp_ow_read_int_matrix_by_cols
,
fp_read_matrix_size_header
,
fp_write_int_matrix_with_title
,
write_int_matrix
,
fp_write_int_matrix
,
write_raw_int_matrix
,
fp_write_raw_int_matrix
,
write_int_matrix_rows
,
fp_write_int_matrix_rows
,
write_int_matrix_cols
,
fp_write_int_matrix_cols
,
write_int_matrix_with_header
,
fp_write_int_matrix_with_header
,
fp_write_matrix_size_header
,
write_int_matrix_to_matlab_file
,
fp_write_int_matrix_to_matlab_file