Program Listing for File StringMatching.h

↰ Return to documentation for file (ADS/string/StringMatching.h)

/*--------------------------------------------------------------------------*/
/*------------------------- File StringMatching.h --------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef __ADS_StringMatching
 #define __ADS_StringMatching
                      /* self-identification: #endif constant */

/*--------------------------------------------------------------------------*/
/*------------------------------ INCLUDES ----------------------------------*/
/*--------------------------------------------------------------------------*/

#include <cstddef>
#include <cstdint>
#include "ADS/Contract.h"

#include <string_view>
#include <vector>

/*--------------------------------------------------------------------------*/
/*--------------------------- NAMESPACE ------------------------------------*/
/*--------------------------------------------------------------------------*/

namespace ADS {

inline std::vector< std::size_t > naiveMatching( std::string_view T ,
                                                 std::string_view P );

inline std::vector< long > failure( std::string_view P );

inline std::vector< std::size_t > kmp( std::string_view T ,
                                       std::string_view P ,
                                       long * comparisons = nullptr );

inline std::vector< long > strongFailure( std::string_view P );

inline std::vector< std::size_t > kmpStrong( std::string_view T ,
                                             std::string_view P ,
                                             long * comparisons = nullptr );

inline std::vector< std::size_t > boyerMoore( std::string_view T ,
                                              std::string_view P ,
                                              long * comparisons = nullptr );

inline std::vector< std::size_t > horspool( std::string_view T ,
                                            std::string_view P ,
                                            long * comparisons = nullptr );

inline std::vector< std::size_t > shiftOr( std::string_view T ,
                                           std::string_view P );

inline std::vector< std::size_t > zFunction( std::string_view S );

inline std::vector< std::size_t > zMatching( std::string_view T ,
                                             std::string_view P );

inline std::vector< std::size_t > twoWay( std::string_view T ,
                                          std::string_view P );

/*--------------------------------------------------------------------------*/

}  // end( namespace ADS )

/*--------------------------------------------------------------------------*/
/*-------------------------- IMPLEMENTATION --------------------------------*/
/*--------------------------------------------------------------------------*/

#include "ADS/string/impl/StringMatching.tpp"

/*--------------------------------------------------------------------------*/

#endif  /* StringMatching.h included */

/*--------------------------------------------------------------------------*/
/*----------------------- End File StringMatching.h ------------------------*/
/*--------------------------------------------------------------------------*/