Loading...
Searching...
No Matches
PolyMinorValue Class Reference

Class PolyMinorValue is derived from MinorValue and can be used for representing values in a cache for sub-determinantes; see class Cache. More...

`#include <Minor.h>`

## Public Member Functions

| PolyMinorValue (const poly result, const int multiplications, const int additions, const int accumulatedMultiplications, const int accumulatedAdditions, const int retrievals, const int potentialRetrievals)
| A constructor for class MinorValue.
| PolyMinorValue (const PolyMinorValue &mv)
| Copy constructor for creating a deep copy.
void | operator= (const PolyMinorValue &mv)
| Assignment operator which creates a deep copy.
| PolyMinorValue ()
| just to make the compiler happy
virtual | ~PolyMinorValue ()
| Destructor.
poly | getResult () const
| Accessor for the private field _result.
int | getWeight () const
| Accessor for the current weight of this class instance.
std::string | toString () const
| A method for providing a printable version of the represented MinorValue.
Public Member Functions inherited from MinorValue
bool | operator== (const MinorValue &mv) const
| just to make the compiler happy
bool | operator< (const MinorValue &mv) const
| just to make the compiler happy
int | getRetrievals () const
| A method for accessing the number of retrievals of this minor.
int | getPotentialRetrievals () const
| A method for accessing the maximum number of potential retrievals of this minor.
int | getMultiplications () const
| A method for accessing the multiplications performed while computing this minor.
int | getAccumulatedMultiplications () const
| A method for accessing the multiplications performed while computing this minor, including all nested multiplications.
int | getAdditions () const
| A method for accessing the additions performed while computing this minor.
int | getAccumulatedAdditions () const
| A method for accessing the additions performed while computing this minor, including all nested additions.
void | incrementRetrievals ()
| A method for incrementing the number of performed retrievals of this instance of MinorValue.
int | getUtility () const
| A method for obtaining a rank measure for theiven MinorValue.
void | print () const
| A method for printing a string representation of the given MinorValue to std::cout.

## Private Attributes

poly | _result
| a store for the actual value of the minor

## Additional Inherited Members

