Loading...
Searching...
No Matches
PowerSeriesInputIterator< traits > Class Template Reference

`#include <PowerSeries.h>`

## Public Member Functions

| PowerSeriesInputIterator (numerator_type num_arg, denominator_type den_arg)
| PowerSeriesInputIterator ()
void | shorten ()
expansion_type | getValue ()
PowerSeriesInputIterator & | operator++ ()
bool | operator== (const PowerSeriesInputIterator &t2)
bool | operator!= (const PowerSeriesInputIterator &t2)
PowerSeriesInputIterator | operator++ (int)
const expansion_type | operator* ()
shared_ptr< const expansion_type > | operator-> ()

## Private Types

typedef traits::denominator_type | denominator_type
typedef traits::numerator_type | numerator_type
typedef traits::expansion_type | expansion_type

## Private Attributes

denominator_type | denominator
numerator_type | numerator
denominator_type | toPot
int | state
expansion_type | data
denominator_type | lastPot

## Detailed Description

template<class traits>
class PowerSeriesInputIterator< traits >

Definition at line 5 of file PowerSeries.h.

## Member Typedef Documentation

## denominator_type

template<class traits>

typedef traits::denominator_type PowerSeriesInputIterator< traits >::denominator_type

private

Definition at line 16 of file PowerSeries.h.

## expansion_type

template<class traits>

typedef traits::expansion_type PowerSeriesInputIterator< traits >::expansion_type

private

Definition at line 18 of file PowerSeries.h.

## numerator_type

template<class traits>

typedef traits::numerator_type PowerSeriesInputIterator< traits >::numerator_type

private

Definition at line 17 of file PowerSeries.h.

## Constructor & Destructor Documentation

## PowerSeriesInputIterator() [1/2]

template<class traits>

PowerSeriesInputIterator< traits >::PowerSeriesInputIterator | ( | numerator_type | num_arg,
|  | denominator_type | den_arg )

inline

Definition at line 26 of file PowerSeries.h.

:
data(den_arg.getRing()),
lastPot(den_arg.getRing()),
numerator(num_arg),
denominator(den_arg)
{
ring r=denominator.getRing();
//not the lead coef Number c=denominator.leadCoef();
Number c(1,r);
typename traits::denominator_type::iterator it=denominator.begin();
typename traits::denominator_type::iterator end=denominator.end();
while(it!=end)
{
if ((*it).isConstant())
{
//change this type
c=denominator_type(*it).leadCoef();
break;
}
++it;
}
c=Number(1,r)/c;
numerator*=c;
denominator*=c;
toPot=denominator+denominator_type(-1,r);
toPot*=Number(-1,r);
//change this type
lastPot=denominator_type(1,r);
data=numerator;
state=0;
}
PowerSeriesInputIterator
Definition PowerSeries.h:14
PowerSeriesInputIterator::denominator_type
traits::denominator_type denominator_type
Definition PowerSeries.h:16
PowerSeriesInputIterator::data
expansion_type data
Definition PowerSeries.h:23
PowerSeriesInputIterator::lastPot
denominator_type lastPot
Definition PowerSeries.h:24
PowerSeriesInputIterator::numerator
numerator_type numerator
Definition PowerSeries.h:20
PowerSeriesInputIterator::toPot
denominator_type toPot
Definition PowerSeries.h:21
PowerSeriesInputIterator::state
int state
Definition PowerSeries.h:22
PowerSeriesInputIterator::denominator
denominator_type denominator
Definition PowerSeries.h:19

## PowerSeriesInputIterator() [2/2]

template<class traits>

PowerSeriesInputIterator< traits >::PowerSeriesInputIterator | ( |  | ) |

inline

Definition at line 58 of file PowerSeries.h.

{
state=-1;
}

## Member Function Documentation

## getValue()

template<class traits>

expansion_type PowerSeriesInputIterator< traits >::getValue | ( |  | ) |

inline

Definition at line 79 of file PowerSeries.h.

