OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
table_io.cpp File Reference
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <ctime>
#include <cmath>
#include <cstring>
#include "table_io.h"
Include dependency graph for table_io.cpp:

Go to the source code of this file.

Macros

#define INCX   10
 
#define INCX   5
 
#define INCX   5
 
#define TIME_SIZE   40
 

Functions

char ch_cap (char ch)
 
bool ch_eqi (char ch1, char ch2)
 
int ch_to_digit (char ch)
 
int file_column_count (string filename)
 
int file_row_count (string input_filename)
 
int i4_log_10 (int i)
 
int i4_max (int i1, int i2)
 
int i4_min (int i1, int i2)
 
int * i4mat_border_add (int m, int n, int table[])
 
int * i4mat_border_cut (int m, int n, int table[])
 
int * i4mat_data_read (string input_filename, int m, int n)
 
void i4mat_header_read (string input_filename, int *m, int *n)
 
int * i4mat_indicator (int m, int n)
 
void i4mat_print (int m, int n, int a[], string title)
 
void i4mat_print_some (int m, int n, int a[], int ilo, int jlo, int ihi, int jhi, string title)
 
int * i4mat_read (string input_filename, int *m, int *n)
 
void i4mat_write (string output_filename, int m, int n, int table[])
 
double * r8mat_data_read (string input_filename, int m, int n)
 
float * r4mat_data_read (string input_filename, int m, int n)
 
void r8mat_header_read (string input_filename, int *m, int *n)
 
double * r8mat_indicator (int m, int n)
 
void r8mat_print (int m, int n, double a[], string title)
 
void r8mat_print_some (int m, int n, double a[], int ilo, int jlo, int ihi, int jhi, string title)
 
double * r8mat_read (string input_filename, int *m, int *n)
 
void r8mat_transpose_print (int m, int n, double a[], string title)
 
void r8mat_transpose_print_some (int m, int n, double a[], int ilo, int jlo, int ihi, int jhi, string title)
 
double * r8mat_uniform_01 (int m, int n, int *seed)
 
void r8mat_write (string output_filename, int m, int n, double table[])
 
int s_len_trim (string s)
 
int s_to_i4 (string s, int *last, bool *error)
 
bool s_to_i4vec (string s, int n, int ivec[])
 
double s_to_r8 (string s, int *lchar, bool *error)
 
bool s_to_r8vec (string s, int n, double rvec[])
 
int s_word_count (string s)
 
void timestamp ()
 
int table_column_count (char *input_filename)
 
int table_row_count (char *input_filename)
 
int * table_read_i4 (char *input_filename, int m, int n)
 
double * table_read_r8 (char *input_filename, int m, int n)
 
float * table_read_r4 (char *input_filename, int m, int n)
 
void table_free_i4 (int *table)
 
void table_free_r8 (double *table)
 
void table_free_r4 (float *table)
 

Macro Definition Documentation

◆ INCX [1/3]

#define INCX   10

◆ INCX [2/3]

#define INCX   5

◆ INCX [3/3]

#define INCX   5

◆ TIME_SIZE

#define TIME_SIZE   40

Function Documentation

◆ ch_cap()

char ch_cap ( char  ch)

Definition at line 15 of file table_io.cpp.

◆ ch_eqi()

bool ch_eqi ( char  ch1,
char  ch2 
)

Definition at line 54 of file table_io.cpp.

◆ ch_to_digit()

int ch_to_digit ( char  ch)

Definition at line 93 of file table_io.cpp.

◆ file_column_count()

int file_column_count ( string  filename)

Definition at line 146 of file table_io.cpp.

◆ file_row_count()

int file_row_count ( string  input_filename)

Definition at line 263 of file table_io.cpp.

◆ i4_log_10()

int i4_log_10 ( int  i)

Definition at line 343 of file table_io.cpp.

◆ i4_max()

int i4_max ( int  i1,
int  i2 
)

Definition at line 417 of file table_io.cpp.

◆ i4_min()

int i4_min ( int  i1,
int  i2 
)

Definition at line 455 of file table_io.cpp.

◆ i4mat_border_add()

int* i4mat_border_add ( int  m,
int  n,
int  table[] 
)

Definition at line 493 of file table_io.cpp.

◆ i4mat_border_cut()

int* i4mat_border_cut ( int  m,
int  n,
int  table[] 
)

Definition at line 564 of file table_io.cpp.

◆ i4mat_data_read()

int* i4mat_data_read ( string  input_filename,
int  m,
int  n 
)

Definition at line 632 of file table_io.cpp.

◆ i4mat_header_read()

void i4mat_header_read ( string  input_filename,
int *  m,
int *  n 
)

Definition at line 734 of file table_io.cpp.

◆ i4mat_indicator()

int* i4mat_indicator ( int  m,
int  n 
)