Static Public Member Functions inherited from MinorValue
static void | SetRankingStrategy (const int rankingStrategy)
| A method for determining the value ranking strategy.
Protected Member Functions inherited from MinorValue
int | rankMeasure1 () const
| A method for obtaining a rank measure for the given MinorValue.
int | rankMeasure2 () const
| A method for obtaining a rank measure for the given MinorValue.
int | rankMeasure3 () const
| A method for obtaining a rank measure for the given MinorValue.
int | rankMeasure4 () const
| A method for obtaining a rank measure for the given MinorValue.
int | rankMeasure5 () const
| A method for obtaining a rank measure for the given MinorValue.
Static Protected Member Functions inherited from MinorValue
static int | GetRankingStrategy ()
| Accessor for the static private field g_rankingStrategy.
Protected Attributes inherited from MinorValue
int | _retrievals
| -1 iff cache is not used, otherwise the number of retrievals so far of the current minor
int | _potentialRetrievals
| -1 iff cache is not used, otherwise the maximum number of potential retrievals of this minor (e.g.
int | _multiplications
| a store for the actual number of multiplications to compute the current minor
int | _additions
| a store for the actual number of additions to compute the current minor
int | _accumulatedMult
| a store for the accumulated number of multiplications to compute the current minor; This also includes all multiplications nested in sub-minors which may be retrieved from a cache.
int | _accumulatedSum
| a store for the accumulated number of additions to compute the current minor; This also includes all additions nested in sub-minors which may be retrieved from a cache.
STATIC_VAR int | g_rankingStrategy = -1
| private store for the current value ranking strategy; This member can be set using MinorValue::SetRankingStrategy (const int).

## Detailed Description

Class PolyMinorValue is derived from MinorValue and can be used for representing values in a cache for sub-determinantes; see class Cache.

As such, it is a realization of the template class ValueClass which is used in the declaration of class Cache. Following the documentation of class Cache, we need to implement at least the methods:
`bool IntMinorValue::operator< (const IntMinorValue& key),`
`bool IntMinorValue::operator== (const IntMinorValue& key),`
`int IntMinorValue::getWeight ().`
The main purpose of PolyMinorValue is to represent values of sub-determinantes of a pre-defined matrix. Class MinorKey is used to determine which rows and columns of this pre-defined matrix ought to belong to the respective sub-determinante of interest. PolyMinorValue is a special implementation which assumes matrices with polynomial entries, such that the result of any minor is again a polynomial.

Author
  Frank Seelisch, http://www.mathematik.uni-kl.de/~seelisch

Definition at line 799 of file Minor.h.

## Constructor & Destructor Documentation

## PolyMinorValue() [1/3]

PolyMinorValue::PolyMinorValue | ( | const poly | result,
|  | const int | multiplications,
|  | const int | additions,
|  | const int | accumulatedMultiplications,
|  | const int | accumulatedAdditions,
|  | const int | retrievals,
|  | const int | potentialRetrievals )

A constructor for class MinorValue.

Parameters

  result | the actual value of the represented minor
  multiplications | number of multiplications to compute this minor
  additions | number of additions to compute this minor
  accumulatedMultiplications | number of multiplications to compute this minor, including nested operations
  accumulatedAdditions | number of additions to compute this minor, including nested operations
  retrievals | number of times this minor has been retrieved from cache
  potentialRetrievals | maximum number of times this minor may be retrieved from cache

Definition at line 1070 of file Minor.cc.

{
_result = pCopy(result);
_multiplications = multiplications;
_additions = additions;
_accumulatedMult = accumulatedMultiplications;
_accumulatedSum = accumulatedAdditions;
_potentialRetrievals = potentialRetrievals;
_retrievals = retrievals;
}
MinorValue::_additions
int _additions
a store for the actual number of additions to compute the current minor
Definition Minor.h:432
MinorValue::_potentialRetrievals
int _potentialRetrievals
-1 iff cache is not used, otherwise the maximum number of potential retrievals of this minor (e....
Definition Minor.h:421
MinorValue::_accumulatedMult
int _accumulatedMult
a store for the accumulated number of multiplications to compute the current minor; This also include...
Definition Minor.h:441
MinorValue::_accumulatedSum
int _accumulatedSum
a store for the accumulated number of additions to compute the current minor; This also includes all ...
Definition Minor.h:450
MinorValue::_multiplications
int _multiplications
a store for the actual number of multiplications to compute the current minor
Definition Minor.h:427
MinorValue::_retrievals
int _retrievals
-1 iff cache is not used, otherwise the number of retrievals so far of the current minor
Definition Minor.h:414
PolyMinorValue::_result
poly _result
a store for the actual value of the minor
Definition Minor.h:805
result
return result
Definition facAbsBiFact.cc:76
pCopy
#define pCopy(p)
return a copy of the poly
Definition polys.h:186

## PolyMinorValue() [2/3]

PolyMinorValue::PolyMinorValue | ( | const PolyMinorValue & | mv | ) |

Copy constructor for creating a deep copy.

Definition at line 1148 of file Minor.cc.

{
_result = pCopy(mv.getResult());
_retrievals = mv.getRetrievals();
_potentialRetrievals = mv.getPotentialRetrievals();
_multiplications = mv.getMultiplications();
_additions = mv.getAdditions();
_accumulatedMult = mv.getAccumulatedMultiplications();
_accumulatedSum = mv.getAccumulatedAdditions();
}
MinorValue::getPotentialRetrievals
int getPotentialRetrievals() const
A method for accessing the maximum number of potential retrievals of this minor.
Definition Minor.cc:878
MinorValue::getAdditions
int getAdditions() const
A method for accessing the additions performed while computing this minor.
Definition Minor.cc:888
MinorValue::getAccumulatedAdditions
int getAccumulatedAdditions() const
A method for accessing the additions performed while computing this minor, including all nested addit...
Definition Minor.cc:898
MinorValue::getMultiplications
int getMultiplications() const
A method for accessing the multiplications performed while computing this minor.
Definition Minor.cc:883
MinorValue::getRetrievals
int getRetrievals() const
A method for accessing the number of retrievals of this minor.
Definition Minor.cc:868
MinorValue::getAccumulatedMultiplications
int getAccumulatedMultiplications() const
A method for accessing the multiplications performed while computing this minor, including all nested...
Definition Minor.cc:893
PolyMinorValue::getResult
poly getResult() const
Accessor for the private field _result.
Definition Minor.cc:1102

## PolyMinorValue() [3/3]

PolyMinorValue::PolyMinorValue | ( |  | ) |

just to make the compiler happy

Definition at line 1086 of file Minor.cc.

{
_result = NULL;
_multiplications = -1;
_additions = -1;
_accumulatedMult = -1;
_accumulatedSum = -1;
_potentialRetrievals = -1;
_retrievals = -1;
}
NULL
#define NULL
Definition omList.c:12

## ~PolyMinorValue()

PolyMinorValue::~PolyMinorValue | ( |  | ) |

virtual

Destructor.

Definition at line 1097 of file Minor.cc.

{
p_Delete(&_result, currRing);
}
p_Delete
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13

## Member Function Documentation

## getResult()

poly PolyMinorValue::getResult | ( |  | ) | const

Accessor for the private field _result.

Returns
  the result encoded in this class instance

Definition at line 1102 of file Minor.cc.

{
return _result;
}

## getWeight()

int PolyMinorValue::getWeight | ( |  | ) | const

virtual

Accessor for the current weight of this class instance.

Returns
  the current weight of this class instance

Reimplemented from MinorValue.

Definition at line 1107 of file Minor.cc.

{
/* put measure for size of PolyMinorValue here, e.g. the number of monomials
in the cached polynomial */
return pLength(_result); // the number of monomials in the polynomial
}
pLength
static int pLength(poly a)
Definition p_polys.h:190

## operator=()

void PolyMinorValue::operator= | ( | const PolyMinorValue & | mv | ) |

Assignment operator which creates a deep copy.

Definition at line 1159 of file Minor.cc.

{
if (_result != mv.getResult()) pDelete(&_result);
_result = pCopy(mv.getResult());
_retrievals = mv.getRetrievals();
_potentialRetrievals = mv.getPotentialRetrievals();
_multiplications = mv.getMultiplications();
_additions = mv.getAdditions();
_accumulatedMult = mv.getAccumulatedMultiplications();
_accumulatedSum = mv.getAccumulatedAdditions();
}
pDelete
#define pDelete(p_ptr)
Definition polys.h:187

## toString()

string PolyMinorValue::toString | ( |  | ) | const

virtual

A method for providing a printable version of the represented MinorValue.

Returns
  a printable version of the given instance as instance of class string

Reimplemented from MinorValue.

Definition at line 1114 of file Minor.cc.

{
char h[20];
/* Let's see whether a cache has been used to compute this MinorValue: */
bool cacheHasBeenUsed = true;
if (this->getRetrievals() == -1) cacheHasBeenUsed = false;
string s = pString(_result);
s += " [retrievals: ";
if (cacheHasBeenUsed) { snprintf(h,20, "%d", this->getRetrievals()); s += h; }
else s += "/";
s += " (of ";
if (cacheHasBeenUsed)
{
snprintf(h,20, "%d", this->getPotentialRetrievals());
s += h;
}
else s += "/";
s += "), *: ";
snprintf(h,20, "%d", this->getMultiplications()); s += h;
s += " (accumulated: ";
snprintf(h,20, "%d", this->getAccumulatedMultiplications()); s += h;
s += "), +: ";
snprintf(h,20, "%d", this->getAdditions()); s += h;
s += " (accumulated: ";
snprintf(h,20, "%d", this->getAccumulatedAdditions()); s += h;
s += "), rank: ";
if (cacheHasBeenUsed) { snprintf(h,20, "%d", this->getUtility()); s += h; }
else s += "/";
s += "]";
return s;
}
MinorValue::getUtility
int getUtility() const
A method for obtaining a rank measure for theiven MinorValue.
Definition Minor.cc:926
s
const CanonicalForm int s
Definition facAbsFact.cc:51
h
STATIC_VAR Poly * h
Definition janet.cc:971
pString
char * pString(poly p)
Definition polys.h:307

## Field Documentation

## _result

poly PolyMinorValue::_result

private

a store for the actual value of the minor

Definition at line 805 of file Minor.h.

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

- kernel/linear_algebra/Minor.h
- kernel/linear_algebra/Minor.cc