casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
casa::ArrayIO_global_functions_Array_Ascii_IO Struct Reference

Global functions for Matrix/Vector input/output using ASCII format. More...

#include <ArrayIO.h>

List of all members.

Public Member Functions

template<class T >
void readAsciiMatrix (Matrix< T > &mat, const Char *fileName)
 These routines read and write a Matrix of data.
template<class T >
void writeAsciiMatrix (const Matrix< T > &mat, const Char *fileName)
template<class T >
void readAsciiVector (Vector< T > &vec, const Char *fileName)
 These two functions read and write a Vector of data.
template<class T >
void writeAsciiVector (const Vector< T > &vec, const Char *fileName)

Detailed Description

Global functions for Matrix/Vector input/output using ASCII format.

Intended use:

Public interface

Prerequisite

Synopsis

These global functions support file I/O between ASCII files and Matrices or Vectors.

Example

       Matrix<Float> picture(256, 256); picture = 0.0;
       String fileName="picture.data";
   
       // operations to populate picture
       // ..\.
   
       writeAsciiMatrix (picture, fileName);

Definition at line 324 of file ArrayIO.h.


Member Function Documentation

template<class T >
void casa::ArrayIO_global_functions_Array_Ascii_IO::readAsciiMatrix ( Matrix< T > &  mat,
const Char fileName 
)

These routines read and write a Matrix of data.

The first line of input will be examined to determine the number of columns in the matrix. The maximum number of columns provided for is 100. Each item may be up to 50 characters long.

Each item must be separated from others by one (or more) blank column. The "line" may be up to 1024 characters long. Each subsequent line must contain the SAME number of items as the first line but may be any length (up to 1024 characters).

The matrix need NOT be square.

The matrix should be declared but NOT dimensioned in the calling program.

template<class T >
void casa::ArrayIO_global_functions_Array_Ascii_IO::readAsciiVector ( Vector< T > &  vec,
const Char fileName 
)

These two functions read and write a Vector of data.

The input may be arranged in any format (i.e. It may be recorded as one value per line or it may be recorded with all values on a single line). Values must be separated by whitespace.

template<class T >
void casa::ArrayIO_global_functions_Array_Ascii_IO::writeAsciiMatrix ( const Matrix< T > &  mat,
const Char fileName 
)
template<class T >
void casa::ArrayIO_global_functions_Array_Ascii_IO::writeAsciiVector ( const Vector< T > &  vec,
const Char fileName 
)

The documentation for this struct was generated from the following file: