SampleValueAdjacencyList.h
Go to the documentation of this file.
/*
* steghide 0.5.1 - a steganography program
* Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef SH_SAMPLEVALUEADJACENCYLIST_H
#define SH_SAMPLEVALUEADJACENCYLIST_H
#include <vector>
#include "SampleValue.h"
#include "common.h"
class SampleValueAdjacencyList {
public:
SampleValueAdjacencyList (SampleValueLabel numsvs) ;
std::vector<SampleValue*>& operator[] (const SampleValueLabel lbl)
{ return AdjacencyList[lbl] ; } ;
std::vector<SampleValue*>& operator[] (const SampleValue* sv)
{ return AdjacencyList[sv->getLabel()] ; } ;
unsigned long getNumRows (void) const
{ return AdjacencyList.size() ; } ;
bool operator== (const SampleValueAdjacencyList& sval) ;
void sort (void) ;
private:
std::vector<std::vector<SampleValue*> > AdjacencyList ;
void quicksort (std::vector<SampleValue*>& oppneighs, UWORD32* distances, unsigned int l, unsigned int r) ;
unsigned int partition (std::vector<SampleValue*>& oppneighs, UWORD32* distances, unsigned int l, unsigned int r, UWORD32 x) ;
void swap (std::vector<SampleValue*>& oppneighs, UWORD32* distances, unsigned int i, unsigned int j) ;
} ;
#endif // ndef SH_SAMPLEVALUEADJACENCYLIST_H
SampleValue.h
SampleValueAdjacencyList
an adjacency list-like data structur for sample values
Definition SampleValueAdjacencyList.h:33
SampleValueAdjacencyList::operator==
bool operator==(const SampleValueAdjacencyList &sval)
Definition SampleValueAdjacencyList.cc:39
SampleValueAdjacencyList::sort
void sort(void)
Definition SampleValueAdjacencyList.cc:63
SampleValueAdjacencyList::SampleValueAdjacencyList
SampleValueAdjacencyList(SampleValueLabel numsvs)
Definition SampleValueAdjacencyList.cc:34
SampleValueAdjacencyList::operator[]
std::vector< SampleValue * > & operator[](const SampleValueLabel lbl)
Definition SampleValueAdjacencyList.h:40
SampleValueAdjacencyList::partition
unsigned int partition(std::vector< SampleValue * > &oppneighs, UWORD32 *distances, unsigned int l, unsigned int r, UWORD32 x)
Definition SampleValueAdjacencyList.cc:92
SampleValueAdjacencyList::quicksort
void quicksort(std::vector< SampleValue * > &oppneighs, UWORD32 *distances, unsigned int l, unsigned int r)
Definition SampleValueAdjacencyList.cc:81
SampleValueAdjacencyList::getNumRows
unsigned long getNumRows(void) const
Definition SampleValueAdjacencyList.h:46
SampleValueAdjacencyList::AdjacencyList
std::vector< std::vector< SampleValue * > > AdjacencyList
Definition SampleValueAdjacencyList.h:60
SampleValueAdjacencyList::swap
void swap(std::vector< SampleValue * > &oppneighs, UWORD32 *distances, unsigned int i, unsigned int j)
Definition SampleValueAdjacencyList.cc:110
SampleValue
the value of a sample in a CvrStgFile
Definition SampleValue.h:61
SampleValue::getLabel
unsigned long getLabel(void) const
Definition SampleValue.h:128
common.h
SampleValueLabel
UWORD32 SampleValueLabel
Definition common.h:69
UWORD32
unsigned long UWORD32
Definition common.h:45