Definition at line 790 of file table_io.cpp.

◆ i4mat_print()

void i4mat_print ( int  m,
int  n,
int  a[],
string  title 
)

Definition at line 850 of file table_io.cpp.

◆ i4mat_print_some()

void i4mat_print_some ( int  m,
int  n,
int  a[],
int  ilo,
int  jlo,
int  ihi,
int  jhi,
string  title 
)

Definition at line 892 of file table_io.cpp.

◆ i4mat_read()

int* i4mat_read ( string  input_filename,
int *  m,
int *  n 
)

Definition at line 989 of file table_io.cpp.

◆ i4mat_write()

void i4mat_write ( string  output_filename,
int  m,
int  n,
int  table[] 
)

Definition at line 1045 of file table_io.cpp.

◆ r4mat_data_read()

float* r4mat_data_read ( string  input_filename,
int  m,
int  n 
)

Definition at line 1214 of file table_io.cpp.

◆ r8mat_data_read()

double* r8mat_data_read ( string  input_filename,
int  m,
int  n 
)

Definition at line 1112 of file table_io.cpp.

◆ r8mat_header_read()

void r8mat_header_read ( string  input_filename,
int *  m,
int *  n 
)

Definition at line 1316 of file table_io.cpp.

◆ r8mat_indicator()

double* r8mat_indicator ( int  m,
int  n 
)

Definition at line 1372 of file table_io.cpp.

◆ r8mat_print()

void r8mat_print ( int  m,
int  n,
double  a[],
string  title 
)

Definition at line 1432 of file table_io.cpp.

◆ r8mat_print_some()

void r8mat_print_some ( int  m,
int  n,
double  a[],
int  ilo,
int  jlo,
int  ihi,
int  jhi,
string  title 
)

Definition at line 1473 of file table_io.cpp.

◆ r8mat_read()

double* r8mat_read ( string  input_filename,
int *  m,
int *  n 
)

Definition at line 1571 of file table_io.cpp.

◆ r8mat_transpose_print()

void r8mat_transpose_print ( int  m,
int  n,
double  a[],
string  title 
)

Definition at line 1627 of file table_io.cpp.

◆ r8mat_transpose_print_some()

void r8mat_transpose_print_some ( int  m,
int  n,
double  a[],
int  ilo,
int  jlo,
int  ihi,
int  jhi,
string  title 
)

Definition at line 1666 of file table_io.cpp.

◆ r8mat_uniform_01()

double* r8mat_uniform_01 ( int  m,
int  n,
int *  seed 
)

Definition at line 1753 of file table_io.cpp.

◆ r8mat_write()

void r8mat_write ( string  output_filename,
int  m,
int  n,
double  table[] 
)

Definition at line 1846 of file table_io.cpp.

◆ s_len_trim()

int s_len_trim ( string  s)

Definition at line 1913 of file table_io.cpp.

◆ s_to_i4()

int s_to_i4 ( string  s,
int *  last,
bool error 
)

Definition at line 1956 of file table_io.cpp.

◆ s_to_i4vec()

bool s_to_i4vec ( string  s,
int  n,
int  ivec[] 
)

Definition at line 2062 of file table_io.cpp.

◆ s_to_r8()

double s_to_r8 ( string  s,
int *  lchar,
bool error 
)

Definition at line 2117 of file table_io.cpp.

◆ s_to_r8vec()

bool s_to_r8vec ( string  s,
int  n,
double  rvec[] 
)

Definition at line 2372 of file table_io.cpp.

◆ s_word_count()

int s_word_count ( string  s)

Definition at line 2427 of file table_io.cpp.

◆ table_column_count()

int table_column_count ( char *  input_filename)

Definition at line 2524 of file table_io.cpp.

◆ table_free_i4()

void table_free_i4 ( int *  table)

Definition at line 2544 of file table_io.cpp.

◆ table_free_r4()

void table_free_r4 ( float *  table)

Definition at line 2552 of file table_io.cpp.

◆ table_free_r8()

void table_free_r8 ( double *  table)

Definition at line 2548 of file table_io.cpp.

◆ table_read_i4()

int* table_read_i4 ( char *  input_filename,
int  m,
int  n 
)

Definition at line 2532 of file table_io.cpp.

◆ table_read_r4()

float* table_read_r4 ( char *  input_filename,
int  m,
int  n 
)

Definition at line 2540 of file table_io.cpp.

◆ table_read_r8()

double* table_read_r8 ( char *  input_filename,
int  m,
int  n 
)

Definition at line 2536 of file table_io.cpp.

◆ table_row_count()

int table_row_count ( char *  input_filename)

Definition at line 2528 of file table_io.cpp.

◆ timestamp()

void timestamp ( )

Definition at line 2478 of file table_io.cpp.