src/cplib/fps/sparse_formal_power_series

  Source   Edit

Types

SparseFPS[T] = seq[SparseTerm[T]]
  Source   Edit
SparseTerm[T] = tuple[degree: int, coefficient: T]
  Source   Edit

Procs

proc `*`[T](f: seq[T]; g: SparseFPS[T]): seq[T]
  Source   Edit
proc `*`[T](f: SparseFPS[T]; g: seq[T]): seq[T]
  Source   Edit
proc `/`[T](f: seq[T]; g: SparseFPS[T]): seq[T]
  Source   Edit
proc coefficient[T](f: SparseFPS[T]; degree: int): T
指定した次数の係数を返す。項が存在しなければ零を返す。   Source   Edit
proc constantTerm[T](f: SparseFPS[T]): T
  Source   Edit
proc degree[T](f: SparseFPS[T]): int
零FPSに対しては -1 を返す。   Source   Edit
proc divPrefix[T](f: seq[T]; g: SparseFPS[T]; n: int): seq[T]
f / g を x^n で打ち切って返す。   Source   Edit
proc exp[T](f: SparseFPS[T]; n: int): seq[T]
疎なFPSの形式的指数関数を x^n で打ち切って返す。   Source   Edit
proc expCoefficient[T](f: SparseFPS[T]; degree: int): T
形式的指数関数の x^degree の係数だけを平方分割で求める。 fの次数をdとして計算量は O(d^3 M(sqrt(degree)) log degree)。   Source   Edit
proc initSparseFPS[T](terms: openArray[SparseTerm[T]]): SparseFPS[T]
次数の重複をまとめ、零係数を除いた疎なFPSを構築する。   Source   Edit
proc inv[T](f: SparseFPS[T]; n: int): seq[T]
疎なFPSの乗法逆元を x^n で打ち切って返す。   Source   Edit
proc invCoefficient[T](f: SparseFPS[T]; degree: int): T
乗法逆元の x^degree の係数だけを Bostan--Mori法で求める。 fの次数をdとして計算量は O(M(d) log degree)。   Source   Edit
proc isZero[T](f: SparseFPS[T]): bool
  Source   Edit
proc log[T](f: SparseFPS[T]; n: int): seq[T]
疎なFPSの形式的対数を x^n で打ち切って返す。   Source   Edit
proc logCoefficient[T](f: SparseFPS[T]; degree: int): T
形式的対数の x^degree の係数だけを Bostan--Mori法で求める。 fの次数をdとして計算量は O(M(d) log degree)。   Source   Edit
proc mulPrefix[T](f: seq[T]; g: SparseFPS[T]; n: int): seq[T]
密なFPSと疎なFPSの積を x^n で打ち切って返す。   Source   Edit
proc pow[T](f: SparseFPS[T]; k, n: int): seq[T]
疎なFPSの非負整数冪を x^n で打ち切って返す。   Source   Edit
proc powCoefficient[T](f: SparseFPS[T]; k, degree: int): T
非負整数冪の x^degree の係数だけを平方分割で求める。 fの次数をdとして計算量は O(d^3 M(sqrt(degree)) log degree)。   Source   Edit
proc sqrt[T](f: SparseFPS[T]; n: int): Option[seq[T]]
疎なFPSの形式的平方根を x^n で打ち切って返す。   Source   Edit
proc toDense[T](f: SparseFPS[T]; n: int): seq[T]
x^n で打ち切った密な係数列へ変換する。   Source   Edit