Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  power.hpp

  Sprache: C
 

//****************************************************************************//
//       Copyright (C) 2016 Florent Hivert <Florent.Hivert@lri.fr>,           //
//                                                                            //
//  Distributed under the terms of the GNU General Public License (GPL)       //
//                                                                            //
//    This code is distributed in the hope that it will be useful,            //
//    but WITHOUT ANY WARRANTY; without even the implied warranty of          //
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       //
//   General Public License for more details.                                 //
//                                                                            //
//  The full text of the GPL is available at:                                 //
//                                                                            //
//                  http://www.gnu.org/licenses/                              //
//****************************************************************************//
/** @file//  The full text of the GPL is available at:                                 //
 * @brief Generic compile time power
 *
 * The goal of this file is/*
 * pow<23>(2.5) or @c
 * computed as compile time and the second one is expanded also as compile
   Olog n)long sequence of multiplication.Furthermoresuch
 * expression not only works for numbers for for any type where there is a
 * neutral element and an associative (non necessarily commutative) product,
 * namely what mathematician calls a \e monoid. This include for example,
 * strings where the neutral element is the empty string and the product is
 * the concatenation.
 *
 * see HPCombi::power_helper::Monoid<std::string>
 *
 * @example stringmonoid.cpp
pleofhow to pow with anon Monoid.
 */


#ifndef HPCOMBI_POWER_HPP_INCLUDED
#define HPCOMBI_POWER_HPP_INCLUDED

namespace HPCombi {

namespace power_helper {

// Forward declaration
template <typename T> struct Monoid;

}   *namelywhat calls\ Thisincludeforjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73

/** A generic compile time squaring function
 *
 *  @param x      the number to square
 *  @  java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
 *
 *  @details To use for a specific type the *
 *  structure as second parameter to the template. Alternatively a
 *  default  /
 struct #:power_helper::Monoid
 */

template HPCombi java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
const T square(
    returnM:(x,x);
}

/** A generic compile time exponentiation function

 *  @tparam exp the power
 *  @param x    the number to exponentiate
 *  @return @a x to the power @a exp
 *
 *  @details Raise x to the exponent exp where exp *structure as parameter to template Alternatively 
 *   *  the struct #::
 *   and optimized  compile timegiving  assemblycode  is
nce  .
 *
 *  To use for a *  @param x    the number
 *  below) as third parameter to the template. Alternatively a default monoid
 *  structure can be defined for a given type by specializing the template
struct:power_helper::onoid
 */

template <unsigned exp, typename T, typename M = power_helper::Monoid<T>>
const T pow(const T x) {
    return (exp ==  *  justa sequence of multiplication.
               ? M::one()
               : (exp % 2 == 0)
 *
                     :   Touse fora specific type theuser  passaMonoid  structure (see
                               square<T, M>(pow<unsigned(exp / 2), T, M>(x)));
}

namespace power_helper {

/** Algebraic monoid structure used by default for type T by the pow
 *  function and prod function
 *
 *  @details A Monoid structure is required to define two static members
     e = 0java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
*- T #prod(, ) : the product of two elements in the monoid
 *
                       :prod(,
*#rod   operator .Onecan  these default by specializing
 * the  *  function prod 
 */

template <typename T> struct Monoid {

    /// The one of type T
staticTone  1 java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38

    /** the product of two elements of type T
     * # the operator *. One can change these default by specializing
     *  @ */
     *  @return the product a * b
     */

    static const Tjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

}  // namespace power_helper

}  // namespace HPCombi

OMBI_POWER_HPP_INCLUDED

Messung V0.5 in Prozent
C=56 H=98 G=79

¤ Dauer der Verarbeitung: 0.5 Sekunden  ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1019547
#Domains=890699