{
typename expansion_type::iterator it=data.begin();
typename expansion_type::iterator end=data.end();
ring r=data.getRing();
expansion_type res(r);
while(it!=end)
{
if(it->lmTotalDegree()==state)
{
res+=expansion_type(*it);
}
it++;
}
return res;
}
PowerSeriesInputIterator::expansion_type
traits::expansion_type expansion_type
Definition PowerSeries.h:18
res
CanonicalForm res
Definition facAbsFact.cc:60

## operator!=()

template<class traits>

bool PowerSeriesInputIterator< traits >::operator!= | ( | const PowerSeriesInputIterator< traits > & | t2 | ) |

inline

Definition at line 108 of file PowerSeries.h.

{
return state!=t2.state;
}

## operator*()

template<class traits>

const expansion_type PowerSeriesInputIterator< traits >::operator* | ( |  | ) |

inline

Definition at line 118 of file PowerSeries.h.

{
return expansion_type(getValue());
}
PowerSeriesInputIterator::getValue
expansion_type getValue()
Definition PowerSeries.h:79

## operator++() [1/2]

template<class traits>

PowerSeriesInputIterator & PowerSeriesInputIterator< traits >::operator++ | ( |  | ) |

inline

Definition at line 95 of file PowerSeries.h.

{
state++;
shorten();
lastPot*=toPot;
data+=lastPot*numerator;
return *this;
}
PowerSeriesInputIterator::shorten
void shorten()
Definition PowerSeries.h:62

## operator++() [2/2]

template<class traits>

PowerSeriesInputIterator PowerSeriesInputIterator< traits >::operator++ | ( | int |  | ) |

inline

Definition at line 112 of file PowerSeries.h.

{
PowerSeriesInputIterator it(*this);
++(*this);
return it;
}
PowerSeriesInputIterator::PowerSeriesInputIterator
PowerSeriesInputIterator(numerator_type num_arg, denominator_type den_arg)
Definition PowerSeries.h:26

## operator->()

template<class traits>

shared_ptr< const expansion_type > PowerSeriesInputIterator< traits >::operator-> | ( |  | ) |

inline

Definition at line 122 of file PowerSeries.h.

{
return shared_ptr<const expansion_type>(new expansion_type(getValue()));
}

## operator==()

template<class traits>

bool PowerSeriesInputIterator< traits >::operator== | ( | const PowerSeriesInputIterator< traits > & | t2 | ) |

inline

Definition at line 104 of file PowerSeries.h.

{
return state==t2.state;
}

## shorten()

template<class traits>

void PowerSeriesInputIterator< traits >::shorten | ( |  | ) |

inline

Definition at line 62 of file PowerSeries.h.

{
typename expansion_type::iterator it=data.begin();
typename expansion_type::iterator end=data.end();
ring r=data.getRing();
expansion_type remove(r);
while(it!=end)
{
if(it->lmTotalDegree()<state)
{
remove+=expansion_type(*it);
}
it++;
}
remove*=Number(-1,r);
data+=remove;
}

## Field Documentation

## data

template<class traits>

expansion_type PowerSeriesInputIterator< traits >::data

private

Definition at line 23 of file PowerSeries.h.

## denominator

template<class traits>

denominator_type PowerSeriesInputIterator< traits >::denominator

private

Definition at line 19 of file PowerSeries.h.

## lastPot

template<class traits>

denominator_type PowerSeriesInputIterator< traits >::lastPot

private

Definition at line 24 of file PowerSeries.h.

## numerator

template<class traits>

numerator_type PowerSeriesInputIterator< traits >::numerator

private

Definition at line 20 of file PowerSeries.h.

## state

template<class traits>

int PowerSeriesInputIterator< traits >::state

private

Definition at line 22 of file PowerSeries.h.

## toPot

template<class traits>

denominator_type PowerSeriesInputIterator< traits >::toPot

private

Definition at line 21 of file PowerSeries.h.

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

- Singular/dyn_modules/python/PowerSeries.h