本文整理汇总了C++中layer类的典型用法代码示例。如果您正苦于以下问题:C++ layer类的具体用法?C++ layer怎么用?C++ layer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了layer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: MAPNIK_LOG_DEBUG
void grid_renderer<T>::start_layer_processing(layer const& lay, box2d<double> const& query_extent)
{
MAPNIK_LOG_DEBUG(grid_renderer) << "grid_renderer: Start processing layer=" << lay.name();
MAPNIK_LOG_DEBUG(grid_renderer) << "grid_renderer: datasource=" << lay.datasource().get();
MAPNIK_LOG_DEBUG(grid_renderer) << "grid_renderer: query_extent = " << query_extent;
if (lay.clear_label_cache())
{
detector_->clear();
}
query_extent_ = query_extent;
int buffer_size = lay.buffer_size();
if (buffer_size != 0 )
{
double padding = buffer_size * (double)(query_extent.width()/pixmap_.width());
double x0 = query_extent_.minx();
double y0 = query_extent_.miny();
double x1 = query_extent_.maxx();
double y1 = query_extent_.maxy();
query_extent_.init(x0 - padding, y0 - padding, x1 + padding , y1 + padding);
}
boost::optional<box2d<double> > const& maximum_extent = lay.maximum_extent();
if (maximum_extent)
{
query_extent_.clip(*maximum_extent);
}
}
开发者ID:LeadsPlus,项目名称:mapnik,代码行数:28,代码来源:grid_renderer.cpp
示例2: hash
std::size_t layer_hasher::hash(const layer& v) {
std::size_t seed(0);
combine(seed, v.name());
combine(seed, v.visible());
combine(seed, v.active());
combine(seed, hash_std_vector_dogen_dia_object(v.objects()));
return seed;
}
开发者ID:pgannon,项目名称:dogen,代码行数:10,代码来源:layer_hash.cpp
示例3:
void grid_renderer<T>::start_layer_processing(layer const& lay)
{
#ifdef MAPNIK_DEBUG
std::clog << "start layer processing : " << lay.name() << "\n";
std::clog << "datasource = " << lay.datasource().get() << "\n";
#endif
if (lay.clear_label_cache())
{
detector_.clear();
}
}
开发者ID:ParveenArora,项目名称:mapnik,代码行数:11,代码来源:grid_renderer.cpp
示例4: getstate
static boost::python::tuple
getstate(const layer& l)
{
boost::python::list s;
std::vector<std::string> const& style_names = l.styles();
for (unsigned i = 0; i < style_names.size(); ++i)
{
s.append(style_names[i]);
}
return boost::python::make_tuple(l.clear_label_cache(),l.min_zoom(),l.max_zoom(),l.queryable(),l.datasource()->params(),l.cache_features(),s);
}
开发者ID:Andrey-VI,项目名称:mapnik,代码行数:11,代码来源:mapnik_layer.cpp
示例5: MAPNIK_LOG_DEBUG
void cairo_renderer<T>::end_layer_processing(layer const& lay)
{
MAPNIK_LOG_DEBUG(cairo_renderer) << "cairo_renderer: End layer processing";
if (lay.comp_op() || lay.get_opacity() < 1.0)
{
context_.pop_group();
composite_mode_e comp_op = lay.comp_op() ? *lay.comp_op() : src_over;
context_.set_operator(comp_op);
context_.paint(lay.get_opacity());
}
}
开发者ID:,项目名称:,代码行数:12,代码来源:
示例6: std_to_wx_string
/**
* \brief Set the properties of the layer.
* \param lay The layer from which we take the info.
*
* The new width is max(lay.get_width(), s_min_width), and the new height
* max(lay.get_height(), s_min_height).
*/
void bf::layer_properties_frame::fill_from( const layer& lay )
{
m_fit_level->SetValue( lay.fits_level() );
m_width->SetValue
( wxString::Format(wxT("%d"), std::max(lay.get_width(), s_min_width)) );
m_height->SetValue
( wxString::Format(wxT("%d"), std::max(lay.get_height(), s_min_height)) );
m_height->Enable( !lay.fits_level() );
m_width->Enable( !lay.fits_level() );
m_name->SetValue( std_to_wx_string(lay.get_name()) );
m_tag->SetValue( std_to_wx_string(lay.get_tag()) );
unsigned int i=0;
bool found = false;
const wxString ref( std_to_wx_string(lay.get_class_name()) );
while ( !found && (i!=m_class_name->GetCount()) )
if ( m_class_name->GetString(i) == ref )
found = true;
else
++i;
if ( found )
m_class_name->SetSelection(i);
else
m_class_name->SetSelection(0);
} // layer_properties_frame::set_layer_size()
开发者ID:LibreGames,项目名称:bear,代码行数:35,代码来源:layer_properties_frame.cpp
示例7: create
void create(int input_cnt,int output_cnt,int hidden_cnt,int neurons_cnt) {
hidden_count=hidden_cnt;
hidden_layers.resize(hidden_count);
if(hidden_count) {
hidden_layers[0].create(input_cnt,neurons_cnt);
for(int i=1;i<hidden_count;i++) {
hidden_layers[i].create(neurons_cnt,neurons_cnt);
}
output_layer.create(neurons_cnt,output_cnt);
}
else {
output_layer.create(input_cnt,output_cnt);
}
}
开发者ID:saikrishna17394,项目名称:AI-lab-ffnn,代码行数:15,代码来源:ffnn.cpp
示例8: mat
void feature_style_processor<Processor>::apply_to_layer(layer const& lay,
Processor & p,
projection const& proj0,
double scale,
double scale_denom,
unsigned width,
unsigned height,
box2d<double> const& extent,
int buffer_size,
std::set<std::string>& names)
{
feature_style_context_map ctx_map;
layer_rendering_material mat(lay, proj0);
prepare_layer(mat,
ctx_map,
p,
scale,
scale_denom,
width,
height,
extent,
buffer_size,
names);
prepare_layers(mat, lay.layers(), ctx_map, p, scale_denom);
if (!mat.active_styles_.empty())
{
render_material(mat,p);
render_submaterials(mat, p);
}
}
开发者ID:afflerbach,项目名称:mapnik,代码行数:33,代码来源:feature_style_processor_impl.hpp
示例9: MAPNIK_LOG_DEBUG
void grid_renderer<T>::start_layer_processing(layer const& lay, box2d<double> const& query_extent)
{
MAPNIK_LOG_DEBUG(grid_renderer) << "grid_renderer: Start processing layer=" << lay.name();
MAPNIK_LOG_DEBUG(grid_renderer) << "grid_renderer: datasource=" << lay.datasource().get();
MAPNIK_LOG_DEBUG(grid_renderer) << "grid_renderer: query_extent = " << query_extent;
if (lay.clear_label_cache())
{
detector_->clear();
}
query_extent_ = query_extent;
boost::optional<box2d<double> > const& maximum_extent = lay.maximum_extent();
if (maximum_extent)
{
query_extent_.clip(*maximum_extent);
}
}
开发者ID:Blaxxun,项目名称:mapnik,代码行数:17,代码来源:grid_renderer.cpp
示例10: setstate
static void
setstate (layer& l, boost::python::tuple state)
{
using namespace boost::python;
if (len(state) != 9)
{
PyErr_SetObject(PyExc_ValueError,
("expected 9-item tuple in call to __setstate__; got %s"
% state).ptr()
);
throw_error_already_set();
}
l.set_clear_label_cache(extract<bool>(state[0]));
l.set_min_zoom(extract<double>(state[1]));
l.set_max_zoom(extract<double>(state[2]));
l.set_queryable(extract<bool>(state[3]));
mapnik::parameters params = extract<parameters>(state[4]);
l.set_datasource(datasource_cache::instance().create(params));
boost::python::list s = extract<boost::python::list>(state[5]);
for (int i=0;i<len(s);++i)
{
l.add_style(extract<std::string>(s[i]));
}
l.set_cache_features(extract<bool>(state[6]));
}
开发者ID:Andrey-VI,项目名称:mapnik,代码行数:32,代码来源:mapnik_layer.cpp
示例11: update_layer
void update_layer(layer l, network net)
{
int update_batch = net.batch*net.subdivisions;
float rate = get_current_rate(net);
l.t = get_current_batch(net);
if(l.update_gpu){
l.update_gpu(l, update_batch, rate*l.learning_rate_scale, net.momentum, net.decay);
}
}
开发者ID:samlong-yang,项目名称:darknet,代码行数:9,代码来源:network_kernels.c
示例12: propagate
void propagate (vector<double> input) {
if(hidden_count==0) {
output_layer.layer_input=input;
// cout<<"Output Layer :\n";
output_layer.calculate();
return ;
}
hidden_layers[0].layer_input=input;
// cout<<"Hidden Layer 0 : \n";
hidden_layers[0].calculate();
// Propogating the out values to input of next layer
update(0);
for(int i=1;i<hidden_count;i++) {
hidden_layers[i].calculate();
update(i);
}
output_layer.calculate();
}
开发者ID:saikrishna17394,项目名称:AI-lab-ffnn,代码行数:20,代码来源:ffnn.cpp
示例13: layersCalculate
void mlp::layersCalculate(float * inputArray, float * setOutputArray){
hiddenLayer->neuronCalculate(inputArray);
outputLayer->neuronCalculate(hiddenLayer, setOutputArray);
}
开发者ID:kenoir,项目名称:mlp,代码行数:4,代码来源:mlp.cpp
示例14: layersUpdate
void mlp::layersUpdate(){
outputLayer->neuronUpdate();
hiddenLayer->neuronUpdate();
}
开发者ID:kenoir,项目名称:mlp,代码行数:4,代码来源:mlp.cpp
示例15: feed
void feed(const layer<lt>& p){
neurons[0]=p;
if(neurons[1].len()!=p.len()) neurons[1]=layer<lt>(p.len());
hopstep=0;
generateOrder();
}
开发者ID:pisto,项目名称:neurons,代码行数:6,代码来源:hopfield.hpp
示例16: layersBackprop
void mlp::layersBackprop(float * trainArray){
outputLayer->neuronBackProp(trainArray);
hiddenLayer->neuronBackProp(outputLayer);
}
开发者ID:kenoir,项目名称:mlp,代码行数:4,代码来源:mlp.cpp
示例17: getinitargs
static boost::python::tuple
getinitargs(const layer& l)
{
return boost::python::make_tuple(l.name(),l.srs());
}
开发者ID:Andrey-VI,项目名称:mapnik,代码行数:5,代码来源:mapnik_layer.cpp
示例18: layer_rendering_material
layer_rendering_material(layer const& lay, projection const& dest)
:
lay_(lay),
proj0_(dest),
proj1_(lay.srs(),true) {}
开发者ID:CartoDB,项目名称:mapnik,代码行数:5,代码来源:feature_style_processor_impl.hpp
示例19: addWeights
float mlp::addWeights(){
float tempVal = 0;
tempVal += hiddenLayer->addWeights();
tempVal += outputLayer->addWeights();
return tempVal;
}
开发者ID:kenoir,项目名称:mlp,代码行数:7,代码来源:mlp.cpp
示例20: printWeights
void mlp::printWeights(){
cout << "Hidden Layer: " << endl;
hiddenLayer->printWeights();
cout << "Output Layer: " << endl;
outputLayer->printWeights();
}
开发者ID:kenoir,项目名称:mlp,代码行数:6,代码来源:mlp.cpp
注:本文中的layer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论