Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Feel::ParameterSpace< P >::Sampling Class Reference

#include <parameterspace.hpp>

Detailed Description

template<int P>
class Feel::ParameterSpace< P >::Sampling

Parameter space sampling class.

Inherits vector< Element >.

Public Types

typedef boost::shared_ptr
< element_type
element_ptrtype
 
typedef
parameterspace_type::Element 
element_type
 
typedef boost::shared_ptr
< parameterspace_type
parameterspace_ptrtype
 
typedef ParameterSpace< Dimensionparameterspace_type
 
typedef boost::shared_ptr
< sampling_type
sampling_ptrtype
 
typedef Sampling sampling_type
 

Public Member Functions

std::vector< int > closestSamplingFromFile (std::string file_name="list_of_parameters_taken")
 
sampling_ptrtype complement () const
 if supersampling is != 0, Returns the complement
 
void equidistribute (int N)
 create a sampling with equidistributed elements More...
 
void equidistributeProduct (std::vector< int > N)
 create a sampling with equidistributed elements More...
 
void generateElementsProduct (std::vector< std::vector< double > > components)
 
void generateElementsProduct (std::vector< std::vector< std::vector< double > > > vector_components)
 
size_type indexInSuperSampling (size_type index) const
 given a local index, returns the index in the super sampling More...
 
void logEquidistribute (int N)
 create a sampling with log-equidistributed elements More...
 
void logEquidistributeProduct (std::vector< int > N)
 create a sampling with log-equidistributed elements More...
 
boost::tuple< element_type,
size_type
max () const
 Returns the maximum element in the sampling and its index.
 
boost::tuple< element_type,
size_type
min () const
 Returns the minimum element in the sampling and its index.
 
void mixEquiLogEquidistributeProduct (std::vector< int > Nlogequi, std::vector< int > Nequi)
 create a sampling with log-equidistributed and equidistributed elements More...
 
parameterspace_ptrtype parameterSpace () const
 Retuns the parameter space.
 
void push_back (element_type const &mu, size_type index)
 add new parameter mu in sampling and store index in super sampling
 
void randomize (int N)
 create a sampling with random elements More...
 
double readFromFile (std::string file_name="list_of_parameters_taken")
 read the sampling from a file More...
 
 Sampling (parameterspace_ptrtype space, int N=1, sampling_ptrtype supersampling=sampling_ptrtype())
 
sampling_ptrtype searchNearestNeighbors (element_type const &mu, size_type M, std::vector< int > &index_vector)
 Returns the M closest points to mu in sampling. More...
 
void setElements (std::vector< element_type > V)
 create a sampling with elements given by the user More...
 
void setSuperSampling (sampling_ptrtype const &super)
 
sampling_ptrtype const & superSampling () const
 
void writeOnFile (std::string file_name="list_of_parameters_taken")
 write the sampling in a file More...
 

Friends

class boost::serialization::access
 

Member Function Documentation

template<int P>
std::vector<int> Feel::ParameterSpace< P >::Sampling::closestSamplingFromFile ( std::string  file_name = "list_of_parameters_taken")
inline

build the closest sampling with parameters given from the file look in the supersampling closest parameters

Parameters
file_name: give the real parameters we want return the index vector of parameters in the supersampling
template<int P>
void Feel::ParameterSpace< P >::Sampling::equidistribute ( int  N)
inline

create a sampling with equidistributed elements

Parameters
Nthe number of samples

References Feel::ParameterSpace< P >::equidistributed().

template<int P>
void Feel::ParameterSpace< P >::Sampling::equidistributeProduct ( std::vector< int >  N)
inline

create a sampling with equidistributed elements

Parameters
N: vector containing the number of samples on each direction

References Feel::ParameterSpace< P >::equidistributeInDirection().

template<int P>
size_type Feel::ParameterSpace< P >::Sampling::indexInSuperSampling ( size_type  index) const
inline

given a local index, returns the index in the super sampling

Parameters
indexindex in the local sampling
Returns
the index in the super sampling
template<int P>
void Feel::ParameterSpace< P >::Sampling::logEquidistribute ( int  N)
inline

create a sampling with log-equidistributed elements

Parameters
Nthe number of samples

References Feel::ParameterSpace< P >::logEquidistributed().

template<int P>
void Feel::ParameterSpace< P >::Sampling::logEquidistributeProduct ( std::vector< int >  N)
inline

create a sampling with log-equidistributed elements

Parameters
N: vector containing the number of samples on each direction

References Feel::ParameterSpace< P >::logEquidistributeInDirection().

template<int P>
void Feel::ParameterSpace< P >::Sampling::mixEquiLogEquidistributeProduct ( std::vector< int >  Nlogequi,
std::vector< int >  Nequi 
)
inline

create a sampling with log-equidistributed and equidistributed elements

Parameters
Nlogequi: vector containing the number of log-equidistributed samples on each direction
Nequi: vector containing the number of equidistributed samples on each direction

References Feel::ParameterSpace< P >::equidistributeInDirection(), and Feel::ParameterSpace< P >::logEquidistributeInDirection().

template<int P>
void Feel::ParameterSpace< P >::Sampling::randomize ( int  N)
inline

create a sampling with random elements

Parameters
Nthe number of samples

References Feel::ParameterSpace< P >::logRandom().

template<int P>
double Feel::ParameterSpace< P >::Sampling::readFromFile ( std::string  file_name = "list_of_parameters_taken")
inline

read the sampling from a file

Parameters
file_name: name of the file to read in the file we expect : mu_0= [ value0 , value1 , ... ] mu_1= [ value0 , value1 , ... ] return the size of the sampling
template<int P>
boost::shared_ptr< typename ParameterSpace< P >::Sampling > Feel::ParameterSpace< P >::Sampling::searchNearestNeighbors ( element_type const &  mu,
size_type  M,
std::vector< int > &  index_vector 
)

Returns the M closest points to mu in sampling.

Parameters
muthe point in parameter whom we want to find the neighbors
Mthe number of neighbors to find
Returns
vector of neighbors and index of them in the sampling
template<int P>
void Feel::ParameterSpace< P >::Sampling::setElements ( std::vector< element_type V)
inline

create a sampling with elements given by the user

Parameters
V: vector of element_type
template<int P>
void Feel::ParameterSpace< P >::Sampling::setSuperSampling ( sampling_ptrtype const &  super)
inline

set the super sampling

template<int P>
sampling_ptrtype const& Feel::ParameterSpace< P >::Sampling::superSampling ( ) const
inline

Returns the supersampling (might be null)

template<int P>
void Feel::ParameterSpace< P >::Sampling::writeOnFile ( std::string  file_name = "list_of_parameters_taken")
inline

write the sampling in a file

Parameters
file_name: name of the file to read in the file we write : mu_0= [ value0 , value1 , ... ] mu_1= [ value0 , value1 , ... ]

The documentation for this class was generated from the following file:

Generated on Fri Oct 25 2013 14:24:31 for Feel++ by doxygen 1.8.4