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

Quelle  util.h   Sprache: C

 
//
//  util.h
//  Bistellar
//
//  Created by Alexander Thumm on 07.10.11.
//  Copyright 2011 -. All rights reserved.
//

#ifndef Bistellar_util_h
#define Bistellar_util_h

#include <iostream>
#include <vector>
#include <deque>
#include <utility>

// prints a list in the format [a,b,...,z].
templateclass Iterator >
void list_print(std::ostream & os, Iterator first, Iterator last)
{
    os << "[";
    if (first != last)
        os << *first << std::flush;
    for (first++; first != last; first++)
        os << "," << *first << std::flush;
    os << "]";
}

templateclass Container, class Object >
void list_read(std::istream & is, Container & list)
{
    is.ignore(1, '[');
    
    if (is.eof() || is.peek() == ']')
    {
        is.ignore(1, ']');
    }
    else
    {
        is.unget();
        do {
            is.ignore(1, ',');
            Object newObject;
            is >> newObject;
            list.push_back(newObject);
        } while (!is.eof() && is.peek() != ']');
        
        is.ignore(1, ']');
    }
}

templateclass T >
void list_read(std::istream & is, std::vector< T > & list)
{
    list_read< std::vector< T >, T >(is, list);
}

templateclass T >
void list_read(std::istream & is, std::deque< T > & list)
{
    list_read< std::deque< T >, T >(is, list);
}


templateclass T, class U >
std::ostream & operator<< (std::ostream & os, const std::pair<T,U> & pair )
{
    os << pair.first << "," << pair.second;
    return os;
}


// removes all duplivates from the !sorted! array base.
size_t remove_duplicates(void * base, size_t num, size_t size, int (* comparison)(const void *, const void *));
// removes all elements of the !sorted! array base2 from the !sorted! array base.
size_t remove_from_set(void * base, size_t num, const void * base2, size_t num2, size_t size, int (* comparison)(const void *, const void *));

#endif

98%


¤ Dauer der Verarbeitung: 0.24 Sekunden  (vorverarbeitet)  ¤

*© 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 ist noch experimentell.