Loading...
Searching...
No Matches
amp::mpfr_storage Class Reference

`#include <amp.h>`

## Static Public Member Functions

static mpfr_record * | newMpfr (unsigned int Precision)
static void | deleteMpfr (mpfr_record *ref)
static gmp_randstate_t * | getRandState ()
static mpfr_record * | newMpfr (unsigned int Precision)
static void | deleteMpfr (mpfr_record *ref)
static gmp_randstate_t * | getRandState ()

## Static Private Member Functions

static mpfr_record_ptr & | getList (unsigned int Precision)
static mpfr_record_ptr & | getList (unsigned int Precision)

## Detailed Description

Definition at line 46 of file amp.h.

## Member Function Documentation

## deleteMpfr() [1/2]

void amp::mpfr_storage::deleteMpfr | ( | amp::mpfr_record * | ref | ) |

static

Definition at line 30 of file amp.cpp.

{
amp::mpfr_record_ptr &lst = getList(ref->Precision);
ref->next = lst;
lst = ref;
}
amp::mpfr_storage::getList
static mpfr_record_ptr & getList(unsigned int Precision)
Definition amp.cpp:63
amp::mpfr_record::Precision
unsigned int Precision
Definition amp.h:36
amp::mpfr_record_ptr
mpfr_record * mpfr_record_ptr
Definition amp.h:41
amp::mpfr_record::next
mpfr_record * next
Definition amp.h:38

## deleteMpfr() [2/2]

void amp::mpfr_storage::deleteMpfr | ( | mpfr_record * | ref | ) |

static

## getList() [1/2]

amp::mpfr_record_ptr & amp::mpfr_storage::getList | ( | unsigned int | Precision | ) |

static private

Definition at line 63 of file amp.cpp.

{
static amp::mpfr_record_ptr tmp = NULL;
STATIC_VAR int lastPrec = -1;
static amp::mpfr_record_ptr &lastList = tmp;
if( lastPrec!=Precision )
{
while( _mpfr_storage_v.size()<Precision+1 )
_mpfr_storage_v.push_back(NULL);
lastPrec = (int)Precision;
lastList = _mpfr_storage_v[Precision];
}
return lastList;
}
_mpfr_storage_v
std::vector< amp::mpfr_record * > _mpfr_storage_v
Definition amp.cpp:7
STATIC_VAR
#define STATIC_VAR
Definition globaldefs.h:7
NULL
#define NULL
Definition omList.c:12

## getList() [2/2]

mpfr_record_ptr & amp::mpfr_storage::getList | ( | unsigned int | Precision | ) |

static private

## getRandState() [1/2]

gmp_randstate_t * amp::mpfr_storage::getRandState | ( |  | ) |

static

Definition at line 37 of file amp.cpp.

{
if( !_mpfr_storage_init )
{
time_t _timer;
gmp_randinit_default(_mpfr_storage_rs);
gmp_randseed_ui(_mpfr_storage_rs, (unsigned long int)(time(&_timer)));
_mpfr_storage_init = true;
}
return &_mpfr_storage_rs;
}
_mpfr_storage_init
VAR bool _mpfr_storage_init
Definition amp.cpp:9
_mpfr_storage_rs
VAR gmp_randstate_t _mpfr_storage_rs
Definition amp.cpp:8

## getRandState() [2/2]

gmp_randstate_t * amp::mpfr_storage::getRandState | ( |  | ) |

static

## newMpfr() [1/2]

amp::mpfr_record * amp::mpfr_storage::newMpfr | ( | unsigned int | Precision | ) |

static

Definition at line 11 of file amp.cpp.

{
amp::mpfr_record_ptr &lst = getList(Precision);
if( lst==NULL )
{
amp::mpfr_record *rec = new amp::mpfr_record;
rec->Precision = Precision;
rec->refCount = 0;
mpfr_init2(rec->value, Precision);
rec->next = lst;
lst = rec;
}
amp::mpfr_record *p = lst;
p->refCount = 1;
lst = lst->next;
return p;
}
p
int p
Definition cfModGcd.cc:4086
amp::mpfr_record::value
mpfr_t value
Definition amp.h:37
amp::mpfr_record::refCount
unsigned int refCount
Definition amp.h:35

## newMpfr() [2/2]

mpfr_record * amp::mpfr_storage::newMpfr | ( | unsigned int | Precision | ) |

static

The documentation for this class was generated from the following files:

- Singular/svd/libs/amp.h
- Singular/svd_si.h
- Singular/svd/libs/amp.cpp