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

`#include <amp.h>`

## Public Member Functions

| mpfr_reference ()
| mpfr_reference (const mpfr_reference &r)
mpfr_reference & | operator= (const mpfr_reference &r)
| ~mpfr_reference ()
void | initialize (int Precision)
void | free ()
mpfr_srcptr | getReadPtr () const
mpfr_ptr | getWritePtr ()
| mpfr_reference ()
| mpfr_reference (const mpfr_reference &r)
mpfr_reference & | operator= (const mpfr_reference &r)
| ~mpfr_reference ()
void | initialize (int Precision)
void | free ()
mpfr_srcptr | getReadPtr () const
mpfr_ptr | getWritePtr ()

## Private Attributes

mpfr_record * | ref

## Detailed Description

Definition at line 60 of file amp.h.

## Constructor & Destructor Documentation

## mpfr_reference() [1/4]

amp::mpfr_reference::mpfr_reference | ( |  | ) |

Definition at line 82 of file amp.cpp.

{
ref = NULL;
}
amp::mpfr_reference::ref
mpfr_record * ref
Definition amp.h:74
NULL
#define NULL
Definition omList.c:12

## mpfr_reference() [2/4]

amp::mpfr_reference::mpfr_reference | ( | const mpfr_reference & | r | ) |

Definition at line 87 of file amp.cpp.

{
ref = r.ref;
if( ref!=NULL )
ref->refCount++;
}

## ~mpfr_reference() [1/2]

amp::mpfr_reference::~mpfr_reference | ( |  | ) |

Definition at line 109 of file amp.cpp.

{
if( ref!=NULL )
free();
}
amp::mpfr_reference::free
void free()
Definition amp.cpp:123

## mpfr_reference() [3/4]

amp::mpfr_reference::mpfr_reference | ( |  | ) |

## mpfr_reference() [4/4]

amp::mpfr_reference::mpfr_reference | ( | const mpfr_reference & | r | ) |

## ~mpfr_reference() [2/2]

amp::mpfr_reference::~mpfr_reference | ( |  | ) |

## Member Function Documentation

## free() [1/2]

void amp::mpfr_reference::free | ( |  | ) |

Definition at line 123 of file amp.cpp.

{
if( ref==NULL )
//throw amp::internalError();
{WerrorS("internalError");return;}
ref->refCount--;
if( ref->refCount==0 )
amp::mpfr_storage::deleteMpfr(ref);
ref = NULL;
}
amp::mpfr_storage::deleteMpfr
static void deleteMpfr(mpfr_record *ref)
Definition amp.cpp:30
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24

## free() [2/2]

void amp::mpfr_reference::free | ( |  | ) |

## getReadPtr() [1/2]

mpfr_srcptr amp::mpfr_reference::getReadPtr | ( |  | ) | const

Definition at line 134 of file amp.cpp.

{
if( ref==NULL )
//throw amp::internalError();
{WerrorS("internalError");return NULL;}
return ref->value;
}

## getReadPtr() [2/2]

mpfr_srcptr amp::mpfr_reference::getReadPtr | ( |  | ) | const

## getWritePtr() [1/2]

mpfr_ptr amp::mpfr_reference::getWritePtr | ( |  | ) |

Definition at line 142 of file amp.cpp.

{
if( ref==NULL )
//throw amp::internalError();
{WerrorS("internalError");return NULL;}
if( ref->refCount==1 )
return ref->value;
amp::mpfr_record *newref = amp::mpfr_storage::newMpfr(ref->Precision);
mpfr_set(newref->value, ref->value, GMP_RNDN);
free();
ref = newref;
return ref->value;
}
amp::mpfr_storage::newMpfr
static mpfr_record * newMpfr(unsigned int Precision)
Definition amp.cpp:11
amp::mpfr_record::value
mpfr_t value
Definition amp.h:37

## getWritePtr() [2/2]

mpfr_ptr amp::mpfr_reference::getWritePtr | ( |  | ) |

## initialize() [1/2]

void amp::mpfr_reference::initialize | ( | int | Precision | ) |

Definition at line 115 of file amp.cpp.

{
if( ref!=NULL )
free();
ref = amp::mpfr_storage::newMpfr(Precision);
ref->refCount = 1;
}

## initialize() [2/2]

void amp::mpfr_reference::initialize | ( | int | Precision | ) |

## operator=() [1/2]

amp::mpfr_reference & amp::mpfr_reference::operator= | ( | const mpfr_reference & | r | ) |

Definition at line 94 of file amp.cpp.

{
if ( &r==this )
return *this;
if ( ref==r.ref )
return *this;
if( ref!=NULL )
free();
ref = r.ref;
if( ref!=NULL )
ref->refCount++;
return *this;
}

## operator=() [2/2]

mpfr_reference & amp::mpfr_reference::operator= | ( | const mpfr_reference & | r | ) |

## Field Documentation

## ref

mpfr_record * amp::mpfr_reference::ref

private

Definition at line 74 of file amp.h.

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