DGtal 1.4.2
Loading...
Searching...
No Matches
labelledMapBestParameters.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/base/LabelledMap.h"
Include dependency graph for labelledMapBestParameters.cpp:

Go to the source code of this file.

Functions

void usage ()
 
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
Jacques-Olivier Lachaud (jacqu.nosp@m.es-o.nosp@m.livie.nosp@m.r.la.nosp@m.chaud.nosp@m.@uni.nosp@m.v-sav.nosp@m.oie..nosp@m.fr ) Laboratory of Mathematics (CNRS, UMR 5807), University of Savoie, France
Date
2011/03/05

An example file named labelledMapBestParameters.

This file is part of the DGtal library.

Definition in file labelledMapBestParameters.cpp.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 50 of file labelledMapBestParameters.cpp.

51{
52 typedef double Data;
53 if ( argc < 4 )
54 {
55 usage();
56 return 1;
57 }
58
59 std::pair< unsigned int, unsigned int > res =
61 ( atoi( argv[ 1 ] ), atof( argv[ 3 ] ), atof( argv[ 2 ] ) );
62 cout << res.first << " " << res.second << endl;
63 return 0;
64}
std::pair< unsigned int, unsigned int > argminLabelledMapMemoryUsageForGeometricDistribution(unsigned int L, double prob_no_data, double prob_one_data)

References DGtal::detail::argminLabelledMapMemoryUsageForGeometricDistribution(), and usage().

◆ usage()

void usage ( )

Definition at line 40 of file labelledMapBestParameters.cpp.

41{
42 cerr << "Usage: ./labelledMapBestParameters <L> <p> <q>" << endl
43 << " Tries to find the best values N and M which will minimized" << endl
44 << " the memory usage of a LabelledMap, for the distribution" << endl
45 << " specified by the parameters." << endl
46 << " - L: max number of labels." << endl
47 << " - p: If there is a possibility to have a data, this probability is used to define a geometric distribution that defines the number of data (ie valid labels) at this place. The smaller, the higher is the expectation. 0.5 means E(X) = 1.." << endl
48 << " - q: probability that there is no data at this location." << endl;
49}

Referenced by main().