Classes | Macros | Functions
vnl_matlab_read.h File Reference

Read from MATLAB files. More...

#include <iosfwd>
#include <complex>
#include <vnl/vnl_matlab_header.h>
#include "vnl/vnl_export.h"

Go to the source code of this file.

Classes

class  vnl_vector< T >
 Mathematical vector class, templated by type of element. More...
 
class  vnl_matrix< T >
 An ordinary mathematical matrix. More...
 
class  vnl_matlab_readhdr
 

Macros

#define fsm_declare_methods(T)
 

Functions

template<class T >
VNL_EXPORT bool vnl_matlab_read_or_die (std::istream &, vnl_vector< T > &, char const *name=nullptr)
 Attempt to read vector or matrix. More...
 
template<class T >
VNL_EXPORT bool vnl_matlab_read_or_die (std::istream &, vnl_matrix< T > &, char const *name=nullptr)
 
template<class T >
VNL_EXPORT void vnl_matlab_read_data (std::istream &s, T *ptr, unsigned n)
 MATLAB stores its data as a real block followed by an imaginary block. More...
 

Detailed Description

Read from MATLAB files.

Author
fsm
  Modifications
   LSB (Manchester) 23 Mar 2001 documentation tidied
   Feb.2002 - Peter Vanroose - brief doxygen comment placed on single line
   21 Apr 2009 Kent Williams - Taking care of the byte ordering of the MAT file

Definition in file vnl_matlab_read.h.

Macro Definition Documentation

◆ fsm_declare_methods

#define fsm_declare_methods (   T)
Value:
private: \
bool type_chck(T &); \
public: \
bool read_data(T &); \
bool read_data(T *); \
bool read_data(T * const *)

Definition at line 70 of file vnl_matlab_read.h.

Function Documentation

◆ vnl_matlab_read_data()

template<class T >
VNL_EXPORT void vnl_matlab_read_data ( std::istream &  s,
T *  ptr,
unsigned  n 
)

MATLAB stores its data as a real block followed by an imaginary block.

This function will read both blocks and interleave them into the area pointed to by ptr. For real T, it is equivalent to s.read(ptr, sizeof(T)*n);

◆ vnl_matlab_read_or_die() [1/2]

template<class T >
VNL_EXPORT bool vnl_matlab_read_or_die ( std::istream &  ,
vnl_vector< T > &  ,
char const *  name = nullptr 
)

Attempt to read vector or matrix.

If the MATLAB header cannot be read, return false. Else, if a name is given, and it doesn't match what's in the file, abort(). If the data in the file cannot reasonably be read into the destination, abort().

The vector/matrix will be resized if necessary.

Definition at line 231 of file vnl_matlab_read.cxx.

◆ vnl_matlab_read_or_die() [2/2]

template<class T >
VNL_EXPORT bool vnl_matlab_read_or_die ( std::istream &  ,
vnl_matrix< T > &  ,
char const *  name = nullptr 
)

Definition at line 257 of file vnl_matlab_read.cxx.