Class UnivPowerSeriesRing<C extends RingElem<C>>
java.lang.Object
edu.jas.ps.UnivPowerSeriesRing<C>
- Type Parameters:
C- ring element type
- All Implemented Interfaces:
AbelianGroupFactory<UnivPowerSeries<C>>, ElemFactory<UnivPowerSeries<C>>, MonoidFactory<UnivPowerSeries<C>>, RingFactory<UnivPowerSeries<C>>, Serializable
public class UnivPowerSeriesRing<C extends RingElem<C>>
extends Object
implements RingFactory<UnivPowerSeries<C>>
Univariate power series ring implementation. Uses lazy evaluated generating
function for coefficients.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal RingFactory<C> Coefficient ring factory.static final StringDefault variable name.static final intDefault truncate.final UnivPowerSeries<C> The constant power series 1 for this ring.protected static final RandomA default random sequence generator.(package private) intTruncate.(package private) StringVariable name.final UnivPowerSeries<C> The constant power series 0 for this ring. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNo argument constructor.Constructor.UnivPowerSeriesRing(RingFactory<C> coFac) Constructor.UnivPowerSeriesRing(RingFactory<C> coFac, int truncate) Constructor.UnivPowerSeriesRing(RingFactory<C> cofac, int truncate, String name) Constructor.UnivPowerSeriesRing(RingFactory<C> coFac, String name) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionCharacteristic of this ring.copy(UnivPowerSeries<C> c) Copy power series.booleanComparison with any other object.fixPoint(UnivPowerSeriesMap<C> map) Fixed point construction.fromInteger(long a) Get a (constant) UnivPowerSeries<C> from a long value.Get a (constant) UnivPowerSeries<C> from a java.math.BigInteger.Get a UnivPowerSeries<C> from a GenPolynomial<C>.fromVector(GenVector<C> a) Get a UnivPowerSeries<C> from a GenVector<C>.generate(IntFunction<C> gener) Generate a power series via lambda expression.Get a list of the generating elements.getCOS()Get the power series of the cosine function.getEXP()Get the power series of the exponential function.getONE()Get the one element.getSIN()Get the power series of the sinus function.getTAN()Get the power series of the tangens function.getZERO()Get the zero element.inthashCode()Hash code for this .booleanQuery if this ring is associative.booleanIs commutative.booleanisField()Query if this ring is a field.booleanisFinite()Is this structure finite or infinite.Parse a power series.Parse a power series.polyRing()Get the corresponding GenPolynomialRing<C>.random()Generate a random power series with k = 5, d = 0.7.random(int k) Generate a random power series with d = 0.7.random(int k, float d) Generate a random power series.Generate a random power series.Generate a random power series with d = 0.7.seriesOfTaylor(TaylorFunction<C> f, C a) Taylor power series.solveODE(UnivPowerSeries<C> f, C c) Solve an ordinary differential equation.toScript()Get a scripting compatible string representation.toString()To String.Methods inherited from interface ElemFactory
valueOf
-
Field Details
-
random
A default random sequence generator. -
DEFAULT_TRUNCATE
public static final int DEFAULT_TRUNCATEDefault truncate.- See Also:
-
truncate
int truncateTruncate. -
DEFAULT_NAME
-
var
String varVariable name. -
coFac
Coefficient ring factory. -
ONE
The constant power series 1 for this ring. -
ZERO
The constant power series 0 for this ring.
-
-
Constructor Details
-
UnivPowerSeriesRing
private UnivPowerSeriesRing()No argument constructor. -
UnivPowerSeriesRing
Constructor.- Parameters:
coFac- coefficient ring factory.
-
UnivPowerSeriesRing
Constructor.- Parameters:
coFac- coefficient ring factory.truncate- index of truncation.
-
UnivPowerSeriesRing
Constructor.- Parameters:
coFac- coefficient ring factory.name- of the variable.
-
UnivPowerSeriesRing
Constructor.- Parameters:
pfac- polynomial ring factory.
-
UnivPowerSeriesRing
Constructor.- Parameters:
cofac- coefficient ring factory.truncate- index of truncation.name- of the variable.
-
-
Method Details
-
fixPoint
Fixed point construction.- Parameters:
map- a mapping of power series.- Returns:
- fix point wrt map.
-
toString
-
toScript
-
equals
-
hashCode
-
getZERO
Get the zero element.- Specified by:
getZEROin interfaceAbelianGroupFactory<C extends RingElem<C>>- Returns:
- 0 as UnivPowerSeries
.
-
getONE
Get the one element.- Specified by:
getONEin interfaceMonoidFactory<C extends RingElem<C>>- Returns:
- 1 as UnivPowerSeries
.
-
generators
Get a list of the generating elements.- Specified by:
generatorsin interfaceElemFactory<C extends RingElem<C>>- Returns:
- list of generators for the algebraic structure.
- See Also:
-
isFinite
public boolean isFinite()Is this structure finite or infinite.- Specified by:
isFinitein interfaceElemFactory<C extends RingElem<C>>- Returns:
- true if this structure is finite, else false.
- See Also:
-
getEXP
Get the power series of the exponential function.- Returns:
- exp(x) as UnivPowerSeries
.
-
getSIN
Get the power series of the sinus function.- Returns:
- sin(x) as UnivPowerSeries
.
-
getCOS
Get the power series of the cosine function.- Returns:
- cos(x) as UnivPowerSeries
.
-
getTAN
Get the power series of the tangens function.- Returns:
- tan(x) as UnivPowerSeries
.
-
solveODE
Solve an ordinary differential equation. y' = f(y) with y(0) = c.- Parameters:
f- a UnivPowerSeries. c- integration constant.- Returns:
- f.integrate(c).
-
isCommutative
public boolean isCommutative()Is commutative.- Specified by:
isCommutativein interfaceMonoidFactory<C extends RingElem<C>>- Returns:
- true, if this ring is commutative, else false.
-
isAssociative
public boolean isAssociative()Query if this ring is associative.- Specified by:
isAssociativein interfaceMonoidFactory<C extends RingElem<C>>- Returns:
- true if this ring is associative, else false.
-
isField
public boolean isField()Query if this ring is a field.- Specified by:
isFieldin interfaceRingFactory<C extends RingElem<C>>- Returns:
- false.
-
characteristic
Characteristic of this ring.- Specified by:
characteristicin interfaceRingFactory<C extends RingElem<C>>- Returns:
- characteristic of this ring.
-
fromInteger
Get a (constant) UnivPowerSeries<C> from a long value.- Specified by:
fromIntegerin interfaceElemFactory<C extends RingElem<C>>- Parameters:
a- long.- Returns:
- a UnivPowerSeries<C>.
-
fromInteger
Get a (constant) UnivPowerSeries<C> from a java.math.BigInteger.- Specified by:
fromIntegerin interfaceElemFactory<C extends RingElem<C>>- Parameters:
a- BigInteger.- Returns:
- a UnivPowerSeries<C>.
-
polyRing
Get the corresponding GenPolynomialRing<C>.- Returns:
- GenPolynomialRing<C>.
-
fromPolynomial
Get a UnivPowerSeries<C> from a GenPolynomial<C>.- Parameters:
a- GenPolynomial<C>.- Returns:
- a UnivPowerSeries<C>.
-
fromVector
Get a UnivPowerSeries<C> from a GenVector<C>.- Parameters:
a- GenVector<C>.- Returns:
- a UnivPowerSeries<C>.
-
random
Generate a random power series with k = 5, d = 0.7.- Returns:
- a random power series.
-
random
Generate a random power series with d = 0.7.- Specified by:
randomin interfaceElemFactory<C extends RingElem<C>>- Parameters:
k- bitsize of random coefficients.- Returns:
- a random power series.
-
random
Generate a random power series with d = 0.7.- Specified by:
randomin interfaceElemFactory<C extends RingElem<C>>- Parameters:
k- bit-size of random coefficients.rnd- is a source for random bits.- Returns:
- a random power series.
-
random
Generate a random power series.- Parameters:
k- bit-size of random coefficients.d- density of non-zero coefficients.- Returns:
- a random power series.
-
random
Generate a random power series.- Parameters:
k- bit-size of random coefficients.d- density of non-zero coefficients.rnd- is a source for random bits.- Returns:
- a random power series.
-
generate
Generate a power series via lambda expression.- Parameters:
gener- lambda expression.- Returns:
- a generated power series.
-
copy
Copy power series.- Specified by:
copyin interfaceElemFactory<C extends RingElem<C>>- Parameters:
c- a power series.- Returns:
- a copy of c.
-
parse
Parse a power series. Note: not implemented.- Specified by:
parsein interfaceElemFactory<C extends RingElem<C>>- Parameters:
s- String.- Returns:
- power series from s.
-
parse
Parse a power series. Note: not implemented.- Specified by:
parsein interfaceElemFactory<C extends RingElem<C>>- Parameters:
r- Reader.- Returns:
- next power series from r.
-
seriesOfTaylor
Taylor power series.- Parameters:
f- function.a- expansion point.- Returns:
- Taylor series of f.
-