Skip to content
Snippets Groups Projects
BorderArray.h 833 B
Newer Older
  • Learn to ignore specific revisions
  • /*
     * BorderArray.h
     *
     *  Created on: 1. 11. 2014
     *      Author: Tomas Pecka
     */
    
    #ifndef _BORDER_ARRAY_H_
    #define _BORDER_ARRAY_H_
    
    #include <vector>
    
    #include <core/multipleDispatch.hpp>
    
    #include <string/StringFeatures.h>
    
    namespace string {
    
    namespace properties {
    
    class BorderArray : public std::SingleDispatch<BorderArray, std::vector<unsigned>, const string::StringBase &> {
    
    public:
    	/**
    	 * Computes border array of string
    	 * @param string string to compute border array for
    	 * @return Vector of length same as string, where i-th index corresponds to i-th element of string
    	 */
    	static std::vector<unsigned> construct(const string::String& string);
    
    
    	static std::vector<unsigned> construct(const string::LinearString < >& string);
    
    } /* namespace properties */
    
    } /* namespace string */
    
    
    #endif /* _BORDER_ARRAY_H_ */