Prev Next omp_create_array

@(@\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }@)@
Allocate Memory and Create A Raw Array

Deprecated 2011-08-31
Use the function thread_alloc::create_array instead.

Syntax
# include <cppad/utility/omp_alloc.hpp>
array = omp_alloc::create_array<Type>(size_minsize_out) .

Purpose
Create a new raw array using omp_alloc a fast memory allocator that works well in a multi-threading OpenMP environment.

Type
The type of the elements of the array.

size_min
This argument has prototype
     size_t 
size_min
This is the minimum number of elements that there can be in the resulting array .

size_out
This argument has prototype
     size_t& 
size_out
The input value of this argument does not matter. Upon return, it is the actual number of elements in array (  size_min <= size_out ).

array
The return value array has prototype
     
Typearray
It is array with size_out elements. The default constructor for Type is used to initialize the elements of array . Note that omp_delete_array should be used to destroy the array when it is no longer needed.

Delta
The amount of memory omp_inuse by the current thread, will increase delta where
     sizeof(
Type) * (size_out + 1) > delta >= sizeof(Type) * size_out
The omp_available memory will decrease by delta , (and the allocation will be faster) if a previous allocation with size_min between its current value and size_out is available.

Example
omp_alloc.cpp
Input File: cppad/utility/omp_alloc.hpp