# Synopsis

PDX_MSGT gdx_AllocateApprox(long option, long init_size, long inc_size, void *default_attr, EAM_INFO *default_attr_info)

# Purpose

Allocate a GDX linear approximation workspace

# Description

Allocates the GDX approximation workspace data used to perform and manage linear approximation of GDX entities. Use gdx_FreeApprox to free the current allocated workspace or gdx_FreeAllApprox to free all allocated workspaces. By default, if gdx_AllocateApprox is called again before gdx_FreeApprox is called, the current workspace is freed and then reallocated to the specified size. If the option mask equals GDX_NEWAPPROX, the current workspace is saved (this includes all approximation option settings) and a new workspace is allocated. When this workspace is freed, the previous workspace is restored as the current workspace. For certain platform malloc perfromance, init_size and inc_size is no longer used, unless inc_size is zero(0). In this case for each init_size word 3 doubles and 1 long are allocated(28 bytes). For example, an init_size value of 1000 would allocate 3000 doubles and 1000 longs initially. If inc_size is zero(0), then once the init_size workspace is used an error is returned which indicates that no reallocation took place(GDX_NOREALLOC).

# Input

## option

Options GDX_NEWAPPROX Create a new approximation workspace

## init_size

The initial workspace size

## inc_size

The amount to increment the workspace size if the current workspace is exhausted

## default_attr

The default attribute data structure to be used by default for attribute management or NULL

## default_attr_info

The default EAM attribute information for creation of the default attribute stack or NULL.

# Return

          GDX_NOERR
          GDX_NOMEMORY
          Low level error return
          .fi