Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

util.h File Reference

Collection of handy utility functions. More...

#include <string>
#include <sstream>
#include <iostream>
#include <fstream>

Go to the source code of this file.

Functions

std::string itos (int i)
 int-to-string conversion.
int print2file1d (const char *filename, double *numbers, int len)
 Prints an array of numbers to a plain text file, one number per line.
int print2filebin (const char *filename, double *numbers, int len)
 Prints an array of numbers to a binary file as one large sequence.
int print2file2d (const char *filename, double *numbers, int len)
 Prints an array of numbers to a plain text file, two numbers per line.


Detailed Description

Collection of handy utility functions.

Supplies functions for easy integer-to-string conversion and simple file-writing functions.

Author:
Arthur van Dam, dam@math.uu.nl

Albert-Jan Yzelman, yzelman@math.uu.nl


Function Documentation

std::string itos int  i  ) 
 

int-to-string conversion.

Parameters:
i The integer to convert.
Returns:
The integer i in string format.

int print2file1d const char *  filename,
double *  numbers,
int  len
 

Prints an array of numbers to a plain text file, one number per line.

Parameters:
filename Name of the destination file. Created if nonexistent.
numbers pointer to number array.
len Number of array elements that should be written to file.
Returns:
1 on success, 0 otherwise.

int print2file2d const char *  filename,
double *  numbers,
int  len
 

Prints an array of numbers to a plain text file, two numbers per line.

Parameters:
filename Name of the destination file. Created if nonexistent.
numbers pointer to number array.
len Number of array elements that should be written to file.
Returns:
1 on success, 0 otherwise.

int print2filebin const char *  filename,
double *  numbers,
int  len
 

Prints an array of numbers to a binary file as one large sequence.

It assumes its input array (double*) only contains UNSIGNED INTs! (Numbers are cast down to unsigned ints)

Parameters:
filename Name of the destination file. Created if nonexistent.
numbers pointer to number array.
len Number of array elements that should be written to file.
Returns:
1 on success, 0 otherwise.


Generated on Fri Sep 4 18:03:45 2009 for LabSci RNG/MC generators by  doxygen 1.3.9.1