Public Member Functions | Private Attributes
IntMinorValue Class Reference

Class IntMinorValue 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

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

Private Attributes

int _result
 a store for the actual value of the minor More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MinorValue
static void SetRankingStrategy (const int rankingStrategy)
 A method for determining the value ranking strategy. More...
 
- Protected Member Functions inherited from MinorValue
int rankMeasure1 () const
 A method for obtaining a rank measure for the given MinorValue. More...
 
int rankMeasure2 () const
 A method for obtaining a rank measure for the given MinorValue. More...
 
int rankMeasure3 () const
 A method for obtaining a rank measure for the given MinorValue. More...
 
int rankMeasure4 () const
 A method for obtaining a rank measure for the given MinorValue. More...
 
int rankMeasure5 () const
 A method for obtaining a rank measure for the given MinorValue. More...
 
- Static Protected Member Functions inherited from MinorValue
static int GetRankingStrategy ()
 Accessor for the static private field g_rankingStrategy. More...
 
- Protected Attributes inherited from MinorValue
int _retrievals
 -1 iff cache is not used, otherwise the number of retrievals so far of the current minor More...
 
int _potentialRetrievals
 -1 iff cache is not used, otherwise the maximum number of potential retrievals of this minor (e.g. More...
 
int _multiplications
 a store for the actual number of multiplications to compute the current minor More...
 
int _additions
 a store for the actual number of additions to compute the current minor More...
 
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. More...
 
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. More...
 
- Static Protected Attributes inherited from MinorValue
static int g_rankingStrategy = -1
 private store for the current value ranking strategy; This member can be set using MinorValue::SetRankingStrategy (const int). More...
 

Detailed Description

Class IntMinorValue 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 IntMinorValue 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. So far, IntMinorValue is just an example implementation which assumes matrices with int entries, such that the result of any minor is again an int.

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

Definition at line 717 of file Minor.h.

Constructor & Destructor Documentation

◆ IntMinorValue() [1/3]

IntMinorValue::IntMinorValue ( const int  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
resultthe actual value of the represented minor
multiplicationsnumber of multiplications to compute this minor
additionsnumber of additions to compute this minor
accumulatedMultiplicationsnumber of multiplications to compute this minor, including nested operations
accumulatedAdditionsnumber of additions to compute this minor, including nested operations
retrievalsnumber of times this minor has been retrieved from cache
potentialRetrievalsmaximum number of times this minor may be retrieved from cache

Definition at line 986 of file Minor.cc.

992 {
993  _result = result;
994  _multiplications = multiplications;
995  _additions = additions;
996  _accumulatedMult = accumulatedMultiplications;
997  _accumulatedSum = accumulatedAdditions;
998  _potentialRetrievals = potentialRetrievals;
999  _retrievals = retrievals;
1000 }
int _accumulatedSum
a store for the accumulated number of additions to compute the current minor; This also includes all ...
Definition: Minor.h:450
int _additions
a store for the actual number of additions to compute the current minor
Definition: Minor.h:432
int _accumulatedMult
a store for the accumulated number of multiplications to compute the current minor; This also include...
Definition: Minor.h:441
int _retrievals
-1 iff cache is not used, otherwise the number of retrievals so far of the current minor ...
Definition: Minor.h:414
int _result
a store for the actual value of the minor
Definition: Minor.h:723
int _multiplications
a store for the actual number of multiplications to compute the current minor
Definition: Minor.h:427
int _potentialRetrievals
-1 iff cache is not used, otherwise the maximum number of potential retrievals of this minor (e...
Definition: Minor.h:421
return result
Definition: facAbsBiFact.cc:76

◆ IntMinorValue() [2/3]

IntMinorValue::IntMinorValue ( const IntMinorValue mv)

Copy constructor.

Definition at line 1057 of file Minor.cc.

1058 {
1059  _result = mv.getResult();
1060  _retrievals = mv.getRetrievals();
1063  _additions = mv.getAdditions();
1066 }
int getAdditions() const
A method for accessing the additions performed while computing this minor.
Definition: Minor.cc:886
int _accumulatedSum
a store for the accumulated number of additions to compute the current minor; This also includes all ...
Definition: Minor.h:450
int getAccumulatedAdditions() const
A method for accessing the additions performed while computing this minor, including all nested addit...
Definition: Minor.cc:896
int getResult() const
Accessor for the private field _result.
Definition: Minor.cc:1017
int getMultiplications() const
A method for accessing the multiplications performed while computing this minor.
Definition: Minor.cc:881
int _additions
a store for the actual number of additions to compute the current minor
Definition: Minor.h:432
int _accumulatedMult
a store for the accumulated number of multiplications to compute the current minor; This also include...
Definition: Minor.h:441
int getPotentialRetrievals() const
A method for accessing the maximum number of potential retrievals of this minor.
Definition: Minor.cc:876
int _retrievals
-1 iff cache is not used, otherwise the number of retrievals so far of the current minor ...
Definition: Minor.h:414
int _result
a store for the actual value of the minor
Definition: Minor.h:723
int getAccumulatedMultiplications() const
A method for accessing the multiplications performed while computing this minor, including all nested...
Definition: Minor.cc:891
int _multiplications
a store for the actual number of multiplications to compute the current minor
Definition: Minor.h:427
int _potentialRetrievals
-1 iff cache is not used, otherwise the maximum number of potential retrievals of this minor (e...
Definition: Minor.h:421
int getRetrievals() const
A method for accessing the number of retrievals of this minor.
Definition: Minor.cc:866

◆ IntMinorValue() [3/3]

IntMinorValue::IntMinorValue ( )

just to make the compiler happy

Definition at line 1002 of file Minor.cc.

1003 {
1004  _result = -1;
1005  _multiplications = -1;
1006  _additions = -1;
1007  _accumulatedMult = -1;
1008  _accumulatedSum = -1;
1009  _potentialRetrievals = -1;
1010  _retrievals = -1;
1011 }
int _accumulatedSum
a store for the accumulated number of additions to compute the current minor; This also includes all ...
Definition: Minor.h:450
int _additions
a store for the actual number of additions to compute the current minor
Definition: Minor.h:432
int _accumulatedMult
a store for the accumulated number of multiplications to compute the current minor; This also include...
Definition: Minor.h:441
int _retrievals
-1 iff cache is not used, otherwise the number of retrievals so far of the current minor ...
Definition: Minor.h:414
int _result
a store for the actual value of the minor
Definition: Minor.h:723
int _multiplications
a store for the actual number of multiplications to compute the current minor
Definition: Minor.h:427
int _potentialRetrievals
-1 iff cache is not used, otherwise the maximum number of potential retrievals of this minor (e...
Definition: Minor.h:421

◆ ~IntMinorValue()

IntMinorValue::~IntMinorValue ( )
virtual

Destructor.

Definition at line 1013 of file Minor.cc.

1014 {
1015 }

Member Function Documentation

◆ getResult()

int IntMinorValue::getResult ( ) const

Accessor for the private field _result.

Returns
the result encoded in this class instance

Definition at line 1017 of file Minor.cc.

1018 {
1019  return _result;
1020 }
int _result
a store for the actual value of the minor
Definition: Minor.h:723

◆ getWeight()

int IntMinorValue::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 978 of file Minor.cc.

979 {
980  /* put measure for size of MinorValue here, i.e. number of monomials in
981  polynomial; so far, we use the accumulated number of multiplications
982  (i.e., including all nested ones) to simmulate the size of a polynomial */
983  return _accumulatedMult;
984 }
int _accumulatedMult
a store for the accumulated number of multiplications to compute the current minor; This also include...
Definition: Minor.h:441

◆ toString()

string IntMinorValue::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 1022 of file Minor.cc.

1023 {
1024  char h[10];
1025 
1026  /* Let's see whether a cache has been used to compute this MinorValue: */
1027  bool cacheHasBeenUsed = true;
1028  if (this->getRetrievals() == -1) cacheHasBeenUsed = false;
1029 
1030  sprintf(h, "%d", this->getResult());
1031  string s = h;
1032  s += " [retrievals: ";
1033  if (cacheHasBeenUsed) { sprintf(h, "%d", this->getRetrievals()); s += h; }
1034  else s += "/";
1035  s += " (of ";
1036  if (cacheHasBeenUsed)
1037  {
1038  sprintf(h, "%d", this->getPotentialRetrievals());
1039  s += h;
1040  }
1041  else s += "/";
1042  s += "), *: ";
1043  sprintf(h, "%d", this->getMultiplications()); s += h;
1044  s += " (accumulated: ";
1045  sprintf(h, "%d", this->getAccumulatedMultiplications()); s += h;
1046  s += "), +: ";
1047  sprintf(h, "%d", this->getAdditions()); s += h;
1048  s += " (accumulated: ";
1049  sprintf(h, "%d", this->getAccumulatedAdditions()); s += h;
1050  s += "), rank: ";
1051  if (cacheHasBeenUsed) { sprintf(h, "%d", this->getUtility()); s += h; }
1052  else s += "/";
1053  s += "]";
1054  return s;
1055 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
int getAdditions() const
A method for accessing the additions performed while computing this minor.
Definition: Minor.cc:886
int getAccumulatedAdditions() const
A method for accessing the additions performed while computing this minor, including all nested addit...
Definition: Minor.cc:896
int getResult() const
Accessor for the private field _result.
Definition: Minor.cc:1017
int getMultiplications() const
A method for accessing the multiplications performed while computing this minor.
Definition: Minor.cc:881
int getPotentialRetrievals() const
A method for accessing the maximum number of potential retrievals of this minor.
Definition: Minor.cc:876
int getUtility() const
A method for obtaining a rank measure for theiven MinorValue.
Definition: Minor.cc:924
int getAccumulatedMultiplications() const
A method for accessing the multiplications performed while computing this minor, including all nested...
Definition: Minor.cc:891
static Poly * h
Definition: janet.cc:978
int getRetrievals() const
A method for accessing the number of retrievals of this minor.
Definition: Minor.cc:866

Field Documentation

◆ _result

int IntMinorValue::_result
private

a store for the actual value of the minor

Definition at line 723 of file Minor.h.


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