steghide 0.5.1
SampleValueAdjacencyList.h
Go to the documentation of this file.
1/*
2 * steghide 0.5.1 - a steganography program
3 * Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *
19 */
20
21#ifndef SH_SAMPLEVALUEADJACENCYLIST_H
22#define SH_SAMPLEVALUEADJACENCYLIST_H
23
24#include <vector>
25
26#include "SampleValue.h"
27#include "common.h"
28
34 public:
39
40 std::vector<SampleValue*>& operator[] (const SampleValueLabel lbl)
41 { return AdjacencyList[lbl] ; } ;
42
43 std::vector<SampleValue*>& operator[] (const SampleValue* sv)
44 { return AdjacencyList[sv->getLabel()] ; } ;
45
46 unsigned long getNumRows (void) const
47 { return AdjacencyList.size() ; } ;
48
52 bool operator== (const SampleValueAdjacencyList& sval) ;
53
57 void sort (void) ;
58
59 private:
60 std::vector<std::vector<SampleValue*> > AdjacencyList ;
61
62 void quicksort (std::vector<SampleValue*>& oppneighs, UWORD32* distances, unsigned int l, unsigned int r) ;
67 unsigned int partition (std::vector<SampleValue*>& oppneighs, UWORD32* distances, unsigned int l, unsigned int r, UWORD32 x) ;
68 void swap (std::vector<SampleValue*>& oppneighs, UWORD32* distances, unsigned int i, unsigned int j) ;
69} ;
70
71#endif // ndef SH_SAMPLEVALUEADJACENCYLIST_H
an adjacency list-like data structur for sample values
Definition: SampleValueAdjacencyList.h:33
bool operator==(const SampleValueAdjacencyList &sval)
Definition: SampleValueAdjacencyList.cc:39
void sort(void)
Definition: SampleValueAdjacencyList.cc:63
SampleValueAdjacencyList(SampleValueLabel numsvs)
Definition: SampleValueAdjacencyList.cc:34
std::vector< SampleValue * > & operator[](const SampleValueLabel lbl)
Definition: SampleValueAdjacencyList.h:40
unsigned int partition(std::vector< SampleValue * > &oppneighs, UWORD32 *distances, unsigned int l, unsigned int r, UWORD32 x)
Definition: SampleValueAdjacencyList.cc:92
void quicksort(std::vector< SampleValue * > &oppneighs, UWORD32 *distances, unsigned int l, unsigned int r)
Definition: SampleValueAdjacencyList.cc:81
unsigned long getNumRows(void) const
Definition: SampleValueAdjacencyList.h:46
std::vector< std::vector< SampleValue * > > AdjacencyList
Definition: SampleValueAdjacencyList.h:60
void swap(std::vector< SampleValue * > &oppneighs, UWORD32 *distances, unsigned int i, unsigned int j)
Definition: SampleValueAdjacencyList.cc:110
the value of a sample in a CvrStgFile
Definition: SampleValue.h:61
unsigned long getLabel(void) const
Definition: SampleValue.h:128
UWORD32 SampleValueLabel
Definition: common.h:69
unsigned long UWORD32
Definition: common.h:45