fp_read_matrix_size_header - Reads matrix size header in matrix file.


#include "l/l_int_mat_io.h"

Example compile flags (system dependent):
   -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_matrix_size_header
	FILE *fp,
	int *num_rows_ptr,
	int *num_cols_ptr


This routine reads the matrix size header in file indicated by the file pointer indicated by the argument "fp". If the header contains information about the number of matrix rows, the number of matrix columns, or both, then the corresponding variables whose pointers are arguments are set. Variables are not changed unless there is information in the header. The variables corresponding to the pointer arguments "num_rows_ptr" and "num_cols_ptr" can be tested on returnare assigned a value of NOT_SET before calling this function, the values eturn to see if a matrix size header was found in the file. The matrix size header has the format:
    #! rows=<num-matrix-rows> cols=<num-matrix-cols>
(The "#" is actually the comment char (user settable) and the "!" is actually the header char, also user settable). where <num-matrix-rows> and <num-matrix-cols> are positive integers. Note that one or both of these values may be present in a header.


Either NO_ERROR if a matrix size header was successfully read, or ERROR on a file error or if no header is present.


This routine can fail if the stream is a pipe. The argument fp must point to something that can be "seeked". Exaclty what that is can depend on the OS.


This software is not adequatedly tested. It is recomended that results are checked independantly where appropriate.


Kobus Barnard


Kobus Barnard


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_int_matrix_with_header , 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_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