Functions

testOrderedAlphabet.cpp File Reference

#include <iostream>
#include <sstream>
#include "DGtal/base/Common.h"
#include "DGtal/base/OrderedAlphabet.h"
Include dependency graph for testOrderedAlphabet.cpp:

Functions

bool testFLF (const OrderedAlphabet &alphabet, const string &output, const string &input)
bool testDuvalPP (const OrderedAlphabet &alphabet, const string &output, const string &input)
bool testDuvalPPMod (const OrderedAlphabet &alphabet, const string &output, const string &input, OrderedAlphabet::index_t s)
bool testOrderedAlphabet ()
int main (int argc, char **argv)

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program 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.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Author:
Laurent Provot (Laurent.Provot@loria.fr ) LORIA (CNRS, UMR 7503), Nancy University, France
Date:
2010/07/04

Functions for testing class OrderedAlphabet.

This file is part of the DGtal library.


Function Documentation

int main ( int  argc,
char **  argv 
)
bool testDuvalPP ( const OrderedAlphabet alphabet,
const string &  output,
const string &  input 
)

Checks if Duval++ works.

Parameters:
alphabet an alphabet.
input the input word.
output the expected output word as "NC" or "C(w1)^l1"
Returns:
'true' if the test was ok, 'false' otherwise.

References DGtal::Trace::beginBlock(), DGtal::OrderedAlphabet::duvalPP(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.

Referenced by testOrderedAlphabet().

bool testDuvalPPMod ( const OrderedAlphabet alphabet,
const string &  output,
const string &  input,
OrderedAlphabet::index_t  s 
)

Checks if Duval++ modulo works.

Parameters:
alphabet an alphabet.
input the input word.
output the expected output word as "NC" or "C(w1)^l1"
s starting index.
Returns:
'true' if the test was ok, 'false' otherwise.

References DGtal::Trace::beginBlock(), DGtal::OrderedAlphabet::duvalPPMod(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.

Referenced by testOrderedAlphabet().

bool testFLF ( const OrderedAlphabet alphabet,
const string &  output,
const string &  input 
)

Checks if the Lyndon factorization works.

Parameters:
alphabet an alphabet.
input the input word.
output the expected output word as (w1)^l1...(wn)^ln.
Returns:
'true' if the test was ok, 'false' otherwise.

References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::OrderedAlphabet::firstLyndonFactor(), DGtal::Trace::info(), and DGtal::trace.

Referenced by testOrderedAlphabet().

bool testOrderedAlphabet (  ) 

Test the class OrderedAlphabet.

References DGtal::Trace::info(), testDuvalPP(), testDuvalPPMod(), testFLF(), and DGtal::trace.

Referenced by main().