Project

General

Profile

Feature #17

implement "binomial" (coefficient) for RingElem

Added by Anna Maria Bigatti over 12 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
New Function
Start date:
28 Oct 2011
Due date:
% Done:

100%

Estimated time:
1.00 h
Spent time:

Description

in CoCoA-5 it is currently called "Bin"


Related issues

Related to CoCoA-5 - Design #474: Eliminate package BinReprIn Progress2014-03-14

History

#1 Updated by Anna Maria Bigatti over 12 years ago

  • Category set to New Function

#2 Updated by John Abbott over 12 years ago

Please clarify what exactly you want the function to do, and what values it accepts as args. For instance is the following allowed:

  PolyRing P = ...;
  RingElem x = indet(P,0);
  cout << binomial(x, 3) << endl;

An analogous call in C4 works and produces 1/6x^3 - 1/2x^2 + 1/3x (in QQ[x]);

In C4 the function is called "Bin". In CoCoALib there is a function called binomial (which accepts BigInt args, and presumably MachineInt too).

What should the function do if the second arg is not a non-neg integer? Is a RingElem which satisfies IsInteger OK?

#3 Updated by Anna Maria Bigatti almost 11 years ago

.. and resume/clean up BR.PolyBinRepr_xi

#4 Updated by John Abbott about 10 years ago

  • Status changed from New to Feedback
  • Target version set to CoCoALib-0.99533 Easter14
  • % Done changed from 0 to 90

I've made a simple impl (obviously correct, might not be fast).

In answer to my qn in post 2, we've decided to keep it simple (KISS): the 2nd arg must be an integer (or BigInt).

Also made the fn available in C5 (the doc said it was already there!)

#5 Updated by John Abbott about 10 years ago

  • Status changed from Feedback to Closed
  • Assignee set to John Abbott
  • % Done changed from 90 to 100

#6 Updated by Anna Maria Bigatti about 10 years ago

  • Estimated time set to 1.00 h

Also available in: Atom PDF