Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/guava/src/leon/src/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 1.1.2025 mit Größe 1 kB image not shown  

Quelle  oldcopy.c   Sprache: C

 
/* File oldcopy.c.  Contains functions that copy an object to an already-
   existing object of the same type. */


#include <stddef.h>
#include <string.h>

#include "group.h"
#include "storage.h"

CHECK( oldcop)


/*-------------------------- copyPermutation ------------------------------*/

/* This function copies one permutation to another.  The destination permutation
   must already exist; its invImage field may be allocated or freed, depending
   on whether the source permutation has an invImage field.  The level and
   essential fields are not copied. */


void copyPermutation(
   const Permutation *const fromPerm,
   Permutation *const toPerm)
{
   Unsigned pt;

   strcpy ( toPerm->name, fromPerm->name);
   toPerm->degree = fromPerm->degree;
   for ( pt = 1 ; pt <= fromPerm->degree ; ++pt )
      toPerm->image[pt] = fromPerm->image[pt];
   if ( fromPerm->invImage ) {
      if ( fromPerm->invImage == fromPerm->image ) {
         if ( toPerm->invImage && toPerm->invImage != toPerm->image )
            freeIntArrayDegree( toPerm->invImage);
         toPerm->invImage = toPerm->image;
      }
      else {
         if ( !toPerm->invImage || toPerm->invImage == toPerm->image )
            toPerm->invImage = allocIntArrayDegree();
         for ( pt = 1 ; pt <= fromPerm->degree ; ++pt )
            toPerm->invImage[pt] = fromPerm->invImage[pt];
      }
   }
   else if ( toPerm->invImage ) {
      freeIntArrayDegree( toPerm->invImage);
      toPerm->invImage = NULL;
   }
}

Messung V0.5
C=95 H=73 G=84

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.