array.h File Reference

Various array classes. More...

#include <iostream>
#include <cmath>
#include <string>
#include <fstream>
#include <sstream>
#include <new>
#include <o2scl/err_hnd.h>
#include <gsl/gsl_ieee_utils.h>
#include <gsl/gsl_sort.h>

Go to the source code of this file.


Detailed Description

Various array classes.

For a more general discussion of vectors and matrices in O2scl , see the Arrays, Vectors, Matrices and Tensors of the User's Guide.

This file contains classes and functions for operating with C-style 1- or 2-dimensional arrays and pointers to double. For an example of the usage of the array allocation classes, see the Multidimensional solver example . For more generic operations on generic vector objects (including in some cases C-style arrays), see also the file vector.h .

This file contains the allocation classes

the classes for the manipulation of arrays in smart_interp

the array equivalent of omatrix_row and omatrix_col (see usage in src/ode/ode_it_solve_ts.cpp)

Note:
The classes
can be used with pointers or arrays, but array_alloc and pointer_alloc are not interchangable.

Definition in file array.h.


Data Structures

class  array_alloc
 A simple class to provide an allocate() function for arrays. More...
class  array_2d_alloc
 A simple class to provide an allocate() function for 2-dimensional arrays. More...
class  pointer_alloc
 A simple class to provide an allocate() function for pointers. More...
class  pointer_2d_alloc
 A simple class to provide an allocate() function for pointers. More...
class  array_reverse
 A simple class which reverses the order of an array. More...
class  array_const_reverse
 A simple class which reverses the order of an array. More...
class  array_subvector
 A simple subvector class for an array (without error checking). More...
class  array_2d_col
 Column of a 2d array. More...
class  array_2d_row
 Row of a 2d array. More...
class  array_const_subvector
 A simple subvector class for a const array (without error checking). More...
class  array_subvector_reverse
 Reverse a subvector of an array. More...
class  array_const_subvector_reverse
 Reverse a subvector of a const array. More...

Functions

template<class type >
type * new_array (size_t n)
 Create a new C-style 1-dimensional array.
template<class type >
void delete_array (type *t)
 Free the memory for a C-style 1-dimensional array.
template<class type >
type ** new_2d_array (size_t nr, size_t nc)
 Create a new C-style 2-dimensional array.
template<class type >
void delete_2d_array (type **t, size_t nr)
 Free the memory for a C-style 2-dimensional array.

Function Documentation

void delete_2d_array ( type **  t,
size_t  nr 
) [inline]

Free the memory for a C-style 2-dimensional array.

This function never calls the error handler, but may create a segmentation fault if improperly called multiple times.

Definition at line 549 of file array.h.

void delete_array ( type *  t  )  [inline]

Free the memory for a C-style 1-dimensional array.

This function never calls the error handler, but may create a segmentation fault if improperly called multiple times.

Definition at line 510 of file array.h.

type** new_2d_array ( size_t  nr,
size_t  nc 
) [inline]

Create a new C-style 2-dimensional array.

This function is convenient because it automatically calls the O2scl error handler in case the allocation fails, and will free the portions of the memory which were successfully allocated.

Definition at line 522 of file array.h.

type* new_array ( size_t  n  )  [inline]

Create a new C-style 1-dimensional array.

This function is convenient because it automatically calls the O2scl error handler in case the allocation fails.

Definition at line 493 of file array.h.


Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page