Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/anupq/src/   (GAP Algebra Version 4.15.1©)  Datei vom 28.7.2025 mit Größe 1 kB image not shown  

Quelle  store_definition_sets.c

  Sprache: C
 

/****************************************************************************
**
*A  store_definition_sets.c     ANUPQ source                   Eamonn O'Brien
**
*Y  Copyright 1995-2001,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
*Y  Copyright 1995-2001,  School of Mathematical Sciences, ANU,     Australia
**
*/


#include "pq_defs.h"
#include "pga_vars.h"
#include "pq_functions.h"

/* set up the maximum storage space required for the definition sets --
   this is the maximum of r choose s where lower_step <= s <= upper_step */


void store_definition_sets(int r,
                           int lower_step,
                           int upper_step,
                           struct pga_vars *pga)
{
   int s, nmr_of_sets = 0;

   for (s = lower_step; s <= upper_step; ++s)
      nmr_of_sets = MAX(nmr_of_sets, choose(r, s));

   pga->list = allocate_vector(nmr_of_sets, 0FALSE);
   pga->available = allocate_vector(nmr_of_sets, 0FALSE);
   pga->offset = allocate_vector(nmr_of_sets, 0FALSE);
}

/* calculate r choose s */

int choose(int r, int s)
{
   register int i;
   int binom = 1;

   for (i = 1; i <= s; ++i) {
      /* after the ith pass of the loop binom == binom(r, i) */
      binom *= (r + 1 - i);
      binom /= i;
   }

   return binom;
}

Messung V0.5 in Prozent
C=96 H=91 G=93

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-18) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.